-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Problem matcher can't support absolute and relative filenames at the same time #449
Comments
The idea was to file path autodetection support. Something like: "fileLocation": ["autoDetect"] It would check whether a path appears to be relative or absolute (e.g. starts with / or a drive letter). Would that help in your case. |
That would solve my problem, yes. |
We need this feature for vshaxe (https://github.com/vshaxe/vshaxe) as well - the Haxe compiler reports errors with absolute paths if the error is in a haxelib somewhere outside of the current project, and relative otherwise. |
It is also required by Dlang compilers. |
I am hitting the same issue using C++ with clang. Sometimes error paths are reported as relative and sometimes are absolute. |
Same issue with mbed compiler, it generally just prints the filename that errors are in, it would be great if it could file the file in the browse path or let me supply a list of paths to search in. |
I would like to up this one more, this is quite a show stopper as there is no real workaround once you have an absolute path, for instance on a different drive. |
Would anyone like to work on a PR for it. |
For now, we found a workaround for this in the Haxe extension: provide two problem matchers, one of them being listed first to have priority and having a pattern that only matches against absolute paths ( The only annoying part is that "Configure Default Build Task" copy-pastes the problem matchers of contributed tasks into |
MSVC sometimes outputs paths in relative paths, and sometimes in absolute path. I would like the problem matchers to try harder to find files. If the problemMatcher is upgraded I prefer there to be no "relative" or "absolute" option and "fileLocation" to always be a path and "autoDetect" is the only option. Autodetection I can't imagine being too heavy just test if the file exists if not try as absolute, if not then try relative to project, if that fails try relative to build and if that fails then nothing much can be done. That will cover majority of the cases and will allow having it much simpler and not requiring to specify a fileLocation. |
I have the same issue with problem matcher, I uninstalled all extensions except Platformio.io and C/C++ (Microsoft), but the links in the problem matcher are still broken because the path is duplicated. I've tied to clean compile with these three settings and the wrong path managing persists : Related threads: |
@alexr00 thanks for addressing this. |
Nice. Looking at the commit c541056 it looks like |
We usually don't write documentation until we've release a feature. I'll add documentation around the time when |
I have a problem matcher that works on the output of the Delphi compller. Sometimes it gives relative and absolute file names at the same time. When I set
"fileLocation": ["absolute"]
the messages having relative paths can't be opened. When I set"fileLocation": ["relative", "${workspaceRoot}"]
the messages having absolute paths can't be opened anymore.Is it possible to define a a problem matcher that uses relative paths as long as the mentioned file exists and uses absolute paths as a fallback mode?
The text was updated successfully, but these errors were encountered: