From 938c46e2ca8bc7bb783aa4d0ca486328d1dc53ee Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Sat, 24 Feb 2024 23:13:40 +0800 Subject: [PATCH] update --- CHANGELOG.md | 3 ++- resources/hdlParser/index.js | 2 +- src/extension.ts | 5 +++-- src/function/lsp/definition/vlog.ts | 3 ++- src/function/sim/testbench.ts | 2 ++ src/function/treeView/tree.ts | 2 -- src/monitor/index.ts | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f10dc..d1848c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ Feature Bug 修复 - Verilog 参数例化位置错误 -- 文档化的部分问题 +- [issue-51] 文档化的部分问题 +- 点击 Refuse 会在用户工作区创建 json 文件 --- diff --git a/resources/hdlParser/index.js b/resources/hdlParser/index.js index 0c658fa..c2378e9 100644 --- a/resources/hdlParser/index.js +++ b/resources/hdlParser/index.js @@ -64,7 +64,7 @@ async function callParser(path, func) { if (res && res.value === true) { vscode.env.openExternal(vscode.Uri.parse(githubIssueUrl)); } else if (res && res.value === false) { - dsaSetting.update('propose.issue', true); + dsaSetting.update('propose.issue', true, vscode.ConfigurationTarget.Global); } return undefined; diff --git a/src/extension.ts b/src/extension.ts index 7c50ac1..1497b8f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -36,13 +36,14 @@ async function launch(context: vscode.ExtensionContext) { // show welcome information (if first install) const welcomeSetting = vscode.workspace.getConfiguration('digital-ide.welcome'); const showWelcome = welcomeSetting.get('show', true); + if (showWelcome) { // don't show in next time - welcomeSetting.update('show', false); + welcomeSetting.update('show', false, vscode.ConfigurationTarget.Global); const res = await vscode.window.showInformationMessage( 'Thanks for using Digital-IDE ❤️. Your star will be our best motivation! 😊', { title: 'Star', value: true }, - { title: 'Refuse', value: true }, + { title: 'Refuse', value: false }, ); if (res?.value) { vscode.env.openExternal(vscode.Uri.parse(extensionUrl)); diff --git a/src/function/lsp/definition/vlog.ts b/src/function/lsp/definition/vlog.ts index 54b51de..94738e8 100644 --- a/src/function/lsp/definition/vlog.ts +++ b/src/function/lsp/definition/vlog.ts @@ -86,12 +86,13 @@ class VlogDefinitionProvider implements vscode.DefinitionProvider { // match instance const instResult = util.matchInstance(targetWord, currentModule); + if (instResult) { const instModule = instResult.module; if (!instModule || !instResult.instModPath) { return null; } - const targetFile = vscode.Uri.file(instResult.instModPath); + const targetFile = vscode.Uri.file(instResult.instModPath); const targetRange = util.transformRange(instModule.range, -1, 0, 1); const link: vscode.LocationLink = { targetUri: targetFile, targetRange }; return [link]; diff --git a/src/function/sim/testbench.ts b/src/function/sim/testbench.ts index ec10972..d8559cd 100644 --- a/src/function/sim/testbench.ts +++ b/src/function/sim/testbench.ts @@ -65,6 +65,8 @@ async function testbench() { console.log(path); const currentHdlFile = hdlParam.getHdlFile(path); + console.log(currentHdlFile); + if (!currentHdlFile) { vscode.window.showErrorMessage('There is no hdlFile respect to ' + path); return; diff --git a/src/function/treeView/tree.ts b/src/function/treeView/tree.ts index 5888f64..ca00a89 100644 --- a/src/function/treeView/tree.ts +++ b/src/function/treeView/tree.ts @@ -181,8 +181,6 @@ class ModuleTreeProvider implements vscode.TreeDataProvider { const range = firstTop.range; const parent = element; - - const tops = topModuleItemList.filter(item => item.path === path && item.name === name); const adjustItemList = []; if (tops.length > 0 || !hdlParam.hasHdlModule(path, name)) { diff --git a/src/monitor/index.ts b/src/monitor/index.ts index 8d21dc3..96bbb76 100644 --- a/src/monitor/index.ts +++ b/src/monitor/index.ts @@ -55,7 +55,7 @@ class HdlMonitor{ } MainOutput.report('Following folders are tracked: '); monitorPathSet.files.forEach(p => MainOutput.report(p)); - + return this.makeMonitor(monitorFoldersWithGlob); }