Skip to content

Commit

Permalink
Add lib to LOAD_PATH instead of using require_relative (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Oct 26, 2023
1 parent 4e80438 commit 943f76e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
run: bundle exec rake

- name: Run index troubleshooting tool
run: ./exe/ruby-lsp-doctor
run: bundle exec ruby-lsp-doctor
3 changes: 2 additions & 1 deletion exe/ruby-lsp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ rescue
nil
end

require_relative "../lib/ruby_lsp/internal"
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
require "ruby_lsp/internal"

if options[:debug]
if ["x64-mingw-ucrt", "x64-mingw32"].include?(RUBY_PLATFORM)
Expand Down
3 changes: 2 additions & 1 deletion exe/ruby-lsp-check
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ rescue
nil
end

require_relative "../lib/ruby_lsp/internal"
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
require "ruby_lsp/internal"

RubyLsp::Addon.load_addons

Expand Down
3 changes: 1 addition & 2 deletions exe/ruby-lsp-doctor
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"

$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
require "ruby_lsp/internal"

index = RubyIndexer::Index.new
Expand Down

0 comments on commit 943f76e

Please sign in to comment.