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

Code Intelligence Fails with Multiple Definitions of Same Function #1672

Closed
aaroncampbell opened this Issue Jun 6, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@aaroncampbell

aaroncampbell commented Jun 6, 2016

Short Summary

I work on a lot of WordPress projects. There are certain functions that exist in multiple places, usually where one instance is a stub. For example, add_filter exists as a stub with no parameters in wp-admin/includes/noop.php (each function here has an @ignore comment) and the actual (oft used) function is in wp-includes/plugin.php. When you type add_filter( you get no parameters offered.

There are quite a few more functions that suffer from this. Including many that are in wp-includes/pluggable.php which aren't overridden in core but are often overridden in a given project (these are each wrapped in a function_exists check and loaded later than other files.

Steps to Reproduce

  • Start a WordPress project
  • Open a file and type add_filter(

Expected results

code-intelligence-correct-add_filter

Actual results

code-intelligence-incorrect-add_filter

Platform Information

Komodo IDE, version 10.0.0, build 89159, platform linux-x86_64
Specifically running Ubuntu 16.04

@aaroncampbell

This comment has been minimized.

aaroncampbell commented Jun 6, 2016

I'm sure there are other projects that suffer from the same kind of issues, but WordPress is what I work in every day (and is wildly popular) so it's what I used as an example.

@mitchell-as mitchell-as added this to the 10.1 milestone Jun 6, 2016

@mitchell-as mitchell-as self-assigned this Jun 6, 2016

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Jun 6, 2016

Thanks for the report. I'm going to have to investigate whether or not this is feasible in a reasonable amount of time. The milestone is for planning purposes.

@seattledeveloper

This comment has been minimized.

seattledeveloper commented Jun 7, 2016

I have another use case that might be helpful to add.

I have a project that has customized session management. There are several login locations for different classes of users, each with different PHP files with slightly different versions of functions with the same name, each file located relative to it's own login area.

It would be nice if code intelligence could work based on the files actually included within the file being edited, but this might be way too big an undertaking. I'm not saying or implying that I need this feature for myself, just wanted to add another example.

Cheers!

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Aug 9, 2016

I believe the proper course of action here is to ignore storing functions with the @ignore tag or prevent them from being valid "hits".

@Naatan

This comment has been minimized.

Member

Naatan commented Aug 9, 2016

@mitchell-as would Wordpress' functions fall under that new logic?

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Aug 9, 2016

Yeah, my conclusion comes from analyzing a wordpress project.

@Naatan

This comment has been minimized.

Member

Naatan commented Aug 9, 2016

Perfect :)

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