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

Find in reference for size() opens StringList.size() #4224

Closed
danomatika opened this Issue Jan 6, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@danomatika

danomatika commented Jan 6, 2016

Just a small thing, but I keep getting bitten by it when demoing "Find in reference".

Highlighting size() and choosing "Find in reference" opens the page for the StringList size() member function, not the P5 size() function.

Tested in P5 3.0.1

@Akarshit

This comment has been minimized.

Show comment
Hide comment
@Akarshit

Akarshit Jan 9, 2016

Member

The cause of this is that in the keywords.txt file there are many occurrences of size like these

size    FUNCTION2   FloatDict_size_
size    FUNCTION2   FloatList_size_
size    FUNCTION2   IntDict_size_  
size    FUNCTION2   IntList_size_  
size    FUNCTION2   JSONArray_size_  
size    FUNCTION1   size_  
size    FUNCTION2   StringDict_size_  
size    FUNCTION2   StringList_size_

So when constructong the map of the keywords to the html files the value of the size keyword gets repeatedly overwritten and is set to StringList_size at last. That's why the reference for StringList:size() is opened when opening reference for size().

A solution is to take account of the class along with the method while searching for reference.
Is there a better/easier way to do it ?

Member

Akarshit commented Jan 9, 2016

The cause of this is that in the keywords.txt file there are many occurrences of size like these

size    FUNCTION2   FloatDict_size_
size    FUNCTION2   FloatList_size_
size    FUNCTION2   IntDict_size_  
size    FUNCTION2   IntList_size_  
size    FUNCTION2   JSONArray_size_  
size    FUNCTION1   size_  
size    FUNCTION2   StringDict_size_  
size    FUNCTION2   StringList_size_

So when constructong the map of the keywords to the html files the value of the size keyword gets repeatedly overwritten and is set to StringList_size at last. That's why the reference for StringList:size() is opened when opening reference for size().

A solution is to take account of the class along with the method while searching for reference.
Is there a better/easier way to do it ?

@dhowe

This comment has been minimized.

Show comment
Hide comment
@dhowe

dhowe Sep 8, 2016

Contributor

This still exists and happens with any methods on objects with the same name as methods on PApplet, so filter() leads to PImage.filter(), etc (which is pretty confusing for beginners)

Tested in P5 3.2.1

Contributor

dhowe commented Sep 8, 2016

This still exists and happens with any methods on objects with the same name as methods on PApplet, so filter() leads to PImage.filter(), etc (which is pretty confusing for beginners)

Tested in P5 3.2.1

@benfry benfry changed the title from Find in reference for size() opens StringList::size() to Find in reference for size() opens StringList.size() Sep 8, 2016

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Sep 8, 2016

Member

Just fixed for 3.2.2 to save the beginners, though the larger issue remains: #4655

Member

benfry commented Sep 8, 2016

Just fixed for 3.2.2 to save the beginners, though the larger issue remains: #4655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment