sugi_711
@sugi_711

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

vscodeのruby-lspでフォーマットが動作しない

解決したいこと

vscodeのruby-lspでフォーマットが動作しない

発生している問題

vscodeの拡張機能でruby-lspをインストールし、settings.jsonを以下のように記載したが、保存したタイミングでフォーマットが動作しない。「rubocop -A」を実行すると、フォーマットはかかる。

    "editor.formatOnSave": true,
    "[ruby]": {
        "editor.defaultFormatter": "Shopify.ruby-lsp",
        "editor.formatOnSave": true
    },
    "rubyLsp.formatter": "rubocop",
    "rubyLsp.bundleGemfile": "Gemfileのパス",
    },

Gemfile

「bundle install」は行なっています。

source "https://rubygems.org"


gem "ruby-lsp", require: false
gem "rubocop", require: false

ターミナルの出力タブ

2024-11-23 17:26:11.815 [info] Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-11-23 17:26:12.477 [info] Discovered version manager rbenv
2024-11-23 17:26:12.478 [info] Found rbenv executable at /opt/homebrew/bin
2024-11-23 17:26:12.478 [info] Running command: `/opt/homebrew/bin/rbenv exec ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in Gemfileがあるパス using shell: /bin/zsh
2024-11-23 17:26:12.581 [info] Initializing Ruby LSP v0.22.1...
2024-11-23 17:26:12.584 [info] Using formatter specified by user: rubocop
2024-11-23 17:26:12.584 [info] Auto detected linters: rubocop
2024-11-23 17:26:12.584 [info] Detected test library: unknown
2024-11-23 17:26:12.584 [info] Finished initializing Ruby LSP!
0

No Answers yet.

Your answer might help someone💌