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

Commitcd7f010

Browse files
committed
Copilot.vim 1.42.0
1 parent8703812 commitcd7f010

15 files changed

+527
-563
lines changed

‎README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#GitHub Copilot for Vim and Neovim
22

3-
GitHub Copilotuses OpenAI Codex to suggest code and entire functions in
4-
real-time right from your editor.Trained on billions of lines of public
5-
code, GitHub Copilot turnsnatural language prompts including comments and
6-
method names into codingsuggestions across dozens of languages.
3+
GitHub Copilotis an AI pair programmer tool that helps you write code faster
4+
and smarter.Trained on billions of lines of public code, GitHub Copilot turns
5+
natural language prompts including comments and method names into coding
6+
suggestions across dozens of languages.
77

88
Copilot.vim is a Vim/Neovim plugin for GitHub Copilot.
99

1010
To learn more, visit
1111
[https://github.com/features/copilot](https://github.com/features/copilot).
1212

13-
##Subscription
13+
##Getting access to GitHub Copilot
1414

15-
GitHub Copilot requires a subscription. It is free for verified students and
16-
maintainers of popular open source projects on GitHub.
17-
18-
GitHub Copilot is subject to the[GitHub Additional Product
19-
Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features).
15+
To access GitHub Copilot, an active GitHub Copilot subscription is required.
16+
Sign up for[GitHub Copilot Free](https://github.com/settings/copilot), or
17+
request access from your enterprise admin.
2018

2119
##Getting started
2220

‎autoload/copilot.vim

Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ function! s:Echo(msg) abort
2323
endif
2424
endfunction
2525

26-
function!s:EditorConfiguration()abort
27-
let filetypes=copy(s:filetype_defaults)
28-
iftype(get(g:,'copilot_filetypes'))==v:t_dict
29-
callextend(filetypes,g:copilot_filetypes)
30-
endif
31-
return {
32-
\'enableAutoCompletions':empty(get(g:,'copilot_enabled',1)) ?v:false :v:true,
33-
\'disabledLanguages':map(sort(keys(filter(filetypes, {k,v->empty(v) }))), { _,v-> {'languageId':v}}),
34-
\}
35-
endfunction
36-
3726
function!copilot#Init(...)abort
3827
callcopilot#util#Defer({->exists('s:client')||s:Start() })
3928
endfunction
@@ -46,7 +35,7 @@ function! s:Start() abort
4635
ifs:Running()||exists('s:client.startup_error')
4736
return
4837
endif
49-
lets:client=copilot#client#New({'editorConfiguration' :s:EditorConfiguration()})
38+
lets:client=copilot#client#New()
5039
endfunction
5140

5241
function!s:Stop()abort
@@ -599,20 +588,8 @@ function! s:VerifySetup() abort
599588
return
600589
endif
601590

602-
let status=copilot#Call('checkStatus', {})
603-
604-
if!has_key(status,'user')
605-
echo'Copilot: Not authenticated. Invoke :Copilot setup'
606-
return
607-
endif
608-
609-
if status.status==#'NoTelemetryConsent'
610-
echo'Copilot: Telemetry terms not accepted. Invoke :Copilot setup'
611-
return
612-
endif
613-
614-
if status.status==#'NotAuthorized'
615-
echo"Copilot: You don't have access to GitHub Copilot. Sign up by visiting https://github.com/settings/copilot"
591+
ifexists('s:client.status.kind')&&s:client.status.kind==#'Error'
592+
echo'Copilot: Error:' .get(s:client.status,'message','unknown')
616593
return
617594
endif
618595

@@ -624,11 +601,8 @@ function! s:commands.status(opts) abort
624601
return
625602
endif
626603

627-
ifexists('s:client.status.status')&&s:client.status.status=~#'Warning\|Error'
628-
echo'Copilot:' .s:client.status.status
629-
if!empty(get(s:client.status,'message',''))
630-
echon':' .s:client.status.message
631-
endif
604+
ifexists('s:client.status.kind')&&s:client.status.kind==#'Warning'
605+
echo'Copilot: Warning:' .get(s:client.status,'message','unknown')
632606
return
633607
endif
634608

@@ -643,12 +617,7 @@ function! s:commands.status(opts) abort
643617
endfunction
644618

645619
function!s:commands.signout(opts)abort
646-
let status=copilot#Call('checkStatus', {'options': {'localChecksOnly':v:true}})
647-
ifhas_key(status,'user')
648-
echo'Copilot: Signed out as GitHub user' . status.user
649-
else
650-
echo'Copilot: Not signed in'
651-
endif
620+
echo'Copilot: Signed out'
652621
callcopilot#Call('signOut', {})
653622
endfunction
654623

@@ -659,14 +628,7 @@ function! s:commands.setup(opts) abort
659628
return
660629
endif
661630

662-
let browser=copilot#Browser()
663-
664-
let status=copilot#Call('checkStatus', {})
665-
ifhas_key(status,'user')
666-
let data= {'status':'AlreadySignedIn','user': status.user}
667-
else
668-
let data=copilot#Call('signInInitiate', {})
669-
endif
631+
let data=copilot#Call('signIn', {})
670632

671633
ifhas_key(data,'verificationUri')
672634
let uri= data.verificationUri
@@ -688,24 +650,13 @@ function! s:commands.setup(opts) abort
688650
endif
689651
ifget(a:opts,'bang')
690652
calls:Echo(codemsg ."In your browser, visit" . uri)
691-
elseiflen(browser)
692-
callinput(codemsg ."Press ENTER to open GitHub in your browser\n")
693-
let status= {}
694-
callcopilot#job#Stream(browser+ [uri],v:null,v:null,function('s:BrowserCallback', [status]))
695-
let time=reltime()
696-
whileempty(status)&&reltimefloat(reltime(time)) <5
697-
sleep10m
698-
endwhile
699-
ifget(status,'code', browser[0]!=#'xdg-open')!=0
700-
calls:Echo("Failed to open browser. Visit" . uri)
701-
else
702-
calls:Echo("Opened" . uri)
703-
endif
653+
let request=copilot#Request('signInConfirm', {})
704654
else
705-
calls:Echo(codemsg ."Could not find browser. Visit" . uri)
655+
callinput(codemsg ."Press ENTER to open GitHub in your browser\n")
656+
let request=copilot#Request('workspace/executeCommand', data.command)
706657
endif
707-
calls:Echo("Waiting (could take up to 10 seconds)")
708-
let request=copilot#Request('signInConfirm', {'userCode': data.userCode}).Wait()
658+
calls:Echo("Waitingfor" . data.userCode ." at" . uri ."(could take up to 10 seconds)")
659+
call request.Wait()
709660
finally
710661
ifexists('mouse')
711662
let &mouse=mouse
@@ -768,16 +719,6 @@ function! s:commands.version(opts) abort
768719
calls:EditorVersionWarning()
769720
endfunction
770721

771-
function!s:UpdateEditorConfiguration()abort
772-
try
773-
ifs:Running()
774-
callcopilot#Notify('notifyChangeConfiguration', {'settings':s:EditorConfiguration()})
775-
endif
776-
catch
777-
callcopilot#logger#Exception()
778-
endtry
779-
endfunction
780-
781722
lets:feedback_url='https://github.com/orgs/community/discussions/categories/copilot'
782723
function!s:commands.feedback(opts)abort
783724
echos:feedback_url
@@ -795,12 +736,10 @@ endfunction
795736

796737
function!s:commands.disable(opts)abort
797738
letg:copilot_enabled=0
798-
calls:UpdateEditorConfiguration()
799739
endfunction
800740

801741
function!s:commands.enable(opts)abort
802742
letg:copilot_enabled=1
803-
calls:UpdateEditorConfiguration()
804743
endfunction
805744

806745
function!s:commands.panel(opts)abort

‎autoload/copilot/client.vim

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,10 @@ function! copilot#client#Settings() abort
550550
let settings.http.proxy='http://' . settings.http.proxy
551551
endif
552552
iftype(get(g:,'copilot_settings'))==v:t_dict
553-
callextend(settings,g:copilot_settings)
553+
let settings.github= {'copilot':g:copilot_settings}
554+
endif
555+
iftype(get(g:,'copilot_lsp_settings'))==v:t_dict
556+
callextend(settings,g:copilot_lsp_settings)
554557
endif
555558
return settings
556559
endfunction
@@ -610,7 +613,7 @@ endfunction
610613
lets:notifications= {
611614
\'$/progress':function('s:Progress'),
612615
\'featureFlagsNotification':function('s:Nop'),
613-
\'statusNotification':function('s:StatusNotification'),
616+
\'didChangeStatus':function('s:StatusNotification'),
614617
\'window/logMessage':function('copilot#handlers#window_logMessage'),
615618
\}
616619

@@ -624,8 +627,8 @@ let s:vim_capabilities = {
624627
\'window': {'showDocument': {'support':v:true}},
625628
\}
626629

627-
function!copilot#client#New(...)abort
628-
let opts=a:0 ?a:1 :{}
630+
function!copilot#client#New()abort
631+
let opts= {}
629632
let instance= {'requests': {},
630633
\'progress': {},
631634
\'workspaceFolders': {},
@@ -651,13 +654,12 @@ function! copilot#client#New(...) abort
651654
endif
652655
let instance.node= node
653656
letcommand= node+argv
654-
let opts= {}
655657
let opts.initializationOptions= {
656658
\'editorInfo':copilot#client#EditorInfo(),
657659
\'editorPluginInfo':copilot#client#EditorPluginInfo(),
658660
\}
659661
let opts.workspaceFolders= []
660-
let settings=extend(copilot#client#Settings(),get(opts,'editorConfiguration', {}))
662+
let settings=copilot#client#Settings()
661663
iftype(get(g:,'copilot_workspace_folders'))==v:t_list
662664
for foldering:copilot_workspace_folders
663665
iftype(folder)==v:t_string&&!empty(folder)&& folder!~#'\*\*\|^/$'

‎autoload/copilot/panel.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ function! copilot#panel#Accept(...) abort
108108
endfunction
109109

110110
function!s:Initialize(state)abort
111-
let &l:filetype='copilot' . (empty(a:state.filetype) ?'' :'.' .a:state.filetype)
111+
try
112+
let &l:filetype='copilot' . (empty(a:state.filetype) ?'' :'.' .a:state.filetype)
113+
catch
114+
let &l:filetype='copilot'
115+
endtry
112116
let &l:tabstop=a:state.tabstop
113117
nmap<buffer><script><CR><Cmd>exe copilot#panel#Accept()<CR>
114118
nmap<buffer><script> [[<Cmd>call search('^─\{9,}\n.', 'bWe')<CR>

‎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.41.0'
2+
return'1.42.0'
33
endfunction
1.96 MB
Binary file not shown.
2.13 MB
Binary file not shown.
1.96 MB
Binary file not shown.
2.13 MB
Binary file not shown.
1.82 MB
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp