Skip to content
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

Escaped symbol arguments aren't handled correctly #9

Closed
connorshea opened this issue Jun 22, 2019 · 3 comments
Closed

Escaped symbol arguments aren't handled correctly #9

connorshea opened this issue Jun 22, 2019 · 3 comments
Labels
external The issue is caused by a problem in a different project

Comments

@connorshea
Copy link
Contributor

Escaped symbols, or string-symbols, or as I like to call them, 'abominations', don't get sent through to the generated file properly.

Input:

def create_server(name, region = :'eu-central')
  # code
end

Generated rbi method:

def create_server(name, region = eu-central) end
@AaronC81
Copy link
Owner

It looks like this may actually be an issue with YARD itself.

Take the following example code:

module Example
  class Foo
    def bar(x = :'abomination')
      3
    end
  end
end

It appears that the YARD registry (assigned to r here) doesn't include the : and apostrophes around the identifier:

irb(main):012:0> r.all(:class).first.meths.first.parameters
=> [["x", "abomination"]]

@AaronC81
Copy link
Owner

The generated YARD HTML docs also show the same issue!

image

@AaronC81 AaronC81 added the external The issue is caused by a problem in a different project label Jun 22, 2019
@AaronC81
Copy link
Owner

This has now been fixed in YARD (lsegal/yard#1256).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue is caused by a problem in a different project
Projects
None yet
Development

No branches or pull requests

2 participants