-
-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can load tsconfig from subfolders #349
Conversation
Sorry has been & will be a bit busy. Will take a look later this week. |
This is also happening for me too. In my case I do have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think duplicating code is good...
Also what's your reasoning for choosing lastFile
for figuring out where the tsconfig/jsconfig
is?
OP wants to support multiple subprojects in one editor window. @octref Do you know how vscode handle subprojects? |
https://code.visualstudio.com/updates/v1_14#_preview-multi-root-workspaces I haven't looked into the details though. |
Actually i just want vetur to load tsconfig.json from where i want. Because in my case tsconfig.json is not in root directory. Making tsconfig file search path as an option is enough for me. Then i found out @octref |
It doesn't solve my case though. I have multiple projects inside the same folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing configuration file on fly will cause a lot of unexpected errors.
VSCode relies on tsserver to handle multiple projects. And tsserver just maintains a set of language services for different projects.
See https://github.com/Microsoft/TypeScript/blob/master/src/server/editorServices.ts#L1465
and
https://github.com/Microsoft/TypeScript/blob/master/src/server/editorServices.ts#L360
and
https://github.com/Microsoft/TypeScript/blob/master/src/server/project.ts#L116
@WoLfulus if your project structured like this then when editing App.vue it will use client/tsconfig.json and should work for you. @HerringtonDarkholme Vscode can use different configurations for different *.ts files if there are multiple tsconfig files. We need to make this work for *.vue files. Attached a test project, open root folder as vscode workspace. "noImplicitAny" enabled for client and disabled for server. It works as expected. Tested on 1.14.2 (not preview). I think this feature is not related to "Multi Root Workspaces" because i am not using insiders build. Edit: tree structure was not correct on markdown. |
I have listed related source code and explained how vscode support multiple tscofig. In short, we need multiple language service, not changing configuration. |
Yeah, I suggest now you could try editing your |
Ok then, thanks for your time. |
@HerringtonDarkholme Could this at least be merged as a temporary solution for #815? I'd rather have a buggy fix for #815 than have no fix |
My .net core workspace is structured like this.
Workspace
├── Vuecore.Service
├── Vuecore.Shared
└── Vuecore.Web <─ this is where tsconfig.json exists.
Extension doesn't load tsconfig.json if the file is not in workspace but subfolders of workspace. Result of this leads to not applying config options for typescript. For example "Experimental support for decorators is a feature that is subject to change in a future release." warning occurs. And possibly the reason for #301 issue.
This fix makes language service to search tsconfig.json in currently editing file's folder to the root of workspace until it finds config file. Seems to work. There is some duplicate code but revision is welcome.