Formatting Ruby throws "Cannot read property 'split' of undefined"
See original GitHub issueIssue Type: Bug
I’m trying to use the Prettier extension to format Ruby code. The Prettier extension works fine with TypeScript, and the prettier
command-line tool works fine with Ruby.
I open a new file in VSCode and give it the contents
x = 2
I then change the language mode to Ruby, and execute the command Format Document, it correctly removes the leading 2 spaces. However, if I create a new file in my project app/models/test.rb
with the same contents and try to Format Document, I get a VSCode error alert that says:
Cannot read property 'split' of undefined
There is no backtrace, and I can’t find any more information about what could be generating this error.
Extension version: 2.3.0 VS Code version: Code 1.39.2 (6ab598523be7a800d7f3eb4d92d7ab9a66069390, 2019-10-15T15:33:00.827Z) OS version: Darwin x64 17.7.0
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i7-7700HQ CPU @ 2.80GHz (8 x 2800) |
GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: enabled oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_deferred_display_list: disabled_off skia_renderer: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: disabled_off webgl: enabled webgl2: enabled |
Load (avg) | 3, 2, 2 |
Memory (System) | 16.00GB (0.53GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Today I saw a Prettier warning (that I assume was introduced in a new version) saying that my Ruby version is no longer supported. I made sure it’s loading the right version of Ruby, and now formatting seems to work fine for these test cases. Feel free to close (or leave open if there’s some missing logging to address here). Thanks!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.