Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@tomv564
Copy link
Contributor

@tomv564 tomv564 commented Oct 24, 2017

Here are some explorations for #149 for testing / discussion. Likely to conflict with the Rope integration, but this is far from decided anyways.

screen shot 2017-10-01 at 20 30 42

Performance is okay for me in a small codebase, anyone working with a large code base who can do a quick comparison?
References to Jedi implementations:

Signature params: https://github.com/davidhalter/jedi/blob/752b7d8d495689a38076f20475a870f8aa139a28/jedi/api/classes.py#L314

Full_name:
https://github.com/davidhalter/jedi/blob/752b7d8d495689a38076f20475a870f8aa139a28/jedi/api/classes.py#L265

@tomv564 tomv564 changed the title Completion detail using module name Completion detail using module name, function parameters Oct 24, 2017
@gatesn
Copy link
Contributor

gatesn commented Oct 25, 2017

@tomv564 thanks for this, I like it! Much more useful IMO.

Happy to merge once tests pass.

@gatesn
Copy link
Contributor

gatesn commented Oct 28, 2017

@tomv564 think you need read() not read(args)

[edit] ahh, it's a py2 vs py3 thing


def _label(definition):
if definition.type in ('function', 'method'):
params = ", ".join(map(lambda definition: definition.name, definition.params))
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, could you use a list comprehension instead of the map builtin.


assert len(items) > 0
assert items[0]['label'] == 'read'
assert items[0]['label'] == 'read()'
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't make sense to try and deal with 2vs3 (I believe python 3 lets you "inspect" the python * and ** parameters to a function), so you may want to just pick another builtin to test against instead of sys.stdin.read !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried sys.exit which also differed, for now I added the version check inline.
I can try a few more later, agree it is clumsy logic to have in the tests.

@gatesn gatesn merged commit 106e760 into palantir:develop Oct 30, 2017
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.