-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support copilot #688
support copilot #688
Conversation
大佬,需要修复一下elisp文件的编译错误,要不CI会挂,谢谢 |
这个补丁在readme添加说明吧,这样用户可以知道有这个功能 |
建议 copilot 的相关文件让用户自行安装,毕竟那部分文件的 license 和本仓库不符。 |
ok |
感谢建议 |
(self.node_path, ) = get_emacs_vars(["acm-backend-copilot-node-path"]) | ||
|
||
npm_prefix = subprocess.check_output(['npm', 'config', 'get', 'prefix'], universal_newlines=True).strip() | ||
self.agent_path = os.path.join(f'{npm_prefix}/lib/node_modules', "copilot-node-server", "copilot/dist/agent.js") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有条件的话测试一下 Windows 兼容性?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个写的比较仓促 可能一些东西还没来得及考虑到比如windows兼容,node版本检查,copilot状态,错误信息啥的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在我的环境中(Gentoo on WSL2),它是 /usr/local/lib64/node_modules
。
希望您能考虑到这一点🙇♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我提交了一个新的补丁 应该可以考虑到这个路径 #692
|
||
(defvar-local acm-backend-copilot-items nil) | ||
|
||
(defun acm-backend-copilot-check-node-version () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数好像没用到?建议在 Python 里检查 node 版本。
:group 'acm-backend-copilot) | ||
|
||
(defcustom acm-backend-copilot-node-path "node" | ||
"The path to store Codeium API Key." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释忘记改了?
@@ -1341,6 +1341,17 @@ So we build this macro to restore postion after code format." | |||
(when acm-enable-tabnine | |||
(lsp-bridge-tabnine-complete)) | |||
|
|||
;; Copilot search. | |||
(when (and acm-enable-copilot | |||
;; Copilot backend not support remote file now, disable it temporary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是支持远程文件的。Copilot 自己不会去读文件,只需要获取 buffer 内容就行了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的 应该是挺容易兼容的 但是远程文件这块因为我不太熟悉 所以暂时没支持
(symbol-name major-mode) | ||
(buffer-file-name) | ||
relative-path | ||
tab-width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
绝大多数模式的缩进大小都不是 tab-width 控制的,这里可能会导致非预期行为
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢建议
另外建议参考一下这个项目 |
No description provided.