PsiSymbolReference (@NotNull PsiSnippetAttributeValue value) { return new PsiSymbolReference() { @Override public @NotNull PsiElement getElement() { return value; } @Override public @NotNull TextRange getRangeInElement() { return ((PsiSnippetAttributeValueImpl)value).getValueRange(); } @Override public @NotNull Collection<? extends Symbol> resolveReference() { PsiSnippetDocTagValue snippet = PsiTreeUtil.getParentOfType(value, PsiSnippetDocTagValue.class); if (snippet == null) return List.of(); SnippetMarkup markup = SnippetMarkup.fromSnippet(snippet); if (markup == null) return List.of(); String region = value.getValue(); SnippetMarkup.MarkupNode start = markup.getRegionStart(region); if (start == null) return List.of(); PsiElement markupContext = markup.getContext(); PsiFile file = markupContext.getContainingFile(); if (file == null) return List.of(); return List.of( new SnippetRegionSymbol(file, start.range().shiftRight(markupContext.getTextRange().getStartOffset()))); } }; }