finish modelsim support
This commit is contained in:
parent
134c340fa6
commit
fdacf3f2e1
@ -18,15 +18,15 @@ class ModelsimLinter implements BaseLinter {
|
|||||||
this.diagnostic = vscode.languages.createDiagnosticCollection();
|
this.diagnostic = vscode.languages.createDiagnosticCollection();
|
||||||
|
|
||||||
// configure map for executable file name
|
// configure map for executable file name
|
||||||
this.executableFileMap.set(HdlLangID.Verilog, 'xvlog');
|
this.executableFileMap.set(HdlLangID.Verilog, 'vlog');
|
||||||
this.executableFileMap.set(HdlLangID.Vhdl, 'xvhdl');
|
this.executableFileMap.set(HdlLangID.Vhdl, 'vcom');
|
||||||
this.executableFileMap.set(HdlLangID.SystemVerilog, 'xvlog');
|
this.executableFileMap.set(HdlLangID.SystemVerilog, 'vlog');
|
||||||
this.executableFileMap.set(HdlLangID.Unknown, undefined);
|
this.executableFileMap.set(HdlLangID.Unknown, undefined);
|
||||||
|
|
||||||
// configure map for argruments when lintering
|
// configure map for argruments when lintering
|
||||||
this.linterArgsMap.set(HdlLangID.Verilog, ['--nolog']);
|
this.linterArgsMap.set(HdlLangID.Verilog, ['-quiet', '-nologo']);
|
||||||
this.linterArgsMap.set(HdlLangID.Vhdl, ['--nolog']);
|
this.linterArgsMap.set(HdlLangID.Vhdl, ['-quiet', '-nologo', '-2008']);
|
||||||
this.linterArgsMap.set(HdlLangID.SystemVerilog, ['--sv', '--nolog']);
|
this.linterArgsMap.set(HdlLangID.SystemVerilog, ['-quiet', '-nolog', '-sv']);
|
||||||
this.linterArgsMap.set(HdlLangID.Unknown, []);
|
this.linterArgsMap.set(HdlLangID.Unknown, []);
|
||||||
|
|
||||||
this.initialise(HdlLangID.Verilog);
|
this.initialise(HdlLangID.Verilog);
|
||||||
@ -61,17 +61,22 @@ class ModelsimLinter implements BaseLinter {
|
|||||||
private provideDiagnostics(document: vscode.TextDocument, stdout: string): vscode.Diagnostic[] {
|
private provideDiagnostics(document: vscode.TextDocument, stdout: string): vscode.Diagnostic[] {
|
||||||
const diagnostics = [];
|
const diagnostics = [];
|
||||||
for (const line of stdout.split('\n')) {
|
for (const line of stdout.split('\n')) {
|
||||||
const tokens = line.split(/:?\s*(?:\[|\])\s*/);
|
const tokens = line.split(/(Error|Warning).+?(?: *?(?:.+?(?:\\|\/))+.+?\((\d+?)\):|)(?: *?near "(.+?)":|)(?: *?\((.+?)\)|) +?(.+)/gm);
|
||||||
|
|
||||||
|
|
||||||
const headerInfo = tokens[0];
|
const headerInfo = tokens[0];
|
||||||
// const standardInfo = tokens[1];
|
if (headerInfo === 'Error') {
|
||||||
const syntaxInfo = tokens[2];
|
const errorLine = parseInt(tokens[2]) - 1;
|
||||||
const parsedPath = tokens[3];
|
const syntaxInfo = tokens[5];
|
||||||
if (headerInfo === 'ERROR') {
|
|
||||||
const errorInfos = parsedPath.split(':');
|
|
||||||
const errorLine = parseInt(errorInfos[errorInfos.length - 1]);
|
|
||||||
const range = this.makeCorrectRange(document, errorLine);
|
const range = this.makeCorrectRange(document, errorLine);
|
||||||
const diag = new vscode.Diagnostic(range, syntaxInfo, vscode.DiagnosticSeverity.Error);
|
const diag = new vscode.Diagnostic(range, syntaxInfo, vscode.DiagnosticSeverity.Error);
|
||||||
diagnostics.push(diag);
|
diagnostics.push(diag);
|
||||||
|
} else if (headerInfo == 'Warning') {
|
||||||
|
const errorLine = parseInt(tokens[2]) - 1;
|
||||||
|
const syntaxInfo = tokens[5];
|
||||||
|
const range = this.makeCorrectRange(document, errorLine);
|
||||||
|
const diag = new vscode.Diagnostic(range, syntaxInfo, vscode.DiagnosticSeverity.Warning);
|
||||||
|
diagnostics.push(diag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return diagnostics;
|
return diagnostics;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user