Skip to content

Commit cc862ff

Browse files
authored
Merge branch 'master' into stack-ghc-9.2.1
2 parents 064c696 + 905f8f7 commit cc862ff

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
![Qualify Imported Names Demo](qualify-imported-names-demo.gif)
44

5+
## Summary
6+
7+
Rewrite imported names to be qualified.
8+
9+
## Motivation
10+
11+
You've imported a number of modules, and have written a lot of code with unqualified names. You want to import a new module but you know there will be a number name clashes so you want to switch your current usage of names to be qualified.
12+
13+
It would be nice if you could change
14+
```
15+
import Blah
16+
```
17+
to
18+
```
19+
import Blah as Bloo
20+
```
21+
then magically qualify all the previous names imported from `Blah` with `Bloo`. After doing that you could then change
22+
```
23+
import Blah as Bloo
24+
```
25+
to
26+
```
27+
import qualified Blah as Bloo
28+
```
29+
and import your the new module using names from it without worry.
30+
31+
Well, now you can...
32+
533
## Usage
634

735
1. Put cursor over the import declaration you want to qualify names from.
@@ -14,6 +42,9 @@
1442
- If the import declaration has an explicit import list then the plugin will qualify only names on the list.
1543
- 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.
1644

45+
## Future possibilities
46+
- It may be possible to use the LSP rename functionality to ask for a name so that we don't have to do the `as Alias` dance.
47+
1748
## Change log
1849
### 1.0.0.1
1950
- GHC 9.2.1 compatibility

src/Ide/Arguments.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ probeToolsParser exeName =
9595
listPluginsParser :: Parser Arguments
9696
listPluginsParser =
9797
flag' ListPluginsMode
98-
(long "list-plugins" <> help "List all avaliable plugins")
98+
(long "list-plugins" <> help "List all available plugins")
9999

100100
arguments :: IdePlugins IdeState -> Parser GhcideArguments
101101
arguments plugins = GhcideArguments

0 commit comments

Comments
 (0)