Skip to content
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

(consider) supporting personalized code completion results #40207

Open
pq opened this issue Jan 17, 2020 · 6 comments
Open

(consider) supporting personalized code completion results #40207

pq opened this issue Jan 17, 2020 · 6 comments
Labels
area-devexp Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc) devexp-completion Issues with the analysis server's code completion feature devexp-ux P4 type-enhancement A request for a change that isn't a bug

Comments

@pq
Copy link
Member

pq commented Jan 17, 2020

EDIT: this topic began asking whether lambda arg completions should include types and provided the following motivation.

For example, double is certainly not what is wanted here:

lamda_arg_compl

The conversation has since moved to more general mechanisms for customizing completions so I've repurposed the issue to carry those ideas forward.

@pq pq added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. devexp-completion Issues with the analysis server's code completion feature devexp-ux labels Jan 17, 2020
@pq pq self-assigned this Jan 17, 2020
@bwilkerson
Copy link
Member

Not including type annotations in closures is a style choice, not a language requirement.

It's interesting to think about whether it's better, in general, to tailor the suggestions for a certain set of style choices or whether it should support all valid uses of Dart. I don't have an answer to that question, but I do think that if we're going to make changes like this one that it needs to be based on a conscious choice to exclude support for valid code that doesn't conform to that style.

@pq
Copy link
Member Author

pq commented Jan 17, 2020

You make a good point and I think my suggestion was maybe too big of a hammer to solve a UX issue I hit when experimenting w/ range selections for lambda completions. (Easier to explain in person.)

Regardless of whether this would help in that case, the general question stands around how opinionated we want completion to be and whether we want its behavior to be influenced by things like lint rule settings. I'd be curious what @InMatrix thinks about that.

@pq pq changed the title lambda arg completions should not include types (consider) whether lambda arg completions should include types Jan 17, 2020
@devoncarew
Copy link
Member

We have discussed in the past doing things like putting settings in the analysis options file which could control style choices like this. I don't think we had a single case compelling enough to do it.

  settings:
    include-types-for-closure-completions: true

As Phil mentions above, for some settings, we could infer the user's desired value from the set of lints they have enabled.

@bwilkerson
Copy link
Member

Settings might be a good solution for this, as long as it doesn't get too out of hand, but I'd advise that we only add settings when we really can't satisfy all users without them.

If we do add settings, we should put them in the analysis options file. Not enabling a lint isn't a very clear indication that someone doesn't want to follow that style. And we should add some tooling support to improve discoverability of the options.

@pq
Copy link
Member Author

pq commented Jan 17, 2020

Not including type annotations in closures is a style choice, not a language requirement.

FWIW it is recommended style:

https://dart.dev/guides/language/effective-dart/design#avoid-annotating-inferred-parameter-types-on-function-expressions

(Which is just to say this might not be a bad place to be opinionated. 🤔)

@shinayser
Copy link

shinayser commented Jan 17, 2020

We have discussed in the past doing things like putting settings in the analysis options file which could control style choices like this. I don't think we had a single case compelling enough to do it.

  settings:
    include-types-for-closure-completions: true

As Phil mentions above, for some settings, we could infer the user's desired value from the set of lints they have enabled.

Nice to know this conversation is happening! As I said on #40202 (comment) , could be interesting if we could give more analizer options to the infered parameter name, with three posible values:

@pq pq changed the title (consider) whether lambda arg completions should include types (consider) supporting personalized code completion results Jan 17, 2020
@pq pq removed their assignment Jun 29, 2020
@srawlins srawlins added the P4 label Jan 18, 2021
@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Nov 18, 2021
@bwilkerson bwilkerson added area-devexp Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc) and removed area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc) devexp-completion Issues with the analysis server's code completion feature devexp-ux P4 type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants