smacker / go-tree-sitter

Golang bindings for tree-sitter https://github.com/tree-sitter/tree-sitter
MIT License
447 stars 124 forks source link

fix: deprecation warning from README #144

Closed tobb10001 closed 10 months ago

tobb10001 commented 10 months ago

When copying the example code from the README, gopls issues a deprecation warning, because parser.Parse is deprecated.

gopls-screenshot

This PR updates the README to use parser.ParseCtx instead, as it is suggested by the deprecation warning. It uses context.Background(), as it is used in parser.Parse() as well to make sure that the behaviour stays identical.

smacker commented 10 months ago

thanks!