Merge pull request #1559 from zed-industries/language-injection
Add language injection support
This commit is contained in:
commit
d4bbf21650
16 changed files with 2513 additions and 412 deletions
|
@ -999,6 +999,7 @@ fn test_autoindent_language_without_indents_query(cx: &mut MutableAppContext) {
|
|||
Arc::new(Language::new(
|
||||
LanguageConfig {
|
||||
name: "Markdown".into(),
|
||||
auto_indent_using_last_non_empty_line: false,
|
||||
..Default::default()
|
||||
},
|
||||
Some(tree_sitter_json::language()),
|
||||
|
@ -1437,7 +1438,9 @@ fn json_lang() -> Language {
|
|||
|
||||
fn get_tree_sexp(buffer: &ModelHandle<Buffer>, cx: &gpui::TestAppContext) -> String {
|
||||
buffer.read_with(cx, |buffer, _| {
|
||||
buffer.syntax_tree().unwrap().root_node().to_sexp()
|
||||
let snapshot = buffer.snapshot();
|
||||
let layers = snapshot.syntax.layers(buffer.as_text_snapshot());
|
||||
layers[0].2.to_sexp()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue