Skip to content

[ghc-9.2] Fix qualify-imported-names plugin #2600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ jobs:
name: Test hls-alternate-number-format-plugin test suite
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"

- if: matrix.test && matrix.ghc != '9.2.1'
- if: matrix.test
name: Test hls-qualify-imported-names-plugin test suite
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"

Expand Down
1 change: 0 additions & 1 deletion cabal-ghc921.project
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ constraints:
-eval
-haddockComments
-hlint
-qualifyImportedNames
-refineImports
-retrie
-splice
Expand Down
4 changes: 3 additions & 1 deletion plugins/hls-qualify-imported-names-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
- Names are qualified by the imported module's alias if it has one, otherwise by the imported module's name.
- If the import declaration has an explicit import list then the plugin will qualify only names on the list.
- 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.

## Change log
### 1.0.0.1
- GHC 9.2.1 compatibility
### 1.0.0.0
- Released...
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: hls-qualify-imported-names-plugin
version: 1.0.0.0
version: 1.0.0.1
synopsis: A Haskell Language Server plugin that qualifies imported names
description:
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Development.IDE.GHC.Compat (ContextInfo (Use),
SrcSpan,
TcGblEnv (tcg_rdr_env),
emptyUFM, globalRdrEnvElts,
gre_imp, gre_name,
gre_imp, gre_name, locA,
lookupNameEnv,
moduleNameString,
nameOccName, occNameString,
Expand Down Expand Up @@ -96,8 +96,7 @@ findLImportDeclAt range parsedModule
| ParsedModule {..} <- parsedModule
, L _ hsModule <- pm_parsed_source
, locatedImportDecls <- hsmodImports hsModule =
find (\ (L srcSpan _) -> isRangeWithinSrcSpan range srcSpan) locatedImportDecls
| otherwise = Nothing
find (\ (L (locA -> srcSpan) _) -> isRangeWithinSrcSpan range srcSpan) locatedImportDecls

makeCodeActions :: Uri -> [TextEdit] -> [a |? CodeAction]
makeCodeActions uri textEdits = [InR CodeAction {..} | not (null textEdits)]
Expand Down
2 changes: 0 additions & 2 deletions stack-9.2.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ flags:
haddockComments: false
hlint: false
importLens: false
moduleName: true
ormolu: false
qualifyImportedNames: false
refineImports: false
retrie: false
splice: false
Expand Down