Skip to content

Commit 7e2f848

Browse files
authored
Merge pull request #329 from viperproject/nklose/macro-duplication
Added deduplication to inlay and hover hints to remove macro problems
2 parents 127b5cf + a4d6c67 commit 7e2f848

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/scala/viper/server/frontends/lsp/ast/ParseAstLsp.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ object HasHoverHints {
3535
case n: PExp => PLspExp.getHoverHints(n)
3636
case n: PDeclaration => PLspDeclaration.getHoverHints(n)
3737
case n: PReserved[_] => PLspReserved.getHoverHints(n)
38-
}).flatten
38+
}).flatten.distinctBy(h => (h.bound.rangePositions.headOption.map(rp => (rp.start.line, rp.start.column)), h.hint))
3939
}
4040

4141
object HasGotoDefinitions {
@@ -67,7 +67,7 @@ object HasInlayHints {
6767
def apply(p: PProgram): Seq[InlayHint] = p.deepCollect({
6868
case n: PCall => PLspCall.getInlayHints(n)
6969
case n: PLet => PLspLet.getInlayHints(n)
70-
}).flatten
70+
}).flatten.distinctBy(h => (h.position, h.label.map(_.value)))
7171
}
7272

7373
object HasSemanticHighlights {

0 commit comments

Comments
 (0)