New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NoMethodError] undefined method `find_index' for nil:NilClass #323
Comments
I haven't been able to reproduce this one, but I have a hunch what caused it. The mapper seems to be reading past the end of a comment block with a YARD directive, probably starting with I'll try to fix what I suspect is the root cause, but if you can provide a reproducible example, it would help us be sure. |
Any way I could get it to print the file it’s dying on? |
For now, the easiest way might be to create and run this script in your project's root: # test-maps.rb
require 'solargraph'
workspace = Solargraph::Workspace.new('.')
workspace.filenames.each do |file|
begin
Solargraph::SourceMap.load(file)
rescue StandardError => e
puts "Error loading #{file}: #{e.message}"
end
end |
Thanks, that pinpointed it:
|
Perfect, thanks. The root cause is complicated module Foo
# @!macro macro1
# @!macro macro2
# @!method macro_method
# @!macro macro1
class Bar; end
end Proper One other note. Based on your file paths, it looks like you're mapping third-party gems in your workspace. If those gems are visible to Solargraph at runtime (e.g., installed on your system), you should be able to get intellisense for them without including them. Using cached gem documentation instead of mapping them should be significantly faster. You can exclude them from the map by adding the
A few other notes about If there's some reason including gem code is more convenient for you, that should be fine, too. I just thought I'd mention an alternative. |
Thank you for the quick response to this, I appreciate it. The Also, I saw in #322 the mention of |
Nonstandard gem paths can get tricky. One option is to use Solargraph with Bundler.
Running |
The |
That's great, thank you. So far so good. |
I'm getting this error when starting 0.39.5. I also got it with 0.39.3.
The text was updated successfully, but these errors were encountered: