Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend textDocument/documentSymbol to cover more symbols #670

Open
anderseknert opened this issue Apr 22, 2024 · 2 comments
Open

Extend textDocument/documentSymbol to cover more symbols #670

anderseknert opened this issue Apr 22, 2024 · 2 comments

Comments

@anderseknert
Copy link
Member

With #668 we got basic support for textDocument/documentSymbol, which means we currently iterate over all the "public", or top-level identifiers, like packages, rules, functions. This seems to cover the most important aspect of this, which is to quickly get an overview of a package and to be able to navigate around between the rules/functions. Regal doesn't settle for basic though, so we should look into extending our coverage here, and include things like values and symbols inside of rule bodies.

I think objects and arrays in particular would be helpful, as it would be helpful to see where in deeply nested constructs the cursor is. But I'm sure we'll find other useful aspects of this as we make progress.

@anderseknert
Copy link
Member Author

One thing to note is that the implementation of workspace/symbol fetches document symbols from each document. We probably don't want things like values to be seen in the workspace symbol search, so filtering out anything but the top level attributes from there is probably a good idea.

@anderseknert
Copy link
Member Author

Having thought more about this, I think the symbols we'll want to cover are:

  • objects
  • arrays
  • comprehensions

in other words, anything that increases the nesting level. When we have that, I think we can consider this issue as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: TODO
Development

No branches or pull requests

1 participant