-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(tools/spxls): implement textDocument/{prepareRename,rename,signatureHelp,documentHighlight}
#1146
Conversation
param := sig.Params().At(i) | ||
paramsInfo = append(paramsInfo, ParameterInformation{ | ||
Label: param.Name() + " " + param.Type().String(), | ||
// TODO: Add documentation. |
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.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用“MARKER(uid): note body”格式是一个推荐的做法。这意味着在编写注释时,应该遵循这种特定的格式来提高代码的可读性和一致性。
错误用法
以下是一个错误的示例,展示了不正确的注释格式:
// 这是一个错误的注释格式
func exampleFunction() {
// 这里是函数体
}
正确用法
以下是一个正确的示例,展示了遵循推荐格式的注释:
// MARKER(12345): 这是一个正确的注释格式
func exampleFunction() {
// 这里是函数体
}
在这个正确示例中,“MARKER(12345)”部分是一个唯一的标识符,用于标记这个注释。注释的主体部分“这是一个正确的注释格式”则描述了注释的内容。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
return &SignatureHelp{ | ||
Signatures: []SignatureInformation{{ | ||
Label: label, | ||
// TODO: Add documentation. |
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.
A Note is recommended to use "MARKER(uid): note body" format.
Details
lint 解释
这个lint结果提示在注释中使用“MARKER(uid): note body”格式是一个推荐的做法。这意味着在编写注释时,应该遵循这种特定的格式来提高代码的可读性和一致性。
错误用法
以下是一个错误的示例,展示了不正确的注释格式:
// 这是一个错误的注释格式
func exampleFunction() {
// 这里是函数体
}
正确用法
以下是一个正确的示例,展示了遵循推荐格式的注释:
// MARKER(12345): 这是一个正确的注释格式
func exampleFunction() {
// 这里是函数体
}
在这个正确示例中,“MARKER(12345)”部分是一个唯一的标识符,用于标记这个注释。注释的主体部分“这是一个正确的注释格式”则描述了注释的内容。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
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 reviewed 5 out of 13 changed files in this pull request and generated no comments.
Files not reviewed (8)
- tools/spxls/internal/server/highlight_test.go: Evaluated as low risk
- tools/spxls/internal/server/signature_test.go: Evaluated as low risk
- tools/spxls/internal/server/signature.go: Evaluated as low risk
- tools/spxls/README.md: Evaluated as low risk
- tools/spxls/internal/server/command.go: Evaluated as low risk
- tools/spxls/internal/server/def.go: Evaluated as low risk
- tools/spxls/internal/server/server.go: Evaluated as low risk
- tools/spxls/internal/vfs/mapfs.go: Evaluated as low risk
Comments suppressed due to low confidence (1)
tools/spxls/internal/server/highlight.go:19
- Add a check to ensure
ident
is notnil
before using it to prevent potential runtime errors.
if obj == nil {
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 reviewed 5 out of 14 changed files in this pull request and generated no comments.
Files not reviewed (9)
- tools/spxls/internal/server/highlight.go: Evaluated as low risk
- tools/spxls/README.md: Evaluated as low risk
- tools/spxls/internal/server/compile.go: Evaluated as low risk
- tools/spxls/internal/server/def.go: Evaluated as low risk
- tools/spxls/internal/server/document.go: Evaluated as low risk
- tools/spxls/internal/server/server.go: Evaluated as low risk
- tools/spxls/internal/vfs/mapfs.go: Evaluated as low risk
- tools/spxls/internal/server/command.go: Evaluated as low risk
- tools/spxls/internal/server/rename.go: Evaluated as low risk
This PR has been deployed to the preview environment. You can explore it using the preview URL. Warning Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team. |
|
||
var highlights []DocumentHighlight | ||
if isMainPkgObject(obj) { | ||
highlights = append(highlights, DocumentHighlight{ |
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.
为啥 ident.Pos()
(应该差不多就是输入的位置)一定是 write?我以为 xxx = ...
这种才算 write
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.
嗯这个逻辑是有问题,我先给改成 Text
吧,然后在 textDocument/semanticTokens/full
中修复这个方法
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.
OK
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.
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.
下边遍历 result.typeInfo.Uses
得到的项也先改成 Text
?那边好像也不能确定是 Read
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.
…atureHelp,documentHighlight}` Updates goplus#1059 Signed-off-by: Aofei Sheng <[email protected]>
@aofei: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Updates #1059