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

API to trigger a refresh of the OUTLINE (DocumentSymbols) #108722

Open
angelozerr opened this issue Oct 15, 2020 · 8 comments
Open

API to trigger a refresh of the OUTLINE (DocumentSymbols) #108722

angelozerr opened this issue Oct 15, 2020 · 8 comments
Assignees
Labels
api feature-request Request for new features or functionality outline Source outline view issues
Milestone

Comments

@angelozerr
Copy link
Contributor

I recreate the issue #71454 because it was closed.

My need is that I have a XML Language Server which supports settings for configuring symbols (like show/hide XML attributes, XML text nodes in the outline). When those settings are saved, I would like to refresh the outline.

If vscode could provide a command to refresh this outline, it should be great!

Thanks!

@jrieken jrieken added the outline Source outline view issues label Oct 15, 2020
@jrieken jrieken added this to the Backlog Candidates milestone Oct 15, 2020
@jrieken jrieken added the feature-request Request for new features or functionality label Oct 15, 2020
@tsmaeder
Copy link

Not sure if a "refresh" command for the view is the only way to implement it, but I can see the need.

@kiuKisas
Copy link

kiuKisas commented Jan 4, 2022

Up

@qianguyizhe
Copy link

1.67.1 still too slow for C/C++ outline
documentSymbol event is sent to us upon file refresh and keystroke, but not on save. So our outline view is always one step behind when we change a binding or module. And C/C++ parsing is too slow, only show outline when parsing is end, always cost more zhan 10 seconds and reopen the file will continue cost a same long time ... I try to use ctags to provide outline ...
rescript-lang/rescript-vscode#176

@gayanper
Copy link
Contributor

I can think of two ways to do this.

  1. Looking at the XML LS need and Java LS need we could listen for configuration changes and refresh the symbols. But we need a way to filter such change is applicable for current symbol provider's language services. otherwise we will endup doing unwanted refresh operations

  2. Provide the command to refresh without exposing that in the UI. So extensions can call this command when they want to refresh the outline programmatically.

Option two might be a better choice given that, extensions can decide when to refresh based on the context.

@gayanper
Copy link
Contributor

gayanper commented Sep 4, 2022

I did an implementation on 2 option above. #160027
@tsmaeder @jrieken Let me know what you think.

@EhabY
Copy link
Contributor

EhabY commented May 25, 2023

@jrieken You mention in the PR that there is no need for a way to refresh the outline as it is done automatically when the document is touched. However, there are several cases where we might want to refresh even if the document is not changed:

  1. Builds that take a lot of time to finish, so the result of the outline is not ready yet when it is requested (thus having an empty outline)
  2. While the document could have not changed, another document that depends on it could have changed and caused the outline to be out of date (C/C++ included files)

Those are just two examples where we might need a way to refresh the outline without touching the document, I am sure there are a lot more use cases...

@c-claeys
Copy link
Contributor

@jrieken We have need of a refresh like this for DocumentSymbols. Our use case is a sometimes-long running background calculation for each of those that we don't want to leave open with the extension request. Are you open to a PR for optional events similar to onDidChangeSemanticTokens, onDidChangeCodeLenses, onDidChangeInlineValues, onDidChangeInlayHints, and onDidChangeFoldingRanges?

@GallifreyMage
Copy link

I concur with the OP, and our use case is very similar to theirs. We deal with code that has lots of variables and types, so our extension also supports settings like showing/hiding variables in the outline, and deciding whether or not to filter by type (or just call them all Variable). Once a setting is toggled, the outline needs to be refreshed to respond to the change in settings.

In the Extension Host, it appears the DocumentSymbolProvider is called whenever you switch between files in the editor. It just seems like the outline view doesn't recognize the new list of symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality outline Source outline view issues
Projects
None yet
Development

No branches or pull requests

11 participants