Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion languages/ruby/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ tab_size = 2
increase_indent_pattern = '(^\s*(module|class|def|if|elsif|else|unless|case|when|while|until|for|begin|rescue|ensure)\b|\bdo\s*(\|[^|]*\|)?\s*$)'
decrease_indent_pattern = '^\s*(end|elsif|else|when|rescue|ensure)\b'
scope_opt_in_language_servers = ["tailwindcss-language-server"]
word_characters = ["?", "!"]
debuggers = ["rdbg"]

[overrides.string]
completion_query_characters = ["-", "."]
opt_into_language_servers = ["tailwindcss-language-server"]

[overrides.identifier]
word_characters = ["!", "?"]
7 changes: 7 additions & 0 deletions languages/ruby/overrides.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@

(string
(string_content) @string.inclusive)

[
(identifier)
(simple_symbol)
(hash_key_symbol)
"defined?"
] @identifier
Comment on lines +6 to +11

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: should we also add delimited_symbol and bare_symbol to handle use cases like :"ready?" or symbol arrays?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually left those out intentionally.

Delimited symbols and symbol arrays allow you to use any arbitrary non-alphabetic character (e.g. :"symbol-with-dashes! and spaces?") as well as string interpolation - none of those will be treated as word characters, which is why I don't think we should give special treatment to ! and ? in this situation

After all, you won't be able to select the entire symbol with a double click like you would with a non-delimited one.

Loading