Skip to content

Commit 244aa04

Browse files
authored
Merge branch 'master' into ghcide-ca
2 parents 5e76ce7 + 94573be commit 244aa04

File tree

87 files changed

+1232
-889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1232
-889
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,9 @@ jobs:
135135
if: ${{ matrix.test }}
136136
run: LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="-j1"
137137

138+
- name: Test brittany plugin
139+
if: ${{ matrix.test }}
140+
env:
141+
HLS_TEST_EXE: hls
142+
HLS_WRAPPER_TEST_EXE: hls-wrapper
143+
run: cabal test hls-brittany-plugin || cabal test hls-brittany-plugin --test-options="-j1"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ For example, `haskell-language-server` allows you to choose the formatting provi
301301
This option obviously would not make sense for language servers for other languages, or even for other Haskell language servers (which need not even support formatting).
302302

303303
Here is a list of the additional settings currently supported by `haskell-language-server`, along with their setting key (you may not need to know this) and default:
304-
- Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with AGPL)
304+
- Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with the brittany plugin)
305305
- Format on imports (`haskell.formatOnImportOn`, default true): whether to format after adding an import
306306
- Maximum number of problems to report (`haskell.maxNumberOfProblems`, default 100): the maximum number of problems the server will send to the client
307307
- Diagnostics on change (`haskell.diagnosticsOnChange`, default true): (currently unused)
@@ -648,7 +648,7 @@ This issue should be fixed in Stack versions >= 2.5.
648648
#### Problems with dynamic linking
649649

650650
As haskell-language-server prebuilt binaries are statically linked, they don't play well with projects using dynamic linking.
651-
An usual symptom is the presence of errors containing `unknown symbol` and it is typical in arch linux, where a dynamically linked version of ghc is used.
651+
An usual symptom is the presence of errors containing `unknown symbol` and it is typical in arch linux, where a dynamically linked version of ghc is used.
652652

653653
The workaround is to use a version of haskell-language-server compiled from source with `-dynamic` enabled`. See more details [here](https://github.com/haskell/haskell-language-server/issues/1160#issuecomment-756566273).
654654

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ packages:
55
./ghcide
66
./hls-plugin-api
77
./plugins/hls-tactics-plugin
8+
./plugins/hls-brittany-plugin
89
./plugins/hls-class-plugin
910
./plugins/hls-eval-plugin
1011
./plugins/hls-explicit-imports-plugin

docs/plugin-tutorial.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ idePlugins = pluginDescToIdePlugins allPlugins
9696
, Ormolu.descriptor "ormolu"
9797
, StylishHaskell.descriptor "stylish-haskell"
9898
, Retrie.descriptor "retrie"
99-
#if AGPL
10099
, Brittany.descriptor "brittany"
101-
#endif
102100
, Eval.descriptor "eval"
103101
]
104102
```

exe/Plugins.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import Ide.Plugin.Ormolu as Ormolu
7171
import Ide.Plugin.StylishHaskell as StylishHaskell
7272
#endif
7373

74-
#if AGPL && brittany
74+
#if brittany
7575
import Ide.Plugin.Brittany as Brittany
7676
#endif
7777

ghcide/exe/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ main = do
8888
Typecheck x | not argLSP -> Just x
8989
_ -> Nothing
9090

91-
,Main.argsLogger = logger
91+
,Main.argsLogger = pure logger
9292

9393
,Main.argsRules = do
9494
-- install the main and ghcide-plugin rules

ghcide/ghcide.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: 2.2
22
build-type: Simple
33
category: Development
44
name: ghcide
5-
version: 1.0.0.0
5+
version: 1.1.0.0
66
license: Apache-2.0
77
license-file: LICENSE
88
author: Digital Asset and Ghcide contributors

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
395395
lfp <- flip makeRelative cfp <$> getCurrentDirectory
396396
logInfo logger $ T.pack ("Consulting the cradle for " <> show lfp)
397397

398-
when (isNothing hieYaml) $ mRunLspT lspEnv $
399-
sendNotification SWindowShowMessage $ notifyUserImplicitCradle lfp
398+
when (isNothing hieYaml) $
399+
logWarning logger $ implicitCradleWarning lfp
400400

401401
cradle <- maybe (loadImplicitHieCradle $ addTrailingPathSeparator dir) loadCradle hieYaml
402402

@@ -820,8 +820,8 @@ getCacheDirsDefault prefix opts = do
820820
cacheDir :: String
821821
cacheDir = "ghcide"
822822

823-
notifyUserImplicitCradle:: FilePath -> ShowMessageParams
824-
notifyUserImplicitCradle fp =ShowMessageParams MtWarning $
823+
implicitCradleWarning :: FilePath -> T.Text
824+
implicitCradleWarning fp =
825825
"No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for "
826826
<> T.pack fp <>
827827
".\n Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).\n"<>

ghcide/src/Development/IDE.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import Development.IDE.Core.IdeConfiguration as X (IdeConfiguration (.
1212
isWorkspaceFile)
1313
import Development.IDE.Core.OfInterest as X (getFilesOfInterest)
1414
import Development.IDE.Core.RuleTypes as X
15-
import Development.IDE.Core.Rules as X (getAtPoint,
15+
import Development.IDE.Core.Rules as X (IsHiFileStable (..),
16+
getAtPoint,
1617
getClientConfigAction,
1718
getDefinition,
1819
getParsedModule,
@@ -21,10 +22,12 @@ import Development.IDE.Core.Service as X (runAction)
2122
import Development.IDE.Core.Shake as X (FastResult (..),
2223
IdeAction (..),
2324
IdeRule, IdeState,
25+
RuleBody (..),
2426
ShakeExtras,
2527
actionLogger,
2628
define,
2729
defineEarlyCutoff,
30+
defineNoDiagnostics,
2831
getClientConfig,
2932
getPluginConfig,
3033
ideLogger,

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,12 @@ import Control.Concurrent.STM hiding (orElse)
115115
import Data.Aeson (toJSON)
116116
import Data.Binary
117117
import Data.Binary.Put
118-
import Data.Bits (shiftR)
119118
import qualified Data.ByteString.Lazy as LBS
120119
import Data.Coerce
121120
import Data.Functor
122121
import qualified Data.HashMap.Strict as HashMap
123122
import Data.Tuple.Extra (dupe)
124123
import Data.Unique
125-
import Data.Word
126-
import Foreign.Marshal.Array (withArrayLen)
127124
import GHC.Fingerprint
128125
import qualified Language.LSP.Server as LSP
129126
import qualified Language.LSP.Types as LSP

0 commit comments

Comments
 (0)