Skip to content

Conversation

@AsPulse
Copy link
Contributor

@AsPulse AsPulse commented Nov 26, 2025

Problem: TypeScript projects face an issue where the appropriate LSP to launch differs depending on whether it's a Deno project or a Node/Bun project. Furthermore, as Deno started supporting workspaces and coexisting with package.json, problems arise such as LSPs failing to launch or two LSPs launching simultaneously. This has led to the codebase for resolving these issues becoming complex and prone to omissions.

Solution: I introduced a function detect_project into lspconfig.typescript to determine the TypeScript project type (either node, bun, or deno) and its root directory. I then rewrote the logic in various TypeScript-related LSPs (biome, denols, eslint, ts_ls, tsgo, vtsls), which was previously written individually, to use the determination made by this function.

Testing: I created and ran a test runner to confirm that detect_project works as expected in AsPulse/lspconfig-detection-test. In fixtures/, we describe situations that should be tested, and in tests/, we describe which runtime and root_dir should be detected. I've confirmed that the code in the PR passes these tests. I also confirmed that a neovim environment that was installed nvim-lspconfig, included in the PR, functioned as intended.

@AsPulse AsPulse marked this pull request as draft November 27, 2025 03:11
@AsPulse AsPulse marked this pull request as ready for review November 27, 2025 03:31
@AsPulse AsPulse marked this pull request as draft November 28, 2025 16:31
@AsPulse AsPulse force-pushed the feat(lsp)/smarter-typescript-project-detection branch from afa2bb5 to 386c9a3 Compare November 29, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant