Skip to content

some tweaks to code completion - #115

Merged
DanTup merged 1 commit into
Dart-Code:masterfrom
devoncarew:tweaks_to_cc
Aug 19, 2016
Merged

DanTup merged 1 commit into
Dart-Code:masterfrom
devoncarew:tweaks_to_cc

Conversation

@devoncarew

Copy link
Copy Markdown
Contributor

A follow-up to #111:

  • show return types for getters
  • change how we calc the completion type icons to use the element kind if available
  • show the element type in lower case (instead of the default uppercase)

screen shot 2016-08-19 at 1 48 59 pm

@DanTup DanTup added the is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. label Aug 19, 2016
@DanTup DanTup added this to the 0.9 milestone Aug 19, 2016
@DanTup
DanTup merged commit 0223fa4 into Dart-Code:master Aug 19, 2016
@DanTup

DanTup commented Aug 19, 2016

Copy link
Copy Markdown
Member

Looks great, thanks!

Do you think there's any value in showing the full params instead of ...?

I'm not at PC to test, but from screenshot in #111 maybe they're shown when selected - not sure if one way might seem better than the other?

I should probably see how it feels at a PC.. I think there are also a bunch of places now where we display similar info we should probably review to see if improvements made in some places are missing in others (for ex. if there are other places still displaying uppercase kinds and maybe duplicate logic for converting to the Code kinds).

@devoncarew

devoncarew commented Aug 19, 2016 •

Copy link
Copy Markdown
Contributor Author

Definitely more room for iteration here. The TS completion just shows names when not selected, not foo(...) or foo(). When selected, both show the full method sig.

This current implementation is pretty close to how the TS completer displays things. Not sure if we want to match that or look for improvements where possible. Other code completion UIs I'm familiar with show the full method+sig for all items, not just the selected one. I'd like to see how it all fits together w/ the param completer; I'm not very familiar w/ what that looks like.

It would be nice if we could complete more of the item. In atom, you can specify some insertion points and placeholders for params. So something like foo({0}) would complete foo() but leave the cursor between the parans. Or foo({bar}, {baz}) would complete the method, select the bar text, let you change the name, and hitting tab would then select the baz text.

Don't think VSCode has support for this though - completing w/ instructions for how to tab between placeholders.

@DanTup

DanTup commented Aug 20, 2016

Copy link
Copy Markdown
Member

Not sure if we want to match that or look for improvements where possible.

I think the TS one is a good reference to roughly copy, but if we think we can improve it (we've already seen it has "quirks") then I think we should try it out!

I'd like to see how it all fits together w/ the param completer; I'm not very familiar w/ what that looks like.

I made a start on trying to implement this using the Hover data (after the idea in analyzer-discuss) but not sure it's going to work well (I'd need to walk backwards from the current cursor position to the correct symbol for the method call; but I can't use parens in case it's foo(x, (x + z)) so it starts getting complicated). Might just have to park this and hope in the future the AS gets a feature (this is actually the biggest stumbling block when I sat down to try and write some real Dart the other day; it's really hard when you don't know the SDK!).

It would be nice if we could complete more of the item.

Yeah, I agree. Maybe it's worth raising a feature for Code? (maybe including a screenshot of how Atom handles it will help).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants