TabNine icon indicating copy to clipboard operation
TabNine copied to clipboard

Documentation for Pro features API

Open realSaltyFish opened this issue 2 years ago • 3 comments

Currently whole-line and full-function completion are not implemented in coc.nvim. I would like to work on these but I could not find information about the related API (Autocomplete seems to only provide short code completion). Is there any documentation for them?

gz#17684

realSaltyFish avatar Sep 03 '22 06:09 realSaltyFish

Hi! the whole line is not supported on nvim yet, you are correct. If you need any further assistance regarding your paid plan, email us at [email protected]

maya-tabnine avatar Sep 11 '22 10:09 maya-tabnine

@maya-tabnine hello I already opened ticket on the support but my understanding is that you have a lot to answer, so I think providing the community with the documentation on how to trigger whole-line/full function would help us implement it and maybe drop a bit of the request you got :)

even raw example of a exchange , would help us, does not need to be a nice documentation with every bits explained

for example I can see that vscode is sending things like this :

{
   "version":"4.4.71",
   "request":{
     "Autocomplete":{
          "filename":"Untitled-3.py",
          "before":"# check if  number is prime\ndef isPrime", 
          "after":"",
          "region_includes_beginning":true,
          "region_includes_end":true,
          "max_num_results":5,
          "offset":38,
          "line":1,
          "character":10,
          "indentation_size":4
      }
   }
}

is there something else needed , or just switching to 4.4.71 and these arguments enough ?

allan-simon avatar Sep 11 '22 19:09 allan-simon

@maya-tabnine I found a bug

whole line completion don't get a correlation_id in response

If I open tabnine directly and I enter in stdin :

{"version": "3.3.0", "request": {"Autocomplete": {"before": "# check if number is prime\\ndef isPrime(toto):\n    ", "filename": "/home/tmp/toto.py", "region_includes_beginning": true, "correlation_id": 38, "region_includes_end": true, "after": "\\n\\n\\n", "max_num_results": 20}}}

I got in response : (so no correlation id )

{
  "old_prefix": "",
  "results": [
    {
      "new_prefix": "#    if toto % 2 == 0:\n#        return 1\n#    else:\n#        return isPrime(toto // 2)\n",
      "old_suffix": "",
      "new_suffix": "",
      "kind": 15,
      "origin": "CLOUD2",
      "detail": "-18.741",
      "completion_kind": "Snippet",
      "is_cached": false
    },
    {
      "new_prefix": "#    if toto % 2 == 0:\n#        return 1\n#    else:\n#        return isPrime(toto // 2)\n",
      "old_suffix": "",
      "new_suffix": "",
      "kind": 15,
      "origin": "CLOUD2",
      "detail": "-20.658",
      "completion_kind": "Snippet",
      "is_cached": false
    }
  ],
  "user_message": [],
  "docs": [],
  "is_locked": false,
  "snippet_context": {
    "stop_reason": "stop_token",
    "generated_tokens": 60,
    "user_intent": "Comment",
    "intent_metadata": {
      "current_line_indentation": 0,
      "previous_line_indentation": 0,
      "triggered_after_character": ":"
    },
    "response_time_ms": 879,
    "is_cached": false,
    "context_len": 47
  }
}

@RealSaltyFish so it seems that for "whole function" it's specifically the fact that the completion is triggered on an empty line (can have "spaces" )

allan-simon avatar Sep 11 '22 21:09 allan-simon

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 10 '22 23:11 stale[bot]