Comments (4)
I don't understand how files with cerificates, code of conduct, etc. will be helpful for completion.
They aren't indeed, but trying to handle this from the index would mean some sort of allowlist of file extensions, which may not be worth maintaining or at least it's unclear to me at this moment.
If you take a look at the file associations configuration for the VS Code extension, there are numerous extensions that should be associated to Ruby. Which ones should be indexed? For example, what if some .rbx
files should be indexed, but not all of them?
Maybe in the future we can be more opinionated about which extensions other than .rb
should be indexed automatically, but for now I feel like users are better suited to configure this.
from ruby-lsp.
Added this file to excluded_pattens
in .index.yml
Have same issue with httpclient-2.8.3
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/README.md
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/bin
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/bin/httpclient
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/bin/jsonclient
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/hexdump.rb
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/http-access2
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/http-access2/cookie.rb
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/http-access2/http.rb
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/http-access2.rb
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/httpclient
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/httpclient/auth.rb
indexing: /home/egor/Documents/work/aiir/coaching-zone-api/.bundle/ruby/3.2.0/gems/httpclient-2.8.3/lib/httpclient/cacert.pem
/home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/visitor.rb:31:in `visit_child_nodes': stack level too deep (SystemStackError)
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/dispatcher.rb:401:in `visit_constant_read_node'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/node.rb:5545:in `accept'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/visitor.rb:31:in `block in visit_child_nodes'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/visitor.rb:31:in `each'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/visitor.rb:31:in `visit_child_nodes'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/dispatcher.rb:217:in `visit_call_node'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/node.rb:2513:in `accept'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/prism-0.29.0/lib/prism/visitor.rb:31:in `block in visit_child_nodes'
... 10385 levels...
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/libexec/bundle:33:in `<top (required)>'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/bin/bundle:25:in `load'
from /home/egor/.local/share/mise/installs/ruby/3.2.0/bin/bundle:25:in `<main>'
I suppose this issue happens because I'am indexing everything inside .bundle
folder, but I thought the gem will index only ruby or ruby-like files (files on which it can provide useful information).
from ruby-lsp.
Thank you for the issue report. There are certain occasions where you may want to index files with different extensions. For example, we may want to index RBI/RBS files to enhance the index information with type information (currently doesn't work, but it might in the future).
I don't believe the index should enforce that all included files must have a Ruby extension. I think the fix here is to restrict your glob pattern to Ruby files.
included_patterns:
- ".bundle/**/*.rb"
Also, please note that we're discussing the existence of this .index.yml
file as it kind of breaks the approach taken by most language servers, which rely on editor configuration files (like .vscode/settings.json
for VS Code) instead of using custom files. That is, this file may be going away some time soon.
from ruby-lsp.
@vinistock Thank you for quick response!
By ruby files I did not only meant all .rb
files, but just all files that will be useful for completeion inside ruby files, so that also includes RBI/RBS.
I don't understand how files with cerificates, code of conduct, etc. will be helpful for completion.
But maybe you are right, it is better for the editor to provide this type of information (on what to index)
Sometimes I add more than one project folder to editor workspace.
Looking forward to it!🙌
from ruby-lsp.
Related Issues (20)
- VSCode: ERB file false positive problems HOT 39
- Extra output in LSP response causes crash during formatting HOT 5
- LSP stuck in Starting state HOT 8
- Indexing error in `existing_or_new_singleton_class` HOT 2
- Ruby LSP: indexing files: 0% completed hangs forever HOT 8
- jruby installation broken since 0.17.3
- Conditionally provide hints/definitions on typed files. HOT 1
- Error while indexing: undefined method `file_path' for nil:NilClass HOT 10
- Help users diagnose indexing issues HOT 2
- Test indexing against a wide range of gems
- On type formatting incorrectly adds `end` after hitting Enter key at the end of method's arguments when it has a trailing comma HOT 1
- Another "classification" highlighting issue
- Completion should avoid fuzzy searching methods when the typed characters match keywords HOT 2
- VSCode test "Run in Terminal" uses hardcoded `-Itest`
- VSCode Sticky Scroll no longer works in ERB files after 0.7.10 HOT 6
- Add region comments for arbitrary folding ranges
- Index Core accessors using RBS HOT 1
- Index return types using RBS
- Index Core constants using RBS
- Index Core aliases using RBS (if supported) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-lsp.