Skip to content
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

Visual Studio: tsconfig.json file hidden from Solution Explorer is not considered by IntelliSense #11815

Closed
T-Hugs opened this issue Oct 24, 2016 · 9 comments
Labels
Bug A bug in TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@T-Hugs
Copy link

T-Hugs commented Oct 24, 2016

TypeScript Version: 2.0.3

One can hide Items in Solution Explorer by using the <Visible>false</Visible> or <InProject>false</InProject> metadata on the Item.

Expected behavior:
As long as the tsconfig file is in the project (hidden in VS or not), its settings should be applied for syntax highlighting, IntelliSense, etc.

Actual behavior:
When <Visible> or <InProject> is applied to the tsconfig Item, its settings do not take effect.

Scenario/Justification
Our build requires some options that are only available in tsconfig.json (i.e. they don't have an MSBuild property counterpart). Therefore, we generate the tsconfig as part of the build and ensure it is part of the project. We want to hide it from Solution Explorer so engineers don't mistakenly edit it.

@mhegazy
Copy link
Contributor

mhegazy commented Oct 24, 2016

why not switch to use tsconfig.json all together if i may ask?

@T-Hugs
Copy link
Author

T-Hugs commented Oct 24, 2016

There are a couple of reasons here:

  • Our product includes over 100 projects that contain TypeScript, and they all import a common props and targets file, which sets default settings for the compiler (among other things). As of now, there is no way to inherit from a base tsconfig file (although I do see that on the roadmap for 2.1 😄).
  • This is maybe not as good of a reason, but the rest of the product uses MSBuild, so why should TypeScript be any different? Developers understand that a <TypeScriptCompile> node in the proj file will get a TypeScript file compiled. If we were to switch to tsconfig.json exclusively, engineers would need to (unnecessarily, in my opinion) understand a new concept for their build configuration.

@mhegazy
Copy link
Contributor

mhegazy commented Oct 24, 2016

tsconfig.json is not anti-MSBuild. the build targets looks for them and builds them normally just like projects that do not have tsconfig.json.

so what properties specifically are you using the tsconfig.json for? typeRoots?

@T-Hugs
Copy link
Author

T-Hugs commented Nov 22, 2016

I'm not sure exactly which ones, but we're using "baseUrl", "rootDir", "paths", and "typeRoots".

@mhegazy
Copy link
Contributor

mhegazy commented Nov 22, 2016

I see. thanks.

So given that TS 2.1 has support for configuration inheritance, is this still an issue?

@T-Hugs
Copy link
Author

T-Hugs commented Nov 22, 2016

I am pretty sure we will continue to generate a .tsconfig unless the MSBuild properties fully support everything .tsconfig supports. It would be nice to be able to hide that from the project in Solution Explorer.

@mhegazy mhegazy added the Bug A bug in TypeScript label Nov 22, 2016
@mhegazy mhegazy added this to the TypeScript 2.2 milestone Dec 14, 2016
@vladima
Copy link
Contributor

vladima commented Jan 31, 2017

@trevorsg Can you please tell are if this items is still actual for you? Current implementation uses DTE interfaces to pull in list of compile items and unfortunately DTE does not report hidden items. Moving away from DTE is certainly an option however it is not an easy solution and might need some time to incorporate. Alternatively we can use some dedicated MSBuild item group to enumerate all configuration files in project. Downside of this approach is that it can only be added by hand editing the project file meaning that it may easily go out of sync with the actual list of files.

@T-Hugs
Copy link
Author

T-Hugs commented Jan 31, 2017

@vladima It's not a blocking issue or anything, just an inconvenience. If it's an expensive fix I wouldn't be offended by a "won't fix" :)

@vladima vladima added the Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it label Feb 1, 2017
@vladima
Copy link
Contributor

vladima commented Feb 1, 2017

looks like costs of fixing it properly outweighs the benefits so closing it as "won't fix"

@vladima vladima closed this as completed Feb 1, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

3 participants