Skip to content

Commit e049ced

Browse files
committed
add new problemMatcher in attempt to resolve problems relative to workspace
1 parent b31c05c commit e049ced

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
"type": "string",
6464
"description": "The path to the XSLT stylesheet"
6565
},
66+
"useWorkspace": {
67+
"type": "boolean",
68+
"description": "Resolve file-paths from workspace folder"
69+
},
6670
"xmlSource": {
6771
"type": "string",
6872
"description": "The path to the XML source file"
@@ -137,6 +141,25 @@
137141
"message": 2
138142
}
139143
]
144+
},
145+
{
146+
"name": "saxon-xslt-workspace",
147+
"owner": "xslt",
148+
"fileLocation": ["relative", "${workspaceFolder}"],
149+
"pattern": [
150+
{
151+
"regexp": "^(?:Syntax |Static |Dynamic |Type )?(error|Error|Warning|Info)\\s+(?:at.*in.*\\sin|in|on|at|near\\s+.*.*)(?:\\s+)?([^\\s]*)(?:\\s+on)?\\s+line\\s+(\\d+)\\s+column\\s+(\\d+)\\s+of\\s+([^:]*)",
152+
"line": 3,
153+
"column": 4,
154+
"severity": 1,
155+
"file": 5
156+
},
157+
{
158+
"regexp": "^\\s+(\\w{4}\\d{4})(?::)?\\s+(.*)",
159+
"code": 1,
160+
"message": 2
161+
}
162+
]
140163
}
141164
],
142165
"semanticTokenTypes": [

sample/.vscode/tasks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"label": "Basic Transform",
77
"saxonJar": "${config:XSLT.tasks.saxonJar}",
88
"xsltFile": "${workspaceFolder}/basic.xsl",
9+
"useWorkspace": true,
910
"xmlSource": "${workspaceFolder}/basic.xsl",
1011
"resultPath": "${workspaceFolder}/xslt-out/result1.xml",
1112
"parameters": [

src/saxonTaskProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ interface XSLTTask {
3939
parameters?: XSLTParameter[],
4040
initialTemplate?: string,
4141
initialMode?: string,
42-
classPathEntries?: string[]
42+
classPathEntries?: string[],
43+
useWorkspace?: boolean,
4344
group?: TaskGroup
4445
}
4546

@@ -180,9 +181,11 @@ export class SaxonTaskProvider implements vscode.TaskProvider {
180181
commandLineArgs.push(xsltParametersCommand.join(' '));
181182
}
182183

184+
let useWorkspaceResolving = xsltTask.useWorkspace? xsltTask.useWorkspace: false;
185+
183186
let classPathString = classPaths.join(pathSeparator());
184187
let resolvedCommandLine = commandLineArgs.join(' ');
185-
let problemMatcher = "$saxon-xslt";
188+
let problemMatcher = useWorkspaceResolving? "saxon-xslt-workspace": "$saxon-xslt";
186189
let commandline = `java -cp ${classPathString} net.sf.saxon.Transform ${resolvedCommandLine}`;
187190
let newTask = new vscode.Task(xsltTask, xsltTask.label, source, new vscode.ShellExecution(commandline), problemMatcher);
188191
this.tasks.push(newTask);

0 commit comments

Comments
 (0)