Common/LanguageFeature/DTO/
ProviderType.rs

1//! # ProviderType DTO
2//!
3//! Defines the enum that identifies each type of language feature provider.
4
5use std::fmt;
6
7use serde::{Deserialize, Serialize};
8
9/// An enum that provides a unique identifier for each type of language feature.
10/// This is used to register and query for specific provider implementations.
11#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
12#[repr(u8)]
13pub enum ProviderType {
14	Completion = 0,
15
16	Hover = 1,
17
18	SignatureHelp = 2,
19
20	Definition = 3,
21
22	TypeDefinition = 4,
23
24	Implementation = 5,
25
26	References = 6,
27
28	DocumentHighlight = 7,
29
30	DocumentSymbol = 8,
31
32	WorkSpaceSymbol = 9,
33
34	CodeAction = 10,
35
36	CodeLens = 11,
37
38	DocumentFormatting = 12,
39
40	DocumentRangeFormatting = 13,
41
42	OnTypeFormatting = 14,
43
44	Rename = 15,
45
46	DocumentLink = 16,
47
48	Color = 17,
49
50	FoldingRange = 18,
51
52	Declaration = 19,
53
54	SelectionRange = 20,
55
56	InlayHint = 21,
57
58	CallHierarchy = 22,
59
60	SemanticTokens = 23,
61
62	LinkedEditingRange = 24,
63
64	TypeHierarchy = 25,
65}
66
67impl fmt::Display for ProviderType {
68	fn fmt(&self, f:&mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self) }
69}