Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.35k stars 121 forks source link

Update Prism requirement to v0.28 #2017

Closed vinistock closed 2 weeks ago

vinistock commented 3 weeks ago

Motivation

Update our Prism requirement to v0.28 or higher. Version v0.28 includes the new ASCIISource with performance optimization for sources that do not contain multibyte characters, which fixes the performance regression we introduced in semantic highlighting.

Implementation

  1. Updated Prism and RBI
  2. Re-generated gem RBIs
  3. Fixed errors related to the restructuring of constant paths

Before, each part of a constant path was also a constant read. After this version, only the parent parts of the constant path may be constant reads, the main name of the constant is embedded inside the constant path node.

# Before
# This would be 3 constant read nodes to compose the constant path

# After
# This is now 2 constant read nodes and the name `C` is a part of the overall constant path
A::B::C

Automated Tests

Fixed a few tests.

andyw8 commented 3 weeks ago

Are the vscode/ changes supposed to be part of this PR?

vinistock commented 3 weeks ago

The upgrade ended up uncovering some other Windows errors and I was trying to get CI to pass. If you prefer, I can split that into a separate PR, but the changes are necessary.

andyw8 commented 3 weeks ago

The upgrade ended up uncovering some other Windows errors and I was trying to get CI to pass. If you prefer, I can split that into a separate PR, but the changes are necessary.

Ok, yeah I'd say we should split them since there's quite a lot of changes. I'll limit my review to the Ruby part.

vinistock commented 3 weeks ago

Split the other part, which needs to be merged first https://github.com/Shopify/ruby-lsp/pull/2033.

andyw8 commented 2 weeks ago

https://github.com/Shopify/ruby-lsp/pull/2033 is blocked on Windows, so I'll update this branch to remove the /vscode changes.