openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.98k stars 2.55k forks source link

VS Code Problem Matcher Does not accepts relative path correctly #8208

Closed mcpcseal closed 2 days ago

mcpcseal commented 3 days ago

Clicking a problem in the problem matcher leads to "${workspaceFolder}/full_absolute_path_to_the_file" when the error comes out while building.

here's the fix: (tasks.json in .vscode folder)

"problemMatcher": {
    "owner": "cpp",
    "fileLocation": "absolute", // needs to be modified as an absoloute path
    "pattern": {
      "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
      "file": 1,
      "line": 2,
      "column": 3,
      "severity": 4,
      "message": 5
    }
}
ofTheo commented 3 days ago

Thanks! Is this with the latest release or nightly?

cc @dimitre - sounds like a PG issue doing absolute paths instead of relative

mcpcseal commented 2 days ago

Thanks! Is this with the latest release or nightly?

cc @dimitre - sounds like a PG issue doing absolute paths instead of relative

This is the 0.12.0 release, and the tasks.json from PG is relative but I had to modify that into absolute path since vscode problem matcher interpreted it incorrectly.

dimitre commented 2 days ago

@mcpseal great. template was changed after 0.12 release now it is like this:

    "problemMatcher": {
        "owner": "cpp",
        "fileLocation": ["relative", "${workspaceFolder}"],
        "pattern": {
            "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "severity": 4,
            "message": 5
        }
    },

can you test copying the template files from latest git? Thank you

mcpcseal commented 2 days ago

It works! what was the change in tasks.json? It looks like the problemMatcher defined outside of the task section.

dimitre commented 2 days ago

you can see the entire template here https://github.com/openframeworks/openFrameworks/tree/master/scripts/templates/vscode

mcpcseal commented 2 days ago

Oh I see. Thank you!

dimitre commented 2 days ago

@mcpseal thank you. Improvements are welcome in this latest template. ping here if you have any suggestions