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

Contributed problemMatchers can't use Command variables #69622

Closed
elonmallin opened this issue Feb 28, 2019 · 6 comments
Closed

Contributed problemMatchers can't use Command variables #69622

elonmallin opened this issue Feb 28, 2019 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) tasks Task system issues

Comments

@elonmallin
Copy link

package.json contributes.problemMatchers can't use command variables like ${command:myextension.mycommand}.

Steps to Reproduce:

  1. Create an extension with a problem matcher like:
"problemMatchers": [
      {
        "name": "myproblemmatcher",
        "owner": "php",
        "fileLocation": "relative",
        "pattern": [
          {
            "regexp": "^${command:myextension.mycommand}$"
          },
          {
            "regexp": "error: ${command:myextension.mycommand}(.*):(\\d+)",
            "file": 1,
            "line": 2
          }
        ]
     }
]
  1. Use the problem matcher and notice this doesn't find problems.

What I'm trying to achieve is replace part of the file based in my myextension.mycommand command so that the relative file location becomes correct.
I'm aware this usually doesn't happen but this is a scenario where I'm running a command in a docker container and the path mapping then becomes completely wrong and I need to be able to replace part of the path dynamically.

@vscodebot
Copy link

vscodebot bot commented Feb 28, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the tasks Task system issues label Feb 28, 2019
@alexr00
Copy link
Member

alexr00 commented Mar 1, 2019

It sounds like what you really want here is to contribute a problem matcher that reads the terminal output and does something with it instead of just a regex. Duplicate of #11663

@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Mar 1, 2019
@vscodebot
Copy link

vscodebot bot commented Mar 1, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Mar 1, 2019
@elonmallin
Copy link
Author

@alexr00 Well, not sure. I would be fine with just being able to use a command variable in my contributed problemMatchers regex.

I thought this was possible since problemMatchers are defined in tasks.json normally. And the docs say that command variables can be used in tasks.json.

So the bug would be that problemMatchers that are contributed can't use command variables but problemMatchers defined in tasks.json can I guess.

@elonmallin
Copy link
Author

It's not only command variables that doesn't work in contributed problem matchers regex but also environment and config variables.

@alexr00
Copy link
Member

alexr00 commented Mar 4, 2019

I will update the documentation to make it clear that variable substitution is not supported in the problem matchers section of tasks.json. The way to make more complex problem matchers will be with the API changes required by #11663.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) tasks Task system issues
Projects
None yet
Development

No branches or pull requests

2 participants