Replies: 4 comments
-
This sounds like a good optimization. The function signature is all you're really worried about, unless you're working on the body of the function. The signature is the only part that matters for hover hints, completions, etc. Well, and doc comments, too. |
Beta Was this translation helpful? Give feedback.
-
Yes that's the plan. In fact I had it implemented in original V before the 2020 re-write (.vh headers with just declarations). |
Beta Was this translation helpful? Give feedback.
-
Implement in PR #25531 |
Beta Was this translation helpful? Give feedback.
-
Thanks @kbkpbot Have you measured the speed up? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Idea: To significantly improve the V Language Server startup time and responsiveness, we could implement a fast-load mode for the
vlib
. Instead of fully parsing the entire standard library, theLSP
would only process the signatures/declarations of functions, structs, constants, etc., while ignoring the function bodies entirely.For example, a function like
http.get(url string) ?Response
would be parsed for its interface, but its potentially complex implementation body would be treated as empty. This drastically cuts down the number ofAST
nodes theLSP
needs to build and hold in memory.Expected Benefits:
parser
skips the majority of the code invlib
.AST
would be much smaller, making theLSP
more lightweight.Beta Was this translation helpful? Give feedback.
All reactions