Skip to content

Wrong syntax highlighting with chained indexing in Go #48357

@sp301415

Description

@sp301415

Reproduction steps

The following code is the minimum reproducible example:

package main

func main() {
	var x [][]uint64
	var a, b int
	x[a][b] = 0
}

Current vs. Expected behavior

Image

Highlighting of the line x[a][b] = 0 is wrong.

This is exactly the same problem as #30521, in which the cause was identified as a bug in tree-sitter-go: tree-sitter/tree-sitter-go#160. Now that the upstream issue is fixed, hopefully bumping the version of tree-sitter-go is enough to solve this bug.

Zed version and system specs

Zed: v0.221.5+stable.141.03bfbf242c57f7fdb45708d63d74182898edf2c5 (Zed)
OS: Windows 10.0.26200
Memory: 31.8 GiB
Architecture: x86_64
GPU: NVIDIA GeForce RTX 3060 Ti || NVIDIA Corporation || 591.86 r590_00

Attach Zed log file

Zed.log

Relevant Zed settings

settings.json

Relevant Keymap

keymap.json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    .contrib/good first issueIssue suitable for first-time contributorsarea:languages/goGo programming language supportarea:tree-sitterSyntax highlighting and tree-sitterfrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsstate:needs reproNeeds reproduction steps / someone to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions