Remove claim, untrue since over 5 years ago, that cursorOffset is incompatible with rangeStart/rangeEnd (#15750)

This commit is contained in:
Mark Amery authored and GitHub committed 2023-12-08 16:35:02 +02:00
1 parent 39e4e7bf40
commit 1e30f66f39
15 files changed
+18 -51

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ await prettier.format("foo ( );", { semi: false, parser: "babel" });
`formatWithCursor` both formats the code, and translates a cursor position from unformatted code to formatted code. This is useful for editor integrations, to prevent the cursor from moving when code is formatted.
The `cursorOffset` option should be provided, to specify where the cursor is. This option cannot be used with `rangeStart` and `rangeEnd`.
The `cursorOffset` option should be provided, to specify where the cursor is.
```js
await prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });