修复 endmodule 后面的 inlay hints 在结尾处的异常

This commit is contained in:
锦恢 2024-12-23 22:03:22 +08:00
parent c26bd9316e
commit b5671ae752

View File

@ -247,6 +247,11 @@ class HdlParam {
for (const inst of this.unhandleInstances) { for (const inst of this.unhandleInstances) {
if (inst.type === moduleName) { if (inst.type === moduleName) {
unsolvedInstances.push(inst); unsolvedInstances.push(inst);
} else if (inst.type.includes('(')) {
const entityName = moduleName.split('(')[0];
if (entityName === moduleName) {
unsolvedInstances.push(inst);
}
} }
} }
return unsolvedInstances; return unsolvedInstances;
@ -889,7 +894,7 @@ class HdlModule {
rawHdlInstance.instports, rawHdlInstance.instports,
rawHdlInstance.range, rawHdlInstance.range,
this); this);
if (!searchResult.path) { if (!searchResult.path || !hdlPath.exist(searchResult.path)) {
hdlParam.addUnhandleInstance(hdlInstance); hdlParam.addUnhandleInstance(hdlInstance);
this.addUnhandleInstance(hdlInstance); this.addUnhandleInstance(hdlInstance);
} }
@ -909,6 +914,10 @@ class HdlModule {
rawHdlInstance.range, rawHdlInstance.range,
this); this);
if (!searchResult.path || !hdlPath.exist(searchResult.path)) {
hdlParam.addUnhandleInstance(hdlInstance);
this.addUnhandleInstance(hdlInstance);
}
if (this.nameToInstances) { if (this.nameToInstances) {
const key = this.makeInstanceKey(rawHdlInstance.name, rawHdlInstance.type); const key = this.makeInstanceKey(rawHdlInstance.name, rawHdlInstance.type);
this.nameToInstances.set(key, hdlInstance); this.nameToInstances.set(key, hdlInstance);