-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Description
I've written a problemMatcher. It works great and produces problems (error squiggles) in the document.
- Now I edit the document to insert a newline above the squiggle.
- I would like the squiggle to automatically shift down one line.
- (instead, the squiggle currently stays at the exact same file+line+column).
- Now I edit the document to completely delete the text that contained the squiggle.
- I would like the squiggle to automatically be deleted.
- (instead, the squiggle currently stays at the exact same file+line+column).
- If I edit the document to delete part of the text range of the squiggle, I'd like the squiggle's range to be modified accordingly.
Here's a video which shows how squiggles aren't currently auto-moved by file edits.
https://imgur.com/a/yWfq97Z
REPRO
Create a folder with three files:
[a.txt]
hello
there
world
[a.ts]
const x = 15;
f(x);
[.vscode/tasks.json]
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "ts problemMatcher",
"type": "shell",
"command": "printf 'a.ts'; echo ':2:1 - error TS2304: my walk has become rather sillier recently'",
"group": "build",
"problemMatcher": "$tsc"
},
{
"label": "absolute problemMatcher at line 2",
"type": "shell",
"command": "echo 'e /Users/ljw/code/a.txt:2:1: warning: absolute warning in /Users/ljw/code/a.txt:2'",
"group": "build",
"problemMatcher": {
"owner": "moose",
"fileLocation": "absolute",
"pattern": {
"regexp": "^e (.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "relative problemMatcher at line 3",
"type": "shell",
"command": "echo 'e a.txt:3:3: error: relative warning in {workspace}/a.txt:3'",
"group": "build",
"problemMatcher": {
"owner": "moose",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^e (.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
- Run the "relative problemMatcher" build task.
- Observe that it produces a problem on line 3 of a.txt.
- Click on that problem to go to a.txt.
- Insert a newline at the start of the file
WHAT I EXPECT: the problem should be shifted down one line, tracking the text
WHAT I GET: the problem remains on line 3, new on a different span of text
For the repro, I also did it with an "absolute problemMatcher" and "$tsc" problem matcher (this one's easiest to see if you disable the built-in typescript language extension). They all have the same phenomenon: problems fail to track edits to the file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels