<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextView/rangeForUserCompletion",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextView(py)rangeForUserCompletion"
  },
  "title" : "rangeForUserCompletion"
}
-->

# rangeForUserCompletion

The partial range from the most recent beginning of a word up to the insertion point.

```
var rangeForUserCompletion: NSRange { get }
```

## Discussion

This value is intended to be used for the range argument in the text completion methods such as [`completions(forPartialWordRange:indexOfSelectedItem:)`](/documentation/AppKit/NSTextView/completions(forPartialWordRange:indexOfSelectedItem:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)