fix(lsp): harden local provider lifecycle

This commit is contained in:
Dudu-0223
2026-07-16 16:42:32 +08:00
parent 3368f7924f
commit 0d8e7e98f7
21 changed files with 192 additions and 52 deletions
@@ -102,4 +102,16 @@ describe('lsp-local provider resolution', () => {
})).rejects.toThrow(/is not an executable file/)
await ctx.fiber.dispose()
})
it('rejects an executable directory as a command at load', async () => {
const ctx = new Context()
await ctx.plugin(Lsp)
await expect(ctx.plugin(LspLocal, {
providerId: 'abs-directory',
command: ws,
args: [],
extensionToLanguage: { '.ts': 'typescript' },
})).rejects.toThrow(/is not an executable file/)
await ctx.fiber.dispose()
})
})