Skip to content

Commit

Permalink
write out types for grammars under LanguageConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Feb 14, 2022
1 parent d165681 commit f391fc8
Show file tree
Hide file tree
Showing 2 changed files with 315 additions and 177 deletions.
20 changes: 20 additions & 0 deletions helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ where
#[serde(deny_unknown_fields)]
pub struct Configuration {
pub language: Vec<LanguageConfiguration>,
pub grammar: Vec<GrammarConfiguration>,
}

// largely based on tree-sitter/cli/src/loader.rs
Expand Down Expand Up @@ -147,6 +148,25 @@ pub struct IndentQuery {
pub outdent: HashSet<String>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct GrammarConfiguration {
#[serde(rename = "name")]
pub grammar_id: String, // c-sharp, rust
pub source: GrammarSource,
pub path: Option<String>,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum GrammarSource {
#[serde(rename = "path")]
Local(String),
Git {
remote: String,
rev: String,
},
}

#[derive(Debug)]
pub struct TextObjectQuery {
pub query: Query,
Expand Down
Loading

0 comments on commit f391fc8

Please sign in to comment.