Skip to content

Conversation

@rksm
Copy link
Contributor

@rksm rksm commented Feb 20, 2023

...https://github.com/github/copilot.vim/tree/release/copilot/dist

This is just taking the latest version from copilot.vim and fixing an error regarding the missing version property. Used it a bit and as far as I can tell completions are working fine but there might be potentially changes in the interface that are not covered.

Do you know if there is any documentation / changelog for the VSCode extension? Seems really annoying that they just ship that as a blob.

@zerolfx
Copy link
Collaborator

zerolfx commented Feb 21, 2023

I don't know any documentation for the VSCode extension, but the VSCode version does have more functionalities.

I plan to upgrade agent.js after syncing the changes from github/copilot.vim@8c84164 (and when I have enough time). I would appreciate it if you could help me with that.

@rksm
Copy link
Contributor Author

rksm commented Feb 21, 2023

I mean I'm not familiar with the vim plugin but there are probably a few areas of improvement.

Not sure if the language id really matters, it is currently derived from the mode name. The vim plugin has a map with a few ids: https://github.com/github/copilot.vim/blob/release/autoload/copilot/doc.vim#L14. Pretty printing agent.js and looking into it, it seems the full list would be:

abap
bat
bibtex
blade
c
clojure
coffeescript
cpp
csharp
css
dart
dockerfile
elixir
erb
erlang
fsharp
go
groovy
haml
handlebars
haskell
html
ini
java
javascript
javascriptreact
jsonc
jsx
julia
kotlin
latex
less
lua
makefile
markdown
objective-c
objective-cpp
perl
php
powershell
pug
python
ql
r
razor
ruby
rust
sass
scala
scss
shellscript
slim
solidity
sql
stylus
svelte
swift
terraform
tex
typescript
typescriptreact
vb
verilog
vue-html
vue
xml
xsl
yaml
php
plaintext

So making a mapping to ensure those "ids" are used is something that could be improved. Whether or not this makes a difference regarding the completion quality I have no idea.

As for the document version property that now seems to be required: It seems the vim plugin sends textDocument/didChange notification to some lsp server and then uses the version tracking of the lsp client/server as the version property to send to the copilot agent. The version number the copilot agent uses internally and the version specified in the completion request definitely need to match, we get an error otherwise.
Not sure what's the lsp endpoint in this case. It isn't the agent I think, I tried sending that notification but just got errors. In any case, just using 0 as version seems to work OK, the agent does not increment its internal version on its own apparently.

Other than that there don't seem to be much more changes.

@NotBrianZach
Copy link

can confirm this pull request fixes copilot plugin for me after it refused to start after I updated nodejs to version 18.

@zerolfx zerolfx merged commit 7bbfe20 into copilot-emacs:main Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants