aspect-cli icon indicating copy to clipboard operation
aspect-cli copied to clipboard

[Bug]: Kotlin gazelle plugin outputs unexpected parse errors

Open reddaly opened this issue 2 years ago • 2 comments

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 avatar Oct 09 '23 05:10 reddaly

This specific parser error might be due to https://github.com/fwcd/tree-sitter-kotlin/issues/102

reddaly avatar Oct 09 '23 21:10 reddaly

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

alexeagle avatar Mar 27 '24 21:03 alexeagle