Skip to content

Commit 7d95b58

Browse files
committed
Cleanup for non-windows using HttpIt + updates to docker setup
1 parent b69acf4 commit 7d95b58

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM alpine:latest
2-
RUN apk update && apk add git vim curl wslview
2+
RUN apk update && apk add git vim curl
33
RUN mkdir -p ~/.vim/bundle
44
RUN git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

.devcontainer/devcontainer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
22
"dockerFile": "Dockerfile",
3-
"postStartCommand": "cp .devcontainer/vimrc ~/.vimrc && vim +PluginInstall +qall && cp -r * ~/.vim/bundle/copilot.vim/"
3+
"postStartCommand": "cp .devcontainer/vimrc ~/.vimrc && vim +PluginInstall +qall && cp -r * ~/.vim/bundle/copilot.vim/",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"XadillaX.viml"
8+
]
9+
}
10+
}
411
}

plugin/copilot_chat.vim

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,15 @@ function HttpIt(method, url, headers, body)
5959
let l:ps_cmd .= '"'
6060
let l:response = system(l:ps_cmd)
6161
else
62-
let l:token_headers = [
63-
\ 'Accept: application/json',
64-
\ 'User-Agent: GithubCopilot/1.155.0',
65-
\ 'Accept-Encoding: gzip,deflate,br',
66-
\ 'Editor-Plugin-Version: copilot.vim/1.16.0',
67-
\ 'Editor-Version: Neovim/0.6.1',
68-
\ 'Content-Type: application/json',
69-
\ ]
7062
let l:token_data = json_encode(a:body)
7163

72-
" Construct the curl command for token setup
73-
let l:curl_cmd = 'curl -s -X POST --compressed '
64+
let l:curl_cmd = 'curl -s -X ' . a:method . ' --compressed '
7465
for header in a:headers
7566
let l:curl_cmd .= '-H "' . header . '" '
7667
endfor
77-
let l:curl_cmd .= "-d '" . l:token_data . "' " . l:token_url
68+
let l:curl_cmd .= "-d '" . l:token_data . "' " . a:url
7869

7970
let l:response = system(l:curl_cmd)
80-
81-
" Check for errors in the response
8271
if v:shell_error != 0
8372
echom 'Error: ' . v:shell_error
8473
return ''

0 commit comments

Comments
 (0)