Skip to main content

perl_lsp_feature_ids/
lib.rs

1//! Canonical feature identifiers shared across feature-flagging and BDD-grid layers.
2//!
3//! The constants in this crate are stable across feature-profiles and provide a
4//! single source-of-truth to reduce identifier drift between CLI feature toggles,
5//! runtime feature projection, and reporting surfaces.
6
7/// Completion feature identifier.
8pub const LSP_COMPLETION: &str = "lsp.completion";
9/// Hover feature identifier.
10pub const LSP_HOVER: &str = "lsp.hover";
11/// Signature help feature identifier.
12pub const LSP_SIGNATURE_HELP: &str = "lsp.signature_help";
13/// Definition feature identifier.
14pub const LSP_DEFINITION: &str = "lsp.definition";
15/// Declaration feature identifier.
16pub const LSP_DECLARATION: &str = "lsp.declaration";
17/// Execute command feature identifier.
18pub const LSP_EXECUTE_COMMAND: &str = "lsp.execute_command";
19/// Type definition feature identifier.
20pub const LSP_TYPE_DEFINITION: &str = "lsp.type_definition";
21/// Implementation feature identifier.
22pub const LSP_IMPLEMENTATION: &str = "lsp.implementation";
23/// Reference search feature identifier.
24pub const LSP_REFERENCES: &str = "lsp.references";
25/// Document symbol feature identifier.
26pub const LSP_DOCUMENT_SYMBOL: &str = "lsp.document_symbol";
27/// Workspace symbol feature identifier.
28pub const LSP_WORKSPACE_SYMBOL: &str = "lsp.workspace_symbol";
29/// Code action feature identifier.
30pub const LSP_CODE_ACTION: &str = "lsp.code_action";
31/// Code lens feature identifier.
32pub const LSP_CODE_LENS: &str = "lsp.code_lens";
33/// Formatting feature identifier.
34pub const LSP_FORMATTING: &str = "lsp.formatting";
35/// Range formatting feature identifier.
36pub const LSP_RANGE_FORMATTING: &str = "lsp.range_formatting";
37/// Formatting ranges feature identifier.
38pub const LSP_RANGES_FORMATTING: &str = "lsp.ranges_formatting";
39/// On-type formatting feature identifier.
40pub const LSP_ON_TYPE_FORMATTING: &str = "lsp.on_type_formatting";
41/// Rename feature identifier.
42pub const LSP_RENAME: &str = "lsp.rename";
43/// Document link feature identifier.
44pub const LSP_DOCUMENT_LINK: &str = "lsp.document_link";
45/// Folding range feature identifier.
46pub const LSP_FOLDING_RANGE: &str = "lsp.folding_range";
47/// Selection range feature identifier.
48pub const LSP_SELECTION_RANGE: &str = "lsp.selection_range";
49/// Inlay hint feature identifier.
50pub const LSP_INLAY_HINT: &str = "lsp.inlay_hint";
51/// Semantic tokens feature identifier.
52pub const LSP_SEMANTIC_TOKENS: &str = "lsp.semantic_tokens";
53/// Type hierarchy feature identifier.
54pub const LSP_TYPE_HIERARCHY: &str = "lsp.type_hierarchy";
55/// Call hierarchy feature identifier.
56pub const LSP_CALL_HIERARCHY: &str = "lsp.call_hierarchy";
57/// Pull diagnostics feature identifier.
58pub const LSP_PULL_DIAGNOSTICS: &str = "lsp.pull_diagnostics";
59/// Inline completion feature identifier.
60pub const LSP_INLINE_COMPLETION: &str = "lsp.inline_completion";
61/// Inline value feature identifier.
62pub const LSP_INLINE_VALUE: &str = "lsp.inline_value";
63/// Document color feature identifier.
64pub const LSP_DOCUMENT_COLOR: &str = "lsp.document_color";
65/// Legacy alias retained for compatibility with older clients/tools.
66pub const LSP_COLOR: &str = "lsp.color";
67/// Linked editing feature identifier.
68pub const LSP_LINKED_EDITING_RANGE: &str = "lsp.linked_editing_range";
69/// Moniker feature identifier.
70pub const LSP_MONIKER: &str = "lsp.moniker";
71/// Inline values/inspection feature identifier.
72pub const LSP_INLINE_VALUES: &str = "lsp.inline_values";
73/// Notebook document sync feature identifier.
74pub const LSP_NOTEBOOK_DOCUMENT_SYNC: &str = "lsp.notebook_document_sync";
75/// Notebook cell execution feature identifier.
76pub const LSP_NOTEBOOK_CELL_EXECUTION: &str = "lsp.notebook_cell_execution";
77/// Progress feature identifier.
78pub const LSP_PROGRESS: &str = "lsp.progress";
79/// Show message request feature identifier.
80pub const LSP_SHOW_MESSAGE: &str = "lsp.show_message";
81/// Log message feature identifier.
82pub const LSP_LOG_MESSAGE: &str = "lsp.log_message";
83/// Work done progress feature identifier.
84pub const LSP_WORK_DONE_PROGRESS: &str = "lsp.work_done_progress";
85/// Text document sync feature identifier.
86pub const LSP_TEXT_DOCUMENT_SYNC: &str = "lsp.text_document_sync";
87/// Text document did save feature identifier.
88pub const LSP_DID_SAVE: &str = "lsp.did_save";
89/// Text document will save feature identifier.
90pub const LSP_WILL_SAVE: &str = "lsp.will_save";
91/// willSaveWaitUntil feature identifier.
92pub const LSP_WILL_SAVE_WAIT_UNTIL: &str = "lsp.will_save_wait_until";
93/// Document highlight feature identifier.
94pub const LSP_DOCUMENT_HIGHLIGHT: &str = "lsp.document_highlight";
95/// Prepare rename feature identifier.
96pub const LSP_PREPARE_RENAME: &str = "lsp.prepare_rename";
97/// Color presentation feature identifier.
98pub const LSP_COLOR_PRESENTATION: &str = "lsp.color_presentation";
99/// Completion item resolve feature identifier.
100pub const LSP_COMPLETION_ITEM_RESOLVE: &str = "lsp.completion_item_resolve";
101/// Code action resolve feature identifier.
102pub const LSP_CODE_ACTION_RESOLVE: &str = "lsp.code_action_resolve";
103/// Code lens resolve feature identifier.
104pub const LSP_CODE_LENS_RESOLVE: &str = "lsp.code_lens_resolve";
105/// Document link resolve feature identifier.
106pub const LSP_DOCUMENT_LINK_RESOLVE: &str = "lsp.document_link_resolve";
107/// Inlay hint resolve feature identifier.
108pub const LSP_INLAY_HINT_RESOLVE: &str = "lsp.inlay_hint_resolve";
109/// Workspace symbol resolve feature identifier.
110pub const LSP_WORKSPACE_SYMBOL_RESOLVE: &str = "lsp.workspace_symbol_resolve";
111/// Code lens refresh feature identifier.
112pub const LSP_CODE_LENS_REFRESH: &str = "lsp.code_lens_refresh";
113/// Semantic tokens refresh feature identifier.
114pub const LSP_SEMANTIC_TOKENS_REFRESH: &str = "lsp.semantic_tokens_refresh";
115/// Inlay hint refresh feature identifier.
116pub const LSP_INLAY_HINT_REFRESH: &str = "lsp.inlay_hint_refresh";
117/// Inline value refresh feature identifier.
118pub const LSP_INLINE_VALUE_REFRESH: &str = "lsp.inline_value_refresh";
119/// Diagnostic refresh feature identifier.
120pub const LSP_DIAGNOSTIC_REFRESH: &str = "lsp.diagnostic_refresh";
121/// Folding range refresh feature identifier.
122pub const LSP_FOLDING_RANGE_REFRESH: &str = "lsp.folding_range_refresh";
123
124/// DAP core feature identifier.
125pub const DAP_CORE: &str = "dap.core";
126/// DAP inline values feature identifier.
127pub const DAP_INLINE_VALUES: &str = "dap.inline_values";
128/// DAP breakpoint support feature identifier.
129pub const DAP_BREAKPOINTS_BASIC: &str = "dap.breakpoints.basic";
130
131#[cfg(test)]
132mod tests {
133    use super::*;
134
135    #[test]
136    fn canonical_document_color_is_authoritative_id() {
137        assert_ne!(LSP_DOCUMENT_COLOR, LSP_COLOR);
138        assert_eq!(LSP_DOCUMENT_COLOR, "lsp.document_color");
139        assert_eq!(LSP_COLOR, "lsp.color");
140        assert_eq!(LSP_EXECUTE_COMMAND, "lsp.execute_command");
141    }
142
143    #[test]
144    fn feature_id_smoke_list_is_stable() {
145        assert_eq!(LSP_COMPLETION, "lsp.completion");
146        assert_eq!(LSP_FORMATTING, "lsp.formatting");
147        assert_eq!(LSP_INLINE_COMPLETION, "lsp.inline_completion");
148        assert_eq!(DAP_CORE, "dap.core");
149    }
150}