Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ trait PcCollector[T]:
def collectEndMarker =
EndMarker.getPosition(df, pos, sourceText).map:
collect(EndMarker(df.symbol), _)
val annots = collectTrees(df.mods.annotations)
val annots = collectTrees(df.symbol.annotations.map(_.tree))
val traverser =
new PcCollector.DeepFolderWithParent[Set[T]](
collectNamesWithParent
Expand Down Expand Up @@ -215,8 +215,8 @@ trait PcCollector[T]:
* @<<JsonNotification>>("")
* def params() = ???
*/
case mdf: MemberDef if mdf.mods.annotations.nonEmpty =>
val trees = collectTrees(mdf.mods.annotations)
case mdf: MemberDef if mdf.symbol.annotations.nonEmpty =>
val trees = collectTrees(mdf.symbol.annotations.map(_.tree))
val traverser =
new PcCollector.DeepFolderWithParent[Set[T]](
collectNamesWithParent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite:
|""".stripMargin
)

@Test def `metals-6823` =
check(
s"""|package <<example>>/*namespace*/
|
| @<<main>>/*class*/ def <<main1>>/*method,definition*/(): <<Unit>>/*class,abstract*/ =
| val <<array>>/*variable,definition,readonly*/ = <<Array>>/*class*/(1, 2, 3)
| <<println>>/*method*/(<<array>>/*variable,readonly*/)
|
|@<<main>>/*class*/ def <<main2>>/*method,definition*/(): <<Unit>>/*class,abstract*/ =
| val <<list>>/*variable,definition,readonly*/ = <<List>>/*class*/(1, 2, 3)
| <<println>>/*method*/(<<list>>/*variable,readonly*/)
|
|@<<main>>/*class*/ def <<main3>>/*method,definition*/(): <<Unit>>/*class,abstract*/ =
| val <<list>>/*variable,definition,readonly*/ = <<List>>/*class*/(1, 2, 3)
| <<println>>/*method*/(<<list>>/*variable,readonly*/)
|""".stripMargin
)

@Test def `Comment(Single-Line, Multi-Line)` =
check(
s"""|package <<example>>/*namespace*/
Expand Down
Loading