Sha256: c59020546888e6567a043cfc3f963914fc01c9104f73ff4c305156146dfef0b0

Contents?: true

Size: 632 Bytes

Versions: 7

Compression:

Stored size: 632 Bytes

Contents

# typed: true
# frozen_string_literal: true

def compose(raw_initialize)
  require_relative "../setup_bundler"
  require "json"
  require "uri"
  require "ruby_indexer/lib/ruby_indexer/uri"

  initialize_request = JSON.parse(raw_initialize, symbolize_names: true)
  workspace_uri = initialize_request.dig(:params, :workspaceFolders, 0, :uri)
  workspace_path = workspace_uri && URI(workspace_uri).to_standardized_path
  workspace_path ||= Dir.pwd

  env = RubyLsp::SetupBundler.new(workspace_path, launcher: true).setup!
  File.write(
    File.join(".ruby-lsp", "bundle_env"),
    env.map { |k, v| "#{k}=#{v}" }.join("\n"),
  )
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-lsp-0.23.6 lib/ruby_lsp/scripts/compose_bundle.rb
ruby-lsp-0.23.5 lib/ruby_lsp/scripts/compose_bundle.rb
ruby-lsp-0.23.4 lib/ruby_lsp/scripts/compose_bundle.rb
ruby-lsp-0.23.3 lib/ruby_lsp/scripts/compose_bundle.rb
ruby-lsp-0.23.2 lib/ruby_lsp/scripts/compose_bundle.rb
ruby-lsp-0.23.1 lib/ruby_lsp/scripts/compose_bundle.rb
ruby-lsp-0.23.0 lib/ruby_lsp/scripts/compose_bundle.rb