修复模块树中 vhdl 引用 vlog 模块渲染错误的问题
This commit is contained in:
parent
ab24f6c670
commit
fa9e97be82
@ -154,6 +154,7 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
|
||||
public getChildren(element?: ModuleDataItem | undefined): vscode.ProviderResult<ModuleDataItem[]> {
|
||||
if (element) {
|
||||
const name = element.name;
|
||||
|
||||
if (name === 'sim' || name === 'src') {
|
||||
element.parent = undefined;
|
||||
return this.getTopModuleItemList(element);
|
||||
@ -242,9 +243,9 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
|
||||
|
||||
const moduleDataItemList: ModuleDataItem[] = [];
|
||||
const targetModule = hdlParam.getHdlModule(element.path, element.name);
|
||||
|
||||
|
||||
if (targetModule) {
|
||||
const allInstances = targetModule.getAllInstances();
|
||||
const allInstances = targetModule.getAllInstances();
|
||||
// 根据出现次序进行排序
|
||||
allInstances.sort((a, b) => a.range.start.line - b.range.start.line);
|
||||
for (const instance of allInstances) {
|
||||
|
@ -808,7 +808,7 @@ class HdlModule {
|
||||
const instModName = rawHdlInstance.type;
|
||||
|
||||
if (this.languageId === HdlLangID.Verilog || this.languageId === HdlLangID.SystemVerilog) {
|
||||
const searchResult = this.searchInstModPath(instModName);
|
||||
const searchResult = this.searchInstModPath(instModName);
|
||||
const hdlInstance = new HdlInstance(rawHdlInstance.name,
|
||||
rawHdlInstance.type,
|
||||
searchResult.path,
|
||||
@ -827,15 +827,19 @@ class HdlModule {
|
||||
}
|
||||
return hdlInstance;
|
||||
} else if (this.languageId === HdlLangID.Vhdl) {
|
||||
const searchResult = this.searchInstModPath(instModName);
|
||||
const hdlInstance = new HdlInstance(rawHdlInstance.name,
|
||||
rawHdlInstance.type,
|
||||
this.path,
|
||||
common.InstModPathStatus.Current,
|
||||
searchResult.path,
|
||||
searchResult.status,
|
||||
rawHdlInstance.instparams,
|
||||
rawHdlInstance.instports,
|
||||
rawHdlInstance.range,
|
||||
this);
|
||||
hdlInstance.module = this;
|
||||
|
||||
if (hdlInstance.module === undefined) {
|
||||
hdlInstance.module = this;
|
||||
}
|
||||
if (this.nameToInstances) {
|
||||
const key = this.makeInstanceKey(rawHdlInstance.name, rawHdlInstance.type);
|
||||
this.nameToInstances.set(key, hdlInstance);
|
||||
|
Loading…
x
Reference in New Issue
Block a user