WIP LSP for C3 language
Using tree-sitter grammar rules from https://github.com/cbuttner/tree-sitter-c3.git
Features
- Indexes workspace variables and function definitions
- Naïve auto completion items of variables and function names defined in the workspace.
- Go to declaration.
- Hover
TODO list
-
Parser:
- Variables & type
- Global constants
- Functions
- Function parameters
- Function return type
- Enums + Enumerators
- base type
- enum methods
- Faults
- Structs
- Struct members
- Struct methods
- Struct implementing interface
- Unions
- Union members
- [~] defines
- Interfaces
- [~] Macros
- imports
- modules
- multiple modules per file
- implicit module name is assumed to be the file name, converted to lower case, with any invalid characters replaced by underscore (_).
- Generics
- Language Builtins
-
Index scopes and its hierarchy to improve hover and Auto Completion.
-
Complete Hover
-
Complete Go to declaration
- Find symbol in same scope
- Find symbol in parent scope
- Find symbol present in same module, but different file
- Find symbol in imported module
- Find symbol in implicit parent module.
- Find symbol in stdlib
-
Go to definition
-
Go to type definition
-
Go to implementation
-
Find references
-
Rename
- LSP specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
- treesitter
- Queries docs: https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries
- Queries: https://emacs-tree-sitter.github.io/syntax-highlighting/queries/
- Tree-sitter - a new parsing system for programming tools (video) https://www.thestrangeloop.com/2018/tree-sitter---a-new-parsing-system-for-programming-tools.html