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

Code seems to only refresh imported d.ts on tab switch / file open #26435

Closed
kraftwer1 opened this issue May 11, 2017 · 4 comments
Closed

Code seems to only refresh imported d.ts on tab switch / file open #26435

kraftwer1 opened this issue May 11, 2017 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster typescript Typescript support issues

Comments

@kraftwer1
Copy link

kraftwer1 commented May 11, 2017

  • VSCode Version: 1.12.1
  • OS Version: OSX El Capitan 10.11.6

I'm working on a file MyFile.ts that imports a definition Library.d.ts which is written by an external TypeScript compiler (tsc -w).
When I change something in Library.ts, then tsc -w will overwrite its Library.d.ts, but VS Code does not "update" its editor view of MyFile.ts automatically (in order to show errors) - it only updates it on events like tab switch or close/open (and thus the Problems tab in the bottom is also not getting updated).

Would it somehow be possible to "check" for changes in background?

@kraftwer1 kraftwer1 changed the title Code seems to only refresh imported d.ts on file open Code seems to only refresh imported d.ts on tab switch / file open May 11, 2017
@mjbvz mjbvz added info-needed Issue requires more information from poster typescript Typescript support issues labels May 13, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented May 13, 2017

Do you have a tsconfig.json setup that includes both the ts file and the d.ts file? Try running the TypeScript: Go to Project Configuration command in each to make sure they are in the same project

@kraftwer1
Copy link
Author

Thanks for your help.
I found out why it didn't work. I included my Library.d.ts like this:

{
    ...
    "files": [
        "src/MANIFEST.ts" // with /// <reference path="Library.d.ts" />
    ]
}

...but after changing it to this it works:

{
    ...
    "files": [
        "src/MANIFEST.ts",
        "Library.d.ts"
    ]
}

But:
It only reports problems for the file that is currently open in the editor - not to the closed ones. Since I have several tsconfig.json files within my project (and no on the project root folder level), is there a way to specify VS Codes "main" tsconfig.json file? Or do I explicitly have to have one on root level?

@kraftwer1
Copy link
Author

Hmm, does the VS Code Problems panel actually support reporting "global" errors (meaning on non-opened files)? When I close the file, the error disappears.

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 14, 2017

Hey sorry I lost track of this issue.

It sounds like it is resolved though? files must include *.d.ts files you reference so that would explain why adding it fixed things.

We are tracking project wide error JS/TS reporting with: #13953

@mjbvz mjbvz closed this as completed Nov 14, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

2 participants