zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.57k stars 2.9k forks source link

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

Open mocenigo opened 3 weeks ago

mocenigo commented 3 weeks ago

Check for existing issues

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 c3075dfe9afc788a1a0a2b965f0eb4f9a4ba77b4) 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 commented 2 weeks ago

@mocenigo I'm facing the same error.

This happened after update zed version. Before I had https://github.com/zed-industries/zed/issues/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 commented 1 week ago

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 commented 1 week ago

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

lnay commented 6 days ago

db92a31067c8a6e6d889a63326decdd42f9de6c2 @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 commented 6 days ago

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

lnay commented 6 days ago

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 commented 6 days ago

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:

srteppei commented 5 days ago

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 commented 5 days ago

@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 commented 5 days ago

@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 commented 5 days ago

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.