Comments (14)
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.
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.
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.
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.
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.
Pulling this from 0.6.0.
from dcd.
Any ideas on how to move forward with this?
from dcd.
I'd be happy with that.
from dcd.
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.
Any update here?
from dcd.
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.
Why not add this feature?
from dcd.
Why not add this feature?
It's a bit of work completing #657.
from dcd.
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)
- only autocomplete types inside AA type definition
- Custom object.d should be included by default
- Fail to build from source HOT 3
- dmd 2.101: none of the overloads of `fatalHandler` are callable using a `shared` object HOT 2
- Support `imported!"module".T`
- no compleltion with auto HOT 4
- MacPorts build is broken HOT 8
- No completion when mixing auto with symbols that references types bellow the cursor HOT 2
- DUB build of ~master broken on Appveyor HOT 1
- Get rid of deprecate warnings
- An idea to resolve usages of auto as return type and alias as parameters HOT 1
- UFCS regression on master
- No completion for eponymous alias template HOT 1
- UFCS not matching class inheritance
- Differentiate UFCS functions from regular fields HOT 2
- Add option to disable UFCS completion
- Missing named arguments implementation HOT 1
- Implement `FunctionCallExpression` HOT 1
- Handle ``package`` access visibility
- dcd-client brings down server when querying for documentation of modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcd.