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

Duplicate comments? #1054

Closed
ioquatix opened this issue Jul 1, 2022 · 3 comments · Fixed by #1103
Closed

Duplicate comments? #1054

ioquatix opened this issue Jul 1, 2022 · 3 comments · Fixed by #1103
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ioquatix
Copy link
Member

ioquatix commented Jul 1, 2022

Following the example:

> instance.methods[:gsub].comments.size
=> 4

Did I do something wrong? The 4 comments all seem identical?

@hdf1996
Copy link

hdf1996 commented Aug 25, 2022

I've been able to reproduce, the location in fact seems to be the same, even the position.

Seems like it not only happens with that method. I've also tried with slice but probably happens with others

11] pry(main)> instance.methods[:gsub].comments.map(&:location)
=> [#<RBS::Location:7720 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=1816:2, pos=57378...57861, children= source='# <!--'>,
 #<RBS::Location:7720 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=1816:2, pos=57378...57861, children= source='# <!--'>,
 #<RBS::Location:7720 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=1816:2, pos=57378...57861, children= source='# <!--'>,
 #<RBS::Location:7720 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=1816:2, pos=57378...57861, children= source='# <!--'>]
[10] pry(main)> instance.methods[:slice].comments.map(&:location)
=> [#<RBS::Location:8480 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=888:2, pos=25452...28393, children= source='# <!--'>,
 #<RBS::Location:8480 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=888:2, pos=25452...28393, children= source='# <!--'>,
 #<RBS::Location:8480 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=888:2, pos=25452...28393, children= source='# <!--'>,
 #<RBS::Location:8480 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=888:2, pos=25452...28393, children= source='# <!--'>,
 #<RBS::Location:8480 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=888:2, pos=25452...28393, children= source='# <!--'>,
 #<RBS::Location:8480 buffer=/home/hfarji/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rbs-2.6.0/core/string.rbs, start=888:2, pos=25452...28393, children= source='# <!--'>]

@hdf1996
Copy link

hdf1996 commented Aug 25, 2022

Just for reference, I've tried this with the code mentioned at https://github.com/ruby/rbs#library and at least I've been able to reproduce with rbs 2.6.0 in ruby 3.1.2

@soutaro soutaro self-assigned this Sep 2, 2022
@soutaro soutaro added the bug Something isn't working label Sep 2, 2022
@soutaro soutaro added this to the RBS 2.7.0 milestone Sep 2, 2022
@soutaro
Copy link
Member

soutaro commented Sep 2, 2022

Ok, deduping would make sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants