дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
feat(plugins): brand document-indexer gutter markers with marker icons (#2196)
Indexed markers (Edges.markers) were always drawn with the navigation glyph, so a plugin couldn't tell its marker kinds apart. A [[contributes.markerIcons]] entry can now claim them by key prefix (`markers`), with an optional `tooltip` shown above the targets. The host matches the longest prefix and sends the declaration id with each marker; the editor resolves the icon and the translated tooltip from the projected declaration. Manifest only, under the existing API 1.3 gate of markerIcons. Closes #2194
Цей коміт міститься в:
1 джерело
e1be533bd2
коміт
e0982cc51d
15 files changed
+341
-31
No files matched your search
@@ -634,6 +634,23 @@ several cross-file targets, publish document-index mappings; the existing
|
||||
chooser lists every matching definition. Command clicks are deferred; use a
|
||||
code action on the same line.
|
||||
|
||||
Document-indexer markers (`Edges.markers`) use a declared icon when their key
|
||||
starts with one of its `markers` prefixes; the longest matching prefix wins,
|
||||
then declaration order. An optional `tooltip` (1–256 bytes, translated by the
|
||||
plugin's catalog) is shown above the marker's targets and needs `markers`:
|
||||
|
||||
```toml
|
||||
[[contributes.markerIcons]]
|
||||
id = "usages"
|
||||
icon = "icons/usages.svg"
|
||||
markers = ["usages#"] # up to 16 key prefixes of 1–256 bytes
|
||||
tooltip = "Usages of this class"
|
||||
```
|
||||
|
||||
Keys without a matching prefix keep the navigation glyph. Older IDEs that do
|
||||
not recognize `markers` or `tooltip` reject the manifest at install; update the
|
||||
IDE to use them.
|
||||
|
||||
Then `register_plugin!(MyPlugin, providers)` and implement
|
||||
`openidea_plugin::providers::Providers` for it: `completion`,
|
||||
`inline_completion`, `code_actions`, `definition`, `line_markers`. Each gets
|
||||
|
||||
Reference in new issue
Заблокувати користувача