Skip to content

problemMatcher assumes relative paths #4281

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

Open
paulkilroy opened this issue Mar 30, 2025 · 0 comments
Open

problemMatcher assumes relative paths #4281

paulkilroy opened this issue Mar 30, 2025 · 0 comments

Comments

@paulkilroy
Copy link

In the code below, it assumes all paths from gcc, etc are relative -- but they are not. The fix is describe at the link below, the change is simple and seems to work on mac and linux. Change the word "relative" to "autoDetect"

https://code.visualstudio.com/docs/debugtest/tasks#_output-behavior

Note that the file, line, and message properties are mandatory. The fileLocation specifies whether the file paths that are produced by the task output and matched in the problem are absolute or relative. If the task produces both absolute and relative paths, you can use the autoDetect file location. With autoDetect, paths are first tested as absolute paths, and if the file doesn't exist then the path is assumed to be relative.

"problemMatchers": [
      {
        "name": "platformio",
        "owner": "cpp",
        "fileLocation": [
          "relative",
          "${workspaceFolder}"
        ],
        "pattern": {
          "regexp": "^([^:\\n]+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
          "file": 1,
          "line": 2,
          "column": 3,
          "severity": 4,
          "message": 5
        }
      }
    ],
paulkilroy added a commit to paulkilroy/platformio-vscode-ide that referenced this issue Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant