Skip to content

Commit ff2cdb7

Browse files
committed
Watch for YAML file changes
1 parent 27a3728 commit ff2cdb7

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

lib/ruby_lsp/ruby_lsp_rails/addon.rb

+17-6
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,30 @@ def register_additional_file_watchers(global_state:, outgoing_queue:)
223223
id: "workspace/didChangeWatchedFilesRails",
224224
method: "workspace/didChangeWatchedFiles",
225225
register_options: Interface::DidChangeWatchedFilesRegistrationOptions.new(
226-
watchers: [
227-
Interface::FileSystemWatcher.new(
228-
glob_pattern: "**/*structure.sql",
229-
kind: Constant::WatchKind::CREATE | Constant::WatchKind::CHANGE | Constant::WatchKind::DELETE,
230-
),
231-
],
226+
watchers: [structure_sql_file_watcher, yaml_file_watcher],
232227
),
233228
),
234229
],
235230
),
236231
)
237232
end
238233

234+
sig { returns(Interface::FileSystemWatcher) }
235+
def structure_sql_file_watcher
236+
Interface::FileSystemWatcher.new(
237+
glob_pattern: "**/*structure.sql",
238+
kind: Constant::WatchKind::CREATE | Constant::WatchKind::CHANGE | Constant::WatchKind::DELETE,
239+
)
240+
end
241+
242+
sig { returns(Interface::FileSystemWatcher) }
243+
def yaml_file_watcher
244+
Interface::FileSystemWatcher.new(
245+
glob_pattern: "**/*.{yml,yaml}",
246+
kind: Constant::WatchKind::CREATE | Constant::WatchKind::CHANGE | Constant::WatchKind::DELETE,
247+
)
248+
end
249+
239250
sig { void }
240251
def offer_to_run_pending_migrations
241252
return unless @outgoing_queue

0 commit comments

Comments
 (0)