microsoft / vscode-makefile-tools

MAKE integration in Visual Studio Code
Other
194 stars 58 forks source link

Errors from building with Makefile are not in the Problems pane #473

Closed tankist02 closed 1 year ago

tankist02 commented 1 year ago

I'm using VSCode on Fedora 38, everything is fully updated at this moment. I have Makefile tools extension installed. I also created a custom Task to run make on my project. Results are the same as described below.

Here is my custom Task:

   {
        "type": "shell",
        "label": "Run make",
        "command": "make",
        "args": [
            "-j 8"
        ],
        "problemMatcher": ["$gcc"],
        "group": {
            "kind": "build",
            "isDefault": false
        },
        "detail": "Custom task created manually"
    }

If I build my project with make and get compilation errors or warnings I see them in the Terminal pane, but they are not present in the Problems pane.

I added the following to the settings.json but it didn't help:

"makefile.configurations": [
    {
        "problemMatchers": [
            "$gcc"
        ]
    }
],

Maybe it is related - in the Output pane I see these messages for every build command I run:

Error: the task 'makefile: Makefile Tools Build Task' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is: { "type": "shell", "id": "shell,make,all,", "problemMatcher": [], "label": "makefile: Makefile Tools Build Task" }

Here problemMatcher is empty, but I do not know if I need to add "$gcc" there and how to do that.

gcampbell-msft commented 1 year ago

@tankist02 Thanks for the report!

We will, based on bandwidth, look into this and try to get a reproduction, and if we are able to do so, get a fix.

andreeis commented 1 year ago

@tankist02, you can safely ignore the error in the "Tasks" output channel. It is caused by a core bug in VSCode which we created and following its status here: https://github.com/microsoft/vscode/issues/176670.

About why you don't see errors in the problems tab when you use the task you wrote: I actually was not able to identify a reason like how you write the task or how you invoke it. In any case, that would also not be a Makefile Tools issue, it would be either wrong usage on your side or a bug on VSCode side.

But let us help you not need to use that task anymore. The core extension features should allow you to build and see errors in the Problems tab. From seeing your task and your configurations setting, I think you need to define the following:

"makefile.configurations": [ { "name": "MyConfig", "makeArgs": ["-j 8"], "problemMatchers": [ "$gcc" ] } ],

Then, not enough to define it in settings but you also need to activate it via the left sidebar UI: click on the "Configuration" element, that will trigger a quickPick UI element in the upper area of VSCode, where all "makefile.configurations" would show up for you to select. Chose "MyConfig". Let the configuration process finish (we're launching "make --dry-run" and other switches, parsing the output, calculating IntelliSense). Then build our build buttons or pallete commands and let us know if errors/warnings still don't show up in the Problems tab.

andreeis commented 1 year ago

@tankist02 , I am closing this ticket since it's a "more info needed" without an update for about two months. Please reactivate if this still occurs and if none of our ideas above helped.