-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add problemMatcher for svelte-check #1036
Comments
Writing a custom matcher is probably the better alternative. During that I'd also like to revisit the way we print the file location. I'm thinking about using Babel's npm package for that. |
I tried tackling this but I'm stuck on two things:
Matcher for a single run: {
"owner": "svelte",
"applyTo": "closedDocuments",
"fileLocation": ["absolute"],
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d+)$",
"file": 1,
"line": 2,
"column": 3
},
{
"regexp": "^(Error|Warn|Hint):(.*?)$",
"severity": 1,
"message": 2
}
]
} Matcher for multiple runs (needs at least {
"owner": "svelte",
"applyTo": "closedDocuments",
"fileLocation": ["absolute"],
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d+)$",
"file": 1,
"line": 2,
"column": 3
},
{
"regexp": "^(Error|Warn|Hint):(.*?)$",
"severity": 1,
"message": 2
}
],
"background": {
"activeOnStart": false,
"beginsPattern": {
"regexp": "Getting Svelte diagnostics"
},
"endsPattern": {
"regexp": "Watching for file changes"
}
}
} |
It seems like using "Watching for file changes" as |
I just wanted to thank @dummdidumm for a solution and @jasonlyu123 for an improvement. For me the difference of reading 204 errors (big refactoring, VS Code doesn't update imports very well) from a CLI and from "Problems" (with all it's formatting and filtering) is a difference between "I'll never deal with this pile" and "Hmm, I think this is manageable" God bless non-console interfaces 🥲 ![]() vs ![]() |
Is your feature request related to a problem? Please describe.
svelte-check
reports errors and hints in a different format thantsc
does. Here is a simple example.tsc --watch
output:svelte-check --watch
output:This is problematic because it is impossible to integrate
svelte-check
with VSCode tasks and a built-in$tsc-watch
problem matcher.To clarify: VSCode allows to define tasks for building, testing, checking, linting, etc. For example, to run
tsc
on my project I can define a task like this:VSCode comes with a number of built-in problem matchers. Problem matchers scan the output and report problems in Problems panel. This allows to quickly see the problem in a well-formatted view, and to jump between problems using commands or keyboard navigation.
Here is what the example I provided looks like:
Note that If I open the problematic svelte file, then the problems do appear in the Problems panel. However, at that point, it's no longer useful, because I can see the problem in the open file myself.
![image](https://user-images.githubusercontent.com/5859177/120034837-d71a1380-c027-11eb-9a75-af8621c0d1e1.png)
Describe the solution you'd like
I'd like for
svelte-check
results to be accessible through$tsc-watch
and$tsc
problem matchers without any additional configuration. This will allow to runsvelte-check
in the background and catch errors, even if a file that has issue is not opened in the editor.This would require changing the reporting format to match the one of TypeScript compiler.
Describe alternatives you've considered
An alternative is to define a custom problem matcher to parse
svelte-check
output. This custom problem matcher would need to be added to the VSCode extension.The text was updated successfully, but these errors were encountered: