Skip to content

Enable rename plugin #2598

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

Closed
wants to merge 2 commits into from
Closed
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/hackage.yml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ jobs:
"hls-refine-imports-plugin", "hls-retrie-plugin",
"hls-splice-plugin", "hls-tactics-plugin",
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
"hls-qualify-imported-names-plugin",
"hls-qualify-imported-names-plugin", "hls-rename-plugin",
"haskell-language-server"]
ghc: [ "9.0.2"
, "8.10.7"
6 changes: 6 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@ You can watch demos for some of these features [below](#demos).
- [Call hierarchy support](#call-hierarchy)
- [Qualify names from an import declaration](#qualify-imported-names) in your code
- [Suggest alternate numeric formats](#alternate-number-formatting)
- [Renaming](#renaming) definitions automatically across modules of *the same component* (library, executable, test suite, benchmark).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct. Renaming works across all modules that have been indexed (in this or previous sessions).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, thanks, please, could you note in which cases the lack of multicomponent support could affect the plugin behaviour? does it work for the components currently loaded? so if you open files from components forcing their loading, the renaming would work across those loaded components (and no others)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you note in which cases the lack of multicomponent support could affect the plugin behaviour?

I already said: the plugin will rename all occurrences that have been indexed in this or previous IDE sessions.

One example where the plugin would fail to find some occurrences is the first time a project has been loaded in the IDE ever, and only a subset of the components are loaded.

does it work for the components currently loaded?

It works for all the components indexed, whether they are loaded or not.

so if you open files from components forcing their loading, the renaming would work across those loaded components (and no others)?

If you open a file from a component, that will cause the component to be fully indexed. So assuming that you wait until indexing is done, the plugin will work for that component.

Copy link
Member Author

@jneira jneira Jan 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so indexed as indexed in hiedb, i guess, thanks for the clarification
Afaiu, as we have the option haskell.checkProject, hls by default would index the entire the project opening any file from it, right?
If it is set to false the best way to ensure the last version of files are indexes would open all files where the symbol to berenamed i present.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaiu, as we have the option haskell.checkProject, hls by default would index the entire the project opening any file from it, right?

If by project you mean component, then yes.

If it is set to false the best way to ensure the last version of files are indexes would open all files where the symbol to berenamed i present.

If it is set to false, components won't be indexed in full on open. So you could just open all the files in the workspace.

- Full renaming support for the entire project is being tracked in [this issue](https://github.com/haskell/haskell-language-server/issues/2193)

## Demos

@@ -56,3 +58,7 @@ You can watch demos for some of these features [below](#demos).
### Alternate Number Formatting

![Alternate Number Format Demo](../plugins/hls-alternate-number-format-plugin/HLSAll.gif)

### Renaming

![Rename Demo](https://user-images.githubusercontent.com/30090176/133072143-d7d03ec7-3db1-474e-ad5e-6f40d75ff7ab.gif)
2 changes: 1 addition & 1 deletion haskell-language-server.cabal
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ flag refineImports

flag rename
description: Enable rename plugin
default: False
default: True
manual: True

flag retrie