Giter Club home page Giter Club logo

Comments (4)

vinistock avatar vinistock commented on August 23, 2024 1

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.

egor-khanko avatar egor-khanko commented on August 23, 2024

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.

vinistock avatar vinistock commented on August 23, 2024

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.

egor-khanko avatar egor-khanko commented on August 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.