Giter VIP home page Giter VIP logo

Comments (14)

 avatar commented on August 23, 2024 6

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.

from dcd.

CyberShadow avatar CyberShadow commented on August 23, 2024 3

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.

from dcd.

SSoulaimane avatar SSoulaimane commented on August 23, 2024 1

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.

from dcd.

nordlow avatar nordlow commented on August 23, 2024

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.

from dcd.

Hackerpilot avatar Hackerpilot commented on August 23, 2024

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.

from dcd.

Hackerpilot avatar Hackerpilot commented on August 23, 2024

Pulling this from 0.6.0.

from dcd.

nordlow avatar nordlow commented on August 23, 2024

Any ideas on how to move forward with this?

from dcd.

nordlow avatar nordlow commented on August 23, 2024

I'd be happy with that.

from dcd.

nordlow avatar nordlow commented on August 23, 2024

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.

from dcd.

Imperatorn avatar Imperatorn commented on August 23, 2024

Any update here?

from dcd.

nordlow avatar nordlow commented on August 23, 2024

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.

from dcd.

electricface avatar electricface commented on August 23, 2024

Why not add this feature?

from dcd.

nordlow avatar nordlow commented on August 23, 2024

Why not add this feature?

It's a bit of work completing #657.

from dcd.

vushu avatar vushu commented on August 23, 2024

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.

from dcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.