Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Jul 23, 2024
1 parent f3be528 commit f881a72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Rake::TestTask.new(:test) do |t|
t.test_files = FileList["test/**/*_test.rb", "lib/ruby_indexer/test/**/*_test.rb"].exclude("test/fixtures/prism/**/*")
end

Rake::TestTask.new(:test_indexer) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["lib/ruby_indexer/test/**/*_test.rb"].exclude("test/fixtures/prism/**/*")
end

RDoc::Task.new do |rdoc|
rdoc.main = "README.md"
rdoc.title = "Ruby LSP documentation"
Expand Down
7 changes: 4 additions & 3 deletions lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def add_constant(node, name, value = nil)

sig { params(node: Prism::Node).returns(String) }
def collect_comments(node)
comments = []
comments = +""

start_line = node.location.start_line - 1
start_line -= 1 unless @comments_by_line.key?(start_line)
Expand All @@ -541,10 +541,11 @@ def collect_comments(node)

comment_content.delete_prefix!("#")
comment_content.delete_prefix!(" ")
comments.prepend(comment_content)
comments.prepend("#{comment_content}\n")
end

comments.join("\n")
comments.chomp!
comments
end

sig { params(name: String).returns(String) }
Expand Down

0 comments on commit f881a72

Please sign in to comment.