Skip to content

vscode-workspace randomly brokes typescript syntax checking #265540

@Megabyteceer

Description

@Megabyteceer

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.103.2
  • OS Version: Win 10 PRO 22H2 19045.6216

I use vscode-workspace to pick a few folders inside monorepo project where one tsconfig.json in the root. And this approach randomly causes ts validation fails, because passes wrong projectRootPath to tsservet.js.

Sometime projectRootPath is correct (/my-project/). But sometime it is one of the picked folders from workspace (/my-project/client/picked-folder/src) and tsserver.js can not find tsconfig.json file for analyzing .ts files inside picked folder, because tsconfig is placed upper in hierarchy.
When i open workspace by .vscode-workspace file double click, projectRootPath is correct. But if start vscode first and open workspace via file menu - projectRootPath is wrong.
I think best solution, do no treat folders beyond workspace folder as a project root (maybe by adding flag to folder block in workspace file). Or search tsconfig.json until end of file hierarchy do not stop on projectRootPath passed from vscode. Or even apply both solutions to cover more use cases.

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuestypescriptTypescript support issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions