From bd3cc10aa35a1811906c757693ba3bd7c785ad4a Mon Sep 17 00:00:00 2001 From: Andrew Nolte Date: Sat, 2 Nov 2024 17:16:59 -0400 Subject: [PATCH] filter out already used ports/params --- src/analysis/CtagsServerComponent.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/analysis/CtagsServerComponent.ts b/src/analysis/CtagsServerComponent.ts index 16f8c8f..97bf818 100644 --- a/src/analysis/CtagsServerComponent.ts +++ b/src/analysis/CtagsServerComponent.ts @@ -192,6 +192,7 @@ export class CtagsServerComponent let mod = await ext.index.findModule(inst.typeRef) if (mod) { + // filter out ports or params let isPort = position.isAfter(inst.getIdRange().end) if (isPort) { symbols = (await mod.getSymbols()).filter( @@ -200,6 +201,9 @@ export class CtagsServerComponent } else { symbols = (await mod.getSymbols()).filter((sym) => sym.type === 'parameter') } + // filter out already used ports/params + const text = document.getText(inst.getFullRange()) + symbols = symbols.filter((sym) => !text.includes('.' + sym.name)) } } } else {