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

Add types to symbol outline #398

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add types to symbol outline #398

wants to merge 7 commits into from

Conversation

marvinborner
Copy link
Member

Closes #396. I also added collapsible items for imports and namespaces.

image

I'm not sure how to get the types of sub-level symbols yet, so I just put a '?' when the type is not available. We also need to add some kind of caching so the outline doesn't flicker when the file can't be processed (ie. while actively typing).

@b-studios
Copy link
Collaborator

val ScopesForFile = Annotation[kiama.util.Source, List[symbols.scopes.Scope]](
"ScopesForFile",
"all scopes for file"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might lead to a lot of allocation, but this is a general problem.

@b-studios
Copy link
Collaborator

Hey @marvinborner what are the next steps here?

@marvinborner
Copy link
Member Author

marvinborner commented Aug 24, 2024

I'm really not sure. As discussed, annotating the scopes adds a lot of allocations.
Also, I don't think I understand the scope data type fully, mapping every scope to LLM's allBindings as I did here was definitely the wrong approach as it recurses infinitely.

I think we need to find a better (and cached) solution, and also cache other stages first. Otherwise, merging (something like) this will decrease LSP's performance a lot.

(or we just merge the basic implementation before scope annotations, as an initial solution)

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.

Add types to symbols outline in LSP
2 participants