Skip to content

Commit

Permalink
Merge branch 'master' into ApplicativeDo
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Apr 4, 2021
2 parents f9a7a99 + c2c02fb commit 8586abb
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 48 deletions.
2 changes: 1 addition & 1 deletion ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ library
utf8-string,
vector,
hslogger,
Diff,
Diff ^>=0.4.0,
vector,
bytestring-encoding,
opentelemetry >=0.6.1,
Expand Down
15 changes: 6 additions & 9 deletions ghcide/src/Development/IDE/LSP/LanguageServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ module Development.IDE.LSP.LanguageServer
( runLanguageServer
) where

import Control.Concurrent.Extra (newBarrier,
signalBarrier,
waitBarrier)
import Control.Concurrent.STM
import Control.Monad.Extra
import Control.Monad.IO.Class
Expand Down Expand Up @@ -56,12 +53,11 @@ runLanguageServer
-> IO ()
runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChange userHandlers getIdeState = do

-- These barriers are signaled when the threads reading from these chans exit.
-- This should not happen but if it does, we will make sure that the whole server
-- dies and can be restarted instead of losing threads silently.
clientMsgBarrier <- newBarrier
-- This MVar becomes full when the server thread exits or we receive exit message from client.
-- LSP loop will be canceled when it's full.
clientMsgVar <- newEmptyMVar
-- Forcefully exit
let exit = signalBarrier clientMsgBarrier ()
let exit = void $ tryPutMVar clientMsgVar ()

-- The set of requests ids that we have received but not finished processing
pendingRequests <- newTVarIO Set.empty
Expand Down Expand Up @@ -116,7 +112,7 @@ runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChan
inH
outH
serverDefinition
, void $ waitBarrier clientMsgBarrier
, void $ readMVar clientMsgVar
]

where
Expand Down Expand Up @@ -192,6 +188,7 @@ cancelHandler cancelRequest = LSP.notificationHandler SCancelRequest $ \Notifica
exitHandler :: IO () -> LSP.Handlers (ServerM c)
exitHandler exit = LSP.notificationHandler SExit $ const $ do
(_, ide) <- ask
liftIO $ logDebug (ideLogger ide) "Received exit message"
-- flush out the Shake session to record a Shake profile if applicable
liftIO $ shakeShut ide
liftIO exit
Expand Down
37 changes: 22 additions & 15 deletions hls-plugin-api/hls-plugin-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ version: 1.1.0.0
synopsis: Haskell Language Server API for plugin communication
description:
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
homepage: https://github.com/haskell/haskell-language-server/hls-plugin-api

homepage:
https://github.com/haskell/haskell-language-server/hls-plugin-api

bug-reports: https://github.com/haskell/haskell-language-server/issues
license: Apache-2.0
license-file: LICENSE
Expand Down Expand Up @@ -32,38 +35,42 @@ library
Ide.PluginUtils
Ide.Types

hs-source-dirs: src
hs-source-dirs: src
build-depends:
, aeson
, base >=4.12 && <5
, containers
, data-default
, Diff
, lsp ^>=1.2.0
, dependent-map
, dependent-sum
, Diff ^>=0.4.0
, dlist
, hashable
, hslogger
, lens
, lsp ^>=1.2.0
, opentelemetry
, process
, regex-tdfa >=1.3.1.0
, shake >=0.17.5
, text
, unordered-containers
, dependent-map
, dependent-sum
, dlist
, opentelemetry

if os(windows)
build-depends:
Win32
build-depends: Win32

else
build-depends:
unix
build-depends: unix

ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors
ghc-options:
-Wall -Wredundant-constraints -Wno-name-shadowing
-Wno-unticked-promoted-constructors

if flag(pedantic)
ghc-options: -Werror

default-language: Haskell2010
default-extensions: DataKinds, KindSignatures, TypeOperators
default-language: Haskell2010
default-extensions:
DataKinds
KindSignatures
TypeOperators
9 changes: 4 additions & 5 deletions plugins/hls-eval-plugin/hls-eval-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ build-type: Simple
extra-source-files:
LICENSE
README.md
test/testdata/*.yaml
test/testdata/*.hs
test/testdata/*.cabal
test/testdata/*.expected
test/testdata/*.hs
test/testdata/*.lhs
test/testdata/*.cabal
test/testdata/*.yaml

flag pedantic
description: Enable -Werror
Expand Down Expand Up @@ -53,7 +53,7 @@ library
, base >=4.12 && <5
, containers
, deepseq
, Diff
, Diff ^>=0.4.0
, directory
, dlist
, extra
Expand Down Expand Up @@ -111,7 +111,6 @@ test-suite tests
build-tool-depends: hls-eval-plugin:test-server -any
hs-source-dirs: test
main-is: Main.hs

build-depends:
, aeson
, base
Expand Down
42 changes: 24 additions & 18 deletions plugins/hls-hlint-plugin/hls-hlint-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ cabal-version: 2.2
name: hls-hlint-plugin
version: 1.0.0.1
synopsis: Hlint integration plugin with Haskell Language Server
description: Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme)
description:
Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme)

license: Apache-2.0
license-file: LICENSE
author: The Haskell IDE Team
Expand All @@ -23,51 +25,55 @@ flag ghc-lib
Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported

library
exposed-modules: Ide.Plugin.Hlint
hs-source-dirs: src
exposed-modules: Ide.Plugin.Hlint
hs-source-dirs: src
build-depends:
, aeson
, apply-refact >=0.9
, base >=4.12 && <5
, apply-refact >=0.9
, base >=4.12 && <5
, binary
, bytestring
, containers
, data-default
, deepseq
, Diff
, Diff ^>=0.4.0
, directory
, extra
, filepath
, ghc-exactprint >=0.6.3.4
, ghcide ^>= 1.1.0.0
, ghc-exactprint >=0.6.3.4
, ghcide ^>=1.1.0.0
, hashable
, lsp
, hlint >=3.2
, hls-plugin-api >= 1.0 && < 1.2
, hlint >=3.2
, hls-plugin-api >=1.0 && <1.2
, hslogger
, lens
, lsp
, regex-tdfa
, shake
, temporary
, text
, transformers
, unordered-containers

if (!flag(ghc-lib) && impl(ghc >=8.10.1) && impl(ghc <9.0.0))
build-depends: ghc ^>= 8.10
if ((!flag(ghc-lib) && impl(ghc >=8.10.1)) && impl(ghc <9.0.0))
build-depends: ghc ^>=8.10

else
build-depends:
, ghc
, ghc-lib ^>= 8.10.4.20210206
, ghc-lib-parser-ex ^>= 8.10
, ghc-lib ^>=8.10.4.20210206
, ghc-lib-parser-ex ^>=8.10

cpp-options: -DHLINT_ON_GHC_LIB

ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors
ghc-options:
-Wall -Wredundant-constraints -Wno-name-shadowing
-Wno-unticked-promoted-constructors

if flag(pedantic)
ghc-options: -Werror

default-language: Haskell2010
default-extensions: DataKinds, TypeOperators
default-language: Haskell2010
default-extensions:
DataKinds
TypeOperators

0 comments on commit 8586abb

Please sign in to comment.