From 666e26eefcffdf7a5270f67e27aed66dd98e1248 Mon Sep 17 00:00:00 2001 From: Greg Baimetov Date: Thu, 7 Nov 2024 14:06:36 -0800 Subject: [PATCH] removed code related to inlay hints from this branch --- src/StaticLS/Handlers.hs | 11 ----------- src/StaticLS/ProtoLSP.hs | 18 ------------------ static-ls.cabal | 1 - 3 files changed, 30 deletions(-) diff --git a/src/StaticLS/Handlers.hs b/src/StaticLS/Handlers.hs index ef82962..83f93eb 100644 --- a/src/StaticLS/Handlers.hs +++ b/src/StaticLS/Handlers.hs @@ -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 @@ -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 () diff --git a/src/StaticLS/ProtoLSP.hs b/src/StaticLS/ProtoLSP.hs index b988533..d386aa7 100644 --- a/src/StaticLS/ProtoLSP.hs +++ b/src/StaticLS/ProtoLSP.hs @@ -22,7 +22,6 @@ module StaticLS.ProtoLSP ( completionToProto, diagnosticToProto, diagnosticsToProto, - inlayHintToProto, ) where @@ -41,7 +40,6 @@ 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 (..)) @@ -49,7 +47,6 @@ 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) @@ -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 diff --git a/static-ls.cabal b/static-ls.cabal index ed48598..9b2d50e 100644 --- a/static-ls.cabal +++ b/static-ls.cabal @@ -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