vlang / v-analyzer

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

feat: use build version aware caching #57

Closed ttytm closed 5 months ago

ttytm commented 5 months ago

The changes add a version-aware cache. This fixes the issue where an old cache would prevent updates and bug fixes from becoming visible to users.

obsolete The versioning follows the same scheme as we do for the metadata/stubs. But instead of using a hardcoded version for the metadata(which is handled separately and changes less often) the changes in the PR add a more dynamic handling for the analyzer's indexing cache based on the build commit. This should be appropriate as it is affected by most commits to the project. Refs to stubs versioning: - setup: https://github.com/vlang/v-analyzer/blob/44c804decd62b77a149b5049e1c9f5d9b97f50cf/server/general.v#L345 - version file: https://github.com/vlang/v-analyzer/blob/44c804decd62b77a149b5049e1c9f5d9b97f50cf/config/constants.v#L39 - manual versioning: https://github.com/vlang/v-analyzer/blob/44c804decd62b77a149b5049e1c9f5d9b97f50cf/server/language_server.v#L47-L50
ttytm commented 5 months ago

Can be simplified and improved to be more extensible. Marking as draft.

edit: