Skip to content

fix(lsp): lsp.<server>.command in .please/config.yml is validated but never used #157

Open

Description

@amondnet

Summary

.please/config.yml accepts lsp.<server>.command, but no code path uses it. The schema validates it (packages/format/src/config/schema.ts:36) and getServerCommand reads it (packages/lsp/src/config.ts:61). That function is only re-exported (packages/lsp/src/index.ts:1016). Both spawn sites call server.spawn(root) without it: packages/lsp/src/index.ts:338 and packages/code/src/cli.ts:141. A configured command is silently ignored and nothing is logged.

Why it matters

resolveNativeTypeScriptServer (packages/lsp/src/server/typescript.ts:159-182) finds a TypeScript 7 server only in fixed places:

If none of these exist, it falls back to typescript-language-server and tsserver.

Some projects have to keep typescript below 6.1, because typescript-eslint 8.x peers on >=4.8.4 <6.1.0. eslint-plugin-sonarjs and @astrojs/check set similar caps. Those projects can install TS 7 only beside 6. If they use any alias name other than @typescript/native, or put the binary outside node_modules, they get tsserver, and there is no override. @typescript/native-preview is not a durable workaround either: its last publish was 7.0.0-dev.20260707.2.

The difference is large. In one single-file diagnostic run, the same TS2322 came back from both servers. tsgo --lsp --stdio peaked at about 72 MB and tsserver at about 459 MB.

Proposal

When lsp.<id>.command is set, spawn it and skip auto-detection for that server:

  • spawn command[0] with command.slice(1), cwd = the server root
  • resolve a relative command[0] against the project root
  • log that a configured command is in use, the same way the native path logs Using ... language server

Do this once in the spawn path, in LSPManager and code lsp, instead of in each server. Then every server gets the override, not only typescript. When the field is unset, resolution stays exactly as it is now.

lsp:
  typescript:
    command: ["node_modules/.bin/tsc7", "--lsp", "--stdio"]

Alias status

@typescript/native is handled since #153 (merged 2026-11-22). It is not published yet: the npm latest of @pleaseai/code is still 0.1.16, from 2026-10-21. Other alias names would still need command.

Acceptance criteria

  • With lsp.typescript.command set, code lsp and the multiplexer spawn that command and log it.
  • Without command, server resolution is unchanged (existing typescript-native tests still pass).
  • A unit test covers a configured command overriding detection, and a relative path resolving against the root.
  • apps/docs/content/docs/3.configuration/1.overview.md documents command.

Activity

  1. added
    type:bug
    on Nov 23, 2026
  2. added theissue type on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lsptype:bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions