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

\begin{} enviroment function completion lacking backslash in end #5

Closed
ivansigmund opened this issue Jul 17, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@ivansigmund
Copy link

what i get when i start writing \begin{} in zed, notice there is no backslash before end:

begin_zed.mov

what i expect is that the completion works like in neovim, at least that there is a beckslash:

begin_neovim.mov

i tried using the snippets extension, it as well has a backslash problem, i.e. it does not write backslashes. as i wrote here.

osiewicz added a commit to zed-industries/zed that referenced this issue Jul 21, 2024
## Release Notes:

- Fixed issue with backslashes not appearing in snippets
([#14721](#14721)),
motivated by a snippet provided by the latex LSP
([texlab](https://github.com/latex-lsp/texlab)) not working as intended
in Zed ([extension
issue](rzukic/zed-latex#5)).

[Screencast from 2024-07-21
14-57-19.webm](https://github.com/user-attachments/assets/3c95a987-16e5-4132-8c96-15553966d4ac)

## Fix details:

Only $, }, \ can be escaped by a backslash as per [LSP spec (under
grammar
section)](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/\#snippet_syntax).
Technically, commas and pipes can also be escaped only in "choice"
tabstops but it does not look like they are implemented in Zed yet.

## Additional tests added for cases currently not covered:
- backslash not being used to escape anything (so just a normal
backslash)
- backslash escaping a backslash (so that the second does not escape
what follows it)

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
@lnay
Copy link
Collaborator

lnay commented Jul 21, 2024

Should be sorted in next Zed release

kevmo314 pushed a commit to kevmo314/zed that referenced this issue Jul 29, 2024
## Release Notes:

- Fixed issue with backslashes not appearing in snippets
([zed-industries#14721](zed-industries#14721)),
motivated by a snippet provided by the latex LSP
([texlab](https://github.com/latex-lsp/texlab)) not working as intended
in Zed ([extension
issue](rzukic/zed-latex#5)).

[Screencast from 2024-07-21
14-57-19.webm](https://github.com/user-attachments/assets/3c95a987-16e5-4132-8c96-15553966d4ac)

## Fix details:

Only $, }, \ can be escaped by a backslash as per [LSP spec (under
grammar
section)](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/\#snippet_syntax).
Technically, commas and pipes can also be escaped only in "choice"
tabstops but it does not look like they are implemented in Zed yet.

## Additional tests added for cases currently not covered:
- backslash not being used to escape anything (so just a normal
backslash)
- backslash escaping a backslash (so that the second does not escape
what follows it)

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
@lnay
Copy link
Collaborator

lnay commented Aug 13, 2024

The fix came through in Zed version 0.146.3

@lnay lnay closed this as completed Sep 3, 2024
@lnay lnay added the bug Something isn't working label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants