nvim-completion-manager icon indicating copy to clipboard operation
nvim-completion-manager copied to clipboard

Ability to prioritize function parameters and showing them on entering (

Open sassanh opened this issue 8 years ago • 2 comments

Is it possible to:

  1. Have an option to prioritize function parameters.
  2. Show function parameters when user enters (. For example when entering serializers.SerializerMethodField( (python, rest framework) would be great to show method_field as first completion suggestion and when entering serializers.SerializerMethodField(me would be great to have method_field as first suggestion (currently for me it's map then max, etc, method_field is 6th)

sassanh avatar May 22 '17 08:05 sassanh

  1. Have an option to prioritize function parameters.

I guess you want custom sorting of the python completion items.

A completion source can use its own sort algorithm with the sort option set to 0 (it's currently undocumented behavior).

  1. Show function parameters when user enters (. For example when entering serializers.SerializerMethodField( (python, rest framework) would be great to show method_field as first completion suggestion and when entering serializers.SerializerMethodField(me would be great to have method_field as first suggestion (currently for me it's map then max, etc, method_field is 6th)

ncm's python completion is based on jedi library. According to the documentation, it doesn't have this feature.

However, it seems possible to implement it, as the completion results returned by jedi has information about the type. To be specific, it's Completion.BaseDefinition.type http://jedi.readthedocs.io/en/latest/_modules/jedi/api/classes.html#Completion.

It is not really attractive to me so I have no plan to support it.

roxma avatar May 22 '17 12:05 roxma

OK, maybe I can make a PR if it attracts myself 😄

sassanh avatar May 24 '17 15:05 sassanh