-
Notifications
You must be signed in to change notification settings - Fork 71
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
Allow parsing the whole module #759
Conversation
✅ This PR fixes following deprecations:
Total deprecations: 110 Total warnings: 4 Build statistics: statistics (-before, +after)
client size=1048544 bin/dcd-client
server size=3085624 bin/dcd-server
-rough build time=76s
+rough build time=75s
-DCD run_tests.sh Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.29
-DCD run_tests.sh Maximum resident set size (kbytes): 45548
+DCD run_tests.sh Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.38
+DCD run_tests.sh Maximum resident set size (kbytes): 43480
short requests: (230x)
- min request time = 0.009ms
- 10th percentile = 0.115ms
- median time = 0.421ms
- 90th percentile = 0.751ms
- max request time = 1.601ms
+ min request time = 0.008ms
+ 10th percentile = 0.107ms
+ median time = 0.419ms
+ 90th percentile = 0.713ms
+ max request time = 1.402ms
long requests over 10ms: (51x)
- min request time = 15.836ms
- 10th percentile = 16.255ms
- median time = 17.575ms
- 90th percentile = 20.220ms
- max request time = 27.549ms
+ min request time = 15.589ms
+ 10th percentile = 16.847ms
+ median time = 18.471ms
+ 90th percentile = 19.940ms
+ max request time = 27.078ms
top 5 GC sources in server:
bytes allocated, allocations, type, function, file:line
78109696 843 void[] std.array.Appender!(const(TokenStructure!(ubyte, "import dparse.lexer:TokenTriviaFields,TriviaToken; mixin TokenTriviaFields;"))[]).Appender.ensureAddable.__lambda9 /opt/hostedtoolcache/dc/dmd-2.105.3/x64/dmd2/linux/bin64/../../src/phobos/std/array.d:3634
15257216 476788 void[] core.lifetime._d_newitemT!(Data)._d_newitemT /opt/hostedtoolcache/dc/dmd-2.105.3/x64/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d:2833
14316800 164422 void[] std.array.Appender!(DSymbol*[]).Appender.ensureAddable.__lambda9 /opt/hostedtoolcache/dc/dmd-2.105.3/x64/dmd2/linux/bin64/../../src/phobos/std/array.d:3634
9773344 305417 Data std.array.Appender!string.Appender.this /opt/hostedtoolcache/dc/dmd-2.105.3/x64/dmd2/linux/bin64/../../src/phobos/std/array.d:3509
7371616 281 ubyte[] msgpack.unpacker.Unpacker.InternalBuffer!().initializeBuffer ../../../.dub/packages/msgpack-d/1.0.4/msgpack-d/src/msgpack/common.d:628 Full build output
|
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.
what's all the extra work for? you would probably just want to if (cursorPosition == -1) return super.parseBlockStatement();
at the start, right?
@@ -115,7 +115,7 @@ class AutocompleteParser : Parser | |||
{ | |||
if (!currentIs(tok!"{")) | |||
return null; | |||
if (current.index > cursorPosition) | |||
if (cursorPosition != -1 && current.index > cursorPosition) |
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.
if (cursorPosition != -1 && current.index > cursorPosition) | |
if (cursorPosition == -1) return super.parseBlockStatement(); | |
if (current.index > cursorPosition) |
I'm thinking that's all that's needed, no? Otherwise the code always sets a bookmark, skips braces and then immediately rolls back again.
remake of dlang-community#759 Co-authored-by: ryuukk <ryuukk.dev@gmail.com>
remake of #759 Co-authored-by: ryuukk <ryuukk.dev@gmail.com>
This is useful for when wanting to get all the symbols within a module, specially for being able to display inlay hints