tree-sitter / tree-sitter-go

Go grammar for tree-sitter
MIT License
310 stars 65 forks source link

Highlighting multidimensional arrays and slices #148

Closed farid-cs closed 1 month ago

farid-cs commented 1 month 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 1 month ago

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