-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add launch mode integration tests (#2766)
- Loading branch information
Showing
9 changed files
with
160 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# typed: true | ||
# frozen_string_literal: true | ||
|
||
def compose(raw_initialize) | ||
require "ruby_lsp/setup_bundler" | ||
require "json" | ||
require "uri" | ||
require "core_ext/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_gemfile"), env["BUNDLE_GEMFILE"]) | ||
File.write(File.join(".ruby-lsp", "locked_bundler_version"), env["BUNDLER_VERSION"]) if env["BUNDLER_VERSION"] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.unshift(File.expand_path("../../../lib", __dir__)) | ||
require_relative "compose_bundle" | ||
|
||
# When this is invoked on Windows, we pass the raw initialize as an argument to this script. On other platforms, we | ||
# invoke the compose method from inside a forked process | ||
compose(ARGV.first) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters