修复 结构树中,设置顶层模块失效
This commit is contained in:
parent
0987738ed9
commit
734d446038
@ -130,13 +130,15 @@ export async function registerConfigurationUpdater(client: LanguageClient, packa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果诊断模式发生变化,进行一次刷新
|
// 如果诊断模式发生变化,进行一次刷新
|
||||||
await vscode.window.withProgress({
|
if (event.affectsConfiguration(Linter.getLinterModeConfigurationName())) {
|
||||||
location: vscode.ProgressLocation.Window,
|
await vscode.window.withProgress({
|
||||||
title: t('info.progress.doing-diagnostic')
|
location: vscode.ProgressLocation.Window,
|
||||||
}, async (progress: vscode.Progress<IProgress>, token: vscode.CancellationToken) => {
|
title: t('info.progress.doing-diagnostic')
|
||||||
const hdlFiles = await prjManage.getPrjHardwareFiles();
|
}, async (progress: vscode.Progress<IProgress>, token: vscode.CancellationToken) => {
|
||||||
await refreshWorkspaceDiagonastics(client, hdlFiles, false, progress);
|
const hdlFiles = await prjManage.getPrjHardwareFiles();
|
||||||
});
|
await refreshWorkspaceDiagonastics(client, hdlFiles, false, progress);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,10 @@ export function getLinterInstallConfigurationName(linterName: SupportLinterName)
|
|||||||
return `digital-ide.prj.${linterName}.install.path`;
|
return `digital-ide.prj.${linterName}.install.path`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLinterModeConfigurationName(): string {
|
||||||
|
return 'digital-ide.function.lsp.linter.linter-mode';
|
||||||
|
}
|
||||||
|
|
||||||
export function getLinterInstallPath(linterName: SupportLinterName): string {
|
export function getLinterInstallPath(linterName: SupportLinterName): string {
|
||||||
const configuration = vscode.workspace.getConfiguration();
|
const configuration = vscode.workspace.getConfiguration();
|
||||||
const linterInstallConfigurationName = getLinterInstallConfigurationName(linterName);
|
const linterInstallConfigurationName = getLinterInstallConfigurationName(linterName);
|
||||||
@ -117,7 +121,10 @@ export enum LinterMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getLinterMode(): LinterMode {
|
export function getLinterMode(): LinterMode {
|
||||||
return vscode.workspace.getConfiguration().get<LinterMode>('digital-ide.function.lsp.linter.linter-mode', LinterMode.Full);
|
console.log(vscode.workspace.getConfiguration().get('digital-ide.function.lsp.linter.linter-mode'));
|
||||||
|
console.log(vscode.workspace.getConfiguration().get('digital-ide.function.lsp.linter.linter-level'));
|
||||||
|
|
||||||
|
return vscode.workspace.getConfiguration().get<LinterMode>('digital-ide.function.lsp.linter.linter-mode') || LinterMode.Common;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IConfigReminder {
|
export interface IConfigReminder {
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
|
|
||||||
import { LspClient, LinterOutput, ReportType, AbsPath, IProgress } from '../../../global';
|
import { LinterOutput, ReportType, AbsPath, IProgress } from '../../../global';
|
||||||
import { HdlLangID } from '../../../global/enum';
|
import { HdlLangID } from '../../../global/enum';
|
||||||
import { hdlFile, hdlPath } from '../../../hdlFs';
|
import { hdlFile, hdlPath } from '../../../hdlFs';
|
||||||
import { t } from '../../../i18n';
|
import { t } from '../../../i18n';
|
||||||
import { getLinterConfigurationName, getLinterInstallConfigurationName, getLinterName, IConfigReminder, LinterItem, LinterMode, makeLinterNamePickItem, makeLinterOptions, SupportLinterName, updateLinterConfigurationName } from './common';
|
import { getLinterConfigurationName, getLinterInstallConfigurationName, getLinterMode, getLinterName, IConfigReminder, LinterItem, LinterMode, makeLinterNamePickItem, makeLinterOptions, SupportLinterName, updateLinterConfigurationName } from './common';
|
||||||
import { UpdateConfigurationType } from '../../../global/lsp';
|
import { UpdateConfigurationType } from '../../../global/lsp';
|
||||||
import { LanguageClient } from 'vscode-languageclient/node';
|
import { LanguageClient } from 'vscode-languageclient/node';
|
||||||
import { toEscapePath } from '../../../hdlFs/path';
|
|
||||||
|
|
||||||
export class LinterManager {
|
export class LinterManager {
|
||||||
/**
|
/**
|
||||||
@ -318,9 +317,10 @@ export async function refreshWorkspaceDiagonastics(
|
|||||||
progress: vscode.Progress<IProgress>
|
progress: vscode.Progress<IProgress>
|
||||||
) {
|
) {
|
||||||
const parallelChunk = Math.min(os.cpus().length, 32);
|
const parallelChunk = Math.min(os.cpus().length, 32);
|
||||||
const configuration = vscode.workspace.getConfiguration();
|
const linterMode = getLinterMode();
|
||||||
const linterMode = configuration.get<LinterMode>('digital-ide.function.lsp.linter.linter-mode', LinterMode.Common);
|
|
||||||
|
console.log('[refreshWorkspaceDiagonastics]', linterMode);
|
||||||
|
|
||||||
if (linterMode === LinterMode.Full) {
|
if (linterMode === LinterMode.Full) {
|
||||||
// full,对工作区所有文件进行诊断
|
// full,对工作区所有文件进行诊断
|
||||||
const consumer = async (path: string) => {
|
const consumer = async (path: string) => {
|
||||||
@ -359,11 +359,11 @@ export async function refreshWorkspaceDiagonastics(
|
|||||||
|
|
||||||
await asyncConsumer(tabArray, consumer, parallelChunk, progress);
|
await asyncConsumer(tabArray, consumer, parallelChunk, progress);
|
||||||
} else {
|
} else {
|
||||||
// shutdown, 如果是初始化阶段,什么都不需要做
|
|
||||||
const consumer = async (path: string) => {
|
|
||||||
await clearDiagnostics(client, path);
|
|
||||||
};
|
|
||||||
if (!isInitialise) {
|
if (!isInitialise) {
|
||||||
|
// shutdown, 如果是初始化阶段,什么都不需要做
|
||||||
|
const consumer = async (path: string) => {
|
||||||
|
await clearDiagnostics(client, path);
|
||||||
|
};
|
||||||
await asyncConsumer(lintPaths, consumer, parallelChunk, progress);
|
await asyncConsumer(lintPaths, consumer, parallelChunk, progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user