Skip to content

Commit

Permalink
GHC 9.10 compatibility (#133)
Browse files Browse the repository at this point in the history
Update libraries

---------

Co-authored-by: Joseph Sumabat <josephrsumabat@gmail.com>
  • Loading branch information
9999years and josephsumabat authored Oct 30, 2024
1 parent a67cece commit d315986
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 151 deletions.
22 changes: 11 additions & 11 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ packages:

source-repository-package
type: git
location: https://github.com/oberblastmeister/tree-sitter-simple.git
tag: 309ac26ecbb94e6f534bff5c4c5c6a50808397e0
location: https://github.com/josephsumabat/tree-sitter-simple.git
tag: 64f8a19b7e65a4a572770a92085f872caf212833
subdir: tree-sitter-simple

source-repository-package
type: git
location: https://github.com/oberblastmeister/tree-sitter-simple.git
tag: 309ac26ecbb94e6f534bff5c4c5c6a50808397e0
location: https://github.com/josephsumabat/tree-sitter-simple.git
tag: 64f8a19b7e65a4a572770a92085f872caf212833
subdir: tree-sitter-haskell

source-repository-package
type: git
location: https://github.com/oberblastmeister/tree-sitter-simple.git
tag: 309ac26ecbb94e6f534bff5c4c5c6a50808397e0
location: https://github.com/josephsumabat/tree-sitter-simple.git
tag: 64f8a19b7e65a4a572770a92085f872caf212833
subdir: tree-sitter-ast

source-repository-package
type: git
location: https://github.com/oberblastmeister/tree-sitter-simple.git
tag: 309ac26ecbb94e6f534bff5c4c5c6a50808397e0
location: https://github.com/josephsumabat/tree-sitter-simple.git
tag: 64f8a19b7e65a4a572770a92085f872caf212833
subdir: haskell-ast

source-repository-package
type: git
location: https://github.com/oberblastmeister/tree-sitter-simple.git
tag: 309ac26ecbb94e6f534bff5c4c5c6a50808397e0
location: https://github.com/josephsumabat/tree-sitter-simple.git
tag: 64f8a19b7e65a4a572770a92085f872caf212833
subdir: text-range

source-repository-package
type: git
location: https://github.com/oberblastmeister/tasty-expect.git
tag: ec14d702660c79a907e9c45812958cd0df0f036f

test-show-details: direct
test-show-details: direct
9 changes: 5 additions & 4 deletions nix/overlays/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Keep this up to date with cabal.project
let
tree-sitter-simple-repo = {
url = "https://github.com/oberblastmeister/tree-sitter-simple";
sha256 = "sha256-8i2NYbILmGDH+0EIQ/UzRoyuonWzyAqFD06vbjEJH2g=";
rev = "309ac26ecbb94e6f534bff5c4c5c6a50808397e0";
url = "https://github.com/josephsumabat/tree-sitter-simple";
sha256 = "sha256-Taje8q2fYZzA68sSt8f9/oCDdYjTWegfoYusQtmrz8A=";
rev = "64f8a19b7e65a4a572770a92085f872caf212833";
fetchSubmodules = true;
};

Expand Down Expand Up @@ -49,7 +49,8 @@ in
hiedb = self.haskell.lib.dontCheck (haskellSuper.callHackage "hiedb" "0.6.0.1" {});
text-rope = haskellSuper.callHackage "text-rope" "0.2" {};

lsp = haskellSuper.callHackage "lsp" "2.4.0.0" {};
lsp-types = haskellSuper.callHackage "lsp-types" "2.3.0.0" {};
lsp = haskellSuper.callHackage "lsp" "2.7.0.0" {};
};
};
}
14 changes: 7 additions & 7 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ tested-with:

dependencies:
- array >= 0.5.4 && < 0.6
- base >= 4.17.0 && < 4.19
- containers >= 0.6.0 && < 0.7
- base >= 4.17.0 && < 4.21
- containers >= 0.6.0 && < 0.8
- unordered-containers >= 0.2 && < 0.3
- errors >= 2.3.0 && < 2.4
- extra >= 1.7.12 && < 1.8
- directory >= 1.3.7 && < 1.4
- filepath
- ghc >= 9.4.3 && < 9.7
- ghc >= 9.4.3 && < 9.11
- ghc-paths >= 0.1.0 && < 0.2
- haskell-lexer >=1.1.1 && <1.2.0
- hiedb >= 0.6 && < 0.7
- lsp == 2.4.0.0
- lsp-types == 2.1.0.0
- lsp == 2.7.0.0
- lsp-types == 2.3.0.0
- mtl >= 2.2.2 && < 2.4
- parsec >= 3.1.0 && < 3.2
- sqlite-simple >= 0.4.18 && < 0.5
- template-haskell >= 2.19.0 && < 2.21
- text >= 2.0.1 && < 2.1
- template-haskell >= 2.19.0 && < 2.23
- text >= 2.0.1 && < 2.2
- bytestring >=0.10 && <0.13
- transformers >= 0.5.6.2 && < 0.7
- unliftio-core >= 0.2.1 && < 0.3
Expand Down
9 changes: 4 additions & 5 deletions src/StaticLS/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Data.Text qualified as T
import Language.LSP.Logging qualified as LSP.Logging
import Language.LSP.Protocol.Message (
Method (..),
ResponseError (..),
TMessage,
)
import Language.LSP.Protocol.Message qualified as LSP
Expand Down Expand Up @@ -114,7 +113,7 @@ initServer ::
LoggerM IO ->
LanguageContextEnv LspConfig ->
TMessage 'Method_Initialize ->
IO (Either ResponseError (LanguageContextEnv LspConfig))
IO (Either (LSP.TResponseError Method_Initialize) (LanguageContextEnv LspConfig))
initServer reactorChan staticEnvOptions logger serverConfig _ = do
runExceptT $ do
wsRoot <- ExceptT $ LSP.runLspT serverConfig getWsRoot
Expand All @@ -127,11 +126,11 @@ initServer reactorChan staticEnvOptions logger serverConfig _ = do
Conc.writeChan reactorChan $ ReactorMsgLspAct Handlers.handleGhcidFileChange
pure serverConfig
where
getWsRoot :: LSP.LspM config (Either ResponseError FilePath)
getWsRoot :: LSP.LspM config (Either (LSP.TResponseError Method_Initialize) FilePath)
getWsRoot = do
mRootPath <- LSP.getRootPath
pure $ case mRootPath of
Nothing -> Left $ ResponseError (InR ErrorCodes_InvalidRequest) "No root workspace was found" Nothing
Nothing -> Left $ LSP.TResponseError (InR ErrorCodes_InvalidRequest) "No root workspace was found" Nothing
Just p -> Right p

serverDef :: StaticEnvOptions -> LoggerM IO -> IO (ServerDefinition ())
Expand Down Expand Up @@ -205,7 +204,7 @@ serverDef argOptions logger = do
Exception.catchAny m $ \e ->
logException e

respondWithError res e = res $ Left $ ResponseError (InR ErrorCodes_InvalidRequest) ("An error was caught: " <> T.pack (show e)) Nothing
respondWithError res e = res $ Left $ LSP.TResponseError (InR ErrorCodes_InvalidRequest) ("An error was caught: " <> T.pack (show e)) Nothing

logException e = do
LSP.Logging.logToLogMessage Colog.<& Colog.WithSeverity (T.pack (show e)) Colog.Error
Expand Down
Loading

0 comments on commit d315986

Please sign in to comment.