// fromProtocolRange converts a protocol range to a source range.
// It uses fromProtocolPosition to convert the start and end positions, which
// requires the token file the positions belongs to.
fromProtocolRange converts a protocol range to a source range.
It uses fromProtocolPosition to convert the start and end positions, which
requires the token file the positions belongs to.
// fromProtocolRange converts a protocol range to a source range . // It uses fromProtocolPosition to convert the start and end positions which // requires the token file the positions belongs to .
func fromProtocolRange(f *token.File, r protocol.Range) source.Range {
	start := fromProtocolPosition(f, r.Start)
	var end token.Pos
	switch {
	case r.End == r.Start:
		end = start
	case r.End.Line < 0:
		end = token.NoPos
	default:
		end = fromProtocolPosition(f, r.End)
	}
	return source.Range{
		Start: start,
		End:   end,
	}
}
func fromProtocolRange ( f * token . File , r protocol . Range ) source . Range { start := fromProtocolPosition ( f , r . Start ) var end token . Pos switch { case r . End == r . Start : end = start case r . End . Line < 0 : end = token . NoPos default : end = fromProtocolPosition ( f , r . End ) } return source . Range { Start : start , End : end , } }
fromProtocolRange converts a protocol range to a source range.
fromProtocolRange converts a protocol range to a source range .