-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Feat: basic record dot completions #3080
Conversation
898e577
to
5f4be06
Compare
5f4be06
to
795ad8e
Compare
b0ad658
to
d61dac3
Compare
d61dac3
to
d69114b
Compare
@pepeiborra Would you mind doing another review? It should be good to go. |
d69114b
to
0bc2cfe
Compare
let uses_overloaded_record_dot _ = False | ||
#endif | ||
ms <- fmap fst <$> useWithStaleFast GetModSummaryWithoutTimestamps npath | ||
astres <- case ms of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly stupid question, but why guard here? What happens if we just guard getting the HIE AST on whether or not we have record dot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand you correctly, that's exactly what I'm trying to do here. Maybe there's a simpler way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was a stupid question: I missed that the uses_overloaded_record_dot
predicate needs the module summary!
case (pfix, completionContext) of | ||
(Just (VFS.PosPrefixInfo _ "" _ _), Just CompletionContext { _triggerCharacter = Just "."}) | ||
((PosPrefixInfo _ "" _ _), Just CompletionContext { _triggerCharacter = Just "."}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOI, what is happening in this case? I guess this is basically preventing us from giving completions when people write .
which usually corresponds to function composition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's how I read this too. getCompletionPrefix
doesn't find a prefix word before the cursor so it returns emptiness.
, typeText = Nothing | ||
, label = label | ||
, isInfix = Nothing | ||
, docs = emptySpanDoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, fields have haddock usually, you know
data Foo {
hello :: Int -- ^ This is the doc for foo
}
I would expect to get the field haddock in the completion doc!
This might get automatically sorted out for us with #3204, not sure.
Looks like the new test failed on 9.0.2? |
4231579
to
e021ae1
Compare
e021ae1
to
6077694
Compare
🎉 |
Last thing: could you make some issues for any remaining user-facing problems, like maybe the documentation one? |
When a user dots a record type with OverloadedRecordDot enabled, shows all possible record selectors for that type.
Todo:
Notes