-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
tsconfig.json as higher priority in Visual Studio #5287
Comments
I think the intuition is that a project file is a more committed/custom solution that the user has in mind. After all, if you have a project file, why wouldn't you just set your compilation settings there? @mhegazy and @paulvanbrenk can correct me if I'm wrong. |
tsconfig.json should have higher priority, since we should default to code sharing across editors. The Project properties in VS need updating to reflect that thinking, but the current implementation should work that way. |
Also note, we will need a way to switch off/on compile-on-save for projects managed by tsconfig.json. |
Any updates on this? Is it still going to be part of Typescript 1.8? I rely on it heavily. I can't continue development until it is fixed. |
Yes, there is still work planned here for 1.8. However looking at your project.. I don't think this will work as you expect. The Further we won't support nested So for your project this results in the following compilation contexts:
If you want to separate
Also this currently works in the language service, but the only way to compile this is to use a grunt/gulp pipeline. |
That sounds brilliant to me. Exactly as I want it. Explicit and minimal. |
Thanks @paulvanbrenk!!! looking forward to it! |
Great work on this. Now I can't wait! |
This may be an obvious point, but if I have a developer add a .ts file in Visual Studio, will it go into both the .csproj and tsconfig.json files? Or will Visual Studio have a visual way to show the contents of the tsconfig.json file? Or, are we saying that, when someone is using tsconfig.json file for web project, they should not add .ts files to Visual Studio at all, but only add them to tsconfig.json? I'm not necessarily saying that any of these options is preferred nor that they are invalid. But curious if there's been discussion about various common workflows. |
We expect most users to not explicitly add ts files to their You will still be able to see the compiler context for the |
Paul, thank you. I'm trying to figure out how I'll be able to use this feature in the future to solve a problem that I have right now that forces me to abandon the TS build step altogether from within Visual Studio and issue tsc.exe commands directly from the "pre-build" step from the web project (via a batch file). Ugly, but I don't have another solution. The issue that I'm talking about is documented here: #5448 -- I suggest looking at the specific comment which starts with the text "The following is what I hope to be a better explanation of the issue that I'm facing". I believe 5287 and 4714 will address my use-case indirectly. Because neither feature request directly address my use case, I'm trying to put the pieces together now to see how it will work. That way, if there's some subtle thing that I need, I can contribute to the discussion as the features get implemented. |
@kasajian I think the multiple |
cool. So how would that work? Like, would I specify in Visual Studio which tsconfig file a particular .ts file is associated with? |
You use the |
Okay, then I'll circle back to what I said previously to which you responded "We expect most users to not explicitly add ts files to their tsconfig.json file, but depend on the logic in the compiler to automatically pull in all .ts files. This way they would just add them to Visual Studio." So then it goes to reason that using the Visual Studio UI to add files to the project is really only useful in the case there's only a single tsconfig.json file. Alternatively, the user will have to add .ts files to both the Visual Studio project and the tsconfig.json file. To me, the story isn't very clear, and I realize that may be because we simply haven't thought through that far ahead. I'm just trying to wrap my head around the user workflow for the user who wants to do what I indicated in 5448. thank you. |
Or you could do something like this
|
beautiful |
Support for multiple tsconfig.json files is part of 1.8, as is support for more project types. |
Not quite fixed - still some cases not covered: |
Hey guys,
A question, what is the reason as to why a project file supersedes a tsconfig in Visual Studio? (#4820 comment)
I'd assume that as soon as I introduce a tsconfig.json at any sub-directory level, that tsconfig.json should override the typescript compilation options for that level and below, unless another tsconfig exists within.
That's what makes most sense to me.
Is there a specific reason as to why the current method doesnt work like that?
The action of me adding a tsconfig.json in a project specifically means, i want to override the compilation options, right?
Project(MVC5) / file.ts
--> file.ts should use default project TS options
Project(MVC5) / scripts / tsconfig1.json
Project(MVC5) / scripts / file2.ts
--> file2.ts should use tsconfig1 options
Project(MVC5) / scripts / framework / tsconfig2.json
Project(MVC5) / scripts / framework / file3.ts
--> file3.ts should use tsconfig2 options
Thanks for your time
The text was updated successfully, but these errors were encountered: