-
Notifications
You must be signed in to change notification settings - Fork 73
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
adding bang completion for template func, struct, class #744
adding bang completion for template func, struct, class #744
Conversation
DCD BUILD FAILED Build statistics: statistics (-before, +after)
client size=1055832 bin/dcd-client
-server size=3014768 bin/dcd-server
-rough build time=75s
+server size=3018864 bin/dcd-server
+rough build time=76s
-DCD run_tests.sh Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.83
-DCD run_tests.sh Maximum resident set size (kbytes): 13488
+DCD run_tests.sh Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.94
+DCD run_tests.sh Maximum resident set size (kbytes): 13316
-short requests: (219x)
- min request time = 0.009ms
+short requests: (227x)
+ min request time = 0.017ms
10th percentile = 0.123ms
- median time = 0.426ms
- 90th percentile = 0.768ms
- max request time = 1.908ms
+ median time = 0.466ms
+ 90th percentile = 0.781ms
+ max request time = 1.541ms
top 5 GC sources in server: Full build output
|
Co-authored-by: Jan Jurzitza <gh@webfreak.org>
Co-authored-by: Jan Jurzitza <gh@webfreak.org>
148b53c
to
7db918c
Compare
49081de
to
d99fbef
Compare
d99fbef
to
277b0d0
Compare
277b0d0
to
434f86f
Compare
|
||
// Check if we are doing an index operation calltip hint | ||
bool isIndexOperator(T)(T beforeTokens) pure { | ||
return beforeTokens.length >= 2 && beforeTokens[$ - 2] == tok!"identifier" && beforeTokens[$ - 1] == tok!"["; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite accurate checking just for identifier tokens, since these are index operator accesses that wrongly return false:
x()[...]
foo!int[123]
but these aren't index operator accesses:
cast(int[])[...]
cast(int[...])x
{ int[...] x; }
and this wrongly returns true:
cast(T[...])x
since this is in the context of a declaration. Note that T also can define a static opIndex, which in other contexts would be called.
Also the other util methods aren't quite accurate either, since they also only check for identifiers. I don't think we can really make them accurate without somehow integrating with the parser, so I think this is fine as first implementation, but I'm going to not make them public, so others don't start using these not-yet-perfect functions and instead copy-paste them into their projects if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see :)
I definitely also suspected that I didn't cover all cases. Thanks for the feedback.
Also changes struct and class calltips from `Something(T)` to `Something!(T)`
I am attempting to add bang completion for templated symbols, for now it should show calltip for functions, structs and classes.
I sadly couldn't figure out to get it working with serve-d.