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

Parenthesize operators when exporting #906

Merged
merged 3 commits into from
Nov 13, 2020
Merged

Conversation

berberman
Copy link
Contributor

Subject

A tiny fix to export operators properly. If I understand correctly, identifiers can be either totally symbolic or alpha num. And it might be safe to use type ... in the export list:

The extension -XExplicitNamespaces is implied by -XTypeOperators and (for some reason) by -XTypeFamilies.

we could define those operators only when TypeOperators is enabled.

Closes haskell/haskell-language-server#589. Perhaps I should add some tests :)

Screenshot

Peek 2020-11-12 18-37

@jneira
Copy link
Member

jneira commented Nov 12, 2020

Perhaps I should add some tests

Even one of them would be great 😉

@berberman
Copy link
Contributor Author

I created them separately one by one, consistent with former tests.

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 for fixing this and writing a thorough test suite!

src/Development/IDE/Plugin/CodeAction.hs Outdated Show resolved Hide resolved
@berberman berberman requested a review from pepeiborra November 13, 2020 01:39
@pepeiborra pepeiborra merged commit a791afd into haskell:master Nov 13, 2020
@berberman berberman deleted the patch branch November 14, 2020 03:05
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Parenthesize operators when exporting

* Add tests

* Only consider if the head is an operator letter
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Parenthesize operators when exporting

* Add tests

* Only consider if the head is an operator letter
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Parenthesize operators when exporting

* Add tests

* Only consider if the head is an operator letter
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.

CodeAction suggestExportUnusedTopBinding handles operators incorrectly
3 participants