You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to report what I believe is a bug in tabby-agent.
tabby was started via tabby serve --model StarCoder-1B --no-webserver
For testing a LSP client integration, I enabled the regular textDocument/completion request for now. The client declares in initialze that it only supports InsertTextMode.adjustIndentation, which means that
/*** The editor adjusts leading whitespace of new lines so that* they match the indentation up to the cursor of the line for* which the item is accepted.*/
Using the following Python file
# find max element in arraydeffindMaxElement(arr):
and requesting textDocument/completion at the cursor position shown in the following screenshot, the textEdit of the completion item in the response contains extra (incorrect) indentation; see the JSON payload below.
{
"isIncomplete": true,
"items": [
{
"label": "maxElement = arr[0]\n",
"labelDetails": {
"detail": " for i in range(1, len(arr)):\n",
"description": "Tabby"
},
"kind": 1,
"documentation": {
"kind": "markdown",
"value": "```\n maxElement = arr[0]\n for i in range(1, len(arr)):\n if arr[i] > maxElement:\n maxElement = arr[i]\n return maxElement\n```\n ---\nSuggested by Tabby."
},
"textEdit": {
"newText": "maxElement = arr[0]\n for i in range(1, len(arr)):\n if arr[i] > maxElement:\n maxElement = arr[i]\n return maxElement",
"range": {
"start": {
"line": 2,
"character": 4
},
"end": {
"line": 2,
"character": 4
}
}
},
"data": {
"eventId": {
"completionId": "cmpl-e6481dd3-5fc3-4b60-8c43-aefe5d2b8fd1",
"choiceIndex": 0
}
}
}
]
}
This results in wrong indentation when the completion item gets accepted:
The right thing to do for tabby-agent would be to remove leading indentation from the newText as if the code block (cursor position) had no initial indentation.
Note that this is only relevant for textDocument/completion but not for textDocument/inlineCompletion, because afaik indentation in inline completions should always be handled as InsertTextMode.asIs.
The text was updated successfully, but these errors were encountered:
Thank you for reporting this bug and proposing the detail solution.
Indeed, the tabby-agent does not fully respect all client capabilities regarding the method textDocument/completion, including InsertMode.
I will fix it in the next tabby-agent minor release.
I want to report what I believe is a bug in tabby-agent.
tabby was started via
tabby serve --model StarCoder-1B --no-webserver
For testing a LSP client integration, I enabled the regular
textDocument/completion
request for now. The client declares ininitialze
that it only supports InsertTextMode.adjustIndentation, which means thatUsing the following Python file
and requesting
textDocument/completion
at the cursor position shown in the following screenshot, thetextEdit
of the completion item in the response contains extra (incorrect) indentation; see the JSON payload below.This results in wrong indentation when the completion item gets accepted:
The right thing to do for tabby-agent would be to remove leading indentation from the
newText
as if the code block (cursor position) had no initial indentation.Note that this is only relevant for
textDocument/completion
but not fortextDocument/inlineCompletion
, because afaik indentation in inline completions should always be handled asInsertTextMode.asIs
.The text was updated successfully, but these errors were encountered: