Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: Kotlin gazelle plugin outputs unexpected parse errors #530

Closed
reddaly opened this issue Oct 9, 2023 · 3 comments · May be fixed by #536
Closed

[Bug]: Kotlin gazelle plugin outputs unexpected parse errors #530

reddaly opened this issue Oct 9, 2023 · 3 comments · May be fixed by #536
Assignees
Labels
bug Something isn't working

Comments

@reddaly
Copy link

reddaly commented Oct 9, 2023

What happened?

Gazelle outputs parse errors for Kotlin files that seem to compile without problems. Example:

                1: package gazelle.kotlin.tests.gcsutil
                    ^
                 49:     if (path.contains("//")) {
                                           ^
                 51:             "GCS URIs should not contain two adjacent slashes: ${quote(this)
                                                                                  ^
                 71:      * Returns a [CloudStoragePath] for this "gs://"-style URI.
                                                                     ^
                 73:     val path: CloudStoragePath
                                 ^
                 73:     val path: CloudStoragePath get() = CloudStorageFileSystemSet.DEFAULT.pathFromGsUri(this)
                                                        ^
                 79:     val pathStringWithBucketName: String get() = this.uri.toString().removePrefix("gs://")
                                                     ^
                 79:     val pathStringWithBucketName: String get() = this.uri.toString().removePrefix("gs://")
                                                                    ^
                 84:     val bucket: String get() = this.uri.authority
                                   ^
                 84:     val bucket: String get() = this.uri.authority
                                                  ^
                 90:     val bucketRelativePath: String get() = this.uri.path.removePrefix("/")
                                               ^
                 90:     val bucketRelativePath: String get() = this.uri.path.removePrefix("/")
                                                              ^
                 95:     override fun toString(): String = this.uri.toString()
                                      ^
                 103:     fun child(relativePath: String): CloudStorageUri =
                                                ^
                 103:     fun child(relativePath: String): CloudStorageUri =
                                                        ^
                 103:     fun child(relativePath: String): CloudStorageUri =
                                                                           ^
                 105: }
                      ^

Version

Development (host) and target OS/architectures:

Output of bazel --version:

$ bazel version
Build label: 6.3.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Aug 8 15:48:33 2023 (1691509713)
Build timestamp: 1691509713
Build timestamp as int: 1691509713

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

Language(s) and/or frameworks involved:
gazelle / Kotlin

How to reproduce

Reproduction: https://github.com/aspect-build/aspect-cli/pull/529

Any other information?

No response

@reddaly reddaly added the bug Something isn't working label Oct 9, 2023
@github-actions github-actions bot added the untriaged Requires traige label Oct 9, 2023
@reddaly reddaly changed the title [Bug]: [Bug]: Kotlin gazelle plugin outputs unexpected parse errors Oct 9, 2023
@reddaly
Copy link
Author

reddaly commented Oct 9, 2023

This specific parser error might be due to fwcd/tree-sitter-kotlin#102

@alexeagle
Copy link
Member

@jbedard I thought we had a fix for this one when we paired in Vancouver? Any idea where it went?

@jbedard
Copy link
Member

jbedard commented Oct 7, 2024

I think upgrading the kotlin tree-sitter grammar will fix this. @reddaly do you have any snippet of kotlin code that you know reproduces this parse error?

@jbedard jbedard closed this as completed Oct 7, 2024
@jbedard jbedard closed this as completed Oct 7, 2024
@github-project-automation github-project-automation bot moved this to ✅ Done in Open Source Oct 7, 2024
jbedard added a commit that referenced this issue Oct 23, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
jbedard added a commit that referenced this issue Oct 24, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
jbedard added a commit that referenced this issue Oct 24, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
jbedard added a commit that referenced this issue Oct 24, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
jbedard added a commit that referenced this issue Oct 24, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
jbedard added a commit that referenced this issue Oct 24, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
jbedard added a commit that referenced this issue Oct 24, 2024
Close #530

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 91c1f483e9b74b668ac7690d52e543bb039f09ac
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants