Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9484e35

Browse files
committed
Copilot.vim 1.26.0
1 parent3b39e78 commit9484e35

File tree

7 files changed

+299
-285
lines changed

7 files changed

+299
-285
lines changed

‎.github/workflows/auto-close-pr.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name:Auto-close PR
2+
on:
3+
pull_request_target:
4+
types:[opened, reopened]
5+
6+
jobs:
7+
close:
8+
name:Run
9+
runs-on:ubuntu-latest
10+
permissions:
11+
pull-requests:write
12+
steps:
13+
-run:|
14+
gh pr close ${{ github.event.pull_request.number }} --comment \
15+
"At the moment we are not accepting contributions to the repository.
16+
17+
Feedback for Copilot.vim can be given in the [Copilot community discussions](https://github.com/orgs/community/discussions/categories/copilot)."
18+
env:
19+
GH_REPO: ${{ github.repository }}
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎autoload/copilot.vim

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ function! s:EditorConfiguration() abort
3434
\}
3535
endfunction
3636

37-
function!s:StatusNotification(params,...)abort
38-
let status=get(a:params,'status','')
39-
if status==?'error'
40-
lets:agent_error=a:params.message
41-
else
42-
unlet!s:agent_error
43-
endif
44-
endfunction
45-
4637
function!copilot#Init(...)abort
4738
callcopilot#util#Defer({->exists('s:agent')||s:Start() })
4839
endfunction
@@ -56,7 +47,6 @@ function! s:Start() abort
5647
return
5748
endif
5849
lets:agent=copilot#agent#New({'methods': {
59-
\'statusNotification':function('s:StatusNotification'),
6050
\'PanelSolution':function('copilot#panel#Solution'),
6151
\'PanelSolutionsDone':function('copilot#panel#SolutionsDone'),
6252
\},
@@ -611,6 +601,12 @@ function! s:VerifySetup() abort
611601
echo'Copilot: Telemetry terms not accepted. Invoke :Copilot setup'
612602
return
613603
endif
604+
605+
if status.status==#'NotAuthorized'
606+
echo"Copilot: You don't have access to GitHub Copilot. Sign up by visiting https://github.com/settings/copilot"
607+
return
608+
endif
609+
614610
return1
615611
endfunction
616612

@@ -619,30 +615,21 @@ function! s:commands.status(opts) abort
619615
return
620616
endif
621617

622-
let status=s:EnabledStatusMessage()
623-
if!empty(status)
624-
echo'Copilot:' . status
625-
return
626-
endif
627-
628-
let startup_error=copilot#Agent().StartupError()
629-
if!empty(startup_error)
630-
echo'Copilot:' . startup_error
631-
return
632-
endif
633-
634-
ifexists('s:agent_error')
635-
echo'Copilot:' .s:agent_error
618+
ifexists('s:agent.status.status')&&s:agent.status.status=~#'Warning\|Error'
619+
echo'Copilot:' .s:agent.status.status
620+
if!empty(get(s:agent.status,'message',''))
621+
echon':' .s:agent.status.message
622+
endif
636623
return
637624
endif
638625

639-
let status=copilot#Call('checkStatus', {})
640-
if status.status==#'NotAuthorized'
641-
echo'Copilot:Not authorized'
626+
let status=s:EnabledStatusMessage()
627+
if!empty(status)
628+
echo'Copilot:' . status
642629
return
643630
endif
644631

645-
echo'Copilot:Enabled and online'
632+
echo'Copilot:Ready'
646633
calls:EditorVersionWarning()
647634
calls:NodeVersionWarning()
648635
endfunction

‎autoload/copilot/agent.vim

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function! s:RejectRequest(request, error) abort
5151
ifempty(reject)
5252
callcopilot#logger#Error(msg)
5353
else
54-
callcopilot#logger#Warn(msg)
54+
callcopilot#logger#Debug(msg)
5555
endif
5656
endfunction
5757

@@ -185,7 +185,7 @@ function! s:RegisterWorkspaceFolderForBuffer(agent, buf) abort
185185
return
186186
endif
187187
leta:agent.workspaceFolders[root]=v:true
188-
calla:agent.Notify('workspace/didChangeWorkspaceFolders', {'event': {'added': [{'uri': root,'name':fnamemodify(root,':t')}]}})
188+
calla:agent.Notify('workspace/didChangeWorkspaceFolders', {'event': {'added': [{'uri': root,'name':fnamemodify(root,':t')}],'removed': []}})
189189
endfunction
190190

191191
function!s:PreprocessParams(agent, params)abort
@@ -275,15 +275,15 @@ endfunction
275275

276276
function!s:DispatchMessage(agent, method, handler, id, params,...)abort
277277
try
278-
let response= {'result':call(a:handler, [a:params])}
278+
let response= {'result':call(a:handler, [a:params,a:agent])}
279279
if response.resultis#0
280280
let response.result=v:null
281281
endif
282282
catch
283283
callcopilot#logger#Exception('lsp.request.' .a:method)
284284
let response= {'error': {'code':-32000,'message':v:exception}}
285285
endtry
286-
if!empty(a:id)
286+
ifa:idisnot#v:null
287287
calls:Send(a:agent,extend({'id':a:id}, response))
288288
endif
289289
return response
@@ -556,12 +556,18 @@ function! s:AgentStartupError() dict abort
556556
endif
557557
endfunction
558558

559+
function!s:StatusNotification(params, agent)abort
560+
callcopilot#logger#Info('StatusNotification' .string(a:params))
561+
leta:agent.status=a:params
562+
endfunction
563+
559564
function!s:Nop(...)abort
560565
returnv:null
561566
endfunction
562567

563568
lets:common_handlers= {
564569
\'featureFlagsNotification':function('s:Nop'),
570+
\'statusNotification':function('s:StatusNotification'),
565571
\'window/logMessage':function('copilot#handlers#window_logMessage'),
566572
\}
567573

@@ -579,6 +585,7 @@ function! copilot#agent#New(...) abort
579585
let opts=a:0 ?a:1 : {}
580586
let instance= {'requests': {},
581587
\'workspaceFolders': {},
588+
\'status': {'status':'Starting','message':''},
582589
\'Close':function('s:AgentClose'),
583590
\'Notify':function('s:AgentNotify'),
584591
\'Request':function('s:AgentRequest'),

‎autoload/copilot/handlers.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
function!copilot#handlers#window_logMessage(params)abort
1+
function!copilot#handlers#window_logMessage(params,...)abort
22
callcopilot#logger#Raw(get(a:params,'type',6),get(a:params,'message',''))
33
endfunction
44

5-
function!copilot#handlers#window_showMessageRequest(params)abort
5+
function!copilot#handlers#window_showMessageRequest(params,...)abort
66
let choice=inputlist([a:params.message ."\n\nRequest Actions:"]+
77
\map(copy(get(a:params,'actions', [])), {i,v-> (i+1) .'.' .v.title}))
88
return choice >0 ?get(a:params.actions, choice-1,v:null) :v:null
@@ -12,7 +12,7 @@ function! s:BrowserCallback(into, code) abort
1212
leta:into.code=a:code
1313
endfunction
1414

15-
function!copilot#handlers#window_showDocument(params)abort
15+
function!copilot#handlers#window_showDocument(params,...)abort
1616
echoa:params.uri
1717
ifempty(get(a:params,'external'))
1818
return {'success':v:false}

‎autoload/copilot/version.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function!copilot#version#String()abort
2-
return'1.25.1'
2+
return'1.26.0'
33
endfunction

‎dist/agent.js

Lines changed: 246 additions & 246 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎dist/agent.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp