Location>code7788 >text

Invalid reference to problemmatcher: $esbuild-watch vscode plugin reporting errors

Popularity:184 ℃/2024-10-14 16:06:24

vscode plugin esbuild type prompts errors

Recently in the hands of the development of vscode plugin, demo stage encountered a small problem. The search engine did not have a particularly good answer, record for the leakage of fill in the gaps.

vscode plugin development

As a unified front-end development plug-in , vscode + its rich plug-in capabilities , together to build a thriving vscode plug-in . In terms of team efficiency, it is also an indispensable tool.

Development documentation will not say, directly look at the official website is very detailed:/apiI've run through it. After running along and understanding the general idea you can follow along and develop your own features.

Problem: Invalid problemmatcher reference: $esbuild-watch

It would have been nice to base it onThe first extension Project initialization and installation was performed.

Because of my preference for esbuild, I chose esbuild as the packaging tool for yo's initialization.

As it turned out, the problem arose in the conduct of

// Execute debugging
Debug: Start Debugging

vscode started to report errors.

ps: actually vscode will suggest a solution later:

However, the subconscious behavior of fast hands has opened up to specific messages

Activating task providers npm
incorrect: problemMatcher Invalid citation: $esbuild-watch

Problem solving

In the face of unfamiliar territory, the problem appears directly on the search engine on the line, but this time directly to me confused.
A direct search for the error reported above found the official Microsoft article./items?itemName=-problem-matchers

In fact, I did not pay attention to this is the corresponding plug-in, looked at how to use the plug-in is described.
Subconscious Behavior Shouldn't have to install the plugin additionally manually. Just ignore it.

gpt hint: version matching problem.

The goal was not clear asked the gpt directly and came up with a bit of a hint.

Check if the VSCode version is newer, update to the latest version.

Restart VSCode, sometimes this can solve temporary problems.

Manually add $esbuild-watch to problemMatcher.
"problemMatcher": [
"$esbuild-watch"
]

Try using a different match pattern, e.g..
"problemMatcher": [
{
"base": "$esbuild-watch",
"background": {
"activeOnStart": true, "activeOnStart": true, "activeOnStart".
"beginsPattern":"^\\\swatching\s",
"endsPattern": ""
}
}
]

Here's a variety of checks, the questions are right on the money and the problem is in a tangle.

Problem solving

After all, it's the reporting of errors, and it's actually most efficient to check the official documentation directly in most cases. That's how I found this one:/Docs/editor/tasks

The purpose is to look up the corresponding identifiers in the task output log to determine which task is excepted from the exception.

Well, in that case, let's find

 --watch problemMatcher

Found this article/connor4312/esbuild-problem-matchers Fixing my eyes, isn't this the same plugin that was just there.

As expected, it works correctly after installing the corresponding plugin.

concluding remarks

vscode have to say that the plug-in ecology is really powerful, but the documentation is really a bit old, should be prompted to install the corresponding plug-ins.