// toProtocolPosition converts from a token pos (byte offset) to a protocol
// position  (0-based line and column number)
// It requires the token file the pos belongs to in order to do this.
toProtocolPosition converts from a token pos (byte offset) to a protocol
position  (0-based line and column number)
It requires the token file the pos belongs to in order to do this.
// toProtocolPosition converts from a token pos ( byte offset ) to a protocol // position ( 0 - based line and column number ) // It requires the token file the pos belongs to in order to do this .
func toProtocolPosition(f *token.File, pos token.Pos) protocol.Position {
	if !pos.IsValid() {
		return protocol.Position{Line: -1.0, Character: -1.0}
	}
	p := f.Position(pos)
	return protocol.Position{
		Line:      float64(p.Line - 1),
		Character: float64(p.Column - 1),
	}
}
func toProtocolPosition ( f * token . File , pos token . Pos ) protocol . Position { if ! pos . IsValid ( ) { return protocol . Position { Line : - 1.0 , Character : - 1.0 } } p := f . Position ( pos ) return protocol . Position { Line : float64 ( p . Line - 1 ) , Character : float64 ( p . Column - 1 ) , } }
toProtocolPosition converts from a token pos (byte offset) to a protocol
position  (0-based line and column number)
It requires the token file the pos belongs to in order to do this.
toProtocolPosition converts from a token pos ( byte offset ) to a protocol position ( 0 - based line and column number ) It requires the token file the pos belongs to in order to do this .