-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot specify LANG
or RUBYOPT
, resulting in unintended RuboCop formatting
#3091
Comments
LANG
or RUBYOPT
, resulting in unintended RuboCop formatting
👋 I'm unable to reproduce this behaviour. What happens if you run RuboCop on the command-line? |
@andyw8 Thank you for your reply! It depends on the configuration, so how about the following? $ cat <<EOF > .rubocop_double_quotes.yml
Style/StringLiterals:
EnforcedStyle: double_quotes
EOF
$ echo "'てすと'" > some.rb
$ LANG=C rubocop --config .rubocop_double_quotes.yml --only Style/StringLiterals -A some.rb
Inspecting 1 file
C
Offenses:
some.rb:1:1: C: [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
'てすと'
^^^^^^^^
1 file inspected, 1 offense detected, 1 offense corrected
$ cat some.rb
"\u3066\u3059\u3068" Using |
Would you mind opening an issue on the RuboCop repo about this? I am not too familiar with extended character sets, and |
@andyw8 Thank you! I opened a new issue. |
I would guess so, or at least that extensions don't have access to the real environment. microsoft/vscode#227467 looks very relevant. I think ruby-lsp would need to use such an API and pass the original |
@Earlopain Thank you for your help!
Yes.
No, in the terminal in VSCode,
I agree with you. |
In general, the Ruby LSP doesn't know about most things configured in the shell, exactly because the NodeJS process running extensions has no knowledge about them either. microsoft/vscode#227467 will be an incredibly beneficial change, because it might allow us to simplify all Ruby activation and rely on the shell environment instead, which is guaranteed to take into account user configurations. While that API is not ready for use yet, is there any way you can specify the |
Description
Ruby LSP Information
VS Code Version
1.96.4
Ruby LSP Extension Version
0.8.18
Ruby LSP Server Version
0.23.6
Ruby LSP Add-ons
Ruby Version
3.4.1
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
Reproduction steps
"\u3066\u3059\u3068"
although it's expected to be"てすと"
Code snippet or error message
'てすと'
This problem is related to the issue below, and it can be resolved by properly configuring
LANG
orRUBYOPT
. In fact, if I run the command withLANG=ja_JP.UTF-8 /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code
, it behaves as expected, but this approach is inconvenient. Is it possible to specifyLANG
orRUBYOPT
? Or is there another solution?The text was updated successfully, but these errors were encountered: