Extract a language crate

This commit is contained in:
Max Brunsfeld
2021-10-20 22:51:40 +02:00
parent cdb268e656
commit 81a85e9c79
29 changed files with 2408 additions and 2303 deletions
+2 -1
View File
@@ -8,7 +8,7 @@ test-support = [
"client/test-support",
"project/test-support",
"tree-sitter",
"tree-sitter-rust"
"tree-sitter-rust",
]
[dependencies]
@@ -16,6 +16,7 @@ buffer = { path = "../buffer" }
client = { path = "../client" }
editor = { path = "../editor" }
gpui = { path = "../gpui" }
language = { path = "../language" }
project = { path = "../project" }
theme = { path = "../theme" }
anyhow = "1.0.38"
+1 -1
View File
@@ -1,9 +1,9 @@
use super::{Item, ItemView};
use crate::Settings;
use anyhow::Result;
use buffer::{Buffer, File as _};
use editor::{Editor, EditorSettings, Event};
use gpui::{fonts::TextStyle, AppContext, ModelHandle, Task, ViewContext};
use language::{Buffer, File as _};
use postage::watch;
use project::{ProjectPath, Worktree};
use std::path::Path;
+3 -3
View File
@@ -5,7 +5,7 @@ pub mod settings;
pub mod sidebar;
use anyhow::Result;
use buffer::{Buffer, LanguageRegistry};
use language::{Buffer, LanguageRegistry};
use client::{Authenticate, ChannelList, Client, UserStore};
use gpui::{
action, elements::*, json::to_string_pretty, keymap::Binding, platform::CursorStyle,
@@ -271,8 +271,8 @@ impl WorkspaceParams {
#[cfg(any(test, feature = "test-support"))]
pub fn test(cx: &mut MutableAppContext) -> Self {
let mut languages = LanguageRegistry::new();
languages.add(Arc::new(buffer::Language::new(
buffer::LanguageConfig {
languages.add(Arc::new(language::Language::new(
language::LanguageConfig {
name: "Rust".to_string(),
path_suffixes: vec!["rs".to_string()],
..Default::default()