Skip to content

Commit

Permalink
bugfix: Check if inlay hints refresh is enabled
Browse files Browse the repository at this point in the history
Fixes #6937
  • Loading branch information
tgodzik committed Nov 16, 2024
1 parent 165c266 commit 1104736
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ final class ClientConfiguration(
} yield true
}.getOrElse(false)

def isInlayHintsRefreshEnabled(): Boolean = {
for {
capabilities <- clientCapabilities
workspace <- Option(capabilities.getWorkspace())
inlayHints <- Option(workspace.getInlayHint())
refreshSupport <- Option(inlayHints.getRefreshSupport())
} yield refreshSupport.booleanValue()
}.getOrElse(false)

def hoverContentType(): ContentType =
(for {
capabilities <- clientCapabilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ final class ConfiguredLanguageClient(
}

override def refreshInlayHints(): CompletableFuture[Void] = {
if (clientConfig.isInlayHintsEnabled()) {
if (
clientConfig.isInlayHintsEnabled() && clientConfig
.isInlayHintsRefreshEnabled()
) {
underlying
.refreshInlayHints()
.handle { (msg, ex) =>
Expand Down

0 comments on commit 1104736

Please sign in to comment.