Skip to content
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

Merged
merged 3 commits into from
Jul 27, 2023
Merged

support copilot #688

merged 3 commits into from
Jul 27, 2023

Conversation

kongds
Copy link
Contributor

@kongds kongds commented Jul 26, 2023

No description provided.

@kongds kongds mentioned this pull request Jul 26, 2023
@manateelazycat
Copy link
Owner

大佬,需要修复一下elisp文件的编译错误,要不CI会挂,谢谢

@manateelazycat
Copy link
Owner

这个补丁在readme添加说明吧,这样用户可以知道有这个功能

@fl711203
Copy link

建议 copilot 的相关文件让用户自行安装,毕竟那部分文件的 license 和本仓库不符。
可以通过这个 npm 包:https://www.npmjs.com/package/copilot-node-server

@kongds
Copy link
Contributor Author

kongds commented Jul 27, 2023

这个补丁在readme添加说明吧,这样用户可以知道有这个功能

ok

@kongds
Copy link
Contributor Author

kongds commented Jul 27, 2023

建议 copilot 的相关文件让用户自行安装,毕竟那部分文件的 license 和本仓库不符。
可以通过这个 npm 包:https://www.npmjs.com/package/copilot-node-server

感谢建议

@manateelazycat manateelazycat merged commit 4088c58 into manateelazycat:master Jul 27, 2023
1 of 2 checks passed
acm/acm.el Show resolved Hide resolved
(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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有条件的话测试一下 Windows 兼容性?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个写的比较仓促 可能一些东西还没来得及考虑到比如windows兼容,node版本检查,copilot状态,错误信息啥的。

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
希望您能考虑到这一点🙇‍♂️

Copy link
Contributor Author

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 ()
Copy link
Collaborator

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."
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是支持远程文件的。Copilot 自己不会去读文件,只需要获取 buffer 内容就行了。

Copy link
Contributor Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

绝大多数模式的缩进大小都不是 tab-width 控制的,这里可能会导致非预期行为

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢建议

@zerolfx
Copy link
Collaborator

zerolfx commented Jul 28, 2023

另外建议参考一下这个项目

https://github.com/TerminalFi/LSP-copilot

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.

5 participants