pi-lsp-adapter 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -442,17 +442,20 @@ Run `/reload` in Pi after editing the extension.
442
442
 
443
443
  ## Release
444
444
 
445
- Publishing is tag-driven, but do not create release tags by hand. Use the release helper so `package.json` and `package-lock.json` are bumped before the matching semver tag is created. The GitHub Actions publish workflow is intentionally read-only: it verifies the tag against both version files and fails instead of patching tagged source during publish.
445
+ Publishing is CI-driven. Do not create release tags by hand. To cut a release, make a normal commit that bumps `package.json` and `package-lock.json`; after that commit lands on `main` and CI passes, `.github/workflows/publish.yml` creates the matching semver tag and publishes to npm.
446
446
 
447
447
  npm publishing uses Trusted Publishing for `.github/workflows/publish.yml`, so no npm token secret is required. The npm package must have a Trusted Publisher configured for `nikmmd/pi-lsp-adapter` and workflow filename `publish.yml`.
448
448
 
449
449
  ```bash
450
- npm run release -- 0.1.2 --push
450
+ npm version 0.1.2 --no-git-tag-version
451
+ git add package.json package-lock.json
452
+ git commit -m "chore: release v0.1.2"
453
+ git push origin main
451
454
  ```
452
455
 
453
- Omit `--push` to create the release commit and tag locally, then push with the command printed by the helper.
456
+ Non-release pushes to `main` also trigger the publish workflow, but it exits without publishing when the current `package.json` version already exists on npm.
454
457
 
455
- Stable tags such as `v0.1.0` publish with the npm `latest` dist-tag. Prerelease tags such as `v0.2.0-beta.1` publish with the npm `next` dist-tag.
458
+ Stable versions such as `0.1.2` publish with the npm `latest` dist-tag. Prerelease versions such as `0.2.0-beta.1` publish with the npm `next` dist-tag.
456
459
 
457
460
  ## Troubleshooting
458
461
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lsp-adapter",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Pi extension that gives coding agents Language Server Protocol tools for diagnostics, hover, definitions, references, and symbol search",
5
5
  "author": "Nikmmd",
6
6
  "license": "MIT",
@@ -38,8 +38,7 @@
38
38
  "test:watch": "vitest",
39
39
  "typecheck": "tsc --noEmit",
40
40
  "format": "prettier --write .",
41
- "format:check": "prettier --check .",
42
- "release": "bash scripts/release.sh"
41
+ "format:check": "prettier --check ."
43
42
  },
44
43
  "pi": {
45
44
  "extensions": [
@@ -364,12 +364,29 @@ async function resolveExecutable(command: string, env: Record<string, string>, s
364
364
  return absolute;
365
365
  }
366
366
 
367
- const pathEntries = (env.PATH ?? "").split(process.platform === "win32" ? ";" : ":").filter(Boolean);
367
+ const rawPath = env.PATH ?? "";
368
+
369
+ let pathEntries: string[];
370
+ if (process.platform === "win32" && (rawPath.includes("/c/") || rawPath.includes("/usr/"))) {
371
+ // Git Bash / MSYS / MinGW expose a POSIX-style, ":"-separated PATH.
372
+ pathEntries = rawPath.split(":").filter(Boolean);
373
+ } else {
374
+ pathEntries = rawPath.split(process.platform === "win32" ? ";" : ":").filter(Boolean);
375
+ }
376
+
368
377
  const extensions = process.platform === "win32" ? (env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";") : [""];
369
378
 
370
379
  for (const directory of pathEntries) {
371
380
  for (const extension of extensions) {
372
- const candidate = join(directory, `${command}${extension}`);
381
+ let normalized = directory;
382
+
383
+ // Convert an MSYS "/c/Users/foo" entry to "C:\Users\foo" for fs.access().
384
+ if (process.platform === "win32" && /^\/[a-zA-Z]\//.test(normalized)) {
385
+ const drive = normalized[1]!.toUpperCase();
386
+ normalized = `${drive}:\\${normalized.slice(3).replace(/\//g, "\\")}`;
387
+ }
388
+
389
+ const candidate = join(normalized, `${command}${extension}`);
373
390
  if (await isExecutable(candidate)) {
374
391
  return candidate;
375
392
  }
@@ -192,7 +192,10 @@ function replaceCommandPlaceholders(value: string, placeholders: Record<string,
192
192
  function getInstallBinDir(install: InstalledServerMetadata | undefined): string | undefined {
193
193
  if (install?.binDir) return install.binDir;
194
194
  const commandPath = install?.resolvedCommand[0];
195
- if (!commandPath || !commandPath.includes("/")) return undefined;
195
+ // A bare command name (e.g. "rust-analyzer") has no directory separator and
196
+ // yields no bin dir. Check for both "/" and "\\" so Windows-resolved system
197
+ // commands like "C:\\Users\\rockn\\go\\bin\\gopls.EXE" are handled too.
198
+ if (!commandPath || (!commandPath.includes("/") && !commandPath.includes("\\"))) return undefined;
196
199
  return dirname(commandPath);
197
200
  }
198
201
 
@@ -22,6 +22,17 @@ export function normalizeProcessEnv(env: NodeJS.ProcessEnv): Record<string, stri
22
22
  for (const [key, value] of Object.entries(env)) {
23
23
  if (typeof value === "string") {
24
24
  normalized[key] = value;
25
+ // On Windows, process.env is case-insensitive but a plain copied object is
26
+ // not: Windows stores PATH as "Path", so downstream reads of env.PATH would
27
+ // be undefined. Mirror only PATH/PATHEXT to upper-case keys — uppercasing
28
+ // every key could break case-sensitive variables spawned tools expect
29
+ // (GOBIN, GOPATH, ...).
30
+ if (process.platform === "win32") {
31
+ const upper = key.toUpperCase();
32
+ if (upper === "PATH" || upper === "PATHEXT") {
33
+ normalized[upper] = value;
34
+ }
35
+ }
25
36
  }
26
37
  }
27
38
  return normalized;