Skip to content

Visual Studio ignores inlineSourceMaps / inlineSources option of tsconfig.json #6317

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

Closed
johnnyreilly opened this issue Jan 2, 2016 · 12 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@johnnyreilly
Copy link

Hi,

There's mention of this problem in: #4360

1.) There appears to be no way to set the flags (inlineSourceMap ,inlineSources ) in visual studio 2013 with the 1.5 TypeScript extension installed. Is this a known bug?

However the discussion moves off to cover debugging issues and I'm not clear whether the first issue is resolved. Is Visual Studio due to no longer ignore inlineSourceMaps / inlineSources option of tsconfig.json when TS 1.8 ships?

The issue is still there with TS 1.7.

@nycdotnet
Copy link

I know you're trying to use tsconfig.json, but just FYI - all of the options should be available in VS via MSBuild. https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects

@johnnyreilly
Copy link
Author

Thanks Steve. Happy New Year! It's good that there is another way but in this particular case I have 2 TypeScript projects inside my ASP.Net project. One for tests and one for source and I use different compiler settings for each..

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Jan 4, 2016
@mhegazy mhegazy closed this as completed Jan 4, 2016
@johnnyreilly
Copy link
Author

Is this resolved with 1.8 then?

@mhegazy
Copy link
Contributor

mhegazy commented Jan 4, 2016

@johnnyreilly what do you mean resolved?

as @nycdotnet mentioned all these properties are accessible using through MSBuild using the properties defined in https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects, there is just no UI for it.

@johnnyreilly
Copy link
Author

@mhegazy is this resolved?:

Is Visual Studio due to no longer ignore inlineSourceMaps / inlineSources option of tsconfig.json when TS 1.8 ships?

@mhegazy
Copy link
Contributor

mhegazy commented Jan 4, 2016

  • VS 2013 does not support tsconfig.json. you need to specify all properties as MSBuild properties
  • No UI is available in project properties to set these two properties, nether in VS 2013 no VS 2015. the wiki page has details on how to do it manually.
  • TS 1.8 should add support for debugging JS files generated with inlineSoruceMaps, and inlineSources, which were not supported before.

does that answer your question?

@johnnyreilly
Copy link
Author

Hi @mhegazy,

Sorry for the delay in responding.

TS 1.8 should add support for debugging JS files generated with inlineSoruceMaps, and inlineSources, which were not supported before.

I'm not quite sure if this means that inlineSourceMaps and inlineSources in tsconfig.json are not currently respected by Visual Studio but will be as of TS 1.8. I suspect you mean something else..

I think my original question was not phrased as well as it might have been. Let me try again:

I'm using Visual Studio 2015 with tsconfig.json and TypeScript 1.7. Frustratingly it seems that Visual Studio is ignoring options in my tsconfig.json - specifically the options related to sourcemaps. These are the settings in my tsconfig.json

  "compilerOptions": {
    "inlineSourceMap": true,
    "inlineSources": true,
    "noImplicitAny": false,
    "preserveConstEnums": true,
    "removeComments": false,
    "sourceMap": false
  },

If I invoke tsc then inline sourcemaps are generated as I would hope. But if you save a file in Visual Studio then the inlineSources related options are ignored. Inline source maps are not created. In this Visual Studio project I have 2 TypeScript projects; 1 for source code for the site and 1 for testing. Perhaps Visual Studio cannot cope with more than 1 TypeScript project in a VS project? (Although I seem to recall that @paulvanbrenk said that it was supposed to be able to support this... I may be wrong.)

You can see the problem for yourself by taking a look at the PoorClaresArundel project in the following repo: https://github.com/johnnyreilly/poorclaresarundel

If you clone this repo and go to the PoorClaresArundel folder on the command line you can invoke tsc directly like this:

npm run ts

This generates inline sourcemaps for every file - as expected. Now try in Visual Studio:

  • Open up Visual Studio with this solution
  • Go to the PoorClaresArundel project
  • Go to the js folder and open up app.ts. Make a change to the file and hit "save". VS should compile app.ts without inline sourcemaps.

I could obviously work around this by just ignoring the VS tooling and invoking tsc directly in my build process. But I think that Visual Studio ought to be respecting tsconfig.json. If it's not intentionally then it would be very helpful to understand which properties VS respects and which it does not.

I hope that's clear - please say if not.

@johnnyreilly
Copy link
Author

I can see discussion here that might imply tsconfig.json support will work as expected with TS 1.8: #5287

Not certain though. Support for multiple tsconfig.json files in ASP.NET v5 projects makes me wonder if ASP.Net pre v5 is not going to get this amend? Are ASP.Net v5 and ASP.Net pre v5 going to be treated differently in Visual Studio? That'd be a real shame.

@paulvanbrenk
Copy link
Contributor

@johnnyreilly Current plan is to support all project types (at least the ones that ship in Visual Studio. Others will probably work, but if I don't know about it I can't test it ;) )

@johnnyreilly
Copy link
Author

Great! Is this support due to land in VS 2015 with TypeScript 1.8?

@mhegazy
Copy link
Contributor

mhegazy commented Jan 16, 2016

that is correct.

@johnnyreilly
Copy link
Author

Boom! Thanks @mhegazy

@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
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

4 participants