castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 24 forks source link

Autocomplete for gems #23

Closed bgmat closed 6 years ago

bgmat commented 6 years ago

Hi guys!

Is this extension supposed to show suggestions for methods in the gems I use?

Thanks

castwide commented 6 years ago

It should, but there are circumstances where some suggestions may be missing or incomplete. There's a known issue with bundled gems that should be fixed in the next version.

If you're having trouble with a particular gem, let me know the details and I'll see if there's a fix.

bgmat commented 6 years ago

Hi @castwide Thank you for looking into it! This is the gem I'm using: https://github.com/Shopify/shopify_api

castwide commented 6 years ago

During testing, I found a bug that stops the extension from providing suggestions when a workspace (folder) isn't open. It's actually a problem in the API server, not the extension. It'll be fixed in the next version of the gem.

With the current versions of the extension and gem, I was able to get Shopify suggestions by doing the following:

Results:

image

bgmat commented 6 years ago

Yes, it works in this sequence, thanks! However,I found a case when the results are inconsistent. Maybe you could look into this.

If I type "ShopifyAPI.S" like in the image below, I get one result (popping up as I type) image

but, if I hit escape, then CTRL+Space to get the autocomplete, I get this: image

This is not happening for "ShopifyAPI::S", only for "ShopifyAPI.S" ...

castwide commented 6 years ago

Interesting. It appears to be an issue with case sensitivity. With a lower-case S, you get the expected method suggestions. I'll look into it.

castwide commented 6 years ago

Incidentally, today's gem version update fixes the API server issue, so completion should work when you don't have a workspace/folder open.

castwide commented 6 years ago

In the current gem, completion items in the above cases are better, although case sensitivity can still cause some minor inconsistencies.

This seems reasonable enough to me.

castwide commented 6 years ago

This issue should be resolved in the most recent versions of the gem, including the discrepancies between completion filters, which are now case-insensitive by default. If anyone still has problems, please feel free to open a new issue.