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

Fix #248 and #250 #267

Merged
merged 3 commits into from
Dec 18, 2019
Merged

Fix #248 and #250 #267

merged 3 commits into from
Dec 18, 2019

Conversation

jacg
Copy link
Contributor

@jacg jacg commented Dec 17, 2019

This fixes hover for types, classes and type variables.

Information about spans includes a Maybe Type which is Just for data-level
expressions and Nothing for type-level expressions.

AtPoint.atPoint which is the oddly-named function responsible for constructing
hover information, runs in the Maybe monad, and aborted at the first sight of
a Nothing, thus producing no hover information for type-level spans.

In the process of fixing this, I have refactored the function to

  • separate the construction of data-level and type-level hover info

  • make the components that make up the hover info (and their construction) more
    clear

I can see plenty little improvements that could be made to the functionality of
the code (and lots that could be made to its organization), but the most
important fixes of the basic missing functionality are here.

Fix #248
Fix #250

@jacg jacg changed the title Fix #249 and #250 Fix #248 and #250 Dec 17, 2019
@jacg jacg force-pushed the fix-249-250 branch 2 times, most recently from ab15c99 to 2008199 Compare December 17, 2019 16:14
This fixes hover for types, classes and type variables.

Information about spans includes a `Maybe Type` which is `Just` for data-level
expressions and `Nothing` for type-level expressions.

`AtPoint.atPoint` which is the oddly-named function responsible for constructing
hover information, runs in the `Maybe` monad, and aborted at the first sight of
a `Nothing`, thus producing no hover information for type-level spans.

In the process of fixing this, I have refactored the function to

+ separate the construction of data-level and type-level hover info

+ make the components that make up the hover info (and their construction) more
  clear

I can see plenty little improvements that could be made to the functionality of
the code (and lots that could be made to its organization), but the most
important fixes of the basic missing functionality are here.

Fix #248
Fix #250
@aherrmann-da aherrmann-da self-assigned this Dec 18, 2019
The name suggests that it returns all locations, while the last commit changed
this to return at most one.
There was some confusion about which tests addressed issue 248 vs 249
Copy link
Contributor

@aherrmann-da aherrmann-da left a comment

Choose a reason for hiding this comment

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

That's great, thank you for implementing this!

Could you open issues to track the added TODO comments?

@aherrmann-da aherrmann-da merged commit bbb75c2 into haskell:master Dec 18, 2019
@jacg
Copy link
Contributor Author

jacg commented Dec 18, 2019

Issues #273 and #274 opened as requested.

@jacg jacg deleted the fix-249-250 branch December 18, 2019 14:11
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Fix haskell/ghcide#248 and haskell/ghcide#250

This fixes hover for types, classes and type variables.

Information about spans includes a `Maybe Type` which is `Just` for data-level
expressions and `Nothing` for type-level expressions.

`AtPoint.atPoint` which is the oddly-named function responsible for constructing
hover information, runs in the `Maybe` monad, and aborted at the first sight of
a `Nothing`, thus producing no hover information for type-level spans.

In the process of fixing this, I have refactored the function to

+ separate the construction of data-level and type-level hover info

+ make the components that make up the hover info (and their construction) more
  clear

I can see plenty little improvements that could be made to the functionality of
the code (and lots that could be made to its organization), but the most
important fixes of the basic missing functionality are here.

Fix haskell/ghcide#248
Fix haskell/ghcide#250

* Revert behaviour of locationsAtPoint to match its name

The name suggests that it returns all locations, while the last commit changed
this to return at most one.

* Fix issue numbers in test titles

There was some confusion about which tests addressed issue 248 vs 249
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Fix haskell/ghcide#248 and haskell/ghcide#250

This fixes hover for types, classes and type variables.

Information about spans includes a `Maybe Type` which is `Just` for data-level
expressions and `Nothing` for type-level expressions.

`AtPoint.atPoint` which is the oddly-named function responsible for constructing
hover information, runs in the `Maybe` monad, and aborted at the first sight of
a `Nothing`, thus producing no hover information for type-level spans.

In the process of fixing this, I have refactored the function to

+ separate the construction of data-level and type-level hover info

+ make the components that make up the hover info (and their construction) more
  clear

I can see plenty little improvements that could be made to the functionality of
the code (and lots that could be made to its organization), but the most
important fixes of the basic missing functionality are here.

Fix haskell/ghcide#248
Fix haskell/ghcide#250

* Revert behaviour of locationsAtPoint to match its name

The name suggests that it returns all locations, while the last commit changed
this to return at most one.

* Fix issue numbers in test titles

There was some confusion about which tests addressed issue 248 vs 249
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Fix haskell/ghcide#248 and haskell/ghcide#250

This fixes hover for types, classes and type variables.

Information about spans includes a `Maybe Type` which is `Just` for data-level
expressions and `Nothing` for type-level expressions.

`AtPoint.atPoint` which is the oddly-named function responsible for constructing
hover information, runs in the `Maybe` monad, and aborted at the first sight of
a `Nothing`, thus producing no hover information for type-level spans.

In the process of fixing this, I have refactored the function to

+ separate the construction of data-level and type-level hover info

+ make the components that make up the hover info (and their construction) more
  clear

I can see plenty little improvements that could be made to the functionality of
the code (and lots that could be made to its organization), but the most
important fixes of the basic missing functionality are here.

Fix haskell/ghcide#248
Fix haskell/ghcide#250

* Revert behaviour of locationsAtPoint to match its name

The name suggests that it returns all locations, while the last commit changed
this to return at most one.

* Fix issue numbers in test titles

There was some confusion about which tests addressed issue 248 vs 249
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.

Hover does not work for type constructors Hover does not work for classes
2 participants