Skip to content

Problem matcher can't support absolute and relative filenames at the same time #449

Closed

Description

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?

Activity

  1. dbaeumer commented on Nov 23, 2015

    @dbaeumer
    Member

    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.

  2. added
    feature-request
    on Nov 23, 2015
  3. Wosi commented on Nov 23, 2015

    @Wosi
    Author

    That would solve my problem, yes.

  4. Gama11 commented on Aug 25, 2016

    @Gama11
    Contributor

    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.

  5. 9il commented on Jun 4, 2017

    @9il

    It is also required by Dlang compilers.

  6. Pagghiu commented on Feb 20, 2018

    @Pagghiu

    I am hitting the same issue using C++ with clang. Sometimes error paths are reported as relative and sometimes are absolute.
    The fileLocation could be a list of paths, with absolute and relative specification, just like a C++ include path list.

  7. andrewleech commented on Feb 23, 2018

    @andrewleech

    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.

  8. ncannasse commented on Apr 8, 2018

    @ncannasse

    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.

  9. dbaeumer commented on Apr 9, 2018

    @dbaeumer
    Member

    Would anyone like to work on a PR for it.

  10. Gama11 commented on Apr 9, 2018

    @Gama11
    Contributor

    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 ((?=[a-zA-Z]:|\\/)). This seems to work nicely.

    The only annoying part is that "Configure Default Build Task" copy-pastes the problem matchers of contributed tasks into tasks.json, so users who have already done that in the past will have to add the additional problem matcher manually.

  11. graph commented on Aug 31, 2018

    @graph

    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.

  12. felipecock commented on Mar 7, 2019

    @felipecock

    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.
    Unable to open 'Datalogger.ino': File not found (file:///home/felipe/Documents/PlatformIO/Projects/Bluepill_Datalogger/home/felipe/Documents/PlatformIO/Projects/Bluepill_Datalogger/src/Datalogger.ino).

    I've tied to clean compile with these three settings and the wrong path managing persists :
    "problemMatcher": { "base":"$platformio", "fileLocation": ["relative", "/"] // "fileLocation": ["relative", "${workspaceRoot}"] // "fileLocation": "absolute"
    I hope you could fix this bug. Thanks for listening.

    Related threads:
    microsoft/vscode-cpptools#1915

  13. dbaeumer commented on Jun 4, 2019

    @dbaeumer
    Member

    Alex Ross (@alexr00) thanks for addressing this.

  14. graph commented on Jun 4, 2019

    @graph

    Nice. Looking at the commit c541056 it looks like fileLocation documentation hasn't been updated "AutoDetect" though. Will this value be documented and available?

  15. alexr00 commented on Jun 5, 2019

    @alexr00
    Member

    We usually don't write documentation until we've release a feature. I'll add documentation around the time when autoDetect is part of a release. You can try it the insiders build soon.

  16. locked and limited conversation to collaborators on Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requeston-testplantasks

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions