@codingame/monaco-vscode-output-service-override 25.1.1 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +264 -211
- package/vscode/src/vs/workbench/contrib/output/browser/outputLinkProvider.js +25 -21
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +122 -79
- package/vscode/src/vs/workbench/contrib/output/browser/outputView.js +163 -99
- package/vscode/src/vs/workbench/contrib/output/common/outputChannelModel.js +216 -136
- package/vscode/src/vs/workbench/contrib/output/common/outputLinkComputer.js +18 -19
|
@@ -19,9 +19,8 @@ class OutputLinkComputer {
|
|
|
19
19
|
this.computePatterns(workspaceFolders);
|
|
20
20
|
}
|
|
21
21
|
computePatterns(_workspaceFolders) {
|
|
22
|
-
const workspaceFolders = (
|
|
23
|
-
|
|
24
|
-
.map(resourceStr => ( URI.parse(resourceStr))));
|
|
22
|
+
const workspaceFolders = (
|
|
23
|
+
_workspaceFolders.sort((resourceStrA, resourceStrB) => resourceStrB.length - resourceStrA.length).map(resourceStr => ( URI.parse(resourceStr))));
|
|
25
24
|
for (const workspaceFolder of workspaceFolders) {
|
|
26
25
|
const patterns = OutputLinkComputer.createPatterns(workspaceFolder);
|
|
27
26
|
this.patterns.set(workspaceFolder, patterns);
|
|
@@ -39,15 +38,17 @@ class OutputLinkComputer {
|
|
|
39
38
|
const lines = splitLines(model.getValue());
|
|
40
39
|
for (const [folderUri, folderPatterns] of this.patterns) {
|
|
41
40
|
const resourceCreator = {
|
|
42
|
-
toResource:
|
|
43
|
-
if (typeof folderRelativePath ===
|
|
41
|
+
toResource: folderRelativePath => {
|
|
42
|
+
if (typeof folderRelativePath === "string") {
|
|
44
43
|
return joinPath(folderUri, folderRelativePath);
|
|
45
44
|
}
|
|
46
45
|
return null;
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
48
|
for (let i = 0, len = lines.length; i < len; i++) {
|
|
50
|
-
links.push(
|
|
49
|
+
links.push(
|
|
50
|
+
...OutputLinkComputer.detectLinks(lines[i], i + 1, folderPatterns, resourceCreator)
|
|
51
|
+
);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
return links;
|
|
@@ -60,25 +61,25 @@ class OutputLinkComputer {
|
|
|
60
61
|
workspaceFolderVariants.push(toSlashes(workspaceFolderPath));
|
|
61
62
|
}
|
|
62
63
|
for (const workspaceFolderVariant of workspaceFolderVariants) {
|
|
63
|
-
const validPathCharacterPattern =
|
|
64
|
+
const validPathCharacterPattern = "[^\\s\\(\\):<>'\"]";
|
|
64
65
|
const validPathCharacterOrSpacePattern = `(?:${validPathCharacterPattern}| ${validPathCharacterPattern})`;
|
|
65
66
|
const pathPattern = `${validPathCharacterOrSpacePattern}+\\.${validPathCharacterPattern}+`;
|
|
66
67
|
const strictPathPattern = `${validPathCharacterPattern}+`;
|
|
67
68
|
patterns.push(( new RegExp(
|
|
68
69
|
escapeRegExpCharacters(workspaceFolderVariant) + `(${pathPattern}) on line ((\\d+)(, column (\\d+))?)`,
|
|
69
|
-
|
|
70
|
+
"gi"
|
|
70
71
|
)));
|
|
71
72
|
patterns.push(( new RegExp(
|
|
72
73
|
escapeRegExpCharacters(workspaceFolderVariant) + `(${pathPattern}):line ((\\d+)(, column (\\d+))?)`,
|
|
73
|
-
|
|
74
|
+
"gi"
|
|
74
75
|
)));
|
|
75
76
|
patterns.push(( new RegExp(
|
|
76
77
|
escapeRegExpCharacters(workspaceFolderVariant) + `(${pathPattern})(\\s?\\((\\d+)(,(\\d+))?)\\)`,
|
|
77
|
-
|
|
78
|
+
"gi"
|
|
78
79
|
)));
|
|
79
80
|
patterns.push(( new RegExp(
|
|
80
81
|
escapeRegExpCharacters(workspaceFolderVariant) + `(${strictPathPattern})(:(\\d+))?(:(\\d+))?`,
|
|
81
|
-
|
|
82
|
+
"gi"
|
|
82
83
|
)));
|
|
83
84
|
}
|
|
84
85
|
return patterns;
|
|
@@ -90,28 +91,26 @@ class OutputLinkComputer {
|
|
|
90
91
|
let match;
|
|
91
92
|
let offset = 0;
|
|
92
93
|
while ((match = pattern.exec(line)) !== null) {
|
|
93
|
-
const folderRelativePath = rtrim(match[1],
|
|
94
|
+
const folderRelativePath = rtrim(match[1], ".").replace(/\\/g, "/");
|
|
94
95
|
let resourceString;
|
|
95
96
|
try {
|
|
96
97
|
const resource = resourceCreator.toResource(folderRelativePath);
|
|
97
98
|
if (resource) {
|
|
98
99
|
resourceString = ( resource.toString());
|
|
99
100
|
}
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
101
|
+
} catch (error) {
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
104
|
if (match[3]) {
|
|
105
105
|
const lineNumber = match[3];
|
|
106
106
|
if (match[5]) {
|
|
107
107
|
const columnNumber = match[5];
|
|
108
|
-
resourceString = format(
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
resourceString = format('{0}#{1}', resourceString, lineNumber);
|
|
108
|
+
resourceString = format("{0}#{1},{2}", resourceString, lineNumber, columnNumber);
|
|
109
|
+
} else {
|
|
110
|
+
resourceString = format("{0}#{1}", resourceString, lineNumber);
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
const fullMatch = rtrim(match[0],
|
|
113
|
+
const fullMatch = rtrim(match[0], ".");
|
|
115
114
|
const index = line.indexOf(fullMatch, offset);
|
|
116
115
|
offset = index + fullMatch.length;
|
|
117
116
|
const linkRange = {
|