VSCode Compiler errors & Warnings do not appear in VSCode problems tab

Hey, For some reason I don't get compile warnings or errors listed in the VSCode problems tab. Any ideas why? See video below for a demo.

  • Hi,

    Build errors and errors from the nRF Connect for VS Code extension do not appear in the problems tab. You must look at the terminal output. If you need help solving the errors you are getting, please copy and upload the entire build log here using Insert > Code.

    Best regards,

    Marte

  • Oh right, I'm sure I saw it happen sporadically in the past. Is there a plan to add this? It would be very nice to have the formatted error / warnings in the standard VSCode way. 

  • Marte is out of office, so I will handle this ticket. 

    As far as I know, there are no plan to change where the compile errors are printed. 

    As for the compiler errors themselves, I was not able to see the build log from your video. Please copy the output from the build, and paste it here using Insert -> Code, as Marte said.

    Best regards,

    Edvin

  • No worries about the build errors. I've solved those it was just a general question on how to utilise the vscode problem matcher. 

    It turns out, by setting "$gcc" to the top entry in the ProblemMatcher array for each build in task.json it will direct the build errors and warnings to the problems tab on vscode. I read a post last week that suggested the feature had been removed around 5-6 months ago due to a clash with intellisense? not really sure why though it seems to add a lot of value having it enabled.

    Task.json

    {
    	"version": "2.0.0",
    	"tasks": [
    		{
    			"type": "nrf-connect-build",
    			"config": "c:\\dev\\nrf\\neptune\\build",
    			"runCmake": false,
    			"clean": true,
    			"problemMatcher": [
    				"$gcc",
    				"$cmake",
    				"$kconfig",
    				"$kconfig_syntax",
    				"$kconfig_syntax_files",
    				"$dts",
    				"$dts_syntax",
    			],
    			"group": "build",
    			"label": "nRF Connect: Build [clean]: neptune/build (active)"
    		},
    		{
    			"type": "nrf-connect-build",
    			"config": "c:\\dev\\nrf\\neptune\\build",
    			"runCmake": true,
    			"clean": false,
    			"problemMatcher": [
    				"$gcc",
    				"$cmake",
    				"$kconfig",
    				"$kconfig_syntax",
    				"$kconfig_syntax_files",
    				"$dts",
    				"$dts_syntax",
    			],
    			"group": "build",
    			"label": "nRF Connect: Build [pristine]: neptune/build (active)"
    		},
    		{
    			"type": "nrf-connect-build",
    			"config": "c:\\dev\\nrf\\neptune\\build",
    			"runCmake": false,
    			"clean": false,
    			"problemMatcher": [
    				"$gcc",
    				"$cmake",
    				"$kconfig",
    				"$kconfig_syntax",
    				"$kconfig_syntax_files",
    				"$dts",
    				"$dts_syntax",
    			],
    			"group": "build",
    			"label": "nRF Connect: Build: neptune/build (active)"
    		}
    	]
    }

  • I also would love to have the problems tab work, or at least some error highlighting (red=error, yellow=warning) in the terminal output. where is that task.json? I cant find one on my system.

Related