You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e2ff09c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: rust/contracts/rust-core-api.md
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -467,6 +467,8 @@ or removing a command fails until the table changes in the same commit.
467
467
468
468
| Command | Purpose |
469
469
| --- | --- |
470
+
| `application.fileAssociations.catalog` | Project the built-in highlighted text suffixes into native package formats |
471
+
| `application.fileAssociations.plan` | Validate an explicit selection against current native association revisions |
470
472
| `core.ping` | Verify the ABI and protocol version |
471
473
| `ideHost.control` | Control the native IDE capability broker |
472
474
| `ai.commitInputBudget` | Budget diff prefixes before crossing the native boundary |
@@ -612,6 +614,10 @@ or removing a command fails until the table changes in the same commit.
612
614
| `workspace.rankNames` | Pure ranking of candidate names that the platform enumerates itself (`{ query, candidates: [{ name, path? }], context: { openPaths, recentPaths }, limitPerTier? }`). Use it only for lists Core cannot index: Windows remote/WSL roots, symbol lists, navigator lists. Roots Core indexes go through `workspace.searchEverywhere`, so an inventory is never sent back to Core. Returns `matches: [{ index, degree, tier, nameMatchRanges }]` ordered by degree, open/recent tier, recency, then file-name order (fixture `rust/fixtures/search/rank-names-v1.json`) |
613
615
| `workspace.planDuplicate` | Name the copy of one project item next to its source (`foo.txt` → `foo copy.txt`, then `foo copy 2.txt`) from the sibling names the host has seen to exist |
614
616
| `workspace.planPaste` | Name pasted project items in one destination directory: a free name is kept, a taken one gets the copy suffix, and earlier items of the same paste count as taken |
617
+
| `workspace.createEntry` | Create one file, directory or symbolic link below a workspace root without replacing anything |
618
+
| `workspace.renameEntry` | Rename one entry to a new path of the same root without replacing anything; a link is renamed as a link |
619
+
| `workspace.copyEntry` | Copy one entry, a directory with everything in it, to a new path of the same root without replacing anything; links stay links |
620
+
| `workspace.resolveEntry` | Name one existing entry below a workspace root without following it |
615
621
| `workspace.reduceDirectoryAction` | Apply "set role", "exclude" or "cancel exclusion" to a root's persisted directory rules and return the complete state to persist |
616
622
| `workspace.relocateDirectoryRules` | Move (or drop, after a delete) the directory rule keys of a renamed, moved or deleted subtree, optionally into another workspace root's rules |
617
623
| `workspace.repositories` | Discover deterministic Git repository roots for an opened workspace |
@@ -7440,6 +7446,38 @@ to exist, creates the copy without replacing anything (`FileManager.copyItem`, w
7440
7446
appeared meanwhile, adds the name to `existing` and plans again. After 512 rounds the host reports
7441
7447
the stable `destination_exists` error. Cases are in `rust/fixtures/workspace/file-copy-names-v1.json`.
7442
7448
7449
+
`workspace.createEntry`, `workspace.renameEntry`, `workspace.copyEntry` and `workspace.resolveEntry`
7450
+
change and name entries below a local workspace root on a plugin's behalf (plan API-11). Each takes
7451
+
`root`, the absolute path of the root as the host spells it, and `path`, the entry below it.
7452
+
`createEntry` takes `{ root, path, kind, text?, linkTarget? }`: `kind` is `file`, `directory` or
7453
+
`symlink`; a file takes optional UTF-8 `text`, and a link takes the `linkTarget` it stores verbatim,
7454
+
absolute or relative to the link's directory, which may leave the root or name nothing. On Windows each
7455
+
`/` of `linkTarget` is stored as `\`, and the link is a directory link when the target is an existing
7456
+
directory at creation, otherwise a file link. `renameEntry` and `copyEntry` take
7457
+
`{ root, path, target }`, `target` being the full new path in the same root; `resolveEntry` takes
7458
+
`{ root, path }`. Every command returns `{ path, fullPath, kind }`: `fullPath` is spelled from the
7459
+
`root` the host sent, as its open documents name the entry, and `kind` is `file`, `directory`,
7460
+
`symlink` or `other`.
7461
+
7462
+
A path is `/`-separated with no empty, `.` or `..` component, and on Windows every component must be
7463
+
one Windows stores as written (no reserved name such as `CON`, no trailing dot or space, none of
7464
+
`\ : * ? " < > |`); the root itself is not an entry. The directory holding the entry must exist and
7465
+
resolve inside the root, so no entry is created or moved through a link that leaves it; the last
7466
+
component is never followed, so a link is renamed, copied or resolved as a link, and a copied
7467
+
directory keeps its links as links. Nothing is replaced: macOS and Linux rename with one exclusive
7468
+
system call (`renamex_np` with `RENAME_EXCL`, `renameat2` with `RENAME_NOREPLACE`) and fall back to a
7469
+
check before the rename on volumes that refuse it; Windows renames with `MoveFileExW` without
7470
+
`MOVEFILE_REPLACE_EXISTING`. A rename that only changes the case of a name on a file system that
7471
+
ignores case is not a collision, and a target naming the source itself is. A directory is never moved
7472
+
or copied into itself. A copy that fails part way removes what it created.
7473
+
7474
+
Errors are `invalid_request` (a malformed path or root, fields that do not match the `kind`, a
7475
+
directory moved into itself), `permission_denied` (a parent that resolves outside the root),
7476
+
`workspace_not_found` (no root), `entry_not_found` (no entry, or no parent directory), `entry_exists`
7477
+
(the target exists), and `unknown` with the system's message in `details` for anything else, such as
7478
+
Windows refusing to create a link without Developer Mode or elevation. Saving and moving the open
7479
+
documents under an entry, the system trash and refreshing the project tree stay with the host.
0 commit comments