BlueGit

ict rusty-teams

Files

rusty-teams / vendor / gpui-component / tests / legacy_language_config_compat.rs

legacy_language_config_compat.rs

legacy_language_config_compat.rs 1.0 KiB Download Raw
1// These imports and grammar struct literals were valid in 0.6.0.
2use gpui_component::{highlighter::*, input::*};
3
4#[test]
5fn grammar_config_remains_unambiguous_with_legacy_glob_imports() {
6 let config = LanguageConfig {
7 name: "custom".into(),
8 #[cfg(feature = "tree-sitter")]
9 language: None,
10 #[cfg(feature = "tree-sitter")]
11 injection_languages: vec![],
12 #[cfg(feature = "tree-sitter")]
13 highlights: "".into(),
14 #[cfg(feature = "tree-sitter")]
15 injections: "".into(),
16 #[cfg(feature = "tree-sitter")]
17 locals: "".into(),
18 };
19 let LanguageConfig { name, .. } = config;
20 assert_eq!(name, "custom");
21 let _: Option<EditorState> = None;
22 let _ = language_config::LanguageConfig::default();
23}
24
25#[test]
26fn base_imports_do_not_shadow_legacy_grammar_config() {
27 use gpui_base::input::*;
28 use gpui_component::highlighter::*;
29 let _: Option<LanguageConfig> = None;
30 let _: Option<EditorState> = None;
31 let _ = language_config::LanguageConfig::default();
32}