vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
86 stars 9 forks source link

analyzer: rework path handling to simplify and reduce load #86

Closed ttytm closed 3 months ago

ttytm commented 3 months ago

The PR reworks path handling by using a paths child struct on the LanguageServer. vpaths will be set up during the language server setup process and become easily accessible throughout the session.

This helps to remove things like calling the compiler_path() function and calculating the vexe path on e.g. every request to a tool (like formatting on save). The same goes for repetitive calls of vmodules_root() and vlib_root(). Instead, the paths are just available via ls.paths.vexe ls.paths.vlib_root ls.paths.vmodules_root.