#fix linter allow init lint for a open
This commit is contained in:
parent
18063878dd
commit
dd33f4dfdb
@ -77,12 +77,10 @@ function registerLsp(context: vscode.ExtensionContext) {
|
|||||||
vscode.languages.registerCompletionItemProvider(vlogSelector, lspCompletion.vlogPositionPortProvider, '.');
|
vscode.languages.registerCompletionItemProvider(vlogSelector, lspCompletion.vlogPositionPortProvider, '.');
|
||||||
vscode.languages.registerCompletionItemProvider(vlogSelector, lspCompletion.vlogCompletionProvider);
|
vscode.languages.registerCompletionItemProvider(vlogSelector, lspCompletion.vlogCompletionProvider);
|
||||||
vscode.languages.registerDocumentSemanticTokensProvider(vlogSelector, lspDocSemantic.vlogDocSenmanticProvider, lspDocSemantic.vlogLegend);
|
vscode.languages.registerDocumentSemanticTokensProvider(vlogSelector, lspDocSemantic.vlogDocSenmanticProvider, lspDocSemantic.vlogLegend);
|
||||||
lspLinter.registerVlogLinterServer();
|
const vlogLinter = lspLinter.registerVlogLinterServer();
|
||||||
|
lspLinter.firstLinter(vlogLinter);
|
||||||
|
|
||||||
// vhdl lsp
|
// vhdl lsp
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { registerVlogLinterServer } from './vlog';
|
import { registerVlogLinterServer, firstLinter } from './vlog';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
registerVlogLinterServer
|
registerVlogLinterServer,
|
||||||
|
firstLinter
|
||||||
};
|
};
|
@ -1,5 +1,6 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { All } from '../../../../resources/hdlParser';
|
import { All } from '../../../../resources/hdlParser';
|
||||||
|
import { getLanguageId, isVerilogFile } from '../../../hdlFs/file';
|
||||||
import { hdlParam, HdlSymbol } from '../../../hdlParser';
|
import { hdlParam, HdlSymbol } from '../../../hdlParser';
|
||||||
import { Position, Range } from '../../../hdlParser/common';
|
import { Position, Range } from '../../../hdlParser/common';
|
||||||
|
|
||||||
@ -71,19 +72,35 @@ class VlogLinter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerVlogLinterServer() {
|
function registerVlogLinterServer(): VlogLinter {
|
||||||
const linter = new VlogLinter();
|
const linter = new VlogLinter();
|
||||||
vscode.workspace.onDidOpenTextDocument(doc => {
|
vscode.workspace.onDidOpenTextDocument(doc => {
|
||||||
linter.lint(doc);
|
if (isVerilogFile(doc.fileName)) {
|
||||||
|
linter.lint(doc);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
vscode.workspace.onDidSaveTextDocument(doc => {
|
vscode.workspace.onDidSaveTextDocument(doc => {
|
||||||
linter.lint(doc);
|
if (isVerilogFile(doc.fileName)) {
|
||||||
|
linter.lint(doc);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
vscode.workspace.onDidCloseTextDocument(doc => {
|
vscode.workspace.onDidCloseTextDocument(doc => {
|
||||||
linter.remove(doc);
|
if (isVerilogFile(doc.fileName)) {
|
||||||
|
linter.remove(doc);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
return linter;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function firstLinter(linter: VlogLinter) {
|
||||||
|
for (const doc of vscode.workspace.textDocuments) {
|
||||||
|
if (isVerilogFile(doc.fileName)) {
|
||||||
|
linter.lint(doc);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
registerVlogLinterServer
|
registerVlogLinterServer,
|
||||||
|
firstLinter
|
||||||
};
|
};
|
@ -197,14 +197,9 @@ class PrjManage {
|
|||||||
const softwarePath = hdlPath.join(userPath, 'Software');
|
const softwarePath = hdlPath.join(userPath, 'Software');
|
||||||
const hardwarePath = hdlPath.join(userPath, 'Hardware');
|
const hardwarePath = hdlPath.join(userPath, 'Hardware');
|
||||||
|
|
||||||
const nextmode = this.getNextMode(rawPrjInfo);
|
const nextmode = this.getNextMode(rawPrjInfo);
|
||||||
console.log(softwarePath, fs.existsSync(softwarePath));
|
|
||||||
console.log(hardwarePath, fs.existsSync(hardwarePath));
|
|
||||||
|
|
||||||
const currmode = this.getCurrentMode(softwarePath, hardwarePath);
|
const currmode = this.getCurrentMode(softwarePath, hardwarePath);
|
||||||
|
|
||||||
console.log(currmode, nextmode);
|
|
||||||
|
|
||||||
if (currmode === nextmode) {
|
if (currmode === nextmode) {
|
||||||
const hardware = opeParam.prjInfo.arch.hardware;
|
const hardware = opeParam.prjInfo.arch.hardware;
|
||||||
const software = opeParam.prjInfo.arch.software;
|
const software = opeParam.prjInfo.arch.software;
|
||||||
|
@ -8,5 +8,5 @@ module mux2to1(
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
assign outp = sel == 1'b0 ? a : b;
|
assign outp = sel == 1'b0 ? a : b
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
x
Reference in New Issue
Block a user