sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin
MIT License
134 stars 11 forks source link

Error no project when certain folders are added to jsconfig.json #239

Open aashish108 opened 8 months ago

aashish108 commented 8 months ago

Hey team! Do you know why I get this error when adding some folders to jsconfig.json? I have a list of 10 folders included in jsconfig.json includes section and had to disable 4 folders to get find references to work.

TypeScript Server Error (5.3.3)\nNo Project.\nError: No Project

Complete Error

{
   "message":"<semantic> TypeScript Server Error (5.3.3)\nNo Project.\nError: No Project.\n    at Object.ThrowNoProject (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:175373:11)\n    at IpcIOSession.getProjects (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:184278:21)\n    at IpcIOSession.getReferences (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:184342:27)\n    at references (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:182868:43)\n    at /Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:185375:69\n    at IpcIOSession.executeWithRequestId (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:185367:14)\n    at IpcIOSession.executeCommand (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:185375:29)\n    at IpcIOSession.onMessage (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:185417:51)\n    at process.<anonymous> (/Users/aashishsharma/Library/Caches/Sublime Text/Package Storage/LSP-typescript/18.18.1/typescript-language-server/node_modules/typescript/lib/tsserver.js:186999:14)\n    at process.emit (node:events:517:28)\n    at emit (node:internal/child_process:944:14)\n    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)",
   "code":1
}
rchl commented 8 months ago

Probably would need at least some logs to be able to tell something. https://lsp.sublimetext.io/troubleshooting/#self-help-instructions

silverwind commented 4 months ago

I think the "No project" error is basically "too many large files" in the project and typescript-language-server just bails out. In VSCode, one would get such a warning during rename action where that bailout happens, urging users to configure exclude in tsconfig:

Ideally, LSP-typescript would replicate this warning popup in ST if the user has too many files in their project, likely not excluding dist and similar folders.

silverwind commented 4 months ago

I can reproduce the issue when I include a dist folder with 21MB of compiled Javascript in tsconfig.json. Not sure what the threshold is for typescript-language-server, but I assume it must have some limit and 21MB is over that.

rchl commented 4 months ago

Note to whoever wants to implement that: this message is based on projectLanguageServiceState tsserver event which has languageServiceEnabled property that tells whether the server got disabled.

aashish108 commented 4 months ago

Or it can probably be replicated with a lot of monorepo projects that have a lot of big apps in them.