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

LaTeX extension LSP stopped working on main branch of Zed Dev starting Sep 26 2024 #18456

Closed
1 task done
mocenigo opened this issue Sep 27, 2024 · 14 comments
Closed
1 task done
Labels
bug [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers regression A bug that was introduced in a recent release

Comments

@mocenigo
Copy link

mocenigo commented Sep 27, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Under macOS, assume that texlab, the latex extension version 0.0.7, and Skim are installed, and that texlab has been configured, for instance wirth the following in settings.json

  "lsp": {
    "texlab": {
      "settings": {
        "texlab": {
          "latexindent": {
            "modifyLineBreaks": true
          },
          "build": {
            "onSave": true,
            //"executable": "lualatex",
            //"args": [
            //  "--shell-escape",
            //  "--synctex=1",
            // "%f",
            //],
            "forwardSearchAfter": true
          },
          "forwardSearch": {
            "executable": "/Applications/Skim.app/Contents/SharedSupport/displayline",
            "args": [
              "-r",
              "%l",
              "%p",
              "%f"
            ]
          }
        }
      }
    }
  },

(Nothing changes if the commented command is uncommented.)
Usually, pressing cmd-S under macOS will compile, if necessary, and then open Skim (the location is not always correct, but it us often the previous one, I will file a separate ticket).

However, some commit on Sept Thu 26, broke this, and no compilation occurs, nor is Skim opened.

Environment

Zed: v0.156.0 (Zed Dev c3075df)
OS: macOS 15.1.0
Memory: 24 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
2024-09-27T19:48:28.586072+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-09-27T19:48:30.412691+02:00 [INFO] Summarizing updated entries took 3.917µs
2024-09-27T19:48:30.534001+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-09-27T19:48:30.534155+02:00 [INFO] Summarizing updated entries took 4.167µs
2024-09-27T19:48:30.643115+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-09-27T19:49:00.820457+02:00 [INFO] open paths ["/Users/mocenigo/Research/PAC-Analysis/paper_short/truncated-reduced.tex"]
2024-09-27T19:49:22.238941+02:00 [INFO] Summarizing updated entries took 5.833µs
2024-09-27T19:49:22.377786+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-09-27T19:49:28.451511+02:00 [INFO] Summarizing updated entries took 5.291µs
2024-09-27T19:49:28.558787+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-09-27T19:49:28.632016+02:00 [INFO] Summarizing updated entries took 5.791µs
2024-09-27T19:49:29.852722+02:00 [INFO] Summarizing updated entries took 5.833µs
2024-09-27T19:49:29.961501+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-09-27T19:49:30.482029+02:00 [INFO] Summarizing updated entries took 4.583µs
2024-09-27T19:49:30.582189+02:00 [INFO] Summarizing updated entries took 5.542µs
2024-09-27T19:49:30.78178+02:00 [INFO] Summarizing updated entries took 4.417µs
2024-09-27T19:49:32.940471+02:00 [INFO] Summarizing updated entries took 4.875µs
2024-09-27T19:49:33.180353+02:00 [INFO] Summarizing updated entries took 5.459µs
2024-09-27T19:49:33.286399+02:00 [ERROR] failed to fetch cached embeddings via cloud model
@srteppei
Copy link

srteppei commented Oct 2, 2024

@mocenigo I'm facing the same error.

This happened after update zed version. Before I had #18450 which is already fixed

SO: Fedora 40 Sway atomic
Package manager: Flatpak

2024-10-01T17:57:23.023764166+02:00 [ERROR] failed to fetch cached embeddings via cloud model

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-10-01T17:57:27.85267766+02:00 [INFO] Summarizing updated entries took 5.247µs
2024-10-01T17:57:28.006472896+02:00 [ERROR] failed to fetch cached embeddings via cloud model
$ flatpak list | grep zed                                                                                                                                                                                                                                                                                           
Zed Industries, Inc.	dev.zed.Zed	v0.154.4	stable	system

@cambordas
Copy link

I can also confirm the bug when building it from source (87cc20f) running Arch Linux

Not sure if relevant but I get the same error as above. The logs also shows that the command is sent (texlab - RPC messages):

{"jsonrpc":"2.0","id":4,"result":[{"build":{"onSave":true},"chktex":{"onEdit":true}}]}

@mocenigo
Copy link
Author

mocenigo commented Oct 8, 2024

Yeah, it seems a problem with onSave. The other functionality works, including syncing with the pdf (although in the wrong place).

@notpeter notpeter added language server failure Language server doesn't work as expected language server An umbrella label for all language servers extension infrastructure Feedback for extensions APIs, creation, management, etc regression A bug that was introduced in a recent release and removed triage extension infrastructure Feedback for extensions APIs, creation, management, etc labels Oct 13, 2024
@notpeter notpeter changed the title LaTeX stopped working on main branch of Zed Dev starting Sep 26 2024 LaTeX extension LSP stopped working on main branch of Zed Dev starting Sep 26 2024 Oct 13, 2024
@lnay
Copy link
Contributor

lnay commented Oct 13, 2024

db92a31 @osiewicz
Could you clarify "Save notifications are reported only to servers that signed up for a given extension". Does this mean file extension, and is this signing up something that the language serve do itself or something that Zed extensions can configure?

@lnay
Copy link
Contributor

lnay commented Oct 13, 2024

For reference, texlab still receives textDocument/documentHighlight from just moving the cursor, but no longer receives textDocument/didSave starting from that commit.
image

@lnay
Copy link
Contributor

lnay commented Oct 13, 2024

The first affected release for this particular issue would have been v0.156.0 on 9th October. So @srteppei you have a different problem, you can raise an issue on the extension repository if you are still have this issue on Zed v < 0.156.0.

@lnay
Copy link
Contributor

lnay commented Oct 13, 2024

Just read slightly more into the original PR and LSP spec. Here's another piece of the Zed log in case it's relevant (or is it only didChangeWatchedFiles that matters?):

2024-10-13T23:14:40.825723666+01:00 [INFO] starting language server process. binary path: "/path/to/texlab", working directory: "/path/to/workspace/", args: []
2024-10-13T23:14:40.829361409+01:00 [WARN] unhandled capability registration: Registration { id: "pull-config", method: "workspace/didChangeConfiguration", register_options: None }

The changelog for texlab contains the following from 2022:

  • BREAKING: Use client-side file watching instead of server-side notifications (workspace/didChangeWatchedFiles)

@srteppei
Copy link

srteppei commented Oct 14, 2024

Well I opened here the error cause just was the same message, don't know what is LaText.

Caused by:
    RPC request GetCachedEmbeddings failed: permission denied
2024-10-14T08:11:37.365078357+02:00 [INFO] starting language server process. binary path: "/var/home/user/.var/app/dev.zed.Zed/data/zed/extensions/work/elixir/elixir-ls-v0.24.0/language_server.sh", working directory: "/var/home/user/Documents/project/test", args: []
2024-10-14T08:11:37.546506519+02:00 [INFO] Initializing default prettier with plugins {}
2024-10-14T08:11:37.564651739+02:00 [WARN] request completed with error: failed to connect to the server
2024-10-14T08:11:37.575602145+02:00 [ERROR] failed to fetch cached embeddings via cloud model

My actual version

flatpak list | grep zed                                                                                                                                                                                                                                       
Zed	dev.zed.Zed	v0.155.2	stable	system

If this is not the place, where should I open it @lnay ?

@osiewicz
Copy link
Contributor

@lnay

Could you clarify "Save notifications are reported only to servers that signed up for a given extension". Does this mean file extension, and is this signing up something that the language serve do itself or something that Zed extensions can configure?

Yes, I meant file extensions there. It is on a language server (via file system watchers) to do it and not the Zed extension.

@lnay
Copy link
Contributor

lnay commented Oct 14, 2024

@osiewicz is there a way to get a log for the RPC responses from the server from before I manage to open "debug: open language server logs"? I cannot find didChangeWatchedFiles in either the Zed logs or the language server logs by the time I get it open.

@osiewicz
Copy link
Contributor

Yeah, it's a common pain point of LSP log view. You can run zed with RUST_LOG=lsp=trace zed --foreground; that'll print all logs to the console you run it from.

@cambordas
Copy link

@mocenigo I compiled today my zed with this commit ebc3031 and onSave is working again. I might try to compile with the lastest commit as of today, but I have a feeling it would also work.

@lnay
Copy link
Contributor

lnay commented Oct 29, 2024

Just checked the current release, everything is fine now. It seems there has been a discussion about how to interpret the LSP spec: #19183

@lnay
Copy link
Contributor

lnay commented Nov 7, 2024

I think this can be closed as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers regression A bug that was introduced in a recent release
Projects
None yet
Development

No branches or pull requests

6 participants