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

DCD does not show UFCS completions #13

Open
Hackerpilot opened this issue Aug 18, 2013 · 14 comments
Open

DCD does not show UFCS completions #13

Hackerpilot opened this issue Aug 18, 2013 · 14 comments
Assignees
Labels

Comments

@Hackerpilot
Copy link
Collaborator

DCD has no support for the Uniform Function Call Syntax.

@nordlow
Copy link
Contributor

nordlow commented Feb 12, 2015

What would it take to start supporting this?

We could always start with the easier non-templated-first-parameter case.

This is by far the largest usability improvement I can think of.

If you just point out the places in the code where to add this logic I'd be very happy to help out and start working on a PR for this.

Further I would like the lookup of function definitions to work with UFCS aswell. Is there another place where this logic is defined?

I'm using the Emacs interface ac-dcd to interact with DCD.

@Hackerpilot Hackerpilot modified the milestones: 0.6.0, The Future Feb 12, 2015
@Hackerpilot
Copy link
Collaborator Author

If it was as simple as pointing out a single place in the code where the logic should be added, it would have been added already. I have a few ideas on how this can be implemented and I'll work on adding it for the 0.6.0 release.

@Hackerpilot Hackerpilot self-assigned this Feb 12, 2015
@Hackerpilot Hackerpilot removed this from the 0.6.0 milestone May 4, 2015
@Hackerpilot
Copy link
Collaborator Author

Pulling this from 0.6.0.

@nordlow
Copy link
Contributor

nordlow commented Aug 8, 2015

Any ideas on how to move forward with this?

@ghost
Copy link

ghost commented May 11, 2016

What about this:

  • no UFCS completion after dot
  • UFCS completion activated only if current identifier is at least N characters long.
import std.ascii;
char c;
c. // no UFCS completion so just the type properties.
c.is // no UFCS completion, not enough chars (3 required).
c.isA // 3 chars, ok, isAlpha and isAlphaNumeric proposed.

@nordlow
Copy link
Contributor

nordlow commented May 11, 2016

I'd be happy with that.

@SSoulaimane
Copy link

I made some progress on the subject. You may check it here SSoulaimane/dcd@dc66681.
lookup, documentation, calltip... everything works perfect, except for identifiers completion. the list of matches is bloated with false positives, because I only check if the function/struct/... takes at leat one argument. no type-checking is done, dsymbol is not yet ready for that.
I don't know whether to make a pull request yet. for one every identifiers completion test is broken because new symbols were introduced. second I'm not satisfied with results just yet.

@CyberShadow
Copy link
Member

A potential idea to filter out false positives would be to infer valid UFCS functions from existing usage. For instance, if DCD sees that frobify is called via UFCS in existing code with variables of type Foo, it can suggest it as a completion candidate after . when it knows the preceding expression has type Foo.

This would also help with making the suggestions take into account stylistic / semantic aspects. For instance, if the user always writes format("...", ...args...) but never "...".format(...args...), then they probably don't want to see the latter as a suggestion candidate.

@nordlow
Copy link
Contributor

nordlow commented Aug 14, 2020

Being able to just go to definiton of the function at cursor in a UFCS-call would be an amazing progress. Especially when navigating codebases such as dmd. If there are multiple overloads in multiple scopes just propose a list to choose from.

Can we pleease be pragmatic and add this? It would be a great productivity enhancement.

@Imperatorn
Copy link

Any update here?

@nordlow
Copy link
Contributor

nordlow commented Oct 22, 2021

Any update here?

#657 works partially for me. I don't think it's that difficult get it all the way. I have little time over right now, though.

@electricface
Copy link
Contributor

Why not add this feature?

@nordlow
Copy link
Contributor

nordlow commented May 10, 2022

Why not add this feature?

It's a bit of work completing #657.

@vushu
Copy link
Contributor

vushu commented Sep 27, 2022

I am also very interested in this feature. I think a lot of people are using UFCS, it would be very helpful to be able to navigate to the correct file where the function is defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants