Skip to content

Commit 7fe1fc0

Browse files
committed
merge upstream/master
2 parents 6c0652f + fb5e5c9 commit 7fe1fc0

File tree

6 files changed

+112
-143
lines changed

6 files changed

+112
-143
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ defaults: &defaults
7575

7676
version: 2
7777
jobs:
78-
stackage-lts19:
78+
stackage-lts21:
7979
environment:
80-
- STACK_FILE: "stack-lts19.yaml"
80+
- STACK_FILE: "stack-lts21.yaml"
8181
<<: *defaults
8282

8383
stackage-nightly:
@@ -90,5 +90,5 @@ workflows:
9090
version: 2
9191
multiple-ghcs:
9292
jobs:
93-
- stackage-lts19
93+
- stackage-lts21
9494
- stackage-nightly

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
, "**/stack*.yaml"
4242
, ".gitlab-ci.yaml"
4343
, ".gitlab/**"
44+
, "CODEOWNERS"
4445
]'
4546
# If we only change ghcide downstream packages we have not test ghcide itself
4647
- id: skip_ghcide_check

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/plugins/hls-code-range-plugin @kokobd
3131
/plugins/hls-splice-plugin @konn
3232
/plugins/hls-stylish-haskell-plugin @Ailrun
33-
/plugins/hls-tactics-plugin @isovector
33+
/plugins/hls-tactics-plugin
3434
/plugins/hls-stan-plugin @uhbif19
3535
/plugins/hls-explicit-record-fields-plugin @ozkutuk
3636
/plugins/hls-overloaded-record-dot-plugin @joyfulmantis

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

+23-24
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
{-# LANGUAGE ScopedTypeVariables #-}
1616
{-# LANGUAGE StrictData #-}
1717
{-# LANGUAGE TupleSections #-}
18+
{-# LANGUAGE TypeApplications #-}
1819
{-# LANGUAGE TypeFamilies #-}
1920
{-# LANGUAGE ViewPatterns #-}
20-
2121
{-# OPTIONS_GHC -Wno-orphans #-}
2222

2323
-- On 9.4 we get a new redundant constraint warning, but deleting the
@@ -422,7 +422,7 @@ codeActionProvider ideState _pluginId (CodeActionParams _ _ documentId _ context
422422

423423
where
424424
applyAllAction verTxtDocId =
425-
let args = Just $ toJSON (AA verTxtDocId)
425+
let args = Just $ toJSON (ApplyHint verTxtDocId Nothing)
426426
in LSP.CodeAction "Apply all hints" (Just LSP.CodeActionKind_QuickFix) Nothing Nothing Nothing Nothing Nothing args
427427

428428
-- |Some hints do not have an associated refactoring
@@ -437,14 +437,10 @@ resolveProvider :: Recorder (WithPriority Log) -> ResolveFunction IdeState Hlint
437437
resolveProvider recorder ideState _plId ca uri resolveValue = pluginResponse $ do
438438
file <- getNormalizedFilePath uri
439439
case resolveValue of
440-
(AA verTxtDocId) -> do
441-
edit <- ExceptT $ liftIO $ applyHint recorder ideState file Nothing verTxtDocId
442-
pure $ ca & LSP.edit ?~ edit
443-
(AO verTxtDocId pos hintTitle) -> do
444-
let oneHint = OneHint pos hintTitle
445-
edit <- ExceptT $ liftIO $ applyHint recorder ideState file (Just oneHint) verTxtDocId
440+
(ApplyHint verTxtDocId oneHint) -> do
441+
edit <- ExceptT $ liftIO $ applyHint recorder ideState file oneHint verTxtDocId
446442
pure $ ca & LSP.edit ?~ edit
447-
(IH verTxtDocId hintTitle ) -> do
443+
(IgnoreHint verTxtDocId hintTitle ) -> do
448444
edit <- ExceptT $ liftIO $ ignoreHint recorder ideState file verTxtDocId hintTitle
449445
pure $ ca & LSP.edit ?~ edit
450446

@@ -456,13 +452,13 @@ diagnosticToCodeActions verTxtDocId diagnostic
456452
, let isHintApplicable = "refact:" `T.isPrefixOf` code
457453
, let hint = T.replace "refact:" "" code
458454
, let suppressHintTitle = "Ignore hint \"" <> hint <> "\" in this module"
459-
, let suppressHintArguments = IH verTxtDocId hint
455+
, let suppressHintArguments = IgnoreHint verTxtDocId hint
460456
= catMaybes
461457
-- Applying the hint is marked preferred because it addresses the underlying error.
462458
-- Disabling the rule isn't, because less often used and configuration can be adapted.
463459
[ if | isHintApplicable
464460
, let applyHintTitle = "Apply hint \"" <> hint <> "\""
465-
applyHintArguments = AO verTxtDocId start hint ->
461+
applyHintArguments = ApplyHint verTxtDocId (Just $ OneHint start hint) ->
466462
Just (mkCodeAction applyHintTitle diagnostic (Just (toJSON applyHintArguments)) True)
467463
| otherwise -> Nothing
468464
, Just (mkCodeAction suppressHintTitle diagnostic (Just (toJSON suppressHintArguments)) False)
@@ -520,22 +516,25 @@ ignoreHint _recorder ideState nfp verTxtDocId ignoreHintTitle = do
520516
Nothing -> pure $ Left "Unable to get fileContents"
521517

522518
-- ---------------------------------------------------------------------
523-
data HlintResolveCommands = AA { verTxtDocId :: VersionedTextDocumentIdentifier}
524-
| AO { verTxtDocId :: VersionedTextDocumentIdentifier
525-
, start_pos :: Position
526-
-- | There can be more than one hint suggested at the same position, so HintTitle is used to distinguish between them.
527-
, hintTitle :: HintTitle
528-
}
529-
| IH { verTxtDocId :: VersionedTextDocumentIdentifier
530-
, ignoreHintTitle :: HintTitle
531-
} deriving (Generic, ToJSON, FromJSON)
519+
data HlintResolveCommands =
520+
ApplyHint
521+
{ verTxtDocId :: VersionedTextDocumentIdentifier
522+
-- |If Nothing, apply all hints, otherise only apply
523+
-- the given hint
524+
, oneHint :: Maybe OneHint
525+
}
526+
| IgnoreHint
527+
{ verTxtDocId :: VersionedTextDocumentIdentifier
528+
, ignoreHintTitle :: HintTitle
529+
} deriving (Generic, ToJSON, FromJSON)
532530

533531
type HintTitle = T.Text
534532

535-
data OneHint = OneHint
536-
{ oneHintPos :: Position
537-
, oneHintTitle :: HintTitle
538-
} deriving (Eq, Show)
533+
data OneHint =
534+
OneHint
535+
{ oneHintPos :: Position
536+
, oneHintTitle :: HintTitle
537+
} deriving (Generic, Eq, Show, ToJSON, FromJSON)
539538

540539
applyHint :: Recorder (WithPriority Log) -> IdeState -> NormalizedFilePath -> Maybe OneHint -> VersionedTextDocumentIdentifier -> IO (Either String WorkspaceEdit)
541540
applyHint recorder ide nfp mhint verTxtDocId =

stack-lts19.yaml renamed to stack-lts21.yaml

+30-40
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resolver: lts-19.19
1+
resolver: lts-21.2 # ghc-9.4
22

33
packages:
44
- .
@@ -9,61 +9,51 @@ packages:
99
- ./hls-plugin-api
1010
- ./hls-test-utils
1111
# - ./shake-bench
12-
- ./plugins/hls-cabal-plugin
12+
- ./plugins/hls-alternate-number-format-plugin
1313
- ./plugins/hls-cabal-fmt-plugin
14+
- ./plugins/hls-cabal-plugin
1415
- ./plugins/hls-call-hierarchy-plugin
16+
- ./plugins/hls-change-type-signature-plugin
1517
- ./plugins/hls-class-plugin
16-
- ./plugins/hls-haddock-comments-plugin
18+
- ./plugins/hls-code-range-plugin
1719
- ./plugins/hls-eval-plugin
20+
- ./plugins/hls-explicit-fixity-plugin
1821
- ./plugins/hls-explicit-imports-plugin
19-
- ./plugins/hls-refine-imports-plugin
20-
- ./plugins/hls-hlint-plugin
21-
- ./plugins/hls-rename-plugin
22-
- ./plugins/hls-retrie-plugin
23-
- ./plugins/hls-splice-plugin
24-
- ./plugins/hls-tactics-plugin
25-
- ./plugins/hls-qualify-imported-names-plugin
26-
- ./plugins/hls-stylish-haskell-plugin
22+
- ./plugins/hls-explicit-record-fields-plugin
2723
- ./plugins/hls-floskell-plugin
2824
- ./plugins/hls-fourmolu-plugin
29-
- ./plugins/hls-pragmas-plugin
25+
- ./plugins/hls-gadt-plugin
26+
# - ./plugins/hls-haddock-comments-plugin
27+
- ./plugins/hls-hlint-plugin
3028
- ./plugins/hls-module-name-plugin
3129
- ./plugins/hls-ormolu-plugin
32-
- ./plugins/hls-alternate-number-format-plugin
33-
- ./plugins/hls-code-range-plugin
34-
- ./plugins/hls-change-type-signature-plugin
35-
- ./plugins/hls-gadt-plugin
36-
- ./plugins/hls-explicit-fixity-plugin
30+
- ./plugins/hls-overloaded-record-dot-plugin
31+
- ./plugins/hls-pragmas-plugin
32+
- ./plugins/hls-qualify-imported-names-plugin
3733
- ./plugins/hls-refactor-plugin
38-
- ./plugins/hls-explicit-record-fields-plugin
34+
- ./plugins/hls-refine-imports-plugin
35+
- ./plugins/hls-rename-plugin
36+
- ./plugins/hls-retrie-plugin
37+
- ./plugins/hls-splice-plugin
38+
# - ./plugins/hls-stan-plugin
39+
- ./plugins/hls-stylish-haskell-plugin
40+
# - ./plugins/hls-tactics-plugin
3941

4042
ghc-options:
4143
"$everything": -haddock
4244

45+
# stylish-haskell>strict
46+
allow-newer: true
47+
4348
extra-deps:
44-
- Cabal-3.6.0.0
45-
# needed for tests of hls-cabal-fmt-plugin
46-
- cabal-fmt-0.1.6@sha256:54041d50c8148c32d1e0a67aef7edeebac50ae33571bef22312f6815908eac19,3626
47-
- floskell-0.10.6@sha256:e77d194189e8540abe2ace2c7cb8efafc747ca35881a2fefcbd2d40a1292e036,3819
48-
- fourmolu-0.6.0.0
49-
- ghc-lib-9.2.4.20220729
50-
- ghc-lib-parser-9.2.4.20220729
51-
- ghc-lib-parser-ex-9.2.0.4
49+
- floskell-0.10.7
5250
- hiedb-0.4.3.0
53-
- hlint-3.4
54-
- implicit-hie-0.1.2.7@sha256:82bbbb1a8c05f99c8af3c16ac53e80c8648d8bf047b25ed5ce45a135bd736907,3122
55-
- implicit-hie-cradle-0.5.0.0@sha256:4276f60f3a59bc22df03fd918f73bca9f777de9568f85e3a8be8bd7566234a59,2368
51+
- implicit-hie-0.1.2.7
52+
- implicit-hie-cradle-0.5.0.1
5653
- monad-dijkstra-0.1.1.3
57-
- ormolu-0.5.0.0
58-
- refinery-0.4.0.0@sha256:fe3a43add8ff1db5cfffee7e7694c86128b1dfe62c541f26e25a8eadf9585610,1663
59-
- retrie-1.1.0.0
60-
- stylish-haskell-0.14.2.0@sha256:fffe1c13ad4c2678cf28a7470cac5d3bf20c71c36f09969e3e5f186787cceb7c,4321
61-
- co-log-core-0.3.1.0
62-
- lsp-2.0.0.0
63-
- lsp-types-2.0.0.1
64-
- lsp-test-0.15.0.0
65-
- hie-bios-0.12.0
66-
- row-types-1.0.1.2
54+
- algebraic-graphs-0.6.1
55+
- retrie-1.2.2
56+
- stylish-haskell-0.14.4.0
6757

6858
configure-options:
6959
ghcide:
@@ -79,7 +69,7 @@ flags:
7969
# Stack doesn't support automatic flags.
8070
hyphenation:
8171
embed: true
82-
hlint:
72+
stylish-haskell:
8373
ghc-lib: true
8474

8575
nix:

stack.yaml

+54-75
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,78 @@
1-
resolver: nightly-2022-08-15
1+
resolver: nightly-2023-07-10 # ghc-9.6.2
22

33
packages:
4-
- .
5-
- ./hie-compat
6-
- ./hls-graph
7-
- ./ghcide/
8-
- ./ghcide/test
9-
- ./hls-plugin-api
10-
- ./hls-test-utils
11-
- ./shake-bench
12-
- ./plugins/hls-cabal-plugin
13-
- ./plugins/hls-cabal-fmt-plugin
14-
- ./plugins/hls-call-hierarchy-plugin
15-
- ./plugins/hls-class-plugin
16-
# - ./plugins/hls-haddock-comments-plugin
17-
- ./plugins/hls-eval-plugin
18-
- ./plugins/hls-explicit-imports-plugin
19-
- ./plugins/hls-qualify-imported-names-plugin
20-
- ./plugins/hls-refine-imports-plugin
21-
- ./plugins/hls-hlint-plugin
22-
- ./plugins/hls-rename-plugin
23-
# - ./plugins/hls-retrie-plugin
24-
# - ./plugins/hls-splice-plugin
25-
# - ./plugins/hls-tactics-plugin
26-
- ./plugins/hls-stylish-haskell-plugin
27-
- ./plugins/hls-floskell-plugin
28-
- ./plugins/hls-fourmolu-plugin
29-
- ./plugins/hls-pragmas-plugin
30-
- ./plugins/hls-module-name-plugin
31-
- ./plugins/hls-ormolu-plugin
32-
- ./plugins/hls-alternate-number-format-plugin
33-
- ./plugins/hls-code-range-plugin
34-
- ./plugins/hls-change-type-signature-plugin
35-
- ./plugins/hls-gadt-plugin
36-
- ./plugins/hls-explicit-fixity-plugin
37-
- ./plugins/hls-refactor-plugin
38-
- ./plugins/hls-explicit-record-fields-plugin
39-
- ./plugins/hls-overloaded-record-dot-plugin
4+
- .
5+
- ./hie-compat
6+
- ./hls-graph
7+
- ./ghcide/
8+
- ./ghcide/test
9+
- ./hls-plugin-api
10+
- ./hls-test-utils
11+
# - ./shake-bench
12+
- ./plugins/hls-alternate-number-format-plugin
13+
- ./plugins/hls-cabal-fmt-plugin
14+
- ./plugins/hls-cabal-plugin
15+
- ./plugins/hls-call-hierarchy-plugin
16+
- ./plugins/hls-change-type-signature-plugin
17+
- ./plugins/hls-class-plugin
18+
- ./plugins/hls-code-range-plugin
19+
- ./plugins/hls-eval-plugin
20+
- ./plugins/hls-explicit-fixity-plugin
21+
- ./plugins/hls-explicit-imports-plugin
22+
- ./plugins/hls-explicit-record-fields-plugin
23+
# - ./plugins/hls-floskell-plugin
24+
- ./plugins/hls-fourmolu-plugin
25+
- ./plugins/hls-gadt-plugin
26+
# - ./plugins/hls-haddock-comments-plugin
27+
- ./plugins/hls-hlint-plugin
28+
- ./plugins/hls-module-name-plugin
29+
- ./plugins/hls-ormolu-plugin
30+
- ./plugins/hls-overloaded-record-dot-plugin
31+
- ./plugins/hls-pragmas-plugin
32+
- ./plugins/hls-qualify-imported-names-plugin
33+
- ./plugins/hls-refactor-plugin
34+
- ./plugins/hls-refine-imports-plugin
35+
- ./plugins/hls-rename-plugin
36+
- ./plugins/hls-retrie-plugin
37+
- ./plugins/hls-splice-plugin
38+
# - ./plugins/hls-stan-plugin
39+
- ./plugins/hls-stylish-haskell-plugin
40+
# - ./plugins/hls-tactics-plugin
4041

41-
extra-deps:
42-
# needed for tests of hls-cabal-fmt-plugin
43-
- cabal-fmt-0.1.6@sha256:54041d50c8148c32d1e0a67aef7edeebac50ae33571bef22312f6815908eac19,3626
44-
- floskell-0.10.6@sha256:e77d194189e8540abe2ace2c7cb8efafc747ca35881a2fefcbd2d40a1292e036,3819
45-
- hiedb-0.4.3.0
46-
- implicit-hie-0.1.2.7@sha256:82bbbb1a8c05f99c8af3c16ac53e80c8648d8bf047b25ed5ce45a135bd736907,3122
47-
- implicit-hie-cradle-0.5.0.0@sha256:4276f60f3a59bc22df03fd918f73bca9f777de9568f85e3a8be8bd7566234a59,2368
48-
- monad-dijkstra-0.1.1.3@sha256:d2fc098d7c122555e726830a12ae0423ac187f89de9228f32e56e2f6fc2238e1,1900
49-
- retrie-1.2.0.1
50-
- co-log-core-0.3.1.0
51-
- lsp-2.0.0.0
52-
- lsp-types-2.0.0.1
53-
- lsp-test-0.15.0.0
54-
- hie-bios-0.12.0
55-
- row-types-1.0.1.2
42+
ghc-options:
43+
"$everything": -haddock
5644

57-
# currently needed for ghcide>extra, etc.
45+
# Remove this after https://github.com/haskell-works/hw-prim/pull/146 merged
5846
allow-newer: true
5947

60-
ghc-options:
61-
"$everything": -haddock
48+
extra-deps:
49+
# - floskell-0.10.7
50+
- hiedb-0.4.3.0
51+
- implicit-hie-0.1.2.7
52+
- implicit-hie-cradle-0.5.0.1
53+
- fourmolu-0.12.0.0
54+
- algebraic-graphs-0.6.1
55+
- retrie-1.2.2
56+
- hw-fingertree-0.1.2.1
57+
- hw-prim-0.6.3.2
58+
- ansi-terminal-0.11.5
6259

6360
configure-options:
6461
ghcide:
65-
- --disable-library-for-ghci
62+
- --disable-library-for-ghci
6663
haskell-language-server:
67-
- --disable-library-for-ghci
68-
heapsize:
69-
- --disable-library-for-ghci
64+
- --disable-library-for-ghci
7065

7166
flags:
7267
haskell-language-server:
7368
pedantic: true
74-
75-
ignore-plugins-ghc-bounds: true
76-
haddockComments: false
77-
retrie: false
78-
splice: false
79-
tactic: false
80-
8169
retrie:
8270
BuildExecutable: false
8371
# Stack doesn't support automatic flags.
84-
# Use ghc-lib force instead of ghc itself
85-
ghc-lib-parser-ex:
86-
auto: false
87-
hlint:
88-
ghc-lib: true
89-
stylish-haskell:
90-
ghc-lib: true
9172
hyphenation:
9273
embed: true
9374

9475
nix:
9576
packages: [ icu libcxx zlib ]
9677

9778
concurrent-tests: false
98-
99-
system-ghc: true

0 commit comments

Comments
 (0)