Skip to content

Commit 6111a10

Browse files
authored
Add resolve support in refine imports by merging it with explicit imports (#3729)
1 parent ec1e6c1 commit 6111a10

Some content is hidden

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

49 files changed

+358
-893
lines changed

.github/workflows/hackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
"hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin",
3535
"hls-haddock-comments-plugin", "hls-hlint-plugin", "hls-stan-plugin",
3636
"hls-module-name-plugin", "hls-pragmas-plugin",
37-
"hls-refine-imports-plugin", "hls-rename-plugin", "hls-retrie-plugin",
37+
"hls-rename-plugin", "hls-retrie-plugin",
3838
"hls-splice-plugin", "hls-tactics-plugin",
3939
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
4040
"hls-qualify-imported-names-plugin", "hls-code-range-plugin",

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ jobs:
179179
name: Test hls-tactics-plugin test suite
180180
run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || cabal test hls-tactics-plugin --test-options="$TEST_OPTS"
181181

182-
- if: matrix.test
183-
name: Test hls-refine-imports-plugin test suite
184-
run: cabal test hls-refine-imports-plugin --test-options="$TEST_OPTS" || cabal test hls-refine-imports-plugin --test-options="$TEST_OPTS"
185-
186182
- if: matrix.test
187183
name: Test hls-explicit-imports-plugin test suite
188184
run: cabal test hls-explicit-imports-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-imports-plugin --test-options="$TEST_OPTS"

CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
/plugins/hls-ormolu-plugin @georgefst
2424
/plugins/hls-pragmas-plugin @berberman @Ailrun @eddiemundo
2525
/plugins/hls-qualify-imported-names-plugin @eddiemundo
26-
/plugins/hls-refine-imports-plugin
2726
/plugins/hls-rename-plugin @OliverMadine
2827
/plugins/hls-refactor-plugin @santiweight
2928
/plugins/hls-retrie-plugin @pepeiborra

bench/config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ configurations:
140140
- ormolu
141141
- pragmas
142142
- qualifyImportedNames
143-
- refineImports
144143
- rename
145144
- stylish-haskell
146145
# - alternateNumberFormat
@@ -168,7 +167,6 @@ configurations:
168167
# # - ormolu
169168
# - pragmas
170169
# - qualifyImportedNames
171-
# - refineImports
172170
# - rename
173171
# - retrie
174172
# - splice

cabal.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ packages:
1616
./plugins/hls-class-plugin
1717
./plugins/hls-eval-plugin
1818
./plugins/hls-explicit-imports-plugin
19-
./plugins/hls-refine-imports-plugin
2019
./plugins/hls-hlint-plugin
2120
./plugins/hls-rename-plugin
2221
./plugins/hls-retrie-plugin

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Here is a list of the additional settings currently supported by `haskell-langua
5050
Plugins have a generic config to control their behaviour. The schema of such config is:
5151

5252
- `haskell.plugin.${pluginName}.globalOn`: usually with default true. Whether the plugin is enabled at runtime or it is not. That is the option you might use if you want to disable completely a plugin.
53-
- Actual plugin names are: `ghcide-code-actions-fill-holes`, `ghcide-completions`, `ghcide-hover-and-symbols`, `ghcide-type-lenses`, `ghcide-code-actions-type-signatures`, `ghcide-code-actions-bindings`, `ghcide-code-actions-imports-exports`, `eval`, `moduleName`, `pragmas`, `refineImports`, `importLens`, `class`, `tactics` (aka wingman), `hlint`, `haddockComments`, `retrie`, `rename`, `splice`, `stan`.
53+
- Actual plugin names are: `ghcide-code-actions-fill-holes`, `ghcide-completions`, `ghcide-hover-and-symbols`, `ghcide-type-lenses`, `ghcide-code-actions-type-signatures`, `ghcide-code-actions-bindings`, `ghcide-code-actions-imports-exports`, `eval`, `moduleName`, `pragmas`, `importLens`, `class`, `tactics` (aka wingman), `hlint`, `haddockComments`, `retrie`, `rename`, `splice`, `stan`.
5454
- So to disable the import lens with an explicit list of module definitions you could set `haskell.plugin.importLens.globalOn: false`
5555
- `haskell.plugin.${pluginName}.${lspCapability}On`: usually with default true. Whether a concrete plugin capability is enabled.
5656
- Capabilities are the different ways a lsp server can interact with the editor. The current available capabilities of the server are: `callHierarchy`, `codeActions`, `codeLens`, `diagnostics`, `hover`, `symbols`, `completion`, `rename`.

docs/features.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ Code action kind: `quickfix.literals.style`
180180

181181
Make import lists fully explicit (same as the code lens).
182182

183+
### Refine import
184+
185+
Provided by: `hls-explicit-imports-plugin`
186+
187+
Code action kind: `quickfix.import.refine`
188+
189+
Refines imports to more specific modules when names are re-exported (same as the code lens).
190+
183191
### Qualify imported names
184192

185193
Provided by: `hls-qualify-imported-names-plugin`
@@ -192,14 +200,6 @@ Rewrites imported names to be qualified.
192200

193201
For usage see the ![readme](../plugins/hls-qualify-imported-names-plugin/README.md).
194202

195-
### Refine import
196-
197-
Provided by: `hls-refine-imports-plugin`
198-
199-
Code action kind: `quickfix.import.refine`
200-
201-
Refines imports to more specific modules when names are re-exported (same as the code lens).
202-
203203
### Add missing class methods
204204

205205
Provided by: `hls-class-plugin`
@@ -354,7 +354,7 @@ Shows fully explicit import lists and rewrites them with a click (same as the co
354354

355355
### Refine import code lens
356356

357-
Provided by: `hls-refine-imports-plugin`
357+
Provided by: `hls-explicit-imports-plugin`
358358

359359
Shows refined imports and applies them with a click (same as the code action).
360360

docs/support/plugin-support.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ For example, a plugin to provide a formatter which has itself been abandoned has
5959
| `hls-qualify-imported-names-plugin` | 2 | |
6060
| `hls-ormolu-plugin` | 2 | |
6161
| `hls-rename-plugin` | 2 | |
62-
| `hls-refine-imports-plugin` | 2 | |
6362
| `hls-stylish-haskell-plugin` | 2 | |
6463
| `hls-tactics-plugin` | 2 | 9.2, 9.4, 9.6 |
6564
| `hls-overloaded-record-dot-plugin` | 2 | 8.10, 9.0 |

haskell-language-server.cabal

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ flag importLens
9494
default: True
9595
manual: True
9696

97-
flag refineImports
98-
description: Enable refineImports plugin
99-
default: True
100-
manual: True
101-
10297
flag rename
10398
description: Enable rename plugin
10499
default: True
@@ -251,11 +246,6 @@ common importLens
251246
build-depends: hls-explicit-imports-plugin == 2.1.0.0
252247
cpp-options: -Dhls_importLens
253248

254-
common refineImports
255-
if flag(refineImports)
256-
build-depends: hls-refine-imports-plugin == 2.1.0.0
257-
cpp-options: -Dhls_refineImports
258-
259249
common rename
260250
if flag(rename)
261251
build-depends: hls-rename-plugin == 2.1.0.0
@@ -377,7 +367,6 @@ library
377367
, haddockComments
378368
, eval
379369
, importLens
380-
, refineImports
381370
, rename
382371
, retrie
383372
, tactic

0 commit comments

Comments
 (0)