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

the json outline does not update when the .json file changes #1066

Closed
cognominal opened this issue Jul 31, 2024 · 4 comments
Closed

the json outline does not update when the .json file changes #1066

cognominal opened this issue Jul 31, 2024 · 4 comments
Assignees

Comments

@cognominal
Copy link

cognominal commented Jul 31, 2024

Extension sample

tree-view-sample

VS Code version

1.92-insider

What went wrong?

the json outline does not update when the .json file changes or when the
the selection change in said file. In the later case it should select the correct item in the tree view.

I ran to the same problem and described it in :
https://stackoverflow.com/questions/78814016/can-someone-provide-a-simple-example-of-updating-on-a-treeview-on-a-change-selec

To make things more confusing, an undocumented configuration option named autorefresh is set to false in package.json. But setting it to true does not change anything despite it being tested.

@alexr00
Copy link
Member

alexr00 commented Jul 31, 2024

the json outline does not update when the .json file changes

I see this working correctly. The json outline view changes when the active editor changes. 

or when the the selection change in said file. In the later case it should select the correct item in the tree view.

This is not a feature that the json outline sample provides, so it is expected that the tree doesn't update when the selection changes in the editor.

To make things more confusing, an undocumented configuration option named autorefresh is set to false in package.json. But setting it to true does not change anything despite it being tested.

I tried the setting, and it works. When auto refresh is turned on then the tree changes in response to file changes. I've added a description for the setting: #1068

@alexr00 alexr00 closed this as completed Jul 31, 2024
@cognominal
Copy link
Author

As I said in stackoverflow, I write an AST Explorer vscode extension and like it to behave like https://astexplorer.net/.
That means that when moving the cursor to a new token in the editor,
the relevant info must be selected in the tree view. How do I do that ?

Also I asked an ancillary question about the behavior of the debugger I don't
understand. A symbol that is defined, treeview, does not appear as such in the WATCH view.

Thx for your help.

@cognominal
Copy link
Author

The problem with the watch view is a known one.
It has been filed as a vscode issue but it is dependant
on a problem with ts sourcemaps filed as a tscode issue.

As for updating the treeview, there is an example of treeview.reveal() in testView.ts#L11 that I probably used as a model. To no avail so far, with or without await. There are a lof of questions about treeview.reveal() in many places. Maybe I will find answers there.

@cognominal
Copy link
Author

The code beyond that should probably used as a model
microsoft/vscode#224705 (comment)

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

No branches or pull requests

3 participants