parent
5ad9746747
commit
0ddc1bc087
|
|
@ -244,7 +244,7 @@ function! s:GetPrompt()
|
|||
let first_line = max([1, line('.') - max_lines])
|
||||
let lines = getbufline('%', first_line, line('.'))
|
||||
let lines[-1] = lines[-1][:col('.') - 2]
|
||||
return join(lines, '\n')
|
||||
return join(lines, "\n")
|
||||
endfunction
|
||||
|
||||
function! s:GetLanguage()
|
||||
|
|
@ -275,7 +275,7 @@ function! tabby#Show()
|
|||
if (type(choice.text) != v:t_string) || (len(choice.text) == 0)
|
||||
return
|
||||
endif
|
||||
let lines = split(choice.text, '\\n')
|
||||
let lines = split(choice.text, "\n")
|
||||
call prop_add(line('.'), col('.'), #{
|
||||
\ type: s:prop_type,
|
||||
\ text: lines[0],
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"description": "Tabby client for vim.",
|
||||
"main": "./dist/tabby.js",
|
||||
"scripts": {
|
||||
"watch": "webpack --watch",
|
||||
"dev": "webpack --watch",
|
||||
"build": "webpack --mode=production"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -80,12 +80,17 @@ export class TabbyClient extends EventEmitter {
|
|||
return this.tabbyServerUrl;
|
||||
}
|
||||
|
||||
public async getCompletion(request: TabbyCompletionRequest): Promise<TabbyCompletion | null> {
|
||||
public async getCompletion(
|
||||
request: TabbyCompletionRequest
|
||||
): Promise<TabbyCompletion | null> {
|
||||
if (this.status == "disconnected") {
|
||||
this.ping();
|
||||
}
|
||||
try {
|
||||
const response = await axios.post<TabbyCompletion>(`${this.tabbyServerUrl}/v1/completions`, request);
|
||||
const response = await axios.post<TabbyCompletion>(
|
||||
`${this.tabbyServerUrl}/v1/completions`,
|
||||
request
|
||||
);
|
||||
assert(response.status == 200);
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ Below is the URL for your API endpoint.
|
|||
|
||||
### Clients
|
||||
|
||||
* [Vim](https://github.com/TabbyML/tabby/tree/main/clients/vim)
|
||||
* [VSCode](https://marketplace.visualstudio.com/items?itemName=TabbyML.vscode-tabby)
|
||||
|
||||
""".replace(
|
||||
|
|
|
|||
Loading…
Reference in New Issue