дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 17:47:08 +02:00
Plugin API 1.21 adds the optional rename-provider export (wit/rename.wit, world plugin-rename). A plugin declaring the rename provider kind answers prepare-rename where the language server has no target, and its rename edits are merged into the server's workspace edit (overlapping edits dropped) or form the whole rename when no server handles the file. Edit paths must resolve inside the project's writable roots; calls use the command budget and honour cancellation. Includes the SDK trait and registration, a fixture plugin with a host integration test, rebuilt plugin components, and a README section describing the host policy. Co-authored-by: RuyimgByCN <[email protected]>
34 рядки
1.2 KiB
Plaintext
34 рядки
1.2 KiB
Plaintext
package openidea:[email protected];
|
|
|
|
/// Optional export (world `plugin-rename`, API 1.21): prepare-rename and
|
|
/// cross-file workspace rename edits alongside native language servers.
|
|
interface rename-provider {
|
|
use types.{error, position, range};
|
|
use providers.{document, file-edit};
|
|
|
|
/// Editable target range and optional prefilled text for inline/dialog rename.
|
|
record prepare-rename-result {
|
|
range: range,
|
|
placeholder: option<string>,
|
|
}
|
|
|
|
/// Checks whether `at` names a symbol this plugin can rename, under the
|
|
/// editing-path budget. Returning `none` lets other providers or LSP answer.
|
|
prepare-rename: func(doc: document, at: position) -> option<prepare-rename-result>;
|
|
|
|
/// Computes cross-file edits to rename the symbol at `at` to `new-name`
|
|
/// (command budget; runs alongside any native language server).
|
|
rename: func(doc: document, at: position, new-name: string) -> result<list<file-edit>, error>;
|
|
}
|
|
|
|
/// The optional export-only world the SDK merges with `plugin`.
|
|
world rename-exports {
|
|
export rename-provider;
|
|
}
|
|
|
|
/// The host-side world used to instantiate a component that exports it.
|
|
world plugin-rename {
|
|
include plugin;
|
|
export rename-provider;
|
|
}
|