There should be probably a >= relation between position and start. According to the specification, LSP range is start inclusive, end exclusive: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#range
public func contains(_ position: Position) -> Bool {
return position > start && position < end
}