-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
hls-class-plugin enhancement #2920
Conversation
8e8b03f
to
9283e5f
Compare
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.
I will review in more detail once I come back from my vac. However, just one high level Q.
} | ||
|
||
rules :: Recorder (WithPriority Log) -> Rules () | ||
rules recorder = do |
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.
Could you explain why do you think that it would be better to introduce a new rule?
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.
Because rules have cache? I'm not sure about that.
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.
I didn't get the whole way through, but here's a partial review. It's a bit hard to tell which bits are old and which are new since you moved things, so I just looked at everything.
pure Null | ||
where | ||
toTextDocunemtEdit edit = | ||
TextDocumentEdit (VersionedTextDocumentIdentifier uri (Just 0)) (List [InL edit]) |
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.
This is a bit suspicious. I'm not sure how file versions should be handled but probably not like 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.
$ liftIO | ||
$ runAction "classplugin.codeAction.GetInstanceBindTypeSigs" state | ||
$ use GetInstanceBindTypeSigs docPath | ||
pure $ concatMap mkAction $ minDefToMethodGroups range sigs . classMinimalDef $ cls |
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.
I'd be tempted to move the mkAction
part to the caller. That avoids a nested where clause (3 deep now!), and maybe lets you simplify the call site since you're doing various combinations of concatMap
/mapM
/join
.
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.
Keep mkAction
here due to parameter dependency.
= [ mkCodeAction title | ||
$ mkLspCommand plId codeActionCommandId title | ||
(Just $ mkCmdParams methodGroup False) | ||
, mkCodeAction titleWithSig |
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.
As I don't use type signatures on class methods very often, I prefer that two-step approach. It is indeed, even though we are not so extreme compared to some other LS, too unwieldy to see a list of code actions.
Sorry for the long delay, I think I've resolved all reviews. |
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.
Thanks for the persistent work :)
* hls-class-plugin enhancement * Comment to be compatible * Add HasSrcSpan instances * hls-class-plugin enhancement * Comment to be compatible * Add HasSrcSpan instances * Compitable fix * Qualified name * Fix compatibility * Resolve reviews * Rename test files Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This pr includes:
with signature
code actions.InstanceSigs
pragma if needed.Close #1157