typescript-tools.nvim icon indicating copy to clipboard operation
typescript-tools.nvim copied to clipboard

LSP Crashing with nested tsconfigs

Open samiam376 opened this issue 1 year ago • 3 comments

I have a project with a second tsconfig in the test folder. When I switch between buffers inside the test folder and the src folder the lsp frequently crashes.

samiam376 avatar Jan 19 '24 18:01 samiam376

@samiam376 can you provide both tsconfigs or event better create barebones reproduction repo. I create simple repo with described case where in test folder is second tsconfig and for me it isn't crashing. My bet is you have some conflicting settings in both of them but I won't shoot blindly to find it, it just to be easier to me if you provide project/tsconfigs.

pmizio avatar Jan 22 '24 12:01 pmizio

sure! @pmizio

here is my main tsconfig.json

{ // there is a bug w/ ts node where extends breaks rn // I copied the tsconfig directly // "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "lib": ["es2023"], "module": "node16", "target": "es2022", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "moduleResolution": "node16", "strictPropertyInitialization": false, "outDir": "./build", "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "allowJs": true, "jsx": "react", "noErrorTruncation": false, "incremental": true }, "exclude": ["node_modules"], "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/modules.d.ts"], "ts-node": { "swc": true, "compilerOptions": { "module": "CommonJS", "target": "ESNext" } } }

then we have a tsconfig.prod.json { "extends": "./tsconfig.json", "compilerOptions": { "sourceMap": true, "removeComments": true, "inlineSources": true, "sourceRoot": "/", "jsx": "react", }, "exclude": ["tests"], }

and a tests/tsconfig.json

{ "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "strict": true, "strictPropertyInitialization": false, "incremental": true, "esModuleInterop": true, "resolveJsonModule": true, "skipLibCheck": true, "jsx": "react", "sourceMap": true }, "ts-node": { "swc": true, "compilerOptions": { "module": "CommonJS", "target": "ESNext" } }, "exclude": ["node_modules"], "include": [ "./**/*.ts", "./**/*.tsx", "./**/*.d.ts", "../src/**/*.ts", "../src/**/*.tsx", "scripts/fixtureGenerator.ts" ] }

samiam376 avatar Jan 22 '24 17:01 samiam376

@samiam376 Do you know that your config is hard to read? You can use triple-backquote to write markdowns for multiline codes.

nyngwang avatar Feb 25 '24 19:02 nyngwang