update
This commit is contained in:
parent
8da5cca1ab
commit
c7883d1b46
@ -4,7 +4,7 @@
|
||||
## <code>Digital IDE</code> | All in one <code>vscode</code> plugin for Verilog/VHDL development
|
||||
|
||||
|
||||
[Document (New)](https://sterben.nitcloud.cn/) | [中文文档 (New)](https://sterben.nitcloud.cn/zh/) | [Bilibili Video](https://www.bilibili.com/video/BV1t14y1179V/?spm_id_from=333.999.0.0)
|
||||
[Document (New)](https://nc-ai.cn/) | [中文文档 (New)](https://nc-ai.cn/zh/) | [Bilibili Video](https://www.bilibili.com/video/BV1t14y1179V/?spm_id_from=333.999.0.0)
|
||||
|
||||

|
||||

|
||||
|
@ -1,8 +1,10 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import * as fspath from 'path';
|
||||
|
||||
import { LinterOutput, ReportType, AbsPath, IProgress } from '../../../global';
|
||||
import { HdlLangID } from '../../../global/enum';
|
||||
import { LinterOutput, ReportType, AbsPath, IProgress, opeParam } from '../../../global';
|
||||
import { HdlLangID, LibraryState } from '../../../global/enum';
|
||||
import { hdlFile, hdlPath } from '../../../hdlFs';
|
||||
import { t } from '../../../i18n';
|
||||
import { getLinterConfigurationName, getLinterInstallConfigurationName, getLinterMode, getLinterName, IConfigReminder, LinterItem, LinterMode, makeLinterNamePickItem, makeLinterOptions, SupportLinterName, updateLinterConfigurationName } from './common';
|
||||
@ -244,10 +246,33 @@ export class LinterManager {
|
||||
}
|
||||
}
|
||||
|
||||
function getLibrarySearchPaths(path: string): string[] {
|
||||
const paths = new Set<string>();
|
||||
const langID = hdlFile.getLanguageId(path);
|
||||
const linterName = getLinterName(langID);
|
||||
if (linterName === 'iverilog' || linterName === 'verilator') {
|
||||
const userCommonLibs = opeParam.prjInfo.getLibraryCommonPaths(true, LibraryState.Remote);
|
||||
for (const path of userCommonLibs) {
|
||||
const state = fs.statSync(path);
|
||||
if (state.isDirectory()) {
|
||||
paths.add(path);
|
||||
} else {
|
||||
const parent = fspath.dirname(path);
|
||||
paths.add(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [...paths];
|
||||
}
|
||||
|
||||
export async function publishDiagnostics(
|
||||
client: LanguageClient,
|
||||
path: string
|
||||
) {
|
||||
// 找到所有的库前缀,进行诊断(用于 verilator)
|
||||
// const searchPaths = getLibrarySearchPaths(path);
|
||||
|
||||
await client.sendRequest("workspace/executeCommand", {
|
||||
command: 'publish-diagnostics',
|
||||
arguments: [path]
|
||||
|
Loading…
x
Reference in New Issue
Block a user