# Syntax tree view improvements \(\#37570\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e30f45cf64dcac1943cf726fad2ff55f8018057b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e30f45cf64dcac1943cf726fad2ff55f8018057b

Requested commit: e30f45cf64dcac1943cf726fad2ff55f8018057b

Commit: e30f45cf64dcac1943cf726fad2ff55f8018057b

Tree: 51573af525a7d55b4d896af4d78d69f6b7828ec3

Author: Finn Evers

Committer: GitHub

## Message

```
Syntax tree view improvements (#37570)

In an effort to improve the experience while developing extensions and
improving themes, this PR updates the syntax tree views behavior
slightly.

Before, the view would always update to the current active editor whilst
being used. This was quite painful for improving extension scheme files,
as you would always have to change back and forth between editors to
have a view at the relevant syntax tree.

With this PR, the syntax tree view will now stay attached to the editor
it was opened in, similar to preview views. Once the view is shown, the
`UseActiveEditor` will become available in the command palette and
enable the user to update the view to the last focused editor. On file
close, the view will also be updated accordingly.



https://github.com/user-attachments/assets/922075e5-9da0-4c1d-9e1a-51e024bf41ea

A button is also shown whenever switching is possible.

Futhermore, improved the empty state of the view.

Lastly, a drive-by cleanup of the `show_action_types` method so there is
no need to call `iter()` when calling the method.


Release Notes:

- The syntax tree view will now stay attached to the buffer it was
opened in, similar to the Markdown preview. Use the `UseActiveEditor`
action when the view is shown to change it to the last focused editor.
```

## Parents

- [16c4fd4fc563eeedc645a50931129908bc3bfb07](https://git.cafe/gitcafe/zed/commit/16c4fd4fc563eeedc645a50931129908bc3bfb07?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e30f45cf64dcac1943cf726fad2ff55f8018057b?format=markdown)
