aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/ruby-mode-resources (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge from origin/emacs-29Eli Zaretskii2023-12-301-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 53031528725 Revert "Fix treesit-node-field-name and friends (bug#66674)" fa0bb88302b ; * src/buffer.c (syms_of_buffer) <default-directory>: Do... 44517037aed ; Fix typo ccf46acefd2 ; Fix last change. c86b039dffc ; * etc/DEBUG: Improve advice for debugging native-compil... 9afba605bbc Explain status "r" in `epa-list-keys` 62714221968 ; * lisp/dired.el (dired--make-directory-clickable): Refo... fcbb0044899 Fix mouse clicks on directory line in Dired be8a7155b48 Fix 'split-root-window-right' and 'split-root-window-below' eb19984c4db Mark icalendar.el as maintained by emacs-devel 03dc914fd37 ; Fix footnotes in ELisp Intro manual ceacf753958 Fix usage of `setq-default' and offer more suggestions 2701da0eee5 Fix python-ts-mode triple quote syntax (bug#67262) 683c7c96871 Increment parser timestamp when narrowing changes (bug#67... 8ae42c825e1 ruby-ts-mode: Fix indentation for string_array closer 9cfa498e0ab treesit-major-mode-setup: Use 'treesit--syntax-propertize... da2e440462b ruby-ts-mode: Fix an out-of-bounds error with heredoc at eob 6ea507296a7 Correctly refontify changed region in tree-sitter modes (...
| * ruby-ts-mode: Fix indentation for string_array closerDmitry Gutov2023-12-241-0/+4
| | | | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix indentation for string_array closer.
* | ruby-syntax-methods-before-regexp: Drop this whitelistDmitry Gutov2023-12-161-3/+3
|/ | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re): Match only based on keywords and operators. (ruby-syntax-methods-before-regexp): Delete. (ruby-syntax-propertize): Use the new heuristic based on spaces instead of checking for method names before (bug#67569). * test/lisp/progmodes/ruby-mode-tests.el (ruby-regexp-not-division-when-only-space-before): Use non-whitelisted method name. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Adjust two examples.
* ruby-mode: Fix method call indentation in rhs of multiple assignmentDmitry Gutov2023-02-281-0/+5
| | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Special-case assignment that follows a comma-separated list (bug#61871). * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add case.
* ruby-smie-rules: Fix misindentation of a method call after assignmentDmitry Gutov2023-02-271-0/+4
| | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix indentation of a method call after assignment with ruby-after-operator-indent=nil (bug#61822). * test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb: Add corresponding example.
* ruby-ts-mode: Fix two additional cases with ruby-method-call-indent=nilDmitry Gutov2023-01-221-0/+9
| | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix two additional cases with ruby-method-call-indent=nil. * test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb: Add examples.
* (ruby-ts--indent-rules): Add a rule for continuation of a hash pairDmitry Gutov2023-01-191-0/+6
| | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Add a rule for continuation of a hash pair. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
* (ruby-ts--parent-call-or-bol): Handle more cases with nested literalsDmitry Gutov2023-01-191-0/+17
| | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol): Handle more cases with nested literals. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
* (ruby-ts--statement-container-regexp): Remove "parenthesized_statements"Dmitry Gutov2023-01-191-0/+8
| | | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--statement-container-regexp): Remove "parenthesized_statements", it's not really a statement container, not one we'd use for indentation alignment anyway. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
* ruby-ts-mode: Obey the option ruby-method-call-indentDmitry Gutov2023-01-181-0/+1
| | | | | | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--method-call-indent-p): New function. (ruby-ts--indent-rules): Use it. * test/lisp/progmodes/ruby-ts-mode-tests.el: Run indent test for ruby-method-call-indent.rb. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add explicit value for ruby-method-call-indent.
* ruby-ts-mode: Obey the option ruby-after-operator-indentDmitry Gutov2023-01-181-0/+3
| | | | | | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--after-op-indent-p): New function. (ruby-ts--indent-rules): Use it. * test/lisp/progmodes/ruby-ts-mode-tests.el: Run indent test for ruby-after-operator-indent.rb. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Make sure indentation vars are at their default values.
* ruby-ts-mode: Fix indent after operator or conditionalDmitry Gutov2023-01-181-0/+13
| | | | | | | | | | | | | | Make it match ruby-mode's indentation behavior. * lisp/progmodes/ruby-ts-mode.el (ruby-ts--binary-indent-anchor): New function. (ruby-ts--indent-rules): Use it instead of a composite matcher. Add a rule for 'conditional'. (ruby-ts--assignment-ancestor, ruby-ts--is-in-condition) (ruby-ts--endless-method): Remove. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
* ruby-ts-mode: Fix/change indentation of a continuation method callDmitry Gutov2023-01-181-0/+13
| | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix/change indentation of a continuation method call. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: New examples.
* ruby-ts-mode: Fix indent inside parenthesized_expr and else/end after unlessDmitry Gutov2023-01-181-0/+10
| | | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix indentation for parenthesized_expression and else/end after 'unless'. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: New examples.
* ruby-ts-mode: Fix the rules for hanging arrays and hashesDmitry Gutov2023-01-181-0/+23
| | | | | | | | | | | * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix the rules for hanging arrays and hashes (to line up to parent-bol instead of the opening brace). * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: New file with examples. * test/lisp/progmodes/ruby-ts-mode-tests.el: Use it here.
* ; ruby.rb: Fix pattern matching syntax and extend the exampleDmitry Gutov2023-01-091-1/+1
|
* Add new options for Ruby code indentationDmitry Gutov2022-12-315-0/+123
| | | | | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-block-indent) (ruby-after-operator-indent, ruby-method-call-indent) (ruby-parenless-call-arguments-indent): New options (bug#60186). (ruby-smie-grammar): Specify associativity for "?". (ruby-smie--indent-to-stmt): Add optional argument. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: New cases. * test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb: * test/lisp/progmodes/ruby-mode-resources/ruby-block-indent.rb: * test/lisp/progmodes/ruby-mode-resources/ruby-after-operator-indent.rb: * test/lisp/progmodes/ruby-mode-resources/ ruby-parenless-call-arguments-indent.rb: New files. * test/lisp/progmodes/ruby-mode-tests.el: Add indentation tests for new files.
* ruby-method-params-indent: New user optionDmitry Gutov2022-12-192-0/+22
| | | | | | | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-method-params-indent): New option (bug#60110). (ruby-smie-rules): Use it. * etc/NEWS: Mention it. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Ensure the var's value is default. * test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb: New file. * test/lisp/progmodes/ruby-mode-tests.el (ruby-deftest-indent): New macro, use it to run the indentation test using the new file. Disable the :expensive-test tag, because neither runs for "longer than some few seconds", both take significantly below 1s.
* ruby-mode: Support endless singleton method definitions tooDmitry Gutov2022-12-191-1/+3
| | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re): Update to match not only 'self.' but 'xyz.' as well (bug#54702). * test/lisp/progmodes/ruby-mode-resources/ruby.rb (Bar#foo=): Update example.
* ruby-mode: Support endless methods (bug#54702)Dmitry Gutov2022-12-181-0/+33
| | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-endless-method-head-re): New constant. (ruby-smie-grammar): New token. (ruby-smie--forward-token, ruby-smie--backward-token): Recognize it. (ruby-smie-rules): Indentation support. (ruby-add-log-current-method): Support here too. * test/lisp/progmodes/ruby-mode-tests.el (ruby-add-log-current-method-after-endless-method): New test. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: New examples.
* ruby-mode: Recognize instance or global var as first arg in parenless callDmitry Gutov2022-12-171-0/+3
| | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Recognize instance or global var as first arg in parenless call. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add example.
* ; Prefer HTTPS to HTTP in many URLsStefan Kangas2022-10-151-2/+2
|
* Fix Ruby indentation with double splat as first block paramDmitry Gutov2022-04-261-0/+9
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token) (ruby-smie--backward-token): Tokenize "**" separately from "|". Problem reported at https://github.com/dgutov/robe/issues/136.
* Support indentation of Ruby pattern matching expressionsDmitry Gutov2022-03-211-0/+8
| | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-grammar, ruby-smie-rules) (ruby-block-mid-keywords): Treat 'in' token similarly to 'when'. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add indentation example.
* ruby-syntax-propertize: Fix certain cases following ::Dmitry Gutov2021-02-021-1/+1
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Make sure to backtrack if the "symbols with special characters" rule is aborted because of preceding colon.
* ruby-mode: Recognize setter symbolsDmitry Gutov2020-12-311-0/+8
| | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Add a rule for setter symbols (bug#42846). (ruby-font-lock-keywords): Remove dead code, left over from before commit 26f9c507. * lisp/progmodes/ruby-mode.el (ruby-smie--bosp): Handle '=' being part of a symbol (bug#42846). * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add corresponding indentation examples.
* ; Prefer https to http in more URLsStefan Kangas2020-10-241-1/+1
| | | | These were all tested and confirmed working.
* Convert manual indent test for ruby-mode into unit testStefan Kangas2020-09-211-0/+477
* test/manual/indent/ruby.rb: Move from here... * test/lisp/progmodes/ruby-mode-resources/ruby.rb: ...to here. * test/lisp/progmodes/ruby-mode-tests.el (ruby-mode-tests-data-dir): New variable. (ruby--indent/converted-from-manual-test): New test.