Open philomory opened 4 years ago
Interesting. Using cmd vs powershell depends on what your default shell is set to. Have you turned on verbose logging and looked at the server logs?
@wingrunr21 Sorry if I'm being thick, but, how do you turn on verbose logging? I can't find anything about that in either the extension documentation or in VSCode's documentation. Certainly I've checked the Output pane, but all it says is
Format: executing rubocop.bat -s c:\path\to\dummy.rb -a...
undefined
EDIT: That said, changing my default shell from Powershell to CMD, and then reloading the window, does result in the Format Document
command working correctly. So, this does seem to be specific to Powershell and its confusing line break behavior (as I understand it, when you pipe a multi-line block of text around in Powershell, what actually gets passed around is an array of single-line strings; they only get 'joined' back into a single multi-line block when being displayed, or piped to an external tool).
I think this needs to be investigated. A major issue on Windows / VS Code.
FYI I run following command as installation:
gem install rubocop
Your environment
vscode-ruby
version: 0.27.0useLanguageServer
is true in your configuration?): YesExpected behavior
When I run the
Format Document
command with an already-valid document, no changes should be made to the document.Actual behavior
Before running
Format Document
:After running
Format Document
:I thought this might be because I'm on Windows but using
LF
rather thanCRLF
for line endings (in both VS Code and.rubocop.yml
), but, switching everything toCRLF
didn't actually help.This feels similar to some weird stuff I've seen happen when using pipes in Powershell, but I haven't dug around into the extension code to see if we're actually doing that on Windows or not.