I cannot see FileUtils as a class and its methods.
Is there a specific reason why not working?
Example:
require 'sidekiq'
require 'logger'
require 'file'
require 'fileutils'
REDIS_URI = 'redis://127.0.0.1:6379/11'
REDIS_PWD = ''
REDIS_CON = { url: REDIS_URI, password: REDIS_PWD, :namespace => 'sidekiq-inboxer' }
Sidekiq.configure_server do |config|
config.redis = REDIS_CON
end
Sidekiq.configure_client do |config|
config.redis = REDIS_CON
end
class MailTaskWorker
include Sidekiq::Worker
def perform(uuid, from, to)
logger.info 'Created :' << uuid << ' from ' << from << ' to ' << to.to_s
delete uuid
end
private
#
# Delete cached file
#
# @param [String] uuid UUIDv4
#
# @return [void]
#
def delete(uuid)
File.delete "./tmp/cache/#{uuid}" # File. <-- works. I see every method
FileUtils.rm_rf "./tmp/cache/#{uuid}.exp" # FileUtils. <-- not even FileUtils show up in suggestion list neither its methods.
rescue
raise Exception::FileDeleteError
end
end
It's a minor bug in the current YardMap that's already fixed in the master branch. The fix will be released in v0.30.0.
@castwide, I installed master via specific_install (which is seen as 0.29.5 but not .30) and it just doesnt't work.
Sorry, it looks like the GitHub master is a little behind my checkout. I'm in the middle of merging some major changes, so it'll be a little while before I push the fix.
All the changes for v0.30.0 are merged into master. I don't expect to push anything other than bug fixes before release. If you test it and still experience the problem, please let me know.
@castwide, coluld this be something else? Because still an issue here:

Can you test above sample?
Also this is my config:
include:
- "**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
reporters:
- rubocop
- require_not_found
plugins:
- runtime
require_paths: []
max_files: 5000
Confirmed. Your example worked as expected when I ran Solargraph from my checkout path via Bundler. When I installed v0.30.0 as a gem, fileutils stopped resolving.
I'll look into it and see if I can find a solution before the next release.
This is an odd issue, but fortunately it looks simple to fix. When Solargraph resolves require paths, it checks gems first and stdlib second. In this case, it erroneously finds a fileutils gem, but since it's not on the load path, YARD can't find its documentation. Strangely, it only seems to happen when the Solargraph process isn't using Bundler.
The easy solution is to fall back to the stdlib. Barring unforeseen bugs, I'll add the fix to 0.30.0.
I'm glad you found the problem. Awaiting your fix now. Please ping me here when you push that fix so that i can grab the master branch.
Have a great weekend!
It's pushed. Let me know if the problem persists.
Have a great weekend!
Thanks, you too!
Fixed. Thank you so much once again.
Released in v0.30.0.
Most helpful comment
This is an odd issue, but fortunately it looks simple to fix. When Solargraph resolves require paths, it checks gems first and stdlib second. In this case, it erroneously finds a
fileutilsgem, but since it's not on the load path, YARD can't find its documentation. Strangely, it only seems to happen when the Solargraph process isn't using Bundler.The easy solution is to fall back to the stdlib. Barring unforeseen bugs, I'll add the fix to 0.30.0.