castwide / solargraph

A Ruby language server.
https://solargraph.org
MIT License
1.87k stars 154 forks source link

Failed to start Solargraph: Error: [IndexError] index 268435456 too big #656

Open Goniff opened 1 year ago

Goniff commented 1 year ago

Hello,

I was trying out Solargraph in VScode today and ran into the above issue. I've tried several solutions I found online, and none of them helped. I wish I could provide more information

I have looked at both:

adamlwatson commented 1 year ago

Having this same issue. I've add the "max_files: 0" option to the .solargraph.yml file to no avail. Anyone know of a fix for this?

castwide commented 12 months ago

This appears to be a limitation of array sizes in Ruby. I can reproduce the error in irb like this:

irb(main):001:0> x = Array.new
=> []
irb(main):002:0> x[268_435_456] = 0
(irb):2:in `<main>': index 268435456 too big (IndexError)
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/irb-1.6.3/exe/irb:9:in `<top (required)>'
        from C:/Ruby31-x64/bin/irb:25:in `load'
        from C:/Ruby31-x64/bin/irb:25:in `<main>'

If you can provide a stack trace or a repo that causes the error, I might be able to find a fix.