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

editor: Ensure proposed changes editor is syntax-highlighted when opened #18648

Conversation

maxdeviant
Copy link
Member

This PR fixes an issue where the proposed changes editor would not have any syntax highlighting until a modification was made.

When creating the branch buffer we reparse the buffer to rebuild the syntax map.

Release Notes:

  • N/A

@maxdeviant maxdeviant self-assigned this Oct 2, 2024
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 2, 2024
@maxdeviant maxdeviant merged commit 7c46155 into main Oct 2, 2024
9 checks passed
@maxdeviant maxdeviant deleted the marshall/show-syntax-highlighting-immediately-in-proposed-changes-editor branch October 2, 2024 18:24
schpet added a commit to schpet/zed that referenced this pull request Oct 3, 2024
* upstream/main: (76 commits)
  Remove a debug dev config line (zed-industries#18689)
  Update Rust crate thiserror to v1.0.64 (zed-industries#18677)
  Add command palette action name to outline panel docs (zed-industries#18678)
  Add basic outline panel docs (zed-industries#18674)
  ssh: Add session state indicator to title bar (zed-industries#18645)
  Update Rust crate clap to v4.5.19 (zed-industries#18660)
  Sort dependencies in `Cargo.toml` files (zed-industries#18657)
  collab: Revert changes to Clickhouse event rows (zed-industries#18654)
  Replace isahc with async ureq (zed-industries#18414)
  Update cloudflare/wrangler-action digest to 168bc28 (zed-industries#18651)
  Prepare to sync other kinds of settings (zed-industries#18616)
  editor: Ensure proposed changes editor is syntax-highlighted when opened (zed-industries#18648)
  language: Update buffer doc comments (zed-industries#18646)
  Revert "Fix blurry cursor on Wayland at a scale other than 100%" (zed-industries#18642)
  Tweak warning diagnostic toggle (zed-industries#18637)
  Adjust spacing and sizing of buffer search bar icon buttons (zed-industries#18638)
  docs: Add missing UI font settings to "Configuring Zed" (zed-industries#18267)
  Use `const` over `static` for string literals (zed-industries#18635)
  docs: Add FIPS mode error to Linux troubleshooting (zed-industries#18407)
  v0.157.x dev
  ...
maxdeviant added a commit that referenced this pull request Oct 17, 2024
…editor (#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (#18591)
* [x] Add an apply button above every hunk
(#18592)
* [x] Expand all diff hunks by default
(#18598)
    * [x] Fix #18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(#18945)
* [x] No auto-indent? (#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Richard <[email protected]>
Co-authored-by: Marshall <[email protected]>
Co-authored-by: Nate Butler <[email protected]>
Co-authored-by: Antonio Scandurra <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
mikayla-maki pushed a commit that referenced this pull request Oct 18, 2024
…editor (#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (#18591)
* [x] Add an apply button above every hunk
(#18592)
* [x] Expand all diff hunks by default
(#18598)
    * [x] Fix #18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(#18945)
* [x] No auto-indent? (#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Richard <[email protected]>
Co-authored-by: Marshall <[email protected]>
Co-authored-by: Nate Butler <[email protected]>
Co-authored-by: Antonio Scandurra <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
…ned (zed-industries#18648)

This PR fixes an issue where the proposed changes editor would not have
any syntax highlighting until a modification was made.

When creating the branch buffer we reparse the buffer to rebuild the
syntax map.

Release Notes:

- N/A
noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
…editor (zed-industries#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (zed-industries#18591)
* [x] Add an apply button above every hunk
(zed-industries#18592)
* [x] Expand all diff hunks by default
(zed-industries#18598)
    * [x] Fix zed-industries#18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(zed-industries#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(zed-industries#18945)
* [x] No auto-indent? (zed-industries#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Richard <[email protected]>
Co-authored-by: Marshall <[email protected]>
Co-authored-by: Nate Butler <[email protected]>
Co-authored-by: Antonio Scandurra <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
osiewicz pushed a commit that referenced this pull request Oct 22, 2024
…editor (#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (#18591)
* [x] Add an apply button above every hunk
(#18592)
* [x] Expand all diff hunks by default
(#18598)
    * [x] Fix #18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(#18945)
* [x] No auto-indent? (#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Richard <[email protected]>
Co-authored-by: Marshall <[email protected]>
Co-authored-by: Nate Butler <[email protected]>
Co-authored-by: Antonio Scandurra <[email protected]>
Co-authored-by: Richard Feldman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant