Move hint settings on the language level
This commit is contained in:
parent
480d8c511b
commit
667b70afde
7 changed files with 196 additions and 145 deletions
|
@ -31,7 +31,7 @@ use gpui::{
|
|||
};
|
||||
use itertools::Itertools;
|
||||
use language::{
|
||||
language_settings::{language_settings, FormatOnSave, Formatter},
|
||||
language_settings::{language_settings, FormatOnSave, Formatter, InlayHintKind},
|
||||
point_to_lsp,
|
||||
proto::{
|
||||
deserialize_anchor, deserialize_fingerprint, deserialize_line_ending, deserialize_version,
|
||||
|
@ -339,29 +339,6 @@ pub struct InlayHint {
|
|||
pub tooltip: Option<InlayHintTooltip>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum InlayHintKind {
|
||||
Type,
|
||||
Parameter,
|
||||
}
|
||||
|
||||
impl InlayHintKind {
|
||||
pub fn from_name(name: &str) -> Option<Self> {
|
||||
match name {
|
||||
"type" => Some(InlayHintKind::Type),
|
||||
"parameter" => Some(InlayHintKind::Parameter),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &'static str {
|
||||
match self {
|
||||
InlayHintKind::Type => "type",
|
||||
InlayHintKind::Parameter => "parameter",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl InlayHint {
|
||||
pub fn text(&self) -> String {
|
||||
match &self.label {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue