Currently the lsp is split into 4 parts:
- Lexer
- Parser
- ProjectManager
- LSP Server
The server references code from the scaffolding used by rust-analyzer, the LSP used for the official Rust VSCode Extension: https://github.com/rust-lang/rust-analyzer/tree/master/lib/lsp-server
To Do:
- Maybe worthwhile to consider using Tower-LSP instead. An async Tokio-based library for LSPs with less boilerplate needed. https://github.com/ebkalderon/tower-lsp
Stil in progress, but the idea is that this component will index the project folder and control when the files are read, parsed and analysed. It will also act as a controller to handle the LSP Server request
Tokenize the text file. Output will be fed to the Parser
Reads the Token stream and constructs as AST. Output will be fed to the Analyzer
Currently the analyzer performs linting like services. Currently implemented:
- Checks unused variables
- Checks return values of functions (cannot be text/tvarbytearray/list)
- Checks params that should be inout/const/var
TODO This module would:
- Perform Type Checking on AST (attach types? or generate new tree?)
- Provide Semantic Diagnostics
- Perform static code analysis, should be able to easily add new rules. E.g. rules:
- Check undisposed objects?
- Check unpurged tVarByteArrays?