#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.vlogCompletionProvider);
|
||||
vscode.languages.registerDocumentSemanticTokensProvider(vlogSelector, lspDocSemantic.vlogDocSenmanticProvider, lspDocSemantic.vlogLegend);
|
||||
lspLinter.registerVlogLinterServer();
|
||||
|
||||
const vlogLinter = lspLinter.registerVlogLinterServer();
|
||||
lspLinter.firstLinter(vlogLinter);
|
||||
|
||||
// vhdl lsp
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { registerVlogLinterServer } from './vlog';
|
||||
import { registerVlogLinterServer, firstLinter } from './vlog';
|
||||
|
||||
export {
|
||||
registerVlogLinterServer
|
||||
registerVlogLinterServer,
|
||||
firstLinter
|
||||
};
|
@ -1,5 +1,6 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { All } from '../../../../resources/hdlParser';
|
||||
import { getLanguageId, isVerilogFile } from '../../../hdlFs/file';
|
||||
import { hdlParam, HdlSymbol } from '../../../hdlParser';
|
||||
import { Position, Range } from '../../../hdlParser/common';
|
||||
|
||||
@ -71,19 +72,35 @@ class VlogLinter {
|
||||
}
|
||||
}
|
||||
|
||||
function registerVlogLinterServer() {
|
||||
function registerVlogLinterServer(): VlogLinter {
|
||||
const linter = new VlogLinter();
|
||||
vscode.workspace.onDidOpenTextDocument(doc => {
|
||||
if (isVerilogFile(doc.fileName)) {
|
||||
linter.lint(doc);
|
||||
}
|
||||
});
|
||||
vscode.workspace.onDidSaveTextDocument(doc => {
|
||||
if (isVerilogFile(doc.fileName)) {
|
||||
linter.lint(doc);
|
||||
}
|
||||
});
|
||||
vscode.workspace.onDidCloseTextDocument(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 {
|
||||
registerVlogLinterServer
|
||||
registerVlogLinterServer,
|
||||
firstLinter
|
||||
};
|
@ -198,13 +198,8 @@ class PrjManage {
|
||||
const hardwarePath = hdlPath.join(userPath, 'Hardware');
|
||||
|
||||
const nextmode = this.getNextMode(rawPrjInfo);
|
||||
console.log(softwarePath, fs.existsSync(softwarePath));
|
||||
console.log(hardwarePath, fs.existsSync(hardwarePath));
|
||||
|
||||
const currmode = this.getCurrentMode(softwarePath, hardwarePath);
|
||||
|
||||
console.log(currmode, nextmode);
|
||||
|
||||
if (currmode === nextmode) {
|
||||
const hardware = opeParam.prjInfo.arch.hardware;
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user