z_mirror/luapls
git clone https://git.raiguard.me/z_mirror/luapls
582fe74
main
1package lsp 2 3import ( 4"errors" 5 6"github.com/tliron/glsp" 7 protocol"github.com/tliron/glsp/protocol_3_16" 8) 9 10func (s * Server )textDocumentDefinition (ctx * glsp.Context ,params * protocol.DefinitionParams ) (any ,error ) { 11file := s .getFile (params .TextDocument .URI ) 12if file == nil { 13return nil ,nil 14 } 15if file .Block == nil { 16return nil ,errors .New ("Attempted to goto definition on a file with no AST" ) 17 } 18 19// TODO: 20// pos := file.LineBreaks.ToPos(params.Position) 21// nodePath := ast.GetNode(file.AST, pos) 22// def := file.Env.FindDefinition(nodePath) 23// if def == nil { 24// return nil, nil 25// } 26// return &protocol.Location{ 27// URI: params.TextDocument.URI, 28// Range: file.File.ToProtocolRange(ast.Range(def)), 29// }, nil 30return nil ,nil 31}