pub struct JsonLanguage {
pub trailing_comma: bool,
pub bare_keys: bool,
pub single_quotes: bool,
pub comments: bool,
pub hex_numbers: bool,
pub infinity_and_nan: bool,
}Expand description
The JSON language definition.
Fields§
§trailing_comma: boolWhether to allow trailing commas in objects and arrays
bare_keys: boolWhether to allow bare keys (unquoted keys) in objects
single_quotes: boolWhether to allow single-quoted strings
comments: boolWhether to allow comments (both line and block)
hex_numbers: boolWhether to allow hexadecimal numbers (e.g., 0xDEADBEEF)
infinity_and_nan: boolWhether to allow Infinity, -Infinity, and NaN
Implementations§
Trait Implementations§
Source§impl<'config> Builder<JsonLanguage> for JsonBuilder<'config>
impl<'config> Builder<JsonLanguage> for JsonBuilder<'config>
Source§fn build<'a, S: Source + ?Sized>(
&self,
source: &S,
edits: &[TextEdit],
_cache: &'a mut impl BuilderCache<JsonLanguage>,
) -> OakDiagnostics<JsonRoot>
fn build<'a, S: Source + ?Sized>( &self, source: &S, edits: &[TextEdit], _cache: &'a mut impl BuilderCache<JsonLanguage>, ) -> OakDiagnostics<JsonRoot>
Builds the higher-level structure (typically an AST) from the source text. Read more
Source§impl Clone for JsonLanguage
impl Clone for JsonLanguage
Source§fn clone(&self) -> JsonLanguage
fn clone(&self) -> JsonLanguage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonLanguage
impl Debug for JsonLanguage
Source§impl Default for JsonLanguage
impl Default for JsonLanguage
Source§impl<'de> Deserialize<'de> for JsonLanguage
impl<'de> Deserialize<'de> for JsonLanguage
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
Source§impl Hash for JsonLanguage
impl Hash for JsonLanguage
Source§impl HoverProvider<JsonLanguage> for JsonHoverProvider
Available on crate feature lsp only.
impl HoverProvider<JsonLanguage> for JsonHoverProvider
Available on crate feature
lsp only.Source§impl Language for JsonLanguage
impl Language for JsonLanguage
Source§const CATEGORY: LanguageCategory = LanguageCategory::Config
const CATEGORY: LanguageCategory = LanguageCategory::Config
The category of the language.
Source§type TokenType = JsonTokenType
type TokenType = JsonTokenType
The token type used to represent different token and node types in the language. Read more
Source§type ElementType = JsonElementType
type ElementType = JsonElementType
The element type used to represent composite structures in the parsed tree. Read more
Source§impl<'config> Lexer<JsonLanguage> for JsonLexer<'config>
impl<'config> Lexer<JsonLanguage> for JsonLexer<'config>
Source§fn lex<'a, S: Source + ?Sized>(
&self,
source: &'a S,
_edits: &[TextEdit],
cache: &'a mut impl LexerCache<JsonLanguage>,
) -> LexOutput<JsonLanguage>
fn lex<'a, S: Source + ?Sized>( &self, source: &'a S, _edits: &[TextEdit], cache: &'a mut impl LexerCache<JsonLanguage>, ) -> LexOutput<JsonLanguage>
Tokenizes the source text into a sequence of tokens. Read more
Source§impl<'config> Parser<JsonLanguage> for JsonParser<'config>
impl<'config> Parser<JsonLanguage> for JsonParser<'config>
Source§fn parse<'a, S: Source + ?Sized>(
&self,
text: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<JsonLanguage>,
) -> ParseOutput<'a, JsonLanguage>
fn parse<'a, S: Source + ?Sized>( &self, text: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<JsonLanguage>, ) -> ParseOutput<'a, JsonLanguage>
The core parsing entry point for converting tokens into a syntax tree. Read more
Source§impl PartialEq for JsonLanguage
impl PartialEq for JsonLanguage
Source§impl Serialize for JsonLanguage
impl Serialize for JsonLanguage
impl Eq for JsonLanguage
impl StructuralPartialEq for JsonLanguage
Auto Trait Implementations§
impl Freeze for JsonLanguage
impl RefUnwindSafe for JsonLanguage
impl Send for JsonLanguage
impl Sync for JsonLanguage
impl Unpin for JsonLanguage
impl UnsafeUnpin for JsonLanguage
impl UnwindSafe for JsonLanguage
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