castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 25 forks source link

Type detection for `reduce` return value is always `Object` #203

Open MichaelViveros opened 3 years ago

MichaelViveros commented 3 years ago

Hello!

Type detection for the return value of reduce is always Object. In the example below, it should be Integer.

Hovering over the variable shows Object:

Screen Shot 2020-12-06 at 9 18 07 AM

Auto-complete only suggests Object methods:

Screen Shot 2020-12-06 at 9 17 41 AM

There is a work-around of using the @type tag as mentioned in the readme. But it'd be great if vscode-solargraph could detect this automatically. I'd be willing to help implement this.

Versions:

castwide commented 3 years ago

Confirmed. This issue is actually related to the gem, not the extension, but it's on the roadmap.