Closed taylorthurlow closed 5 years ago
I'm also having some issues getting normal gems to work as well. For example, in a test file I have a require "faker"
which doesn't resolve.
I'm also experiencing this issue.
I have a .solargraph.yml
with:
---
include:
- "**/*.rb"
- "./lib/**/*.rb"
and it still doesn't work!
I have a default .solargraph.yml
---
include:
- "**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
reporters:
- rubocop
- require_not_found
require_paths: []
max_files: 5000
When I turned diagnostics on to help lint my Rails project I'm getting a warning in every test file of Required path test_helper could not be resolved.
I've tried removing the - test/**/*
exclusion as that looked like it would be the problem, but no joy.
Try removing the require_not_found
line instead. That's the reporter that tests require paths.
You probably want to keep the - test/**/*
exclusion. You'll still be able to get linting and autocomplete on your test files, but the exclusion will keep test classes from being mixed into the rest of your application's API.
I'm looking into making the require_not_found
reporter more reliable. At any rate, it's totally optional.
@castwide any ideas when you'll make the reporter more reliable?
Seeing the same issue mentioned here - it appears this issue was closed - what was the resolution?
Edit: Actually, looks like issue is still open elsewhere: https://github.com/castwide/vscode-solargraph/issues/94 (posting here in case someone comes here too looking for a solution)
Same problem here
I'm working in a Rails application and Solargraph is having issues with my require statements. For example, it won't resolve
require "aips/image"
with the follow directory structure:My research would suggest that the default path for resolving these paths is the
lib
folder, assuming there is nogemspec
file, which there is not. I have no.solargraph.yml
file, but adding one with arequire_paths
setting has no effect. I'm using bundler as well, with no special bundler configuration.