-
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
Visual Studio 2015 shows TypeScript errors twice in Error List #4746
Comments
One set of errors are your build errors, prefixed by "Build", the other ones are your language service errors, i.e. you are editing a file and you get an immediate feedback. build errors are just marshaled from MSBuild output, and can contain other errors as well, e.g. post build steps, other tools in the build pipeline, e.g. bundling/publishing to a website.. etc.. why you do not see these for C#? C# has a project system implementation, i.e. in a C# file can only exist in a .csproj, and the csproj knows everything it needs to know about how this file is built. For TypeScript, we wanted it to be hosted in any project kind, so we do not control how things are built. it is up to you, your project, and your build system to decide. this means you can have different errors from build that the language service did not know about at design time. |
@mhegazy thank you for the clarification and sorry for the late reply here! After rereading my question, I don't think it gets my point through. What I am trying to do, is replacing the VsTsc task in (a copy of) Microsoft.TypeScript.targets so that I can compile using my gulp script (with inspiration from here #2294). When I was doing that, I noticed that the error code is not shown for the build errors - and the same is true for errors from the original VsTsc task. So my first question was: Why is that? Can it be fixed? The reason I want the error code on the build errors too, is that I believe I could filter out exact duplicates on the error list. But they are not exact when the code is missing in the build errors. But that was when I thought that the filtering could be done by Visual Studio. After some further experimentation today, I found that it does not work like that :) So maybe it's not worth the trouble... I just kind of hoped I could find a method for filtering out the duplicates. Now I'm thinking something along the lines of not letting the gulp script outputting the errors that the language service has already found, but it may be far fetched. |
Do you append any thing to the error message you get from gulp? what is the format of your error message? |
They are output unaltered directly from tsc, and look like this:
This happens when I use the VsTsc task too and with a HTML application project template right out of the box. |
looks like a bug in the task then. @paulvanbrenk can you take a look. |
I don't think we do anything wrong here, talking to the owners of the error list. |
This is by design, once msbuild migrates to the new error list API this should improve. Until then there's nothing TypeScript can do here. |
@paulvanbrenk @mhegazy thank you for looking into it! |
Maybe this is actually an issue with Visual Studio, but when I create a typescript project and provoke a build error, I'll get the error message twice in the Error List - one time from IntelliSense and one time from the compiler.
And it looks like - when doing something similar in C# - the error messages are merged when they are identical. I do not know, if that is actually how it works, but it would explain the behavior, because the message from the TypeScript compiler is prefixed with "Build: " and for some strange reason the error code does not show up in the the list either, so the messages are not identical.
If that's not the case, the question remains: why are errors shown twice for TypeScript, but not for C#? :)
The text was updated successfully, but these errors were encountered: