solargraph icon indicating copy to clipboard operation
solargraph copied to clipboard

Dir.exist? typecheck issue

Open Postur opened this issue 4 years ago • 6 comments

image

image

For some reason my ruby documentation does not allow the passing of an argument to Dir.exist?

Dir.exist? should take an argument following the ruby docs (2.7.2):

image

Postur avatar Oct 14 '21 17:10 Postur

Any help would be appreciated

Postur avatar Oct 19 '21 13:10 Postur

Confirmed. I'm still trying to determine the root cause, but I should be able to repair it with a core fill. (Side note: the problem is already resolved in the RBS version of core documentation.)

castwide avatar Oct 20 '21 02:10 castwide

how to upgrade to RBS branch?

Postur avatar Oct 20 '21 13:10 Postur

Since the RBS branch is unreleased and still in development, you'd have to either 1) build and install your own gem from a clone of the branch, or 2) specify the branch in your Gemfile, e.g., gem 'solargraph', github: 'castwide/solargraph', branch: 'rbs'

Note that RBS support is not yet stable, so I don't recommend using it unless you're specifically interested in testing and troubleshooting it.

castwide avatar Oct 22 '21 07:10 castwide

@castwide, would you have an example of what a "core fill" is? I would be glad to submit a PR for this.

kamaradclimber avatar Nov 02 '21 08:11 kamaradclimber

@kamaradclimber Solargraph::YardMap::CoreFills contains overrides that fill some of the gaps in core documentation. I expected that the override for Dir.exist? should look something like this:

        Override.from_comment('Dir.exist?', %(
@overload exist?(file_name)
  @param file_name [String]
  @return [Boolean]
        )),

Unfortunately, that doesn't appear to work. Not sure what the problem is.

castwide avatar Nov 17 '21 18:11 castwide