From 3921259b6c054db46245a6d13b95add0d5dc3d83 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Thu, 15 Feb 2024 14:25:18 +0100 Subject: [PATCH] Extend Ruby word characters to include valid identifier chars (#7824) In Ruby `_$=@!:?` can all be part of an identifier. If we don't have them in this list, autocomplete doesn't work as expected. See: https://gist.github.com/misfo/1072693 This fixes one part of #7819 but not the whole ticket. Release Notes: - Fixed completions in Ruby not working for identifiers that start or end with special characters (e.g.: `@`) --- crates/zed/src/languages/ruby/config.toml | 53 +++++++++++++---------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/crates/zed/src/languages/ruby/config.toml b/crates/zed/src/languages/ruby/config.toml index d3285d48d2..3784952f6c 100644 --- a/crates/zed/src/languages/ruby/config.toml +++ b/crates/zed/src/languages/ruby/config.toml @@ -1,33 +1,40 @@ name = "Ruby" grammar = "ruby" path_suffixes = [ - "rb", - "Gemfile", - "rake", - "Rakefile", - "ru", - "thor", - "cap", - "capfile", - "Capfile", - "jbuilder", - "rabl", - "rxml", - "builder", - "gemspec", - "rdoc", - "thor", - "pryrc", - "simplecov" + "rb", + "Gemfile", + "rake", + "Rakefile", + "ru", + "thor", + "cap", + "capfile", + "Capfile", + "jbuilder", + "rabl", + "rxml", + "builder", + "gemspec", + "rdoc", + "thor", + "pryrc", + "simplecov", ] first_line_pattern = '^#!.*\bruby\b' line_comments = ["# "] autoclose_before = ";:.,=}])>" brackets = [ - { start = "{", end = "}", close = true, newline = true }, - { start = "[", end = "]", close = true, newline = true }, - { start = "(", end = ")", close = true, newline = true }, - { start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] }, - { start = "'", end = "'", close = true, newline = false, not_in = ["comment", "string"] }, + { start = "{", end = "}", close = true, newline = true }, + { start = "[", end = "]", close = true, newline = true }, + { start = "(", end = ")", close = true, newline = true }, + { start = "\"", end = "\"", close = true, newline = false, not_in = [ + "comment", + "string", + ] }, + { start = "'", end = "'", close = true, newline = false, not_in = [ + "comment", + "string", + ] }, ] collapsed_placeholder = "# ..." +word_characters = ["_", "$", "=", "@", "!", ":", "?"]