Skip to content

Commit 005ae76

Browse files
committed
Remove old indexer
1 parent b9b9e9e commit 005ae76

58 files changed

Lines changed: 98 additions & 11074 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/indexing.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.rubocop.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Sorbet/TrueSigil:
4949
Enabled: true
5050
Include:
5151
- "test/**/*.rb"
52-
- "lib/ruby_indexer/test/**/*.rb"
53-
- "lib/ruby_indexer/lib/ruby_indexer/prefix_tree.rb"
5452
- "lib/ruby_lsp/scripts/compose_bundle.rb"
5553
- "lib/ruby_lsp/test_reporters/test_unit_reporter.rb"
5654
Exclude:
@@ -64,9 +62,7 @@ Sorbet/StrictSigil:
6462
Exclude:
6563
- "**/*.rake"
6664
- "test/**/*.rb"
67-
- "lib/ruby_indexer/test/**/*.rb"
6865
- "lib/ruby-lsp.rb"
69-
- "lib/ruby_indexer/lib/ruby_indexer/prefix_tree.rb"
7066
- "lib/ruby_lsp/scripts/compose_bundle.rb"
7167
- "lib/ruby_lsp/test_helper.rb"
7268
- "lib/ruby_lsp/test_reporters/test_unit_reporter.rb"

AGENTS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Its parts are:
55

66
- `ruby-lsp` gem: language server implementation and extra custom functionality to support the VS Code extension. This
77
is the top level of the repository
8-
- Ruby code indexer: static analysis engine to support features like go to definition, completion and workspace
9-
symbols. This is entirely implemented inside `lib/ruby_indexer`
108
- Companion VS Code extension that includes several integrations. The extension is entirely implemented in the `vscode`
119
directory
1210
- Jekyll static documentation site. Fully implemented in `jekyll`

Rakefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,8 @@ Rake::TestTask.new(:test) do |t|
99
t.test_files = FileList["test/**/*_test.rb"].exclude("test/fixtures/prism/**/*")
1010
end
1111

12-
namespace :test do
13-
Rake::TestTask.new(:indexer) do |t|
14-
t.libs << "test"
15-
t.libs << "lib"
16-
t.test_files = FileList["lib/ruby_indexer/test/**/*_test.rb"]
17-
end
18-
end
19-
2012
require "rubocop/rake_task"
2113

2214
RuboCop::RakeTask.new
2315

24-
task default: ["test:indexer", :test]
16+
task default: :test

exe/ruby-lsp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ parser = OptionParser.new do |opts|
1717
options[:debug] = true
1818
end
1919

20-
opts.on("--time-index", "Measure the time it takes to index the project") do
21-
options[:time_index] = true
22-
end
23-
24-
opts.on("--doctor", "Run troubleshooting steps") do
25-
options[:doctor] = true
26-
end
27-
2820
opts.on("--use-launcher", "[EXPERIMENTAL] Use launcher mechanism to handle missing dependencies gracefully") do
2921
options[:launcher] = true
3022
end
@@ -110,44 +102,6 @@ if options[:debug]
110102
end
111103
end
112104

113-
if options[:time_index]
114-
index = RubyIndexer::Index.new
115-
116-
time_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
117-
index.index_all
118-
elapsed_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) - time_start
119-
120-
entries = index.instance_variable_get(:@entries)
121-
entries_by_entry_type = entries.values.flatten.group_by(&:class)
122-
123-
puts <<~MSG
124-
Ruby LSP v#{RubyLsp::VERSION}: Indexing took #{elapsed_time.round(5)} seconds and generated:
125-
- #{entries_by_entry_type.sort_by { |k, _| k.to_s }.map { |k, v| "#{k.name.split("::").last}: #{v.size}" }.join("\n- ")}
126-
MSG
127-
return
128-
end
129-
130-
if options[:doctor]
131-
index = RubyIndexer::Index.new
132-
133-
if File.exist?(".index.yml")
134-
begin
135-
config = YAML.parse_file(".index.yml").to_ruby
136-
rescue => e
137-
abort("Error parsing config: #{e.message}")
138-
end
139-
index.configuration.apply_config(config)
140-
end
141-
142-
puts "Globbing for indexable files"
143-
144-
index.configuration.indexable_uris.each do |uri|
145-
puts "indexing: #{uri}"
146-
index.index_file(uri)
147-
end
148-
return
149-
end
150-
151105
server = RubyLsp::Server.new
152106

153107
# Ensure all output goes out stderr by default to allow puts/p/pp to work

exe/ruby-lsp-check

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,6 @@ ensure
3636
end
3737
puts "\n"
3838

39-
# Indexing
40-
puts "Verifying that indexing executes successfully. This may take a while..."
41-
42-
index = RubyIndexer::Index.new
43-
uris = index.configuration.indexable_uris
44-
45-
uris.each_with_index do |uri, i|
46-
index.index_file(uri)
47-
rescue => e
48-
errors[uri.full_path] = e
49-
ensure
50-
print("\033[M\033[0KIndexed #{i + 1}/#{uris.length}") unless ENV["CI"]
51-
end
52-
puts "\n"
53-
5439
if errors.empty?
5540
puts "All operations completed successfully!"
5641
exit

0 commit comments

Comments
 (0)