дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
feat(plugins): let a code action create, rename and delete files (#1778)
A new optional file-actions export (worlds plugin-file-actions / file-actions-provider, API 1.3) lists quick fixes whose operations (create with text, rename, delete) and text edits are applied as one workspace edit, so a failure changes nothing and one undo reverses it; paths stay inside the project root, and `open` shows a file once the action is applied. Like providers' code actions, an action can carry only `data` and get its operations from `resolve` when picked. Co-authored-by: arnaud-ritti <[email protected]>
Цей коміт міститься в:
1 джерело
1ab4edc0d7
коміт
25d930b780
58 files changed
+896
-52
No files matched your search
@@ -480,7 +480,16 @@ can be a `snippet` (`$1`, `${1:name}`, `$0`), match on `filter_text` instead
|
||||
of its label, and bring `additional_edits` elsewhere in the document (an
|
||||
import). A code action can leave `edits` empty and set `data`: its edits are
|
||||
then computed by `resolve_code_action` when the user picks it, under the
|
||||
command budget instead of the 50 ms. Problems (`publish_diagnostics`) can name
|
||||
command budget instead of the 50 ms. A quick fix that creates, renames or
|
||||
deletes files implements `file_actions::FileActions` too
|
||||
(`register_plugin!(T, providers, file_actions)`; the `code-actions` kind
|
||||
covers both): a `FileAction` carries `operations` (`FileOperation::Create {
|
||||
path, text, overwrite }`, `Rename`, `Delete`) and `edits`, applied as one
|
||||
workspace edit, so a failure changes nothing and one undo reverses it. A path
|
||||
outside the project root disables the action; `open` shows a file once the
|
||||
action is applied. Like a code action, it can leave `operations` and `edits`
|
||||
empty and set `data`: `resolve_file_action` computes them when the user picks
|
||||
it. File actions are new in API 1.3. Problems (`publish_diagnostics`) can name
|
||||
the tool that found them (`source`) and be `unnecessary` (faded) or
|
||||
`deprecated` (struck through).
|
||||
Editor providers run under the edit-path budget: 50 ms, after which the
|
||||
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
43d43f7a317c6fb8d5cca1b2a07f0e8dae05be6f5fcfc002527a409c519deb4f
|
||||
df2aad3aa261a7cc4059c92666d221d1599306d47049b7b97a7bba263c6f51e5
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
881d4ad1ac25784507c836c220fc09bdcdf45193f13538e928b8b3619b548552
|
||||
ef4128ec97e203c3dd0c49f3bcdbfaa5eb2be59123dc4628fc31d52dc61b3186
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
b029de3ddd2add1812b3071d407c59a97463a701b63c22232450b19a9f1d6557
|
||||
14dc3f5a5356ed82a84e7802c822545cba412d3e4a3b614aab6f4f7d3686584c
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
4952cbef6094c109c3ca9637c8df7d47836b85632c450164f8f70b6b5f22d4e5
|
||||
936d9fdad9752fa34a4a7ac18014c7bfc7cbd1b22f71b1501c667f4b83faad0b
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
34c03e490bea652f4e28fe2fb785dd9a2b0421f46c0015273793c14e074867f1
|
||||
7b559f3febbd3acd56f08d530209212ab2d7da1c794346e2beaf0f19d0a3227f
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
d18f6687bc32a7a06c32ee81dd6e0c88e3acefd29934c9fa7271179d94fed194
|
||||
b2e111085be32495ac82055e8258f8841a4a44979b4052ef102bb5726efc90e5
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
444dc979be1b8194631303c3ad6399b876ee9229d1a8554681406fd39164f604
|
||||
522aa68db4454f9c5511a90c74c6c26a8b95922e6725d9e411ddde7db998fa71
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
6f9412fce5e1a3d7453b0a1089d50544d49a3b1e8f022a5a1221ea597d2fd7dd
|
||||
2f23364367583f9101cea4fc8f4ff190038a8b04c0f3b07a0f145c917807c237
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
a861d2b792c06dbac0476fa0b99321296da52f792ff340b1fd25de3b0e6422de
|
||||
028e26a83c42ee3e01781e0006e857b1234c8dd655c1619de79aaee116998e9f
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
ccd7eab004cd2f767f6be21ce272f647e20695ceff8694293beff8ce8a06c646
|
||||
9a19f399c1aa5fbc4d80aa7d11c5b73d968d0664bbc12dea8488d5fcab846075
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
8ae2a72ec23163926bac3914f4b27a429598982cd12f42f985df10e920942fdb
|
||||
73b65742330387b7dbf498c6ec275ab41a55475243d771c1274de70b939c327f
|
||||
Reference in new issue
Заблокувати користувача