pi-agent-ide 0.2.0 → 0.2.1
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/CHANGELOG.md +26 -0
- package/dist/chunk-2XYXV5HS.js +4 -0
- package/dist/{chunk-YQTLJ5ZV.js → chunk-6XQQBKPE.js} +1 -1
- package/dist/{chunk-VUNCBASK.js → chunk-KH5KPBCR.js} +3 -3
- package/dist/chunk-L4FA6OD4.js +1 -0
- package/dist/chunk-LGN7EJYR.js +13 -0
- package/dist/chunk-MTQSGWZJ.js +1 -0
- package/dist/chunk-N34ATN52.js +1 -0
- package/dist/{chunk-52BM6J6I.js → chunk-NXHPO7ER.js} +3 -3
- package/dist/{chunk-QW5O42QJ.js → chunk-OFHVDY4Q.js} +1 -1
- package/dist/{chunk-E4SECPF4.js → chunk-ONWUJXUR.js} +1 -1
- package/dist/chunk-QZANC2IG.js +1 -0
- package/dist/{chunk-QNZVPFSP.js → chunk-SMSIT3CE.js} +1 -1
- package/dist/{chunk-KP37XTDI.js → chunk-UTTW55S2.js} +1 -1
- package/dist/chunk-VEJGSURY.js +8 -0
- package/dist/chunk-WZI4YC2O.js +1 -0
- package/dist/{chunk-5A25RATC.js → chunk-ZIHEF6K3.js} +3 -3
- package/dist/entry-0.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -1
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -0
- package/dist/entry-54.js +0 -1
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -0
- package/dist/pi-agent-ide.js +12 -12
- package/docs/configuration.md +32 -1
- package/docs/generated/tool-catalog/cmake.md +5 -5
- package/docs/generated/tool-catalog/csharp.md +5 -5
- package/docs/generated/tool-catalog/css.md +7 -7
- package/docs/generated/tool-catalog/dart.md +9 -0
- package/docs/generated/tool-catalog/dockerfile.md +5 -5
- package/docs/generated/tool-catalog/elixir.md +9 -0
- package/docs/generated/tool-catalog/html.md +7 -6
- package/docs/generated/tool-catalog/index.md +9 -0
- package/docs/generated/tool-catalog/javascript.md +8 -8
- package/docs/generated/tool-catalog/json.md +7 -7
- package/docs/generated/tool-catalog/julia.md +8 -0
- package/docs/generated/tool-catalog/kotlin.md +6 -5
- package/docs/generated/tool-catalog/markdown.md +6 -6
- package/docs/generated/tool-catalog/powershell.md +9 -0
- package/docs/generated/tool-catalog/python.md +6 -6
- package/docs/generated/tool-catalog/r.md +9 -0
- package/docs/generated/tool-catalog/scala.md +9 -0
- package/docs/generated/tool-catalog/svelte.md +9 -0
- package/docs/generated/tool-catalog/typescript.md +9 -8
- package/docs/generated/tool-catalog/vue.md +9 -0
- package/docs/generated/tool-catalog/yaml.md +6 -6
- package/docs/generated/tool-catalog/zig.md +9 -0
- package/node_modules/pi-agent-doctor/package.json +10 -3
- package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
- package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +63 -17
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +3 -0
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +131 -13
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +20 -8
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +196 -39
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +23 -3
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +73 -33
- package/node_modules/pi-agent-ide-lint/src/registry.ts +20 -8
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +3 -6
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +154 -11
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
- package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-read/package.json +11 -11
- package/node_modules/pi-agent-read/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-search/package.json +7 -7
- package/node_modules/pi-agent-search/runtime/entry-44.js +0 -1
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +22 -22
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/package.json +35 -35
- package/src/api/tool-config/formatters.json +70 -12
- package/src/api/tool-config/linters.json +148 -66
- package/src/api/tool-config/lsp-servers.json +142 -7
- package/src/api/tool-config.ts +56 -24
- package/src/code-view/diagnostic-view.ts +14 -10
- package/src/doctor/config-writer.ts +14 -1
- package/src/doctor/discovery.ts +13 -68
- package/src/doctor/run.ts +33 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/package.json +11 -11
- package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
- package/src/extensions/pi-agent-search/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/src/plugins/pi-agent-ide-ast/package.json +11 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +3 -0
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +8 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +131 -13
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +20 -8
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +196 -39
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +23 -3
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +73 -33
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +20 -8
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +3 -6
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +154 -11
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
- package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
- package/src/toolchain/types.ts +2 -0
- package/dist/chunk-476MR2QB.js +0 -1
- package/dist/chunk-4KQOODGE.js +0 -13
- package/dist/chunk-7NDBZ4WX.js +0 -1
- package/dist/chunk-AP7Z3VWC.js +0 -1
- package/dist/chunk-TNWYEXFG.js +0 -1
- package/dist/chunk-U4D6FT66.js +0 -1
- package/dist/chunk-VWVLBOMU.js +0 -8
- package/node_modules/pi-agent-filesystem/runtime/entry-20.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-40.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-53.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-21.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-35.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-45.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-69.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +0 -1
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-21.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-69.js +0 -0
- /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"cross-spawn": "^7.0.6",
|
|
7
|
-
"pi-agent-doctor": "0.2.
|
|
8
|
-
"pi-agent-invariant": "0.2.
|
|
9
|
-
"pi-agent-read": "0.2.
|
|
10
|
-
"pi-agent-resource": "0.2.
|
|
11
|
-
"pi-agent-search": "0.2.
|
|
12
|
-
"pi-agent-text": "0.2.
|
|
7
|
+
"pi-agent-doctor": "0.2.1",
|
|
8
|
+
"pi-agent-invariant": "0.2.1",
|
|
9
|
+
"pi-agent-read": "0.2.1",
|
|
10
|
+
"pi-agent-resource": "0.2.1",
|
|
11
|
+
"pi-agent-search": "0.2.1",
|
|
12
|
+
"pi-agent-text": "0.2.1",
|
|
13
13
|
"vscode-jsonrpc": "^9.0.0",
|
|
14
14
|
"vscode-uri": "^3.1.0"
|
|
15
15
|
},
|
|
16
16
|
"pi": {
|
|
17
17
|
"extensions": [
|
|
18
|
-
"./runtime/entry-
|
|
18
|
+
"./runtime/entry-32.js"
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@earendil-works/pi-coding-agent": "*",
|
|
23
|
-
"pi-agent-ide": "0.2.
|
|
23
|
+
"pi-agent-ide": "0.2.1"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -4,6 +4,104 @@ import type { ToolRecipe } from "pi-agent-doctor/api/catalog";
|
|
|
4
4
|
LSP recipes owned by the LSP plugin.
|
|
5
5
|
*/
|
|
6
6
|
export const LSP_RECIPES: readonly ToolRecipe[] = [
|
|
7
|
+
{
|
|
8
|
+
id: "vue-typescript-language-server",
|
|
9
|
+
name: "vue-typescript-language-server",
|
|
10
|
+
kind: "lsp",
|
|
11
|
+
languages: ["vue"],
|
|
12
|
+
executables: ["typescript-language-server"],
|
|
13
|
+
dependencies: ["typescript-language-server", "@vue/typescript-plugin"],
|
|
14
|
+
configFiles: ["tsconfig.json"],
|
|
15
|
+
documentation: "https://github.com/vuejs/language-tools/tree/master/packages/typescript-plugin",
|
|
16
|
+
lsp: {
|
|
17
|
+
command: ["typescript-language-server", "--stdio"],
|
|
18
|
+
rootMarkers: ["tsconfig.json", "package.json"],
|
|
19
|
+
languageIds: { vue: [".vue"] },
|
|
20
|
+
initializationOptions: {
|
|
21
|
+
plugins: [
|
|
22
|
+
{
|
|
23
|
+
name: "@vue/typescript-plugin",
|
|
24
|
+
location: "{project}/node_modules/@vue/typescript-plugin",
|
|
25
|
+
languages: ["vue"],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
recipe(
|
|
32
|
+
"elixir-ls",
|
|
33
|
+
["elixir"],
|
|
34
|
+
["elixir-ls"],
|
|
35
|
+
["mix.exs"],
|
|
36
|
+
{ elixir: [".ex", ".exs"] },
|
|
37
|
+
["elixir-ls"],
|
|
38
|
+
"https://github.com/elixir-lsp/elixir-ls",
|
|
39
|
+
undefined,
|
|
40
|
+
undefined,
|
|
41
|
+
{ elixirLS: { mcpEnabled: false } },
|
|
42
|
+
),
|
|
43
|
+
recipe(
|
|
44
|
+
"metals",
|
|
45
|
+
["scala"],
|
|
46
|
+
["metals"],
|
|
47
|
+
["build.sbt", "project.scala", ".bsp"],
|
|
48
|
+
{ scala: [".scala", ".sc"] },
|
|
49
|
+
["metals"],
|
|
50
|
+
"https://scalameta.org/metals/",
|
|
51
|
+
),
|
|
52
|
+
{
|
|
53
|
+
id: "angular-language-server",
|
|
54
|
+
name: "angular-language-server",
|
|
55
|
+
kind: "lsp",
|
|
56
|
+
languages: ["typescript", "html"],
|
|
57
|
+
executables: ["ngserver"],
|
|
58
|
+
dependencies: ["@angular/language-server"],
|
|
59
|
+
configFiles: ["angular.json"],
|
|
60
|
+
documentation: "https://github.com/angular/vscode-ng-language-service",
|
|
61
|
+
lsp: {
|
|
62
|
+
command: ["ngserver", "--stdio", "--tsProbeLocations", ".", "--ngProbeLocations", "."],
|
|
63
|
+
rootMarkers: ["angular.json"],
|
|
64
|
+
requireRootMarker: true,
|
|
65
|
+
languageIds: { typescript: [".ts"], html: [".html"] },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
recipe(
|
|
69
|
+
"svelte-language-server",
|
|
70
|
+
["svelte"],
|
|
71
|
+
["svelteserver"],
|
|
72
|
+
["svelte.config.js", "package.json"],
|
|
73
|
+
{ svelte: [".svelte"] },
|
|
74
|
+
["svelteserver", "--stdio"],
|
|
75
|
+
"https://github.com/sveltejs/language-tools/tree/master/packages/language-server",
|
|
76
|
+
["svelte-language-server"],
|
|
77
|
+
),
|
|
78
|
+
recipe(
|
|
79
|
+
"dart-language-server",
|
|
80
|
+
["dart"],
|
|
81
|
+
["dart"],
|
|
82
|
+
["pubspec.yaml", "analysis_options.yaml"],
|
|
83
|
+
{ dart: [".dart"] },
|
|
84
|
+
["dart", "language-server", "--protocol=lsp"],
|
|
85
|
+
"https://dart.dev/tools/dart-language-server",
|
|
86
|
+
),
|
|
87
|
+
recipe(
|
|
88
|
+
"r-language-server",
|
|
89
|
+
["r"],
|
|
90
|
+
["Rscript"],
|
|
91
|
+
["DESCRIPTION", ".lintr", ".Rprofile"],
|
|
92
|
+
{ r: [".r"] },
|
|
93
|
+
["Rscript", "-e", "languageserver::run()"],
|
|
94
|
+
"https://github.com/REditorSupport/languageserver",
|
|
95
|
+
),
|
|
96
|
+
recipe(
|
|
97
|
+
"zls",
|
|
98
|
+
["zig"],
|
|
99
|
+
["zls"],
|
|
100
|
+
["build.zig", "build.zig.zon", "zls.json"],
|
|
101
|
+
{ zig: [".zig", ".zon"] },
|
|
102
|
+
["zls"],
|
|
103
|
+
"https://zigtools.org/zls/",
|
|
104
|
+
),
|
|
7
105
|
recipe(
|
|
8
106
|
"clangd",
|
|
9
107
|
["c", "cpp"],
|
|
@@ -18,7 +116,12 @@ export const LSP_RECIPES: readonly ToolRecipe[] = [
|
|
|
18
116
|
["javascript", "typescript"],
|
|
19
117
|
["typescript-language-server"],
|
|
20
118
|
["tsconfig.json", "jsconfig.json", "package.json"],
|
|
21
|
-
{
|
|
119
|
+
{
|
|
120
|
+
javascript: [".js", ".mjs", ".cjs"],
|
|
121
|
+
javascriptreact: [".jsx"],
|
|
122
|
+
typescript: [".ts", ".mts", ".cts"],
|
|
123
|
+
typescriptreact: [".tsx"],
|
|
124
|
+
},
|
|
22
125
|
["typescript-language-server", "--stdio"],
|
|
23
126
|
"https://github.com/typescript-language-server/typescript-language-server",
|
|
24
127
|
["typescript-language-server"],
|
|
@@ -131,6 +234,9 @@ export const LSP_RECIPES: readonly ToolRecipe[] = [
|
|
|
131
234
|
{ css: [".css", ".scss", ".less"] },
|
|
132
235
|
["vscode-css-language-server", "--stdio"],
|
|
133
236
|
"https://github.com/microsoft/vscode-css-languageservice",
|
|
237
|
+
undefined,
|
|
238
|
+
undefined,
|
|
239
|
+
{ css: {}, scss: {}, less: {} },
|
|
134
240
|
),
|
|
135
241
|
recipe(
|
|
136
242
|
"vscode-html-language-server",
|
|
@@ -178,13 +284,49 @@ export const LSP_RECIPES: readonly ToolRecipe[] = [
|
|
|
178
284
|
"https://github.com/hashicorp/terraform-ls",
|
|
179
285
|
),
|
|
180
286
|
recipe(
|
|
181
|
-
"
|
|
287
|
+
"kotlin-lsp",
|
|
288
|
+
["kotlin"],
|
|
289
|
+
["intellij-server"],
|
|
290
|
+
["build.gradle.kts", "build.gradle", "pom.xml", "settings.gradle.kts"],
|
|
291
|
+
{ kotlin: [".kt", ".kts"] },
|
|
292
|
+
["intellij-server", "--stdio"],
|
|
293
|
+
"https://github.com/Kotlin/kotlin-lsp",
|
|
294
|
+
),
|
|
295
|
+
recipe(
|
|
296
|
+
"julia-language-server",
|
|
297
|
+
["julia"],
|
|
298
|
+
["julia"],
|
|
299
|
+
["Project.toml", "JuliaProject.toml"],
|
|
300
|
+
{ julia: [".jl"] },
|
|
301
|
+
["julia", "--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
|
|
302
|
+
"https://github.com/julia-vscode/LanguageServer.jl",
|
|
303
|
+
),
|
|
304
|
+
recipe(
|
|
305
|
+
"powershell-editor-services",
|
|
306
|
+
["powershell"],
|
|
307
|
+
["pwsh"],
|
|
308
|
+
["PSScriptAnalyzerSettings.psd1"],
|
|
309
|
+
{ powershell: [".ps1", ".psm1", ".psd1"] },
|
|
310
|
+
[
|
|
311
|
+
"pwsh",
|
|
312
|
+
"-NoProfile",
|
|
313
|
+
"-NonInteractive",
|
|
314
|
+
"-Command",
|
|
315
|
+
'$ErrorActionPreference="Stop";Import-Module PowerShellEditorServices;$d=Join-Path (Get-Location) ".agents/tmp/powershell-lsp-$PID";[IO.Directory]::CreateDirectory($d)|Out-Null;Start-EditorServices -HostName Pi -HostProfileId Pi -HostVersion 1.0.0 -Stdio -LanguageServiceOnly -LogPath (Join-Path $d "server.log") -SessionDetailsPath (Join-Path $d "session.json")',
|
|
316
|
+
],
|
|
317
|
+
"https://github.com/PowerShell/PowerShellEditorServices",
|
|
318
|
+
),
|
|
319
|
+
recipe(
|
|
320
|
+
"neocmakelsp",
|
|
182
321
|
["cmake"],
|
|
183
|
-
["
|
|
184
|
-
["CMakeLists.txt"],
|
|
322
|
+
["neocmakelsp"],
|
|
323
|
+
["CMakeLists.txt", ".neocmake.toml", ".neocmakelint.toml"],
|
|
185
324
|
{ cmake: [".cmake"] },
|
|
186
|
-
["
|
|
187
|
-
"https://github.com/
|
|
325
|
+
["neocmakelsp", "stdio"],
|
|
326
|
+
"https://github.com/neocmakelsp/neocmakelsp",
|
|
327
|
+
|
|
328
|
+
undefined,
|
|
329
|
+
{ cmake: ["CMakeLists.txt"] },
|
|
188
330
|
),
|
|
189
331
|
recipe(
|
|
190
332
|
"vscode-json-language-server",
|
|
@@ -221,6 +363,9 @@ export const LSP_RECIPES: readonly ToolRecipe[] = [
|
|
|
221
363
|
{ dockerfile: [".dockerfile"] },
|
|
222
364
|
["docker-langserver", "--stdio"],
|
|
223
365
|
"https://github.com/rcjsuen/dockerfile-language-server-nodejs",
|
|
366
|
+
|
|
367
|
+
undefined,
|
|
368
|
+
{ dockerfile: ["Dockerfile", "Containerfile"] },
|
|
224
369
|
),
|
|
225
370
|
];
|
|
226
371
|
|
|
@@ -233,6 +378,9 @@ function recipe(
|
|
|
233
378
|
command: readonly string[],
|
|
234
379
|
documentation: string,
|
|
235
380
|
dependencies?: readonly string[],
|
|
381
|
+
fileNames?: Readonly<Record<string, readonly string[]>>,
|
|
382
|
+
|
|
383
|
+
settings?: Readonly<Record<string, unknown>>,
|
|
236
384
|
): ToolRecipe {
|
|
237
385
|
return {
|
|
238
386
|
id,
|
|
@@ -243,6 +391,12 @@ function recipe(
|
|
|
243
391
|
configFiles: rootMarkers,
|
|
244
392
|
documentation,
|
|
245
393
|
...(dependencies && { dependencies }),
|
|
246
|
-
lsp: {
|
|
394
|
+
lsp: {
|
|
395
|
+
command,
|
|
396
|
+
rootMarkers,
|
|
397
|
+
languageIds,
|
|
398
|
+
...(fileNames && { fileNames }),
|
|
399
|
+
...(settings && { settings }),
|
|
400
|
+
},
|
|
247
401
|
};
|
|
248
402
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
|
|
3
1
|
import { requestDiagnostics, type LspDiagnosticResult } from "./lsp/diagnostics.js";
|
|
4
2
|
import { completedDiagnosticAdapter } from "./lsp/diagnostic-adapters.js";
|
|
5
3
|
import type { LspManager } from "./lsp/manager.js";
|
|
@@ -16,8 +14,7 @@ export function createLspDiagnosticSource(
|
|
|
16
14
|
async diagnose(filePath, context) {
|
|
17
15
|
const manager = await managerFor(context.cwd);
|
|
18
16
|
context.signal.throwIfAborted();
|
|
19
|
-
const
|
|
20
|
-
const client = await manager.getOrStart(extension, context.cwd, "diagnostics");
|
|
17
|
+
const client = await manager.getOrStart(filePath, context.cwd, "diagnostics");
|
|
21
18
|
context.signal.throwIfAborted();
|
|
22
19
|
if (!client)
|
|
23
20
|
return {
|
|
@@ -26,8 +23,8 @@ export function createLspDiagnosticSource(
|
|
|
26
23
|
reason: "No language server configured for this file",
|
|
27
24
|
};
|
|
28
25
|
const uri = client.toUri(filePath);
|
|
29
|
-
const languageId = manager.languageId(
|
|
30
|
-
client.syncDocument(uri, context.content, languageId);
|
|
26
|
+
const languageId = manager.languageId(filePath);
|
|
27
|
+
client.syncDocument(uri, context.content, languageId, true);
|
|
31
28
|
let version = client.documentVersion(uri);
|
|
32
29
|
const refreshState = { active: true, queued: false };
|
|
33
30
|
const current = () => !context.signal.aborted && client.documentVersion(uri) === version;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
|
|
3
1
|
import { DOCTOR_API_VERSION, DOCTOR_PROTOCOL } from "pi-agent-doctor/api/plugin-protocol";
|
|
4
2
|
import { URI } from "vscode-uri";
|
|
5
3
|
|
|
@@ -106,7 +104,7 @@ async function inspectLspSetup(context: DoctorContext): Promise<DoctorSetupInspe
|
|
|
106
104
|
|
|
107
105
|
for (const [languageId, files] of context.detectedLanguages) {
|
|
108
106
|
const selected = files
|
|
109
|
-
.flatMap((file) => registry.resolve(
|
|
107
|
+
.flatMap((file) => registry.resolve(file))
|
|
110
108
|
.find((server) => server.languageId === languageId);
|
|
111
109
|
if (selected === undefined) {
|
|
112
110
|
continue;
|
|
@@ -141,7 +139,7 @@ function applicableServers(
|
|
|
141
139
|
const applicable = new Map<string, ResolvedServer>();
|
|
142
140
|
|
|
143
141
|
for (const file of files) {
|
|
144
|
-
const server = registry.resolve(
|
|
142
|
+
const server = registry.resolve(file)[0];
|
|
145
143
|
|
|
146
144
|
if (server !== undefined && !applicable.has(server.serverId)) {
|
|
147
145
|
applicable.set(server.serverId, server);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
2
|
import { type ChildProcess } from "node:child_process";
|
|
3
3
|
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
4
6
|
import spawnProcess from "cross-spawn";
|
|
5
7
|
import { createConfiguredProcessEnvironment } from "pi-agent-ide/api/tool-config";
|
|
6
8
|
import {
|
|
@@ -8,12 +10,15 @@ import {
|
|
|
8
10
|
CancellationTokenSource,
|
|
9
11
|
type MessageConnection,
|
|
10
12
|
StreamMessageReader,
|
|
11
|
-
StreamMessageWriter,
|
|
12
13
|
} from "vscode-jsonrpc/node";
|
|
13
14
|
import { URI } from "vscode-uri";
|
|
14
15
|
|
|
15
16
|
import type { LspDiagnostic } from "./types.js";
|
|
16
17
|
|
|
18
|
+
import { LspFileWatchers } from "./file-watchers.js";
|
|
19
|
+
|
|
20
|
+
import { TransportWriter } from "./transport-writer.js";
|
|
21
|
+
|
|
17
22
|
/** Latest push observation for an open document, without a completion guarantee. */
|
|
18
23
|
export interface LspDiagnosticPublication {
|
|
19
24
|
readonly version?: number;
|
|
@@ -34,9 +39,15 @@ export class LspClient {
|
|
|
34
39
|
private _disposed = false;
|
|
35
40
|
|
|
36
41
|
private _crashed = false;
|
|
42
|
+
|
|
43
|
+
private _stderr = "";
|
|
44
|
+
|
|
45
|
+
private _fileWatchers: LspFileWatchers | undefined;
|
|
37
46
|
private readonly _handlers = new Map<string, ((parameters: unknown) => void)[]>();
|
|
38
47
|
private readonly _documentVersions = new Map<string, number>();
|
|
39
48
|
|
|
49
|
+
private readonly _documentContents = new Map<string, string>();
|
|
50
|
+
|
|
40
51
|
private readonly _diagnosticPublications = new Map<string, LspDiagnosticPublication>();
|
|
41
52
|
private _diagnosticMode: "unknown" | "pull" | "push" = "unknown";
|
|
42
53
|
private readonly _activeDiagnosticRequests = new Set<string>();
|
|
@@ -142,6 +153,10 @@ export class LspClient {
|
|
|
142
153
|
const bin = requiredValue(this._command[0]);
|
|
143
154
|
const projectRoot = URI.parse(this.rootUri).fsPath;
|
|
144
155
|
|
|
156
|
+
const workspaceFolders = [
|
|
157
|
+
{ uri: this.rootUri, name: path.basename(projectRoot) || projectRoot },
|
|
158
|
+
];
|
|
159
|
+
|
|
145
160
|
const childProcess = spawnProcess(bin, this._args, {
|
|
146
161
|
stdio: ["pipe", "pipe", "pipe"],
|
|
147
162
|
cwd: projectRoot,
|
|
@@ -160,6 +175,12 @@ export class LspClient {
|
|
|
160
175
|
childProcess.stdout?.on("error", () => void 0);
|
|
161
176
|
childProcess.stderr?.on("error", () => void 0);
|
|
162
177
|
|
|
178
|
+
this._stderr = "";
|
|
179
|
+
childProcess.stderr?.setEncoding("utf8");
|
|
180
|
+
childProcess.stderr?.on("data", (chunk: string) => {
|
|
181
|
+
this._stderr = (this._stderr + chunk).slice(-4096);
|
|
182
|
+
});
|
|
183
|
+
|
|
163
184
|
childProcess.on("error", (error) => {
|
|
164
185
|
const code = "code" in error ? (error as { code?: unknown }).code : undefined;
|
|
165
186
|
|
|
@@ -174,6 +195,7 @@ export class LspClient {
|
|
|
174
195
|
});
|
|
175
196
|
|
|
176
197
|
childProcess.on("exit", (code, _signal) => {
|
|
198
|
+
this._fileWatchers?.dispose();
|
|
177
199
|
if (!this._disposed && code !== 0 && code !== null) {
|
|
178
200
|
this._crashed = true;
|
|
179
201
|
}
|
|
@@ -185,15 +207,77 @@ export class LspClient {
|
|
|
185
207
|
});
|
|
186
208
|
|
|
187
209
|
await spawnPromise;
|
|
188
|
-
|
|
210
|
+
const connection = createMessageConnection(
|
|
189
211
|
new StreamMessageReader(requiredValue(childProcess.stdout)),
|
|
190
|
-
new
|
|
212
|
+
new TransportWriter(requiredValue(childProcess.stdin), (error) => {
|
|
213
|
+
if (this._connection !== connection || this._disposed) return;
|
|
214
|
+
this._crashed = true;
|
|
215
|
+
this._initialized = false;
|
|
216
|
+
this._fileWatchers?.dispose();
|
|
217
|
+
connection.dispose();
|
|
218
|
+
console.error(`[lsp] ${this.serverId}: transport write failed:`, error);
|
|
219
|
+
}),
|
|
191
220
|
);
|
|
221
|
+
this._connection = connection;
|
|
192
222
|
|
|
193
223
|
this._connection.onError((error) => {
|
|
194
224
|
console.error(`[lsp] ${this.serverId}: connection error:`, error);
|
|
195
225
|
});
|
|
196
226
|
|
|
227
|
+
this._fileWatchers = new LspFileWatchers(
|
|
228
|
+
projectRoot,
|
|
229
|
+
(change) => {
|
|
230
|
+
this._sendNotification("workspace/didChangeWatchedFiles", { changes: [change] });
|
|
231
|
+
},
|
|
232
|
+
(error) => console.error(`[lsp] ${this.serverId}: file watcher failed:`, error),
|
|
233
|
+
);
|
|
234
|
+
this._connection.onRequest(
|
|
235
|
+
"client/registerCapability",
|
|
236
|
+
async (parameters: {
|
|
237
|
+
registrations: {
|
|
238
|
+
id: string;
|
|
239
|
+
method: string;
|
|
240
|
+
registerOptions?: { watchers?: Parameters<LspFileWatchers["register"]>[1] };
|
|
241
|
+
}[];
|
|
242
|
+
}) => {
|
|
243
|
+
for (const registration of parameters.registrations) {
|
|
244
|
+
// Settings are fixed for this client and already served by workspace/configuration.
|
|
245
|
+
if (registration.method === "workspace/didChangeConfiguration") continue;
|
|
246
|
+
if (registration.method !== "workspace/didChangeWatchedFiles")
|
|
247
|
+
throw new Error(`Unsupported dynamic capability: ${registration.method}`);
|
|
248
|
+
await this._fileWatchers?.register(
|
|
249
|
+
registration.id,
|
|
250
|
+
registration.registerOptions?.watchers ?? [],
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
return null;
|
|
254
|
+
},
|
|
255
|
+
);
|
|
256
|
+
this._connection.onRequest(
|
|
257
|
+
"client/unregisterCapability",
|
|
258
|
+
(parameters: { unregisterations: { id: string }[] }) => {
|
|
259
|
+
for (const registration of parameters.unregisterations)
|
|
260
|
+
this._fileWatchers?.unregister(registration.id);
|
|
261
|
+
return null;
|
|
262
|
+
},
|
|
263
|
+
);
|
|
264
|
+
this._connection.onRequest("window/workDoneProgress/create", () => null);
|
|
265
|
+
|
|
266
|
+
this._connection.onRequest(
|
|
267
|
+
"workspace/configuration",
|
|
268
|
+
(parameters: { items: { section?: string }[] }) =>
|
|
269
|
+
parameters.items.map((item) => {
|
|
270
|
+
let value: unknown = this._settings ?? null;
|
|
271
|
+
for (const segment of item.section?.split(".").filter(Boolean) ?? []) {
|
|
272
|
+
value =
|
|
273
|
+
typeof value === "object" && value !== null
|
|
274
|
+
? ((value as Record<string, unknown>)[segment] ?? null)
|
|
275
|
+
: null;
|
|
276
|
+
}
|
|
277
|
+
return value;
|
|
278
|
+
}),
|
|
279
|
+
);
|
|
280
|
+
|
|
197
281
|
this._connection.listen();
|
|
198
282
|
|
|
199
283
|
// Forward all incoming notifications to registered handlers
|
|
@@ -221,6 +305,8 @@ export class LspClient {
|
|
|
221
305
|
}
|
|
222
306
|
});
|
|
223
307
|
|
|
308
|
+
this._connection.onRequest("workspace/workspaceFolders", () => workspaceFolders);
|
|
309
|
+
|
|
224
310
|
interface InitResult {
|
|
225
311
|
capabilities: Record<string, unknown>;
|
|
226
312
|
}
|
|
@@ -229,14 +315,24 @@ export class LspClient {
|
|
|
229
315
|
this._connection.sendRequest<InitResult>("initialize", {
|
|
230
316
|
processId: process.pid,
|
|
231
317
|
rootUri: this.rootUri,
|
|
318
|
+
|
|
319
|
+
workspaceFolders,
|
|
232
320
|
capabilities: {
|
|
233
321
|
workspace: {
|
|
234
322
|
applyEdit: false,
|
|
323
|
+
|
|
324
|
+
configuration: true,
|
|
325
|
+
|
|
326
|
+
workspaceFolders: true,
|
|
327
|
+
|
|
328
|
+
didChangeWatchedFiles: { dynamicRegistration: true, relativePatternSupport: true },
|
|
235
329
|
symbol: { dynamicRegistration: false },
|
|
236
330
|
},
|
|
237
331
|
textDocument: {
|
|
238
332
|
synchronization: { didOpen: true, didChange: true, didClose: true },
|
|
239
333
|
publishDiagnostics: { relatedInformation: true },
|
|
334
|
+
|
|
335
|
+
diagnostic: { dynamicRegistration: false, relatedDocumentSupport: false },
|
|
240
336
|
documentSymbol: { hierarchicalDocumentSymbolSupport: true },
|
|
241
337
|
foldingRange: { lineFoldingOnly: true },
|
|
242
338
|
},
|
|
@@ -245,20 +341,30 @@ export class LspClient {
|
|
|
245
341
|
}),
|
|
246
342
|
this._timeoutMs,
|
|
247
343
|
`[lsp] ${this.serverId}: initialize timed out`,
|
|
248
|
-
)
|
|
344
|
+
).catch((error: unknown) => {
|
|
345
|
+
const detail = this._stderr.trim();
|
|
346
|
+
if (!detail) throw error;
|
|
347
|
+
throw new Error(`[lsp] ${this.serverId}: ${detail}`, { cause: error });
|
|
348
|
+
});
|
|
249
349
|
|
|
250
|
-
|
|
350
|
+
await this._connection.sendNotification("initialized", {
|
|
251
351
|
capabilities: initResult.capabilities,
|
|
252
352
|
});
|
|
253
353
|
|
|
254
354
|
if (this._settings !== undefined) {
|
|
255
|
-
|
|
355
|
+
await this._connection.sendNotification("workspace/didChangeConfiguration", {
|
|
256
356
|
settings: this._settings,
|
|
257
357
|
});
|
|
258
358
|
}
|
|
259
359
|
|
|
360
|
+
if (this._crashed)
|
|
361
|
+
throw new Error(`[lsp] ${this.serverId}: transport failed during initialization`);
|
|
362
|
+
|
|
260
363
|
this._initialized = true;
|
|
261
364
|
this._serverCapabilities = initResult.capabilities;
|
|
365
|
+
|
|
366
|
+
// Unadvertised methods may return null or internal errors rather than MethodNotFound.
|
|
367
|
+
this._diagnosticMode = initResult.capabilities.diagnosticProvider ? "pull" : "push";
|
|
262
368
|
}
|
|
263
369
|
|
|
264
370
|
touch(): void {
|
|
@@ -266,6 +372,7 @@ export class LspClient {
|
|
|
266
372
|
}
|
|
267
373
|
|
|
268
374
|
async restart(): Promise<void> {
|
|
375
|
+
this._fileWatchers?.dispose();
|
|
269
376
|
this._connection?.dispose();
|
|
270
377
|
this._connection = null;
|
|
271
378
|
this._process = null;
|
|
@@ -273,6 +380,7 @@ export class LspClient {
|
|
|
273
380
|
this._crashed = false;
|
|
274
381
|
this._disposed = false;
|
|
275
382
|
this._documentVersions.clear();
|
|
383
|
+
this._documentContents.clear();
|
|
276
384
|
this._diagnosticPublications.clear();
|
|
277
385
|
this._diagnosticMode = "unknown";
|
|
278
386
|
this._activeDiagnosticRequests.clear();
|
|
@@ -315,9 +423,23 @@ export class LspClient {
|
|
|
315
423
|
}
|
|
316
424
|
}
|
|
317
425
|
|
|
426
|
+
/** Queue a notification; a failed write makes this client unavailable without escaping to Pi. */
|
|
318
427
|
sendNotification(method: string, parameters: unknown): void {
|
|
319
428
|
this._assertReady();
|
|
320
|
-
|
|
429
|
+
this._sendNotification(method, parameters);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
private _sendNotification(method: string, parameters: unknown): void {
|
|
433
|
+
const connection = this._connection;
|
|
434
|
+
if (!connection) return;
|
|
435
|
+
void connection.sendNotification(method, parameters).catch((error: unknown) => {
|
|
436
|
+
if (this._connection !== connection || this._disposed) return;
|
|
437
|
+
this._crashed = true;
|
|
438
|
+
this._initialized = false;
|
|
439
|
+
this._fileWatchers?.dispose();
|
|
440
|
+
connection.dispose();
|
|
441
|
+
console.error(`[lsp] ${this.serverId}: notification ${method} failed:`, error);
|
|
442
|
+
});
|
|
321
443
|
}
|
|
322
444
|
|
|
323
445
|
/**
|
|
@@ -362,17 +484,31 @@ export class LspClient {
|
|
|
362
484
|
textDocument: { uri, languageId, version, text },
|
|
363
485
|
});
|
|
364
486
|
this._documentVersions.set(uri, version);
|
|
487
|
+
|
|
488
|
+
this._documentContents.set(uri, text);
|
|
365
489
|
}
|
|
366
490
|
|
|
367
|
-
|
|
491
|
+
/** Sync content, optionally reporting a completed disk write to servers that request saves. */
|
|
492
|
+
syncDocument(uri: string, text: string, languageId: string, saved = false): void {
|
|
493
|
+
if (this._documentContents.get(uri) === text) return;
|
|
368
494
|
const currentVersion = this._documentVersions.get(uri);
|
|
369
495
|
|
|
370
496
|
if (currentVersion === undefined) {
|
|
371
497
|
this.openDocument(uri, text, languageId);
|
|
372
|
-
|
|
498
|
+
} else {
|
|
499
|
+
this.changeDocument(uri, text, currentVersion + 1);
|
|
500
|
+
}
|
|
501
|
+
const synchronization = this._serverCapabilities?.textDocumentSync;
|
|
502
|
+
const save =
|
|
503
|
+
typeof synchronization === "object" && synchronization !== null
|
|
504
|
+
? (synchronization as { save?: boolean | { includeText?: boolean } }).save
|
|
505
|
+
: undefined;
|
|
506
|
+
if (saved && save) {
|
|
507
|
+
this.sendNotification("textDocument/didSave", {
|
|
508
|
+
textDocument: { uri },
|
|
509
|
+
...(typeof save === "object" && save.includeText && { text }),
|
|
510
|
+
});
|
|
373
511
|
}
|
|
374
|
-
|
|
375
|
-
this.changeDocument(uri, text, currentVersion + 1);
|
|
376
512
|
}
|
|
377
513
|
|
|
378
514
|
changeDocument(uri: string, text: string, version: number): void {
|
|
@@ -384,12 +520,16 @@ export class LspClient {
|
|
|
384
520
|
contentChanges: [{ text }],
|
|
385
521
|
});
|
|
386
522
|
this._documentVersions.set(uri, nextVersion);
|
|
523
|
+
|
|
524
|
+
this._documentContents.set(uri, text);
|
|
387
525
|
}
|
|
388
526
|
|
|
389
527
|
closeDocument(uri: string): void {
|
|
390
528
|
this.sendNotification("textDocument/didClose", { textDocument: { uri } });
|
|
391
529
|
this._documentVersions.delete(uri);
|
|
392
530
|
|
|
531
|
+
this._documentContents.delete(uri);
|
|
532
|
+
|
|
393
533
|
this._diagnosticPublications.delete(uri);
|
|
394
534
|
}
|
|
395
535
|
|
|
@@ -402,6 +542,8 @@ export class LspClient {
|
|
|
402
542
|
|
|
403
543
|
this._disposed = true;
|
|
404
544
|
|
|
545
|
+
this._fileWatchers?.dispose();
|
|
546
|
+
|
|
405
547
|
if (this._connection && this._initialized) {
|
|
406
548
|
try {
|
|
407
549
|
await withTimeout(
|
|
@@ -433,6 +575,7 @@ export class LspClient {
|
|
|
433
575
|
|
|
434
576
|
this._initialized = false;
|
|
435
577
|
this._documentVersions.clear();
|
|
578
|
+
this._documentContents.clear();
|
|
436
579
|
this._diagnosticPublications.clear();
|
|
437
580
|
this._diagnosticMode = "unknown";
|
|
438
581
|
this._activeDiagnosticRequests.clear();
|