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 1
1
# Revision history for lsp-types
2
2
3
- ## 2.0.0.2
3
+ ## 2.0.1.0
4
4
5
5
* 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.
6
7
7
8
## 2.0.0.1
8
9
Original file line number Diff line number Diff line change 1
1
cabal-version : 3.0
2
2
name : lsp-types
3
- version : 2.0.0.2
3
+ version : 2.0.1.0
4
4
synopsis :
5
5
Haskell library for the Microsoft Language Server Protocol, data types
6
6
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Language.LSP.Protocol.Message.Method where
14
14
15
15
import Data.Aeson.Types
16
16
import Data.Function (on )
17
+ import Data.List (isPrefixOf )
17
18
import Data.GADT.Compare
18
19
import Data.Proxy
19
20
import Data.Type.Equality
@@ -29,6 +30,11 @@ import Unsafe.Coerce
29
30
-- SomeMethod
30
31
---------------
31
32
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
+
32
38
deriving stock instance Show SomeMethod
33
39
instance Eq SomeMethod where
34
40
(==) = (==) `on` someMethodToMethodString
Original file line number Diff line number Diff line change 1
1
# Revision history for lsp
2
2
3
+ ## 2.0.0.1
4
+
5
+ * Fix handling of optional methods.
6
+
3
7
## 2.0.0.0
4
8
5
9
* Support ` lsp-types-2.0.0.0 ` .
Original file line number Diff line number Diff line change 1
1
cabal-version : 2.2
2
2
name : lsp
3
- version : 2.0.0.0
3
+ version : 2.0.0.1
4
4
synopsis : Haskell library for the Microsoft Language Server Protocol
5
5
description :
6
6
An implementation of the types, and basic message server to
@@ -63,7 +63,7 @@ library
63
63
, filepath
64
64
, hashable
65
65
, lens >= 4.15.2
66
- , lsp-types ^>= 2.0
66
+ , lsp-types ^>= 2.0.1
67
67
, mtl < 2.4
68
68
, prettyprinter
69
69
, random
Original file line number Diff line number Diff line change @@ -404,11 +404,8 @@ handle' logger mAction m msg = do
404
404
-- See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#-notifications-and-requests.
405
405
reportMissingHandler :: m ()
406
406
reportMissingHandler =
407
- let optional = isOptionalNotification m
407
+ let optional = isOptionalMethod ( SomeMethod m)
408
408
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
412
409
413
410
progressCancelHandler :: (m ~ LspM config ) => LogAction m (WithSeverity LspProcessingLog ) -> TMessage Method_WindowWorkDoneProgressCancel -> m ()
414
411
progressCancelHandler logger (TNotificationMessage _ _ (WorkDoneProgressCancelParams tid)) = do
You can’t perform that action at this time.
0 commit comments