Skip to content

Filter out two underscore attributes in auto completion #568

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

Merged
merged 2 commits into from
Oct 5, 2015
Merged

Filter out two underscore attributes in auto completion #568

merged 2 commits into from
Oct 5, 2015

Conversation

Tenzer
Copy link
Contributor

@Tenzer Tenzer commented Oct 1, 2015

This change will require you to write two underscores in order to get autocompletion of attributes starting with two underscores, as requested in #528.

I'm not too sure about the changes to the tests, and if there should be some tests for this filtering as well. I just tried to make the change as minimal as possible while making the tests pass.

This change will require you to write two underscores in order to get
autocompletion of attributes starting with two underscores, as requested
in #528.

Fixes #528
@@ -245,12 +245,12 @@ def test_att_matches_found_on_old_style_instance(self):
locals_={'a': OldStyleFoo()}),
set(['a.method', 'a.a', 'a.b']))
self.assertIn(u'a.__dict__',
self.com.matches(3, 'a._', locals_={'a': OldStyleFoo()}))
self.com.matches(3, 'a.__', locals_={'a': OldStyleFoo()}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, the first argument should be changed to 4. @thomasballinger, can you confirm that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests pass with the value set to 3. I also think that makes sense with it finding a, __init__ and method. Which attribute would you say is missing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 and a._ means to test for a._<Tab> while 3 and a.__ means to test for a._<Tab>_ which is a different test. The first argument is the position of the cursor at the time of the autocompletion call. So leaving the first value set to 3 does not preserve the meaning of the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, my bad. The it totally makes sense to change it to 4. I have done that in 9f3460b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants