Shopify / ruby-lsp

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

Document how addons can listen for file changes #1972

Closed Earlopain closed 2 weeks ago

Earlopain commented 3 weeks ago

Motivation

Addons may want to listen for changes to files and do something about it. ruby-lsp-rails for example listens for structure.sql to restart the rails runner for updated column information, after https://github.com/Shopify/ruby-lsp-rails/pull/341 is merged.

ruby-lsp itself wants to check for changes to the rubocop config in the server to resolve https://github.com/Shopify/ruby-lsp/issues/1457

rubyfmt for ruby-lsp-rubyfmt appears to change behaviour depending on .gitignore and .rubyfmtignore.


I noticed that some activation methods didn't yet take the global state in the docs here . I've updated these in a separate commit here.

Earlopain commented 2 weeks ago

I will redo updating the activate methods to take the global state after #1998 is merged so there are no conflicts.

vinistock commented 2 weeks ago

Thank you for the contribution!