Vscode extension that adds intelligent editor features for the Starlark language.
- Syntax highlighting
- Jump-to-definition and description for function calls
- Code autocomplete
- Linting through pylint
Starlark is becoming a dominant configuration language. Its great features include determinitic and isolated execution, as well as simplicity and great readbility.
While there is editor support for Bazel and Buck's build files, no existing editor extension provides jump-to-definition, linting and code completion for pure Starlark files, specifically its load() statement.
These issues will be solved in the future by Google's Starlark language server, which is not open-source yet. This extension here exists to provide a good experience in the meantime.
Because Starlark's syntax is a subset of Python, we could of course try to use existing Python editor extensions - which is exactly what this project does. It only takes a tweak to the supported source file extensions, adjustment to the Python grammar, some AST transformations, disabling python features, correct bundling of the modified libraries and some debugging ;)
Because most Python extension share the same code-intelligence library jedi, these modifications can be applied to other editors relatively easily.
An editor extension based on Google's language server is the best long-term solution, so I don't plan on investing significant time into this project. Though it may be interesting to add autocomplete for files in the load() statement, and we probably want to support buildifier, Starlark's linting & code formatting tool.
Most importantly, please let me know if something doesn't work.