You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS language service ignoring flags with exclude/files directives in tsconfig.json #7044
I am using 1.8 beta. I am also using aurelia framework inside an aspnet5 project. I have configured the module loader, SystemJS, to transpile my TS files. I do *not * want VS to build the TS files. I control this by using a tsconfig.json in the root of the aspnet5 project, which excludes "wwwroot" (along with node_modules, jspm_packages) from compilation. Unfortunately, it appears this also prevents essential flags specified - such as "experimentalDecorators" in this file from being picked up by the language service for excluded folders/files. This gives me annoying red squigglies everywhere complaining that I should specify the flag. If I comment out the wwwroot exlcusion, the squigglies go away.
Therefore, I suggest that the exclude/files directives should only apply to the compiler pass (they are under "compilerOptions" after all,) and not the ambient language service, or you should add a distinct block for controlling the language service flags in tsconfig.json, or even use a separate tsserver.json file. I need support for decorators in intellisense, but I have no intention of using the build process to compile. Make sense?
changed the title [-]VS language service should NOT heed exclude/files directives in tsconfig.json[/-][+]VS language service / intellisense ignoring flags when exclude/files directives in tsconfig.json[/+]on Feb 12, 2016
changed the title [-]VS language service / intellisense ignoring flags when exclude/files directives in tsconfig.json[/-][+]VS language service ignoring flags with exclude/files directives in tsconfig.json[/+]on Feb 12, 2016
What Oisin Grehan (@oising) wants it to block msbuild from invoking the compiler, excluding all files will not allow you to do that.
What the tsconfig.json does in Visual Studio is create a 'mini-project', for that 'mini-project' it defines settings how to interpret the TypeScript files. The name compilerOptions maybe a not so great choice, but it's what we have... further you don't users who actually want to compile duplicate the settings between a file used for Visual Studio and the compiler.
Now, the option you're looking for is actually part of ASP.NET v5, by disabling the checkbox, MSBuild will no longer invoke the TypeScript compiler.
Mohamed Hegazy (@mhegazy) Basically I want to enable decorators for intellisense purposes, yet exclude all TS files from compilation by VS/msbuild because I have another process that will do that.
You can modify your project file for the ASP.NET v4 and add a <TypeScriptCompileBlocked>true< ../> property to one of the property groups. That should give you the same behavior.
Activity
[-]VS language service should NOT heed exclude/files directives in tsconfig.json[/-][+]VS language service / intellisense ignoring flags when exclude/files directives in tsconfig.json[/+][-]VS language service / intellisense ignoring flags when exclude/files directives in tsconfig.json[/-][+]VS language service ignoring flags with exclude/files directives in tsconfig.json[/+]mhegazy commentedon Feb 12, 2016
Oisin Grehan (@oising), i can not piece together what is not working in your scenario. can you share a repro project?
paulvanbrenk commentedon Feb 12, 2016
Mohamed Hegazy (@mhegazy) I can..
What Oisin Grehan (@oising) wants it to block msbuild from invoking the compiler, excluding all files will not allow you to do that.
What the
tsconfig.jsondoes in Visual Studio is create a 'mini-project', for that 'mini-project' it defines settings how to interpret the TypeScript files. The name compilerOptions maybe a not so great choice, but it's what we have... further you don't users who actually want to compile duplicate the settings between a file used for Visual Studio and the compiler.Now, the option you're looking for is actually part of ASP.NET v5, by disabling the checkbox, MSBuild will no longer invoke the TypeScript compiler.
Hth
oising commentedon Feb 14, 2016
Paul van Brenk (@paulvanbrenk) Yes, that's what I would like, yes. Except in a regular asp.net 4.6 project, not in a aspnet5/core/dnx project.
oising commentedon Feb 14, 2016
Mohamed Hegazy (@mhegazy) Basically I want to enable decorators for intellisense purposes, yet exclude all TS files from compilation by VS/msbuild because I have another process that will do that.
paulvanbrenk commentedon Feb 16, 2016
You can modify your project file for the ASP.NET v4 and add a
<TypeScriptCompileBlocked>true< ../>property to one of the property groups. That should give you the same behavior.oising commentedon Feb 18, 2016
Paul van Brenk (@paulvanbrenk) Cheers Paul. Yay for seemingly undocumented obscure magic xml elements without schema!
mhegazy commentedon Feb 20, 2016
Added docs for it on the MSBuild integration docs: https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects#typescriptcompileblocked