Skip to content

Conversation

@Beloin
Copy link

@Beloin Beloin commented Jan 31, 2026

There's a lot to unpack here.

  1. Why not use starlark-lsp?
  • Too weird. It doesnt have any api to ease or way into custom capabilities
  • Also their way to import code was so weird, a custom python file had to be generated to be imported into entrypoint.
  1. Why not Use Starlark Parser?
  • We won't have custom queries.
  • Parsers generate AST not an CST.
  • In CST I can look direct into nodes an query specified node in position offset (thus querying and matching position).
  1. Why use Python Parser?
  • Closer to starlark, we don't have a official starlark parser yet.
  1. How to test?
  • I have also implemented a Neovim plugin that uses this LSP.
  • Available here .

Initial Implemented LSP Capabilities

  • Completion
  • Declaration
  • Hover
  • References
  • Sync

Not implemented (yet)

  • Heph/Starlark modules and structs
  • Meaning we dont have any capabilites for heph.canonicalize etc.

Known improvements

  1. Use DAG to save relationships from BUILD files
  2. Use trie or other prefix trees to make in-memory queries faster

Examples

Function Doc:
image

Arg Doc:
image

Completions:
image

raphaelvigee and others added 2 commits March 28, 2025 12:38
- Implemented base Server
- Implemented base Manager, Document and Symbol
- Implemented queries using TreeSitter
Comment on lines -14 to -17
isFuzzy, suggestions := autocompleteTargetName(targets, toComplete)
if isFuzzy {
directive |= cobra.ShellCompDirectiveNoMatching
}
Copy link
Author

@Beloin Beloin Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1.8.0+ removes ShellCompDirectiveNoMatching.
There's not too much documentation, but for what I could read, the ShellCompDirectiveNoFileComp behaviour is already enough for NoMacthing

@raphaelvigee raphaelvigee force-pushed the master branch 5 times, most recently from b179475 to 76222eb Compare January 31, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants