Skip to content

Commit

Permalink
bugfix: Fix docstring regex in semantic highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
jkciesluk committed Oct 10, 2023
1 parent 2c75be6 commit 8100b5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ object SemanticTokensProvider {
object DocstringToken {

val paramOrThrows: String = "(@param|@tparam|@throws)\\s+([\\w.]+)"
val apiLink: String = "\\[\\[(.*)\\]\\]"
val apiLink: String = "\\[\\[(.*?)\\]\\]"
val other: String = "(@[a-zA-Z]+)"
val reg: Regex = s"$paramOrThrows|$apiLink|$other".r

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SemanticTokensLspSuite extends BaseLspSuite("SemanticTokens") {
|<< * >>/*comment*/<<@param>>/*keyword*/<< >>/*comment*/<<xs>>/*variable,readonly*/<< is [[>>/*comment*/<<scala.collection.immutable.List>>/*string*/<<]]>>/*comment*/
|<< * >>/*comment*/<<@throws>>/*keyword*/<< >>/*comment*/<<java.util.Exception>>/*class*/<< is [[>>/*comment*/<<scala.collection.immutable.List>>/*string*/<<]]>>/*comment*/
|<< * >>/*comment*/<<@return>>/*keyword*/<< the same list>>/*comment*/
|<< * >>/*comment*/<<@note>>/*keyword*/<< This is a note>>/*comment*/
|<< * >>/*comment*/<<@note>>/*keyword*/<< This is a note [[>>/*comment*/<<java.lang.String>>/*string*/<<]] or [[>>/*comment*/<<scala.collection.Seq>>/*string*/<<]]>>/*comment*/
|<< */>>/*comment*/
| <<def>>/*keyword*/ <<m>>/*method,definition*/(<<xs>>/*parameter,declaration,readonly*/: <<List>>/*type*/[<<Int>>/*class,abstract*/]): <<List>>/*type*/[<<Int>>/*class,abstract*/] = <<xs>>/*parameter,readonly*/
|}
Expand Down

0 comments on commit 8100b5c

Please sign in to comment.