Skip to content

Commit

Permalink
removed code related to inlay hints from this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Baimetov committed Nov 7, 2024
1 parent 8463e9c commit 666e26e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
11 changes: 0 additions & 11 deletions src/StaticLS/Handlers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import StaticLS.IDE.DocumentSymbols (getDocumentSymbols)
import StaticLS.IDE.Format qualified as IDE.Format
import StaticLS.IDE.Hover
import StaticLS.IDE.Implementation qualified as IDE.Implementation
import StaticLS.IDE.InlayHints
import StaticLS.IDE.Monad qualified as IDE
import StaticLS.IDE.References
import StaticLS.IDE.Rename qualified as IDE.Rename
Expand Down Expand Up @@ -134,16 +133,6 @@ handlePrepareRenameRequest = LSP.requestHandler LSP.SMethod_TextDocumentPrepareR
res $ Right $ InL resp
pure ()

handleInlayHintRequest :: Handlers (LspT c StaticLsM)
handleInlayHintRequest = LSP.requestHandler LSP.SMethod_TextDocumentInlayHint $ \req res -> do
lift $ logInfo "Received inlay hint request"
let params = req._params
path <- ProtoLSP.tdiToAbsPath params._textDocument
inlayHints <- lift $ getInlayHints path
let resp = ProtoLSP.inlayHintToProto <$> inlayHints
res $ Right $ InL resp
pure ()

handleCancelNotification :: Handlers (LspT c StaticLsM)
handleCancelNotification = LSP.notificationHandler LSP.SMethod_CancelRequest $ \_ -> pure ()

Expand Down
18 changes: 0 additions & 18 deletions src/StaticLS/ProtoLSP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module StaticLS.ProtoLSP (
completionToProto,
diagnosticToProto,
diagnosticsToProto,
inlayHintToProto,
)
where

Expand All @@ -41,15 +40,13 @@ import Data.Path qualified as Path
import Data.Pos
import Data.Rope (Rope)
import Data.Rope qualified as Rope
import Data.Text qualified as Text
import Data.Traversable (for)
import Language.LSP.Protocol.Types qualified as LSP
import StaticLS.IDE.CodeActions.Types (Assist (..))
import StaticLS.IDE.Completion qualified as IDE.Completion
import StaticLS.IDE.Diagnostics qualified as IDE.Diagnostics
import StaticLS.IDE.DocumentSymbols (SymbolTree (..))
import StaticLS.IDE.FileWith (FileLcRange, FileWith' (..))
import StaticLS.IDE.InlayHints qualified as IDE.InlayHints
import StaticLS.IDE.Monad qualified as IDE.Monad
import StaticLS.IDE.SourceEdit (SourceEdit (..))
import StaticLS.IDE.SymbolKind (SymbolKind)
Expand Down Expand Up @@ -256,18 +253,3 @@ diagnosticsToProto diags =
diag <- diags
let path = diag.range.path
pure (path, [diagnosticToProto diag])

inlayHintToProto :: IDE.InlayHints.InlayHint -> LSP.InlayHint
inlayHintToProto IDE.InlayHints.InlayHint {position = p', label = l', textEdits = te'} =
LSP.InlayHint
{ _position = lineColToProto p'
, _label = LSP.InL l'
, _kind = Nothing
, _textEdits = fmap convert te'
, _tooltip = Nothing
, _paddingLeft = Nothing
, _paddingRight = Nothing
, _data_ = Nothing
}
where
convert (rope, changes) = fmap (changeToProto rope) changes
1 change: 0 additions & 1 deletion static-ls.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ library
StaticLS.IDE.Hover
StaticLS.IDE.Hover.Info
StaticLS.IDE.Implementation
StaticLS.IDE.InlayHints
StaticLS.IDE.Monad
StaticLS.IDE.References
StaticLS.IDE.Rename
Expand Down

0 comments on commit 666e26e

Please sign in to comment.