withered-magic / starpls

An LSP implementation for Starlark, the configuration language used by Bazel and Buck2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support document symbols (`textDocument/documentSymbol`)

withered-magic opened this issue · comments

I'm curious if "document symbols" in starlark would include bazel/buck targets?

i.e. would this

_some_local_var = []

cc_library(name = "some_target")

result in these symbols?

_some_local_var
:some_target

same question for "workspace symbols" https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_symbol

Yep, that's what I'm envisioning! Although the initial implementation here would likely use the same heuristic that goto def for labels currently uses and derive the list of targets from call expressions that have a name argument (as opposed to using bazel query or something)