// fromProtocolLocation converts from a protocol location to a source range.
// It will return an error if the file of the location was not valid.
// It uses fromProtocolRange to convert the start and end positions.
fromProtocolLocation converts from a protocol location to a source range.
It will return an error if the file of the location was not valid.
It uses fromProtocolRange to convert the start and end positions.
// fromProtocolLocation converts from a protocol location to a source range . // It will return an error if the file of the location was not valid . // It uses fromProtocolRange to convert the start and end positions .
func fromProtocolLocation(ctx context.Context, v *cache.View, loc protocol.Location) (source.Range, error) {
	f, err := v.GetFile(ctx, fromProtocolURI(loc.URI))
	if err != nil {
		return source.Range{}, err
	}
	tok, err := f.GetToken()
	if err != nil {
		return source.Range{}, err
	}
	return fromProtocolRange(tok, loc.Range), nil
}
func fromProtocolLocation ( ctx context . Context , v * cache . View , loc protocol . Location ) ( source . Range , error ) { f , err := v . GetFile ( ctx , fromProtocolURI ( loc . URI ) ) if err != nil { return source . Range { } , err } tok , err := f . GetToken ( ) if err != nil { return source . Range { } , err } return fromProtocolRange ( tok , loc . Range ) , nil }
fromProtocolLocation converts from a protocol location to a source range.
fromProtocolLocation converts from a protocol location to a source range .