Skip to content
Merged
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 thread
vitallium marked this conversation as resolved.
4 changes: 4 additions & 0 deletions tests/languages/ruby/overrides.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Overrides fixtures for tree-sitter queries

# A Ruby comment
plain_string = "plain text"
interpolated_string = "hello #{user.name}"
single_quoted_string = 'single quoted text'
regexp = /[a-z]+/
symbol = :valid?
defined? function!
{ symbol?: :"!delimited", "key-hash": "value", "string" => nil }
66 changes: 63 additions & 3 deletions tests/languages/ruby/snapshots/overrides.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,76 @@ expression: captures
- name: comment.inclusive
line: 1
column: 1
text: "# Overrides fixtures for tree-sitter queries"
- name: comment.inclusive
line: 3
column: 1
text: "# A Ruby comment"
- name: identifier
line: 4
column: 1
text: plain_string
- name: string.inclusive
line: 2
line: 4
column: 17
text: plain text
- name: identifier
line: 5
column: 1
text: interpolated_string
- name: string.inclusive
line: 3
line: 5
column: 24
text: "hello "
- name: identifier
line: 5
column: 32
text: user
- name: identifier
line: 5
column: 37
text: name
- name: identifier
line: 6
column: 1
text: single_quoted_string
- name: string.inclusive
line: 4
line: 6
column: 25
text: single quoted text
- name: identifier
line: 7
column: 1
text: regexp
- name: identifier
line: 8
column: 1
text: symbol
- name: identifier
line: 8
column: 10
text: ":valid?"
- name: identifier
line: 9
column: 1
text: defined?
- name: identifier
line: 9
column: 10
text: function!
- name: identifier
line: 10
column: 3
text: symbol?
- name: string.inclusive
line: 10
column: 28
text: key-hash
- name: string.inclusive
line: 10
column: 40
text: value
- name: string.inclusive
line: 10
column: 49
text: string
Loading