tree-sitter / tree-sitter-go

Go grammar for tree-sitter
MIT License
317 stars 63 forks source link

Highlighting multidimensional arrays and slices #148

Closed farid-cs closed 2 months ago

farid-cs commented 2 months ago

This parser highlights multidimensional array and also variables in brackets as a type when is used with variables to get specific item in the array. Example code:

package main

func main() {
    var cells [3][2]int;
    var i = 90;
    var j = 20;

    cells[i][j] = 90;
}

The parser highlights variables cells, i and j as types on the line 8.

amaanq commented 2 months ago

this repo is for the parser, highlights are implementation dependent, unless using the cli with the queries here.