-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Intellisense with Ruby-LSP #19143
Comments
If you create a PR similar to #17991 we could take a look? I'm not convinced we should be providing these files for end-users, but if you're able to create a PR we could review it and potentially merge it |
I can definitely put out a pull request with what I have, but ultimately this is a cry for help. I'm having issues setting this up and I'm unsure if it's because lsp is still very new or if my workspace has been messed up. I want to throw this out in case someone else might have found the solution or at least part of it. Baby steps to get back to solargraph |
If you have replication steps, we could maybe take a look - it might be an issue with the projects you're using; and if that's the case you'd probably want to file an issue over there |
So after rebuilding my workspace to recreate my steps, it has finally started to work. I started by installing rbenv and installing the ruby version used in the repo. Afterwards, I Installed Ruby-LSP for vscode and let it build, I finally got it working. Now it technically works. It doesnt find the proper definition for functions nor does it tell what type variables are. I'm unsure if its too new for it to recognize it but I'm unsure. I made a branch with the settings for test. |
Just wanted to check in. Has anyone attempted to recreate the steps that I proposed? Is anyone else having the same issues that I'm having with ruby-lsp? I know that the exclusions need to be improved because with the current config, every module will have any external functions have no file definition. This only changes when the This could be an options issue, but then I'm having issues with seeing class functions for standard ruby. If I do This is probably a settings issue (its also probably an issue that its kinda trash at what its supposed to do) but I do not understand how the indexer works to make better inclusions and exclusions. I also have no idea what could possibly be missing to prevent it from doing intellisense on standard ruby. |
I can confirm that RubyMine provides code completion in that scenario: And from reading ruby-lsp'd docs, it looks like method code completion isn't supported:
|
Is that rubymine with lsp? It sounds like lsp is just terrible and not ready for use just yet. Not sure what to do about intellisense on vscode/other IDE's since solargraph doesnt particularly work anymore. Does rubymine have something specific that it uses for intellisense or is it all built in? |
It's all built in, they don't use LSP - but their own PSI (Program Structure Interface) implementation instead. There's a thread here about why don't really offer LSP integration support:
In this case it looks like Shopify's LSP for Ruby doesn't provide the expected level of support out of the box, but maybe it will in the future |
Let me know if there's anything else to help with here or if we should close it off. I think we could document that Ruby-LSP doesn't offer full support to the user; or maybe there's some additional debugging steps required here to see if there's config changes we need to make?
|
Well its meant to fix intellisense and we have all of the configuration. I cannot properly test that it works as intended (yet), but everything needed on this side should already be done. In that regard, what I can do to resolve this without it being forgotten is close as not planned and we could come back to it when ruby-lsp actually works. |
Summary
So I've been on this problem for months now. I understand that most of Rapid7 uses rubymine which is basically intellij. But I use vscode for developing ruby, which is why I included configs for solargraph that made it read lib and ignoring modules. Fast forward to today and solargraph no longer works (no matter how much I scream at my screen to make it so.)
The next best choice to replace it that most of the ruby community is hopping on now is Ruby-LSP. In theory, it is the best choice for this purpose, but its falling for the same issues solargraph had without configs. LSP needs to be configured to read the modules from lib and ignore any functions defined in modules besides whats in the current file.
This is where I've been stuck because Ruby-LSP's documentation has been a nightmare to say the least and even with whatever configs they give, I cannot get it to include/exclude the right files and modules.
The TL;DR on this is that it would be nice to get some configs in the workspace to allow people using LSP to easily intellisense and format in whatever IDE that they're using.
Motivation
Beside the fact that only some developers use rubymine, everyone has their own preference on IDE *cough* *cough* neovim. It would be helpful to all developers if we had an easier way to read documentation and write modules.
Steps to resolve this issue
I've already done a lot of the heavy lifting. We just need a configuration file to limit LSP's scope on the project to only what we as developers need. That would make IDE's load faster and have little to no overloads.
Configs for other IDE's to use LSP would also be helpful. Such as a
settings.json
andextensions.json
to go in the vscode folder to use lsp and intellisense immediately (since I cant get it to work with vscode without it crashing 3 times)The text was updated successfully, but these errors were encountered: