Skip to content

Commit c114d1a

Browse files
add /TextBuffer to disambiguate links to other package
1 parent 16acf28 commit c114d1a

File tree

17 files changed

+31
-40
lines changed

17 files changed

+31
-40
lines changed

Sources/DeclarativeTextKit/Documentation.docc/Documentation.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,9 @@ If the affected text buffer supports undo/redo (like the default text views do),
4848

4949
### Buffers
5050

51-
A `Buffer` is an abstraction of textual content and a selection. Its ``Buffer/evaluate(_:)-7jmtt`` is the simplest entry point to the DSL.
51+
While a ``/TextBuffer/Buffer`` is an abstraction of textual content and a selection, a `ModifiableBuffer` offers declarative modifications. Its ``ModifiableBuffer/evaluate(_:)-44ndq`` is the simplest entry point to the DSL.
5252

53-
- ``Buffer``
54-
- ``InMemoryBuffer``
55-
- ``MutableStringBuffer``
56-
- ``Undoable``
57-
58-
### Platform-Specific Buffer Adapters
59-
60-
Text Kit's text views behave as buffers, but offer a much wider surface API to perform layout and typesetting. Opposed to these, a `Buffer` is a lightweight API to perform changes like a user would in an interactive text view, which we expose as adapters.
61-
62-
- ``NSTextViewBuffer``
53+
- ``ModifiableBuffer``
6354

6455
### Buffer Mutations in the Domain-Specific Language
6556

Sources/DeclarativeTextKit/Documentation.docc/Runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ try buffer.evaluate {
1616
}
1717
```
1818

19-
1. ``Buffer/evaluate(_:)-7jmtt`` is called
19+
1. ``/TextBuffer/Buffer/evaluate(_:)-7jmtt`` is called
2020
2. the ``ModificationBuilder``-annotated block is executed:
2121
1. ``Identity/init()`` is called to create the value,
2222
2. ``ModificationBuilder/buildPartialBlock(first:)-6xgr4`` is called with the ``Identity`` value as a parameter -- that's the overload that takes a `some ModificationSequence.Element`.

Sources/DeclarativeTextKit/Expression/If.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import TextBuffer
66
///
77
/// ## Motivation for an ``If`` type in spite of Swift Result Builder's capabilities
88
///
9-
/// If you think of ``Buffer/evaluate(_:)-7jmtt`` as the "run time", Swift Result Builder's `buildOptional` and `buildEither` check their condition at "compile time". That means you cannot form conditions on ``AffectedRange``.
9+
/// If you think of ``/TextBuffer/Buffer/evaluate(_:)-7jmtt`` as the "run time", Swift Result Builder's `buildOptional` and `buildEither` check their condition at "compile time". That means you cannot form conditions on ``AffectedRange``.
1010
///
1111
/// This is a confusing limitation, and brings with it potentially dangerous (as in: crashing) situations.
1212
///

Sources/DeclarativeTextKit/Expression/IfLet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import TextBuffer
88
///
99
/// ## Motivation for an ``IfLet`` type in spite of Swift Result Builder's capabilities
1010
///
11-
/// If you think of ``Buffer/evaluate(_:)-7jmtt`` as the "run time", Swift Result Builder's `buildOptional` and `buildEither` check their condition at "compile time". That means you cannot form conditions on ``AffectedRange``.
11+
/// If you think of ``/TextBuffer/Buffer/evaluate(_:)-7jmtt`` as the "run time", Swift Result Builder's `buildOptional` and `buildEither` check their condition at "compile time". That means you cannot form conditions on ``AffectedRange``.
1212
///
1313
/// This is a confusing limitation, and brings with it potentially dangerous (as in: crashing) situations.
1414
///

Sources/DeclarativeTextKit/Expression/Modification/Insert/Insert.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import TextBuffer
44

5-
/// Represents insertion of text into a ``Buffer``.
5+
/// Represents insertion of text into a ``/TextBuffer/Buffer``.
66
///
77
/// ## Inserting in Multiple Locations at Once
88
///

Sources/DeclarativeTextKit/Expression/Modification/Insert/Insertable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import TextBuffer
44

5-
/// Inserts itself into a ``Buffer`` at time of evaluation.
5+
/// Inserts itself into a ``/TextBuffer/Buffer`` at time of evaluation.
66
public protocol Insertable {
77
func insert(
88
in buffer: Buffer,

Sources/DeclarativeTextKit/Expression/Modification/Insert/Line.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct Line: Insertable {
1111

1212
public let content: Buffer.Content
1313

14-
/// Whether to insert a newline at the end of a ``Buffer``.
14+
/// Whether to insert a newline at the end of a ``/TextBuffer/Buffer``.
1515
///
1616
/// For whole text documents, this will ensure that the document's last character is a newline.
1717
public let insertFinalNewline: Bool = true
@@ -59,7 +59,7 @@ public struct Line: Insertable {
5959
extension Line {
6060
/// Ensures its ``content`` is prepended by newline characters (left).
6161
///
62-
/// At the ``Buffer``'s zero location or start position, does not prepend a newline.
62+
/// At the ``/TextBuffer/Buffer``'s zero location or start position, does not prepend a newline.
6363
public struct StartsWithNewlineIfNeeded: Insertable {
6464
public let content: Buffer.Content
6565

@@ -92,11 +92,11 @@ extension Line {
9292

9393
/// Ensures its ``content`` is appended by a newline characters (right).
9494
///
95-
/// At the ``Buffer``'s end position, appends a newline if ``insertFinalNewline`` is `true` so that documents end with a line break.
95+
/// At the ``/TextBuffer/Buffer``'s end position, appends a newline if ``insertFinalNewline`` is `true` so that documents end with a line break.
9696
public struct EndsWithNewlineIfNeeded: Insertable {
9797
public let content: Buffer.Content
9898

99-
/// Whether to insert a newline at the end of a ``Buffer``.
99+
/// Whether to insert a newline at the end of a ``/TextBuffer/Buffer``.
100100
///
101101
/// For whole text documents, this will ensure that the document's last character is a newline.
102102
public let insertFinalNewline: Bool = true

Sources/DeclarativeTextKit/Expression/Modification/Insert/Word.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import TextBuffer
44

55
/// Ensures its ``content`` is enclosed by space characters left and right upon insertion, otherwise inserting a ``Word/space`` character as separator where needed.
66
///
7-
/// Does not insert a space at the ``Buffer``'s zero location (or start position), nor at its end.
7+
/// Does not insert a space at the ``/TextBuffer/Buffer``'s zero location (or start position), nor at its end.
88
public struct Word: Insertable {
99
/// Space character inserted around ``content`` as needed.
1010
public static let space: Buffer.Content = " "
@@ -54,7 +54,7 @@ extension Word {
5454

5555
/// Ensures its ``content`` is preceded by any whitespace characters (to the left), otherwise inserting a ``Word/space`` character.
5656
///
57-
/// At the ``Buffer``'s zero location or start position, does not prepend a space.
57+
/// At the ``/TextBuffer/Buffer``'s zero location or start position, does not prepend a space.
5858
public struct StartsWithSpaceIfNeeded: Insertable {
5959
public let content: Buffer.Content
6060

@@ -87,7 +87,7 @@ extension Word {
8787

8888
/// Ensures its ``content`` is followed by any whitespace characters (to the right), otherwise inserting a ``Word/space`` character. ///
8989
///
90-
/// At the ``Buffer``'s end position, does not append a space.
90+
/// At the ``/TextBuffer/Buffer``'s end position, does not append a space.
9191
public struct EndsWithSpaceIfNeeded: Insertable {
9292
public let content: Buffer.Content
9393

Sources/DeclarativeTextKit/Expression/Modification/Modifying.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import TextBuffer
44

5-
/// Marks a ``Buffer/Range`` as to-be-modified in a range. Depending on the buffer a modification group is applied to, supports grouping of actions like undo, automatic text layout, and ensures that the underlying buffer is editable.
5+
/// Marks a ``/TextBuffer/Buffer/Range`` as to-be-modified in a range. Depending on the buffer a modification group is applied to, supports grouping of actions like undo, automatic text layout, and ensures that the underlying buffer is editable.
66
///
7-
/// - For undo support, see ``Undoable``.
8-
/// - For AppKit-compatible `NSTextViewDelegate` calls (that can prevent changes within the range), see ``NSTextViewBuffer``.
7+
/// - For undo support, see ``/TextBuffer/Undoable``.
8+
/// - For AppKit-compatible `NSTextViewDelegate` calls (that can prevent changes within the range), see ``/TextBuffer/NSTextViewBuffer``.
99
///
1010
/// You use ``Modifying`` to combine and group either
1111
/// - multiple ``Modification``s like ``Insert`` and ``Delete`` at multiple locations into one block,

Sources/DeclarativeTextKit/Expression/Modification/ScopedBufferSlice.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import TextBuffer
44

5-
/// View into a ``Buffer`` that ensures all read and write operations work on the scoped subrange.
5+
/// View into a ``/TextBuffer/Buffer`` that ensures all read and write operations work on the scoped subrange.
66
///
77
/// > Note: Range finders like ``lineRange(for:)`` and ``wordRange(for:)`` are limiting the input to the scoped subrange as well, but the result may exceed the scoped range and extend to content from the base buffer. This ensures that ``Select`` as a terminal command with a scope of ``LineRange`` or ``WordRange`` work as expected.
88
@usableFromInline
@@ -27,7 +27,7 @@ where Base: Buffer {
2727

2828
private(set) var scopedRange: Base.Range
2929

30-
/// - Throws: ``BufferAccessFailure`` if `scopedRange` is outside of `base.range`
30+
/// - Throws: ``/TextBuffer/BufferAccessFailure`` if `scopedRange` is outside of `base.range`
3131
@usableFromInline
3232
init(
3333
base: Base,
@@ -153,7 +153,7 @@ where Base: Buffer {
153153
return try base.modifying(affectedRange: scopedRange, block)
154154
}
155155

156-
// Specialized overload required to avoid stack overflow from infinitely calling ``Buffer``'s implementation from its protocol extension.
156+
// Specialized overload required to avoid stack overflow from infinitely calling ``/TextBuffer/Buffer``'s implementation from its protocol extension.
157157
@discardableResult
158158
@usableFromInline
159159
func evaluate(

0 commit comments

Comments
 (0)