Giter Site home page Giter Site logo

Comments (11)

vector-of-bool avatar vector-of-bool commented on May 18, 2024 1

This is definitely a feature I want to add. It will take a bit of work, as reliably parsing the error output from the different compilers can be difficult. Some compilers (such as Clang) offer machine-parsable output options, so that will be a good place to start.

from vscode-cmake-tools.

xgdgsc avatar xgdgsc commented on May 18, 2024 1

Does jump working for now? I remember it used to work. But not now for me.

from vscode-cmake-tools.

twxs avatar twxs commented on May 18, 2024

I've got it on Windows using a Visual Studio CMake generator.

The tips is to define a custom task in tasks.json that runs cmake --build and specify '$msCompile' as problemMatcher

{
    "version": "0.1.0", 
    // cmake --build build 
    "command": "build.bat",
    // Show the output window only if unrecognized errors occur. 
    "showOutput": "silent", 
    // no args
    "args": [],     
    // use the standard msCompile problem matcher to find compile problems
    // in the output. cmake must use a Microsoft Generator
    "problemMatcher": "$msCompile"
}

As you can see, when the task is executed, the output is analyzed and you can navigate to the warnings and errors

image

For clang or gcc you can define your own problemMatcher based on regexp, you can find an exemple with gcc here

Hope this can help you...

from vscode-cmake-tools.

vector-of-bool avatar vector-of-bool commented on May 18, 2024

Thanks for the info! That'll definitely help. I'll play around with it and see what I can make work.

from vscode-cmake-tools.

vector-of-bool avatar vector-of-bool commented on May 18, 2024

I've been working on a kind-of solution on the feature/diagnostics-parsing branch. Rather than make a problem matcher, I parse the build output when running the cmake.build command.

I wish that it were possible to use a vscode command in place of the "command" on a task, rather than the name of an external program. The cmake.build command does quite a bit more than simply invoke cmake --build build, and I'd like to be able to use the problemMatcher functionality in conjunction with the custom command. Any opinions on which design would be better?

Parsing the output of GCC and Clang seems to work pretty well, although I don't have quick access to a Windows machine where I can test the MSVC output parser (but it should work). Any MSVC users available to give it a try?

from vscode-cmake-tools.

twxs avatar twxs commented on May 18, 2024

I just try it,
It seems there is a little problem in the MSVC Regex, I'll fix it today and send you a PR.

from vscode-cmake-tools.

vector-of-bool avatar vector-of-bool commented on May 18, 2024

This should be fixed as of 0.3.0. Thanks for the help!

from vscode-cmake-tools.

db4 avatar db4 commented on May 18, 2024

Is parsing the output hard-coded into the sources? What if I need to parse an unknown (even non-C) compiler output? When I compile via Run Build Task, I add an appropriate problem matcher to tasks.json and everything works. What about CMake tools? Impossible?

from vscode-cmake-tools.

vector-of-bool avatar vector-of-bool commented on May 18, 2024

At the moment, there is not, unfortunately.

from vscode-cmake-tools.

db4 avatar db4 commented on May 18, 2024

I'm quite new to cmake tools, so excuse me for a dumb question: why to invent your own build system (with custom problem parsers etc.) but not just integrate with vscode build tasks?

from vscode-cmake-tools.

vector-of-bool avatar vector-of-bool commented on May 18, 2024

Early on I tried to do tasks.json integration, but there was a strong impedance mismatch between what tasks.json supported and what CMake required. I haven't taken a look for a while, so that may have changed, but it has in the past not been sufficient to run builds as required.

from vscode-cmake-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.