Skip to content

Compile on save does not update problem view #113

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
danielvanmil opened this issue Nov 16, 2016 · 8 comments
Closed

Compile on save does not update problem view #113

danielvanmil opened this issue Nov 16, 2016 · 8 comments

Comments

@danielvanmil
Copy link

When I enable compile on save, introduce an error in a TS file and save the file the problem is not visible in the problem view. After a complete rebuild the problem is viewed correctly.

@angelozerr
Copy link
Owner

angelozerr commented Nov 16, 2016

I think you are using 1.2.0-SNAPSHOT. The compile on save is done with tsserver now to speed the process. I must finish #109

@lorenzodallavecchia
Copy link
Contributor

I don't know if it is the same problem that @danielvanmil is reporting, but I am having a similar issue and also with 1.1.0.

More specifically, if I change the name of a class method and that class is used by another file (imported via import), more often than not no error marker appears on the other file. However, if I open that file in the editor, the code is immediately annotated with the error.

In general, it looks like only files that are directly saved are checked and depending files are not.

I think this is a major problem: type checking is one of the most important features, since it prevents you from releasing buggy code! For me, this is a lot more important than content assist or refactoring.

@angelozerr, do you think this problem will go away when #109 is finished?
Otherwise I can provide a test case for this problem.

@angelozerr
Copy link
Owner

@angelozerr, do you think this problem will go away when #109 is finished?

No please create a new issue.

Otherwise I can provide a test case for this problem.

Yes it should be very cool. Have you tested your test case with VSCode? I'm afraid that it's a problem with tsserver. So please test your usecase with VSCode and if there is the problem, please create an issue to TypeScript project.

@lorenzodallavecchia
Copy link
Contributor

Have you tested your test case with VSCode?

Good point: I will compare the behavior with VSCode and let you know.

@lorenzodallavecchia
Copy link
Contributor

lorenzodallavecchia commented Jan 2, 2017

Ok, I have tested with VSCode and it behaves worse than TypeScript IDE. In fact, their Problems view is updated only for files that are currently open. I think it is due to the fact that VSCode has no persistent marker concept like Eclipse's: it is just listing all annotations on open editors.

The problem with TypeScript IDE seems caused by the fact that I have multiple interdependent tsconfig.json files. That does not seems to work even when the said tsconfig.json files are in the same Eclipse project.
I have opened issue #128 for that problem.

@angelozerr
Copy link
Owner

angelozerr commented Jan 2, 2017

@lorenzodallavecchia I have studied with simple case:

  • a.ts:

import {bb} from "./b";

  • b.ts:

export var bb = "";

When I change (without saving file) bb from b.ts with xx, the a.ts file should mark error:

  • with VSCode it works.
  • with Eclipse it doesn't work and I cannot fix the problem since I'm using WTP Validator "as you type" hich is not enable to validate other file .

BUT, I can fix the problem, when you activate "compileOnSave", in other words validation is done only if you save file. It's the same behaviour than JSDT. Let me try to implement that, and I will ping you when I will finish.

@lorenzodallavecchia
Copy link
Contributor

@angelozerr thanks for looking into it already!

To clarify, the behavior I am refering to is only the Compile On Save one. I do not expect Eclipse to show markers for other files (or even for the edited file) until I save them. I do expect to see annotations (ruler icons and red underlines) in the edited file only, and that already works correctly in TypeScript IDE.

About VSCode, I think its Problems view is not the same as Eclipse's since it shows live errors on unsaved files, while the Eclipse one shows only markers that result from the state of all saved files. Obviously, coming from an Eclipse background, I prefer/expect the Eclipse behavior :).

@danielvanmil
Copy link
Author

problem seems to be solved now, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants