Skip to content

Ruby LSP indexing files seems to hang at 100% #185

Open

Description

@Samsinite

This never goes away:
Image

The editor will send RPC messages, but it never seems to get a response.

LSP Logs:

// Receive:
{"method":"$/progress","params":{"token":"indexing-progress","value":{"kind":"report","message":"97% completed","percentage":97}},"jsonrpc":"2.0"}

// Receive:
{"method":"$/progress","params":{"token":"indexing-progress","value":{"kind":"report","message":"98% completed","percentage":98}},"jsonrpc":"2.0"}

// Receive:
{"method":"$/progress","params":{"token":"indexing-progress","value":{"kind":"report","message":"99% completed","percentage":99}},"jsonrpc":"2.0"}

// Receive:
{"method":"$/progress","params":{"token":"indexing-progress","value":{"kind":"report","message":"100% completed","percentage":100}},"jsonrpc":"2.0"}

// Send:
{"jsonrpc":"2.0","id":5,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///Users/samclopton/workspace/clever-case/app/models/xero_api.rb"},"position":{"line":27,"character":25}}}

// Send:
{"jsonrpc":"2.0","id":6,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///Users/samclopton/workspace/clever-case/app/models/xero_api.rb"},"range":{"start":{"line":27,"character":25},"end":{"line":27,"character":25}},"context":{"diagnostics":[],"only":["","quickfix","refactor","refactor.extract","source"]}}}

// Send:
{"jsonrpc":"2.0","id":7,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///Users/samclopton/workspace/clever-case/app/models/xero_api.rb"},"position":{"line":20,"character":13}}}

// Send:
{"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":7}}

// Send:
{"jsonrpc":"2.0","id":8,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///Users/samclopton/workspace/clever-case/app/models/xero_api.rb"},"position":{"line":20,"character":13}}}

// Send:
{"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":8}}

It has been doing this for a few weeks. Interestingly, restarting after the latest zed update make it work, but after a subsequent restart, it continues to hang at 100%.

Activity

  1. added theissue type on Sep 23, 2025
  2. vitallium commented on Sep 23, 2025

    @vitallium
    Collaborator

    Hi! Thanks for reporting this. I marked it as an upstream issue (in Ruby LSP), but I'm not fully sure. I'll double-check.

    @Samsinite can you please check which Ruby LSP version you're using? And Ruby version as well, I think.

  3. Samsinite commented on Sep 30, 2025

    @Samsinite
    Author

    Hi! Thanks for reporting this. I marked it as an upstream issue (in Ruby LSP), but I'm not fully sure. I'll double-check.

    @Samsinite can you please check which Ruby LSP version you're using? And Ruby version as well, I think.

    On ruby 3.1.7, just updated ruby-lsp to 0.26.1 in the Gemfile and still getting the same issue,

  4. andrieiev commented on Oct 1, 2025

    @andrieiev

    I have had the same issue for a few weeks; it's reproducible on 2 MacBooks with ruby-lsp 0.22.1, 0.23.24, and 0.26.* in 3 different projects with Ruby 3.0.6. At the same time, it works fine with VSCode.

  5. brunnopleffken commented on Oct 3, 2025

    @brunnopleffken

    I believe my issues here are related to this. Ruby LSP (and the ruby process) are showing very high CPU usage in the last few weeks. Zed became really sluggish when working with Ruby files, with LSP errors taking several seconds to render on screen (or errors taking time to disappear).

    I don't have these issues in VS Code.

  6. Samsinite commented on Oct 10, 2025

    @Samsinite
    Author

    I do want to mention that upgrading to Ruby 3.2 has thankfully solved this issue for me. Still curious why the ruby-lsp extension in VSCode works though and not the ruby Zed extension.

  7. vitallium commented on Oct 11, 2025

    @vitallium
    Collaborator

    I do want to mention that upgrading to Ruby 3.2 has thankfully solved this issue for me. Still curious why the ruby-lsp extension in VSCode works though and not the ruby Zed extension.

    I think this could be due to differences in implementation. The Ruby extension for Zed does not have all the features that the extension for VSCode has because Zed's API is limited.

  8. bernardodsanderson commented on Oct 19, 2025

    @bernardodsanderson

    This is an unfortunate bug, as I can't seem to use Zed anymore due to the memory and CPU usage. Completely locks up my computer after an hour or so.

  9. janko commented on Nov 11, 2025

    @janko
    Contributor

    Can anyone reproduce the indexing hanging outside of Zed?

    # ruby_lsp_index.rb
    require "ruby_lsp/internal"
    
    index = RubyIndexer::Index.new
    index.index_all do |progress|
      puts "Progress: #{progress}%"
      true
    end
    $ bundle exec ruby ruby_lsp_index.rb
    $ bundle exec ruby --yjit ruby_lsp_index.rb # maybe it only happens with YJIT?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions