microsoft / microsoft/vscode-remote-release

Can't follow error in Problems tab in C++ project under WSL (re-open #2786)

Open
#2,871 20 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug wsl
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Version: 1.44.0 (system setup)
Commit: 2aae1f26c72891c399f860409176fe435a154b13
Date: 2020-04-07T23:31:18.860Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
WSL 1

Steps to Reproduce:

  1. Open pure makefile project in VSC under WSL, e.g. Ubuntu 16.04 with gcc and make.
  2. Configure tasks.json for compilation (see below).
  3. Create error. E.g. int a = "a";
  4. Compile project using task.
  5. Switch to PROBLEMS tab and click on error message.
  6. Popup message will inform that:

Unable to open 'file.cpp': Unable to read file 'vscode-remote://wsl+ubuntu-16.04/file.cpp' (Error: Unable to resolve non-existing file 'vscode-remote://wsl+ubuntu-16.04/file.cpp').

image

tasks.json:
{ "version": "2.0.0", "tasks": [ { "label": "Make project", "type": "shell", "command": "make", // use options.cwd property if the Makefile is not in the project root ${workspaceRoot} dir "options": { "cwd": "${workspaceRoot}" }, // start the build without prompting for task selection, use "group": "build" otherwise "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" }, // arg passing example: in this case is executed make QUIET=0 "args": [ "QUIET=0" ], // Use the standard less compilation problem matcher. "problemMatcher": { "owner": "cpp", "fileLocation": [ "absolute" ], "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } } } ] }

Same issue if change problemMatcher to "fileLocation": "relative",.

Attaching test project. Open it in WSL and hit Start Debugging in Run tab
test.tar.gz

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: Without extension - Yes, this is not C++ extension issue. Locally - no, this is WSL1 issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached test project in WSL 1 and reproduce the failure by running the configured make task, then selecting the error in the Problems tab. Compare the absolute and relative problemMatcher configurations and trace the vscode-remote URI resolution. Done means selecting the reported error opens the C++ file instead of showing a non-existing-file error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.