You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
Using language server? (eg useLanguageServer is true?) Yes
Expected behavior
It should format correctly the following file using rubocop:
Input:
# frozen_string_literal: trueputs"this is a test"puts"\n=========================================================="puts"okokokok"
Expected output (works when using rubocop standalone):
# frozen_string_literal: trueputs'this is a test'puts"\n=========================================================="puts'okokokok'
Actual behavior
The actual output when calling Format document removes most of the document:
"
puts 'okokokok'
More info
It looks like the issue is when parsing the output from rubocop it
thinks that the line with multiple ==== is the marker from rubocop when the actual file content starts.
~ ruby-2.6.2 🍔 cat test-rubocop.rb | rubocop -s test-rubocop.rb -a
Inspecting 1 file
C
Offenses:
test-rubocop.rb:1:1: C: Naming/FileName: The name of this source file (test-rubocop.rb) should use snake_case.
# frozen_string_literal: true
^
test-rubocop.rb:3:6: C: [Corrected] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
puts "this is a test"
^^^^^^^^^^^^^^^^
test-rubocop.rb:5:6: C: [Corrected] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
puts "okokokok"
^^^^^^^^^^
1 file inspected, 3 offenses detected, 2 offenses corrected
====================
# frozen_string_literal: true
puts 'this is a test'
puts "\n=========================================================="
puts 'okokokok'
The text was updated successfully, but these errors were encountered:
tkoenig
added a commit
to tkoenig/vscode-ruby
that referenced
this issue
Aug 21, 2019
This would be a quick fix for rubyide#519. (I tested this quickly modifying the extensions js file)
Given more thought it might be better to get the **first** instance of `FORMATTED_OUTPUT_DELIMITER`and not the last one to detect the end of rubocop diagnostics?
Your environment
vscode-ruby
version: 0.24.2useLanguageServer
is true?) YesExpected behavior
It should format correctly the following file using rubocop:
Input:
Expected output (works when using rubocop standalone):
Actual behavior
The actual output when calling Format document removes most of the document:
More info
It looks like the issue is when parsing the output from
rubocop
itthinks that the line with multiple
====
is the marker from rubocop when the actual file content starts.The text was updated successfully, but these errors were encountered: