Skip to content

Commit

Permalink
Set rangeHoverProvider under experimental capabilities
Browse files Browse the repository at this point in the history
A workaround for microsoft/language-server-protocol#377 until it is resolved
this would allow LSP clients to explicitly know that they can send a range with textDocument/hover instead of a position
  • Loading branch information
ayoub-benali committed Nov 16, 2021
1 parent 07a66ff commit f3192aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package scala.meta.internal.metals

/**
* Language Server Protocol extensions that are declared as "server
* capabilities" in the initialize response.
*/

object MetalsExperimental {
// A workaround for https://github.com/microsoft/language-server-protocol/issues/377 until it is resolved
val rangeHoverProvider: java.lang.Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,8 @@ class MetalsLanguageServer(

capabilities.setTextDocumentSync(textDocumentSyncOptions)

capabilities.setExperimental(MetalsExperimental)

val serverInfo = new ServerInfo("Metals", BuildInfo.metalsVersion)
new InitializeResult(capabilities, serverInfo)
})
Expand Down

0 comments on commit f3192aa

Please sign in to comment.