vscode: Task: Typescript errors disappear after document closed
- VSCode Version: 1.22.1 (newest) (typescript 2.8.1)
- OS Version: Windows 10 64bit
I expect typescript errors from all files to show until they have been fixed.
Instead, they disappear as soon as the document is closed again (e.g. by randomly clicking on the error list, which causes documents to open & close again)
Steps to Reproduce:
- Use this tasks.json (check if the project path fits you first)
{
"version": "2.0.0",
"command": "tsc",
"isShellCommand": true,
"args": [
"-w",
"-p",
"."
],
"showOutput": "silent",
"isBackground": true,
"problemMatcher": {
"base": "$tsc-watch",
// "owner": "typescript",
// "applyTo": "allDocuments"
}
}
- Start the task
- Errors will show in error list (hopefully, if there are errors at all)
- Randomly click between errors of different files in error list. The files will open and close automatically (if they are not pinned). When a file closes, it’s errors disappear!
What I have tried:
- $tsc-watch matcher without any other options
- owner property “typescript” or something artificial
- applyTo property all possibilities
- in settings: typescript.validate.enable === false
The “best” in my trial and error endevour I have got was that the errors just persisted, even when fixed, lol 😃
My user settings (don’t have workspace settings)
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"editor.wordWrap": "on",
"explorer.confirmDelete": false,
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
"editor.autoClosingBrackets": false,
"explorer.confirmDragAndDrop": false,
"editor.acceptSuggestionOnCommitCharacter": false,
"window.zoomLevel": 0,
"explorer.autoReveal": true,
"editor.suggestOnTriggerCharacters": true,
"editor.acceptSuggestionOnEnter": "on",
"editor.parameterHints": true,
"typescript.referencesCodeLens.enabled": false,
// "typescript.validate.enable": false
}
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 23
- Comments: 21 (12 by maintainers)
Commits related to this issue
- Don't delete diagnostics on file close if file still exists on disk Workaround for #47386 — committed to microsoft/vscode by mjbvz 6 years ago
- Always clear diagnostics for a js/ts file when it closes Fixes #59363 Fixes #58088 Reopens #47386 — committed to microsoft/vscode by mjbvz 5 years ago
- Always clear diagnostics for a js/ts file when it closes Fixes #59363 Fixes #58088 Reopens #47386 — committed to vldmrkl/vscode by mjbvz 5 years ago
- Fix restoration of problems (from watch task) when closing a file Fixes #47386 Logic was added in https://github.com/microsoft/vscode/commit/df97bc32ada631730715bf97163cf981a3ec6ec0 to add a watcher... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `onMarkerChan... — committed to russelldavis/vscode by russelldavis a year ago
- Fix race condition with restoration of problems when closing a file (#183271) Fixes #47386 This sets the `flushOnListenerRemove` option to true for the call to Event.debounce. Without this, some `on... — committed to microsoft/vscode by russelldavis 6 months ago
We recently swapped from Flow to TypeScript.
In our previous workflow with Flow, the errors would remain when we opened/closed files.
However, with Typescript, none of the errors show by default (when all files are closed). For this reason, we use VSCode’s Tasks -> Run Build Task, to run the detected tsconfig.watch. This is great because it shows all errors across the project without having to open files.
However, when we open a file then close it, the error disappears from the problems tab (same issue as described above).
We would love for there to be a configuration option to disable removing errors from problems tab until they are fixed. This would be a simple fix. An even cooler one would be for this behaviour to be automatic when using a typescript watcher.
Yes but after you close a file, the errors disappear from the file browser bar and the IDE’s problems summary
@mjbvz Could you ping us the GitHub issue which will result in this behaviour being fixed? (i.e. if it’s in the TS repo or something). Just so we can have progress updates 😄
Seems this is still a problem nowadays.
Right now,
tsc --watch
is reporting errors and on first run they appear in Problems pane.tsc --watch
, those errors never come back although they are re-outputted to stdout again.This is fairly time consuming.
It would be great to show all (current and non-outdated) errors for the whole project in its current state, and have an option to disable that like some other people want (they want only errors for open files).
This is not fully correct:
Now open index.ts in vscode
Close index.ts
I looked into re-applying the errors on document close however this is not so easy due to that fact that everything runs async. If I re-add them too early the TS server will take them away if I re-add them too late then the whole problem view flickers. So we need to have some sort of coordination here which very likely requires new API.