pub enum Language {
Show 13 variants
Rust,
Python,
Json,
Yaml,
Toml,
XmlSdf,
Cpp,
JavaScript,
TypeScript,
Markdown,
Shell,
Html,
PlainText,
}Expand description
Supported language syntaxes for the Monaco-class code editor.
Variants§
Implementations§
Source§impl Language
impl Language
Sourcepub const ALL_LANGUAGES: &'static [Language]
pub const ALL_LANGUAGES: &'static [Language]
Returns all 10 primary code/config languages supported by strata-editor.
Sourcepub fn from_extension(ext: &str) -> Self
pub fn from_extension(ext: &str) -> Self
Infers the Language from a file extension or Markdown fence info string
(case-insensitive, with or without leading dot).
Sourcepub fn from_filename(path: &str) -> Self
pub fn from_filename(path: &str) -> Self
Infers the Language from a filename or path.
Sourcepub const fn display_name(self) -> &'static str
pub const fn display_name(self) -> &'static str
Human-readable display label for status bars and language pickers.
Sourcepub const fn line_comment_prefix(self) -> Option<&'static str>
pub const fn line_comment_prefix(self) -> Option<&'static str>
Default single-line comment prefix for Ctrl+/ toggle-comment actions.
Sourcepub const fn has_builtin_tree_sitter(self) -> bool
pub const fn has_builtin_tree_sitter(self) -> bool
Whether this language uses a native Tree-Sitter grammar by default.
Trait Implementations§
impl Copy for Language
Source§impl<'de> Deserialize<'de> for Language
impl<'de> Deserialize<'de> for Language
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Forget for Language
impl Freeze for Language
impl Move for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnsafeUnpin for Language
impl UnwindSafe for Language
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.