Skip to content

Releases: jeanpaulsio/codemirror-lang-ruby

v0.4.4

27 Mar 14:46

Choose a tag to compare

Fixed

  • npm package missing README — Added README.md and LICENSE to the files field in package.json so they are included in the published tarball.

Full Changelog: v0.4.3...v0.4.4

v0.4.3

27 Mar 14:39
68ce567

Choose a tag to compare

Fixed

  • Trailing comma inside delimiters — Pressing Enter after a line ending with a trailing comma inside {}, [], or () no longer adds an extra indent level. Added delimiter-depth detection so the continuation-indent logic defers to delimitedIndent inside brackets.
  • String interpolation false positive — The continuation regex's trailing-comment capture (#.*)?$ was matching #{interpolation} inside strings as a comment, causing lines like "Hello, #{@name}!" to be treated as trailing-comma continuations. Fixed by excluding #{ from the comment pattern.

Added

  • 14 new indent test cases (section 33 + unskipped 28b) covering hashes, arrays, method args, nested constructs, bare call continuations, and interpolated strings

Full Changelog: v0.4.2...v0.4.3

v0.4.2

27 Mar 06:56
f2e42a0

Choose a tag to compare

What's Changed

Bug Fixes

  • Heredocs with trailing codefoo(<<~SQL) and <<~HEREDOC.strip now parse without errors (#25). Uses a hybrid tokenizer approach: full token when no trailing code (body highlighted as string), opener-only token when trailing code exists (parser handles ), .method, etc. correctly).

Documentation

  • Updated README known limitations to reflect the heredoc fix
  • Updated benchmark accuracy numbers — improvements across most projects:
    • Sidekiq 93.5% → 95.6% (+2.1%)
    • Grape 94.0% → 95.8% (+1.8%)
    • Rails 94.3% → 96.0% (+1.7%)
    • Fastlane 95.0% → 96.3% (+1.3%)
    • Devise 98.1% → 98.3% (+0.2%)

Stats

  • 105 tests passing
  • 0 regressions

Full Changelog: v0.4.1...v0.4.2

v0.4.1

27 Mar 03:39

Choose a tag to compare

Fixes

Keyword arguments with receiver (Bug A)

obj.foo(a: 1), User.where(active: true), self.foo(kw: 1), and all receiver-style method calls with keyword args now parse correctly. Previously only foo(a: 1) (no receiver) worked.

Scoped constants in rescue (Bug B)

rescue Foo::Bar => e, rescue Foo::Bar, Baz => e, and rescue Foo::Bar::Baz => e now parse correctly.

24 new bare method names (Bug C)

Added common Rails/Ruby DSL methods: skip_before_action, skip_after_action, skip_around_action, class_methods, included, concerning, validates_presence_of, validates_uniqueness_of, validates_length_of, validates_format_of, has_and_belongs_to_many, after_initialize, after_find, before_destroy, after_destroy, before_update, after_update, before_validation, after_validation, rescue_from, helper_method, helper, memoize, freeze

Stats

  • 49 bare methods (up from 25)
  • 721 total tests across 7 suites (up from 575)
  • 42 new tests for the three fixes
  • Zero regressions

Full changelog: v0.4.0...v0.4.1

v0.4.0

27 Mar 03:14
36092ea

Choose a tag to compare

What's new

Grammar fixes

  • ::TopLevel leading scope resolution::TopLevel, ::TopLevel::Foo, and class ::Foo now parse correctly
  • Hash patterns in case/inin {name: String => n} and in {name:} shorthand now supported
  • Find patterns in case/inin [*, 2, *] and in [*pre, value, *post] now supported

Bug fixes

  • Auto-indent on Enter — Fixed rubyIndentService to use IndentContext.lineAt() instead of raw document access, so pressing Enter after def foo (and other block openers) correctly indents the cursor

Docs

  • README "What's supported" updated with new pattern matching and scope resolution features
  • Removed 4 stale known limitations (symbol-key shorthand was already working, 3 bugs now fixed)
  • Rails parse accuracy improved 94.2% → 94.3%

Stats

  • bug-check.mjs: 114 pass, 3 fail (down from 111 pass, 6 fail in v0.3.0)
  • All 575+ tests passing across 7 suites with zero regressions

Full changelog: v0.3.0...v0.4.0

v0.3.0

27 Mar 02:34

Choose a tag to compare

Highlights

  • 575 tests across 7 suites (up from 105) — indentation, highlighting, folding, completion, grammar accuracy, performance, and integration
  • 35 grammar bugs identified, 29 fixed — bare rescue in method bodies, lambdas without params, setter assignment, constants as method calls, and more
  • Parse accuracy jumped from 85–91% to 93–98% across all real-world benchmark files (Rails, Jekyll, Devise, Faker, Fastlane, Grape, Sidekiq)
  • private def, protected def, and private_class_method def now indent correctly
  • Mixed do/end + {} block nesting no longer confuses the indent engine

What's Changed

See the full CHANGELOG for details.

Full Changelog: v0.2.0...v0.3.0

v0.2.0

26 Mar 21:12
c1efd3b

Choose a tag to compare

Highlights

  • Comprehensive indentation — 119 programmatic tests covering all Ruby indent/dedent patterns including block openers, mid-block keywords, closing delimiters, continuation lines, method chaining, and nested blocks
  • Subscript expressionsarr[0], hash[:key], matrix[i][j]
  • Setter & class method definitionsdef name=(value), def self.method_name
  • Indentation engine rewritten for robust handling of incomplete code while typing

What's Changed

See the full CHANGELOG for details.

Full Changelog: v0.1.0...v0.2.0