-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
Support VS Code problem matchers without custom configuration (i.e. out of the box) #2374
Comments
Do you have ability to modify |
Yeah, we could probably set an env variable. |
@eamodio I can implement |
Do we really want to opt users into all logs? Could we do something more specific to just the types of messages required? |
@eamodio yep, what about |
Yeah, something like that sounds good... maybe |
What about |
Sounds great! |
I will try to implement this tomorrow (need finish ES modules config support) and will do release. Want to clarify:
|
I think it needs to be I'm not sure what the difference between L45 & L55 are, but it looks like those are what I need. Is there a pair that would encapsulate the full watch run, if there were multiple configs? |
Why? It breaks stats output, logging is diagnostic information so it should use stderr
Can you clarify? |
Nm, I think stderr is fine. So for a setup like this: Where there are 2 (or more) webpack configs exported. It would be great to be able to classify each via its own start/end pair as well as the entire run that would encapsulate both of them. |
If developer have |
Yeah, I believe the
That way I can tell when each config starts/finishes, as well as when all of them start/finish. |
We can't do it, because each compilation is async, and we can't wait and slow down build |
Do you have to wait? Couldn't you just have a counter of the number of compilations, and then at the end of each decrement the counter, and then do basically what is done here: webpack-cli/packages/webpack-cli/lib/plugins/CLIPlugin.js Lines 68 to 72 in 1adc5aa
But instead of checking for the |
We don't know when compilation(s) finished so order can be any
We can't use number, because it can be very big after long usage |
Keeping order is impossible, so you can have
|
How can the number get very big? Isn't it always just the number of compilations triggered? As for order, yeah that is definitely expected and not an issue at all. The only ordering that matters is that the start of any compilation is first, and the final compilation line comes at the end.
|
Basically I'm saying something like at the start of a compilation run, set a counter to the number of individual webpack configs that would each output a The same could probably work if you can't/don't know the count up front and just have each compliation increment the counter when it starts and decrement at the end. But that theoretically could have a compilation that starts and ends before another one even starts, so you could end up observing 0 before it was really 0. |
Sorry, but I'm completely confused what you want |
Ideally I want 2 sets of start & end pairs. Pair 1:
This covers the start & end of a single compilation. Pair 2:
This covers the start & end of all compilations. Pair 1, already exists today, while Pair 2 doesn't AFAIK. I don't really have any preference on what the actual messages of Pair 2 are, I just need to be able to tell the difference between them and Pair 1 (via regex) |
What about |
@alexander-akait Is your suggestion for Pair 2? If so, what is the |
Yes
No |
@alexander-akait what would the |
Sorry, I don't understand your, can you clarify? |
Fixed #2566, will be part of the next release, you can use |
Refs: #2206 & webpack/webpack#5895
Without any additional configuration, we would like to be able to support VS Code problem matchers for webpack builds (especially watch).
What They Are
VS Code problem matchers scrape terminal output to detect and surface compile/lint/etc issues in VS Code. These problem matchers allow VS Code to provide a richer build experience when using build tasks. These tasks can be (and often are) just
package.json
scripts run bynpm
oryarn
, or they can be any other type of build system if it outputs usable information to the terminal. For example, many devs configure a default build task, and then when they press F5 to start debugging, the debugger waits until the build task completes successfully before launching. And warnings/errors (say from typescript/eslint/etc) are aggregated into the VS Code Problems view:See the documentation for more information.
How They Work
A problem matcher is a regex patterns that are run against the terminal output, to capture warnings/errors and provide them to VS Code. See a simple sample here.
But a more advanced problem matcher is needed for background/watch tasks. For that we need to provide two more regex patterns, one to capture the start of the desired output and the end of it. So in with webpack that would be the start of a compilation and when the compilation completes.
What We Need
So to support these we need a reliable output that can be matched to provide a starting and ending point for a build/watch. A start & end message should be output for each webpack configuration that is run and ideally a start & end message for entire "run".
We had these messages before #2206 was merged, with the
Compilation starting...
&Compilation finished
messages, and the additionalCompilation [config-name] starting...
&Compilation [config-name] finished
when for each config in a multi-config setupAlso, here is the current TypeScript + Webpack Problem Matchers I maintain for VS Code. The relevant patterns are here: https://github.com/eamodio/vscode-tsl-problem-matcher/blob/687f20cd297b0eaa391e5f8776f8819f806f534f/package.json#L188-L196
And to be clear, I really don't mind/care at all what the start/end messages are -- just that they can be identified and used.
/cc @alexander-akait
The text was updated successfully, but these errors were encountered: