Shopify / ruby-lsp-rails

A Ruby LSP addon for Rails
https://shopify.github.io/ruby-lsp-rails/
MIT License
515 stars 21 forks source link

Set server pipes to binmode #366

Closed vinistock closed 2 months ago

vinistock commented 2 months ago

There are a few Windows related fixes in this PR:

  1. The STDIN and STDOUT pipes must be set to binmode to prevent conversion of carriage returns. Otherwise, the server communication is broken
  2. There were some tests making assertions against URIs/paths that weren't valid on Windows
  3. When splitting the file path on : to separate the line number, we need to account for the fact that Windows' paths begin with C:/, which was resulting in the wrong path and line number
  4. SIGTERM cannot be used on Windows. Windows only responds to KILL, which we can also use on Linux/Mac to terminate a hanging server process