Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Remove language extension completions. #948

Conversation

gdevanla
Copy link
Contributor

@gdevanla gdevanla commented Dec 10, 2020

This PR removes Completions and CodeActions from ghcide thus de-duping the same functionality they is currently available in HLS through the Pragmas plugin module here

Also addresses (haskell/haskell-language-server#380)

@gdevanla gdevanla marked this pull request as ready for review December 10, 2020 15:03
@pepeiborra
Copy link
Collaborator

Did you port the tests too?

@gdevanla
Copy link
Contributor Author

Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

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

Thank you @gdevanla !

@pepeiborra
Copy link
Collaborator

I reviewed the existing tests in HLS. I think they provide similar coverage consistent with the tests I removed. Here are the tests I looked at

https://github.com/haskell/haskell-language-server/blob/8f8aa7f50dac2a1952fa187e4eb9b9e29e6e76f2/test/functional/FunctionalCodeAction.hs#L368-L403

https://github.com/haskell/haskell-language-server/blob/8f8aa7f50dac2a1952fa187e4eb9b9e29e6e76f2/test/functional/Completion.hs#L96-L124

I'm not convinced that the tests in HLS provide the same coverage. In particular, they do not check that completions for specific language pragmas are generated.

@gdevanla
Copy link
Contributor Author

Um. I am sorry I don't understand. I did not remove any completion test. I just added a test to make sure we don't provide any pragma related completions from ghcide.

Perhaps, you are referring to 'CodeActions'? If yes, I see the HLS tests are checking for specific pragmas, though they are not the same pragmas ghcide tests are covering. I assume, we would not need tests for all kinds of pragmas.

Please could you clarify and I can address them.

@pepeiborra
Copy link
Collaborator

pepeiborra commented Dec 13, 2020

You are right, I didn't look closely enough at those tests and thought they were checking for completions, but they are not.

Please fix the conflicts and this is ready to merge.

@gdevanla gdevanla force-pushed the remove-language-extension-completion-code-action branch from f90bb6a to 60d1a31 Compare December 13, 2020 13:13
@pepeiborra pepeiborra merged commit cd0878b into haskell:master Dec 13, 2020
pepeiborra added a commit to haskell/haskell-language-server that referenced this pull request Dec 28, 2020
The ghcide merge includes haskell/ghcide#948
which removes the language extension code actions

This makes the associated func-test fail, because the HLS plugin does not pass
the test (only the ghcide code action did). This is because the HLS plugin uses
commands, and the tests do not wait for the command edit to be applied.

The fix is to change the HLS plugin to return a code action with edits and no commands
pepeiborra added a commit to haskell/haskell-language-server that referenced this pull request Dec 28, 2020
The ghcide merge includes haskell/ghcide#948
which removes the language extension code actions

This makes the associated func-test fail, because the HLS plugin does not pass
the test (only the ghcide code action did). This is because the HLS plugin uses
commands, and the tests do not wait for the command edit to be applied.

The fix is to change the HLS plugin to return a code action with edits and no commands
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Remove language extension completions.

* Remove code actions for language pragma extensions.

* Remove unused defintions and imports

* Remove test defintion use

* Update comment describing why we return an empty list
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
The ghcide merge includes haskell/ghcide#948
which removes the language extension code actions

This makes the associated func-test fail, because the HLS plugin does not pass
the test (only the ghcide code action did). This is because the HLS plugin uses
commands, and the tests do not wait for the command edit to be applied.

The fix is to change the HLS plugin to return a code action with edits and no commands
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Remove language extension completions.

* Remove code actions for language pragma extensions.

* Remove unused defintions and imports

* Remove test defintion use

* Update comment describing why we return an empty list
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
The ghcide merge includes haskell/ghcide#948
which removes the language extension code actions

This makes the associated func-test fail, because the HLS plugin does not pass
the test (only the ghcide code action did). This is because the HLS plugin uses
commands, and the tests do not wait for the command edit to be applied.

The fix is to change the HLS plugin to return a code action with edits and no commands
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Remove language extension completions.

* Remove code actions for language pragma extensions.

* Remove unused defintions and imports

* Remove test defintion use

* Update comment describing why we return an empty list
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
The ghcide merge includes haskell/ghcide#948
which removes the language extension code actions

This makes the associated func-test fail, because the HLS plugin does not pass
the test (only the ghcide code action did). This is because the HLS plugin uses
commands, and the tests do not wait for the command edit to be applied.

The fix is to change the HLS plugin to return a code action with edits and no commands
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants