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

feat(tools/spxls): implement textDocument/completion #1169

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

aofei
Copy link
Member

@aofei aofei commented Dec 24, 2024

Updates #1059

Copy link

qiniu-prow bot commented Dec 24, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

diagnostics := result.diagnostics[param.TextDocument.URI]
if len(diagnostics) > 0 {
return nil, fmt.Errorf("failed to compile file: %s", diagnostics[0].Message)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

当时在 https://github.com/goplus/builder/pull/1162/files#diff-0c6691e1482b8fb7fab79c84814456d80895bd823bc74fee320c1dc82c70ea9f 添加这个处理,是因为有语法错误时 astFilenil 对吧?

这个 pr 调整了 compile 的逻辑,现在有语法错误时也能正常拿到 astFile 了。

Copy link
Collaborator

Choose a reason for hiding this comment

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

添加这个处理,是因为有语法错误时 astFilenil 对吧?

是的

这个 pr 调整了 compile 的逻辑,现在有语法错误时也能正常拿到 astFile 了。

棒 👍

@aofei aofei marked this pull request as ready for review December 25, 2024 03:12
@aofei aofei requested a review from Copilot December 25, 2024 03:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 11 changed files in this pull request and generated 2 comments.

Files not reviewed (5)
  • tools/spxls/README.md: Evaluated as low risk
  • tools/spxls/internal/server/command.go: Evaluated as low risk
  • tools/spxls/internal/server/command_test.go: Evaluated as low risk
  • tools/spxls/internal/server/compile.go: Evaluated as low risk
  • tools/spxls/internal/server/completion_test.go: Evaluated as low risk
Comments suppressed due to low confidence (3)

tools/spxls/internal/server/util.go:148

  • The function name expandGopOverloadedMethod is now consistent with the naming convention used elsewhere in the codebase.
func expandGopOverloadedMethod(method *types.Func) []*types.Func {

tools/spxls/internal/server/util.go:3

  • The bitwise OR operation to convert the first character to lowercase might not work correctly for non-ASCII characters. Consider using a more robust method for handling Unicode characters.
return string(s[0]|32) + s[1:]

tools/spxls/internal/server/server.go:83

  • Ensure that the CompletionItem struct is properly initialized and used within the textDocumentCompletion function.
return s.textDocumentCompletion(&params)

tools/spxls/internal/server/spx_definition.go Outdated Show resolved Hide resolved
tools/spxls/internal/server/server.go Show resolved Hide resolved
@aofei aofei requested a review from Copilot December 25, 2024 03:15
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 11 changed files in this pull request and generated 1 comment.

Files not reviewed (5)
  • tools/spxls/README.md: Evaluated as low risk
  • tools/spxls/internal/server/command.go: Evaluated as low risk
  • tools/spxls/internal/server/server.go: Evaluated as low risk
  • tools/spxls/internal/server/util.go: Evaluated as low risk
  • tools/spxls/internal/server/compile.go: Evaluated as low risk

tools/spxls/internal/server/spx_definition.go Outdated Show resolved Hide resolved
tools/spxls/internal/server/spx_definition.go Outdated Show resolved Hide resolved
tools/spxls/internal/server/completion.go Outdated Show resolved Hide resolved
tools/spxls/internal/server/completion.go Show resolved Hide resolved
tools/spxls/internal/server/completion.go Show resolved Hide resolved
tools/spxls/internal/server/completion.go Outdated Show resolved Hide resolved
@qiniu-ci
Copy link

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.

@nighca nighca merged commit c4859cf into goplus:dev Dec 26, 2024
7 checks passed
@aofei aofei deleted the spxls-completion branch December 26, 2024 06:06
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