Skip to content

Commit

Permalink
Skip displaying inlay hints if it is disabled for a language server
Browse files Browse the repository at this point in the history
  • Loading branch information
yegappan committed Jul 27, 2023
1 parent 40645ca commit ce201fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions autoload/lsp/capabilities.vim
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ export def GetClientCaps(): dict<any>
dynamicRegistration: false,
prepareSupport: false,
},
selectionRange: {
dynamicRegistration: false,
},
signatureHelp: {
dynamicRegistration: false,
signatureInformation: {
Expand Down
6 changes: 4 additions & 2 deletions autoload/lsp/inlayhints.vim
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export def BufferInit(lspserver: dict<any>, bnr: number)

# Inlays hints are disabled
if !opt.lspOptions.showInlayHints
|| !lspserver.featureEnabled('inlayHint')
return
endif

Expand Down Expand Up @@ -174,8 +175,9 @@ export def InlayHintsEnable()
continue
endif
for lspserver in lspservers
if !lspserver.isInlayHintProvider &&
!lspserver.isClangdInlayHintsProvider
if !lspserver.featureEnabled('inlayHint')
|| (!lspserver.isInlayHintProvider &&
!lspserver.isClangdInlayHintsProvider)
continue
endif
BufferInit(lspserver, binfo.bufnr)
Expand Down

0 comments on commit ce201fb

Please sign in to comment.