-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Allow to specify the tsconfig.json filename explicitly #12463
Comments
@waderyan this first needs support in the tsserver IMO. We can't tell tsserver the name or location of a tsconfig.json. |
@Aleksey-Bykov thank you for opening this issue. I'm not sure I completely understand. Can you provide a simple example of what you are describing? Is it something like this? MainProject/ And your feature request is to have SubProject-Y be able to use MainProject/tsconfig.json? |
no, i have it differently, in the folder structure that you showed there is no problem to compile a sub-project if the VSCode is run from under a sub-folder my file structure looks like this:
I want to be able to focus either on |
Interesting. Ok moving to TS repo. |
This issue was moved to microsoft/TypeScript#11224 |
please reopen it looks like there is a way per microsoft/TypeScript#11224 (comment)
|
@Aleksey-Bykov thank you. Let's take another look here. @dbaeumer looks like this is available in protocol.ts (see comment above). |
@waderyan no. This defined interface is a response message that is sent from the server to the client to let the client know which files belong to a tsconfig.json file. The tsserver currently doesn't expose any API to configure the name of the tsconfig.json. With 2.0.6 there is APi to manage the project totally on the client side but that would require us to do all the tsconfig.json file parseing, lookup, ... So I opt to not do that on the client side since it would put us in a constant catchup game. |
Can it be achieved? I've got problem with VSCode because it tries to use tsconfig files from subdirectories and that causes tsserver to restart. |
I have a slightly different scenario that causes me to want this feature. My folder structure is: MainProject/ I'm trying to put all my config files in that config folder instead of polluting the root. This works except that VSCode won't detect my tsconfig.json in there. |
I would love this feature so as to fix the tsconfig.json in my project not being used by VSCode. The answers in https://stackoverflow.com/questions/38268776/why-does-typescript-ignore-my-tsconfig-json-inside-visual-studio-code. do not work for me, so I'd love to be able to explicitly set it. I'm also using submodules. |
What if I have several tsconfig's for several sub-folders in my project? |
I am using Typescript for React development with multiple
Scripts are run in node but they use My solution was just to add a
I commit |
I'm using Angular 6 and I noticed this issue, as well. I just had to make sure that the name of my tsconfig.json file closest to the file that is having an issue, is named |
This comment has been minimized.
This comment has been minimized.
This would be an awesome feature to have, and I've found some behavior that might be helpful. My project's structure is basically the following:
The idea is that all configuration can be kept in one place and not have to litter the root directory. Now, with the proper setting in Webpack config, I am able to use the If I have my The strange part is that if I close the
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm in the same boat as everyone else. Using VS Code for Nativescript means you can't use absolute paths to import code. Any "@MyApp/..." type paths are not recognized because VS Code assumes that my tsconfig file (which is set to exclude all .tns.ts files) is the correct one to use to resolve imports. These imports actually DO work after building the app because Nativescript replaces tsconfig with tsconfig.tns.ts during the build, however during development most of our imports show up red which is highly confusing and causing lots of issues. |
I have the same problem due to a different use case - my config files start with The app itself works. All my tools can be configured to recognise the different filenames. But vscode doesn't and makes every file red. Please allow us to explicitly specify the ts project file as a config option. SIDE NOTE: my workaround is a dummy
All my tools are configured to look for the correct config files, so they ignore this one. |
Hi, this is still an issue for us. Our use case is to migrate a codebase to use strict null checks only in the IDE but not to block compilation (i.e. enabling new TS features: The referenced issue in microsoft/TypeScript#11224 was closed and went horribly off topic. Is it possible to reopen that issue (or open a new one?) since as I understand it this issue needs to be fixed in that repo. |
+1. We badly need this to be implemented in order to have an ability to place our Jest and WDIO tests next to the features they are testing. tsconfig for Jest and WDIO are incompatible with the ones for our react code. As a result, autocomplete doesn't work for WDIO classes which makes an VSCode as an IDE pretty useless. |
This comment has been minimized.
This comment has been minimized.
My project structure is also similar where multiple non-local tsconfig.json files are used to transpile the same library source for testing against different environments. Specifying one of the non-local configs would drop the need for a workaround to enable source navigation and squiggle removal. |
Running into similar issues where I have multiple directories having tsconfig files, the folders contain some shared code and they may reference each other (using tsconfig's paths). As soon as I (close-)open a file from one of the folders it has to "Initializing JS/TS Language features". I would really love to point all of them to one of the tsconfig files that is sitting in one of the sub directories (a directory that contains code that is NOT shared but actually implements the other subdirectories). A workspace setting that would allow to specify a tsconfig for the workspace would fix this issue for me. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
My solution is add typescript compiler options to environment variables. in launch.json: |
This comment has been minimized.
This comment has been minimized.
I've locked this issue because many of recent comments are not constructive and are just polluting the conversation. Suffice it to say: if doing this were as easy and had zero repercussions, we would have already done it |
currently VSCode uses the file with the exact name
tsconfig.json
in the folder as the project file for a typescript project,i have a few other project files named differently for corresponding sub-projects inside the same folder, I wish there was a way to tell VSCode to use one of them rather then the default
tsconfig.json
The text was updated successfully, but these errors were encountered: