File tree Expand file tree Collapse file tree 6 files changed +16
-8
lines changed
src/Language/LSP/Protocol/Message Expand file tree Collapse file tree 6 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 11# Revision history for lsp-types
22
3- ## 2.0.0.2
3+ ## 2.0.1.0
44
55* Removed deprecation pragmas from fields, as these cannot currently be avoided.
6+ * Added ` isOptionalMethod ` , that checks whether a method is optional according to the spec.
67
78## 2.0.0.1
89
Original file line number Diff line number Diff line change 11cabal-version : 3.0
22name : lsp-types
3- version : 2.0.0.2
3+ version : 2.0.1.0
44synopsis :
55 Haskell library for the Microsoft Language Server Protocol, data types
66
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Language.LSP.Protocol.Message.Method where
1414
1515import Data.Aeson.Types
1616import Data.Function (on )
17+ import Data.List (isPrefixOf )
1718import Data.GADT.Compare
1819import Data.Proxy
1920import Data.Type.Equality
@@ -29,6 +30,11 @@ import Unsafe.Coerce
2930-- SomeMethod
3031---------------
3132
33+ -- | Is this an "optional" method which servers and clients are allowed to ignore?
34+ isOptionalMethod :: SomeMethod -> Bool
35+ -- See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#dollarRequests
36+ isOptionalMethod m = " $/" `isPrefixOf` someMethodToMethodString m
37+
3238deriving stock instance Show SomeMethod
3339instance Eq SomeMethod where
3440 (==) = (==) `on` someMethodToMethodString
Original file line number Diff line number Diff line change 11# Revision history for lsp
22
3+ ## 2.0.0.1
4+
5+ * Fix handling of optional methods.
6+
37## 2.0.0.0
48
59* Support ` lsp-types-2.0.0.0 ` .
Original file line number Diff line number Diff line change 11cabal-version : 2.2
22name : lsp
3- version : 2.0.0.0
3+ version : 2.0.0.1
44synopsis : Haskell library for the Microsoft Language Server Protocol
55description :
66 An implementation of the types, and basic message server to
@@ -63,7 +63,7 @@ library
6363 , filepath
6464 , hashable
6565 , lens >= 4.15.2
66- , lsp-types ^>= 2.0
66+ , lsp-types ^>= 2.0.1
6767 , mtl < 2.4
6868 , prettyprinter
6969 , random
Original file line number Diff line number Diff line change @@ -404,11 +404,8 @@ handle' logger mAction m msg = do
404404 -- See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#-notifications-and-requests.
405405 reportMissingHandler :: m ()
406406 reportMissingHandler =
407- let optional = isOptionalNotification m
407+ let optional = isOptionalMethod ( SomeMethod m)
408408 in logger <& MissingHandler optional m `WithSeverity ` if optional then Warning else Error
409- isOptionalNotification (SMethod_CustomMethod p)
410- | " $/" `T.isPrefixOf` T. pack (symbolVal p) = True
411- isOptionalNotification _ = False
412409
413410progressCancelHandler :: (m ~ LspM config ) => LogAction m (WithSeverity LspProcessingLog ) -> TMessage Method_WindowWorkDoneProgressCancel -> m ()
414411progressCancelHandler logger (TNotificationMessage _ _ (WorkDoneProgressCancelParams tid)) = do
You can’t perform that action at this time.
0 commit comments