lazyvim/lua
David Desmarais-Michaud b830a523b5
fix(go): use semanticTokens if setup in gopls config init_options (#7172)
## Description

Since upgrading to the go lsp (gopls) to version 0.22.0 we receive the
following error on load of any Go file:

```
...nvim/lazy/LazyVim/lua/lazyvim/plugins/extras/lang/go.lua:64: attempt to index local 'semantic' (a nil value)
```

This PR adds a check to avoid this error.

If this causes degraded functionality, or a different fix around
semantic tokens is needed, I do not know.

## Screenshots

<img width="1423" height="219" alt="image"
src="https://github.com/user-attachments/assets/a4df1344-3e8f-4f29-9c8c-1257efed22b3"
/>

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2026-05-26 15:25:50 +02:00
..
lazyvim fix(go): use semanticTokens if setup in gopls config init_options (#7172) 2026-05-26 15:25:50 +02:00