From b5671ae75262967a7760b535d27469bc85891275 Mon Sep 17 00:00:00 2001 From: LSTM-Kirigaya <1193466151@qq.com> Date: Mon, 23 Dec 2024 22:03:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20endmodule=20=E5=90=8E?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=20inlay=20hints=20=E5=9C=A8=E7=BB=93?= =?UTF-8?q?=E5=B0=BE=E5=A4=84=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hdlParser/core.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/hdlParser/core.ts b/src/hdlParser/core.ts index 9898293..94eb2db 100644 --- a/src/hdlParser/core.ts +++ b/src/hdlParser/core.ts @@ -247,6 +247,11 @@ class HdlParam { for (const inst of this.unhandleInstances) { if (inst.type === moduleName) { unsolvedInstances.push(inst); + } else if (inst.type.includes('(')) { + const entityName = moduleName.split('(')[0]; + if (entityName === moduleName) { + unsolvedInstances.push(inst); + } } } return unsolvedInstances; @@ -490,7 +495,7 @@ class HdlParam { // match the same module, check then const originalModule = moduleFile.getHdlModule(renderName); uncheckedModuleNames.delete(renderName); - originalModule?.update(rawHdlModule); + originalModule?.update(rawHdlModule); } else { // no matched, create it const newModule = moduleFile.createHdlModule(rawHdlModule); @@ -889,7 +894,7 @@ class HdlModule { rawHdlInstance.instports, rawHdlInstance.range, this); - if (!searchResult.path) { + if (!searchResult.path || !hdlPath.exist(searchResult.path)) { hdlParam.addUnhandleInstance(hdlInstance); this.addUnhandleInstance(hdlInstance); } @@ -908,7 +913,11 @@ class HdlModule { rawHdlInstance.instports, rawHdlInstance.range, this); - + + if (!searchResult.path || !hdlPath.exist(searchResult.path)) { + hdlParam.addUnhandleInstance(hdlInstance); + this.addUnhandleInstance(hdlInstance); + } if (this.nameToInstances) { const key = this.makeInstanceKey(rawHdlInstance.name, rawHdlInstance.type); this.nameToInstances.set(key, hdlInstance); @@ -1069,7 +1078,7 @@ class HdlModule { */ public solveUnhandleInstance() { const instances = hdlParam.getUnhandleInstancesByModuleName(this.name); - + for (const instance of instances) { const belongScopeModule = instance.parentMod; // 先从 unsolved 堆中删除当前的 instance