Skip to content

Commit 5714207

Browse files
authored
[ghc-9.2] Fix qualify-imported-names plugin (#2600)
* [ghc-9.2] Fix qualify-imported-names plugin * Drop default-true plugin flags from stack-9.2.1.yaml
1 parent 3024c80 commit 5714207

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226
name: Test hls-alternate-number-format-plugin test suite
227227
run: cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" || cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS"
228228

229-
- if: matrix.test && matrix.ghc != '9.2.1'
229+
- if: matrix.test
230230
name: Test hls-qualify-imported-names-plugin test suite
231231
run: cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" || cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS"
232232

cabal-ghc921.project

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ constraints:
5959
-eval
6060
-haddockComments
6161
-hlint
62-
-qualifyImportedNames
6362
-refineImports
6463
-retrie
6564
-splice

plugins/hls-qualify-imported-names-plugin/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
- Names are qualified by the imported module's alias if it has one, otherwise by the imported module's name.
1414
- If the import declaration has an explicit import list then the plugin will qualify only names on the list.
1515
- If the import declaration has an explicit hiding list then the plugin will qualify names from the imported module that are not on the list.
16-
16+
1717
## Change log
18+
### 1.0.0.1
19+
- GHC 9.2.1 compatibility
1820
### 1.0.0.0
1921
- Released...

plugins/hls-qualify-imported-names-plugin/hls-qualify-imported-names-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.2
22
name: hls-qualify-imported-names-plugin
3-
version: 1.0.0.0
3+
version: 1.0.0.1
44
synopsis: A Haskell Language Server plugin that qualifies imported names
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>

plugins/hls-qualify-imported-names-plugin/src/Ide/Plugin/QualifyImportedNames.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import Development.IDE.GHC.Compat (ContextInfo (Use),
4242
SrcSpan,
4343
TcGblEnv (tcg_rdr_env),
4444
emptyUFM, globalRdrEnvElts,
45-
gre_imp, gre_name,
45+
gre_imp, gre_name, locA,
4646
lookupNameEnv,
4747
moduleNameString,
4848
nameOccName, occNameString,
@@ -96,8 +96,7 @@ findLImportDeclAt range parsedModule
9696
| ParsedModule {..} <- parsedModule
9797
, L _ hsModule <- pm_parsed_source
9898
, locatedImportDecls <- hsmodImports hsModule =
99-
find (\ (L srcSpan _) -> isRangeWithinSrcSpan range srcSpan) locatedImportDecls
100-
| otherwise = Nothing
99+
find (\ (L (locA -> srcSpan) _) -> isRangeWithinSrcSpan range srcSpan) locatedImportDecls
101100

102101
makeCodeActions :: Uri -> [TextEdit] -> [a |? CodeAction]
103102
makeCodeActions uri textEdits = [InR CodeAction {..} | not (null textEdits)]

stack-9.2.1.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ flags:
100100
haddockComments: false
101101
hlint: false
102102
importLens: false
103-
moduleName: true
104103
ormolu: false
105-
qualifyImportedNames: false
106104
refineImports: false
107105
retrie: false
108106
splice: false

0 commit comments

Comments
 (0)