diff --git a/Cargo.lock b/Cargo.lock
index 69285a1abf..3edf9acab3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1312,12 +1312,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
-[[package]]
-name = "claxon"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688"
-
[[package]]
name = "cli"
version = "0.1.0"
@@ -3890,17 +3884,6 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
-[[package]]
-name = "lewton"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030"
-dependencies = [
- "byteorder",
- "ogg",
- "tinyvec",
-]
-
[[package]]
name = "libc"
version = "0.2.147"
@@ -4754,15 +4737,6 @@ dependencies = [
"cc",
]
-[[package]]
-name = "ogg"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e"
-dependencies = [
- "byteorder",
-]
-
[[package]]
name = "once_cell"
version = "1.18.0"
@@ -6008,11 +5982,8 @@ version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdf1d4dea18dff2e9eb6dca123724f8b60ef44ad74a9ad283cdfe025df7e73fa"
dependencies = [
- "claxon",
"cpal",
"hound",
- "lewton",
- "symphonia",
]
[[package]]
@@ -7328,56 +7299,6 @@ dependencies = [
"siphasher",
]
-[[package]]
-name = "symphonia"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62e48dba70095f265fdb269b99619b95d04c89e619538138383e63310b14d941"
-dependencies = [
- "lazy_static",
- "symphonia-bundle-mp3",
- "symphonia-core",
- "symphonia-metadata",
-]
-
-[[package]]
-name = "symphonia-bundle-mp3"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f31d7fece546f1e6973011a9eceae948133bbd18fd3d52f6073b1e38ae6368a"
-dependencies = [
- "bitflags 1.3.2",
- "lazy_static",
- "log",
- "symphonia-core",
- "symphonia-metadata",
-]
-
-[[package]]
-name = "symphonia-core"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7c73eb88fee79705268cc7b742c7bc93a7b76e092ab751d0833866970754142"
-dependencies = [
- "arrayvec 0.7.4",
- "bitflags 1.3.2",
- "bytemuck",
- "lazy_static",
- "log",
-]
-
-[[package]]
-name = "symphonia-metadata"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89c3e1937e31d0e068bbe829f66b2f2bfaa28d056365279e0ef897172c3320c0"
-dependencies = [
- "encoding_rs",
- "lazy_static",
- "log",
- "symphonia-core",
-]
-
[[package]]
name = "syn"
version = "1.0.109"
@@ -8126,7 +8047,7 @@ dependencies = [
[[package]]
name = "tree-sitter"
version = "0.20.10"
-source = "git+https://github.com/tree-sitter/tree-sitter?rev=1c65ca24bc9a734ab70115188f465e12eecf224e#1c65ca24bc9a734ab70115188f465e12eecf224e"
+source = "git+https://github.com/tree-sitter/tree-sitter?rev=35a6052fbcafc5e5fc0f9415b8652be7dcaf7222#35a6052fbcafc5e5fc0f9415b8652be7dcaf7222"
dependencies = [
"cc",
"regex",
diff --git a/Cargo.toml b/Cargo.toml
index 1938e832e9..7ea79138c0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -135,7 +135,7 @@ tree-sitter-lua = "0.0.14"
tree-sitter-nix = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "66e3e9ce9180ae08fc57372061006ef83f0abde7" }
[patch.crates-io]
-tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "1c65ca24bc9a734ab70115188f465e12eecf224e" }
+tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "35a6052fbcafc5e5fc0f9415b8652be7dcaf7222" }
async-task = { git = "https://github.com/zed-industries/async-task", rev = "341b57d6de98cdfd7b418567b8de2022ca993a6e" }
# TODO - Remove when a version is released with this PR: https://github.com/servo/core-foundation-rs/pull/457
diff --git a/assets/icons/file_icons/elixir.svg b/assets/icons/file_icons/elixir.svg
new file mode 100644
index 0000000000..15a1004328
--- /dev/null
+++ b/assets/icons/file_icons/elixir.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/file_icons/file_types.json b/assets/icons/file_icons/file_types.json
index 9ea75d0730..a65155d4eb 100644
--- a/assets/icons/file_icons/file_types.json
+++ b/assets/icons/file_icons/file_types.json
@@ -21,23 +21,27 @@
"dll": "storage",
"doc": "document",
"docx": "document",
+ "eex": "elixir",
"eslintrc": "eslint",
"eslintrc.js": "eslint",
"eslintrc.json": "eslint",
+ "ex": "elixir",
+ "exs": "elixir",
+ "fish": "terminal",
+ "flac": "audio",
"fmp": "storage",
"fp7": "storage",
- "flac": "audio",
- "fish": "terminal",
"frm": "storage",
"gdb": "storage",
+ "gif": "image",
"gitattributes": "vcs",
"gitignore": "vcs",
"gitmodules": "vcs",
- "gif": "image",
"go": "code",
"h": "code",
"handlebars": "code",
"hbs": "template",
+ "heex": "elixir",
"htm": "template",
"html": "template",
"ib": "storage",
@@ -51,16 +55,16 @@
"ldf": "storage",
"lock": "lock",
"log": "log",
- "mdb": "storage",
"md": "document",
+ "mdb": "storage",
"mdf": "storage",
"mdx": "document",
"mp3": "audio",
"mp4": "video",
"myd": "storage",
"myi": "storage",
- "ods": "document",
"odp": "document",
+ "ods": "document",
"odt": "document",
"ogg": "video",
"pdb": "storage",
@@ -74,24 +78,24 @@
"profile": "terminal",
"ps1": "terminal",
"psd": "image",
- "py": "code",
+ "py": "python",
"rb": "code",
"rkt": "code",
"rs": "rust",
"rtf": "document",
"sav": "storage",
"scm": "code",
+ "sdf": "storage",
"sh": "terminal",
"sqlite": "storage",
- "sdf": "storage",
"svelte": "template",
"svg": "image",
"swift": "code",
- "ts": "typescript",
- "tsx": "code",
"tiff": "image",
"toml": "toml",
+ "ts": "typescript",
"tsv": "storage",
+ "tsx": "code",
"txt": "document",
"wav": "audio",
"webm": "video",
@@ -103,9 +107,9 @@
"zlogin": "terminal",
"zsh": "terminal",
"zsh_aliases": "terminal",
- "zshenv": "terminal",
"zsh_histfile": "terminal",
"zsh_profile": "terminal",
+ "zshenv": "terminal",
"zshrc": "terminal"
},
"types": {
@@ -127,6 +131,9 @@
"document": {
"icon": "icons/file_icons/book.svg"
},
+ "elixir": {
+ "icon": "icons/file_icons/elixir.svg"
+ },
"eslint": {
"icon": "icons/file_icons/eslint.svg"
},
@@ -145,9 +152,15 @@
"log": {
"icon": "icons/file_icons/info.svg"
},
+ "phoenix": {
+ "icon": "icons/file_icons/phoenix.svg"
+ },
"prettier": {
"icon": "icons/file_icons/prettier.svg"
},
+ "python": {
+ "icon": "icons/file_icons/python.svg"
+ },
"rust": {
"icon": "icons/file_icons/rust.svg"
},
diff --git a/assets/icons/file_icons/phoenix.svg b/assets/icons/file_icons/phoenix.svg
new file mode 100644
index 0000000000..424b753806
--- /dev/null
+++ b/assets/icons/file_icons/phoenix.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/icons/file_icons/python.svg b/assets/icons/file_icons/python.svg
new file mode 100644
index 0000000000..dbc8565f90
--- /dev/null
+++ b/assets/icons/file_icons/python.svg
@@ -0,0 +1,6 @@
+
diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json
index 3ec994335e..83875ab44a 100644
--- a/assets/keymaps/default.json
+++ b/assets/keymaps/default.json
@@ -173,6 +173,7 @@
"context": "Editor && mode == full",
"bindings": {
"enter": "editor::Newline",
+ "shift-enter": "editor::Newline",
"cmd-shift-enter": "editor::NewlineAbove",
"cmd-enter": "editor::NewlineBelow",
"alt-z": "editor::ToggleSoftWrap",
diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json
index 02c09b33af..458232b9b0 100644
--- a/assets/keymaps/vim.json
+++ b/assets/keymaps/vim.json
@@ -103,9 +103,19 @@
],
"v": "vim::ToggleVisual",
"shift-v": "vim::ToggleVisualLine",
+ "ctrl-v": "vim::ToggleVisualBlock",
+ "ctrl-q": "vim::ToggleVisualBlock",
"*": "vim::MoveToNext",
"#": "vim::MoveToPrev",
"0": "vim::StartOfLine", // When no number operator present, use start of line motion
+ "ctrl-f": "vim::PageDown",
+ "pagedown": "vim::PageDown",
+ "ctrl-b": "vim::PageUp",
+ "pageup": "vim::PageUp",
+ "ctrl-d": "vim::ScrollDown",
+ "ctrl-u": "vim::ScrollUp",
+ "ctrl-e": "vim::LineDown",
+ "ctrl-y": "vim::LineUp",
// "g" commands
"g g": "vim::StartOfDocument",
"g h": "editor::Hover",
@@ -293,14 +303,6 @@
"backwards": true
}
],
- "ctrl-f": "vim::PageDown",
- "pagedown": "vim::PageDown",
- "ctrl-b": "vim::PageUp",
- "pageup": "vim::PageUp",
- "ctrl-d": "vim::ScrollDown",
- "ctrl-u": "vim::ScrollUp",
- "ctrl-e": "vim::LineDown",
- "ctrl-y": "vim::LineUp",
"r": [
"vim::PushOperator",
"Replace"
@@ -365,7 +367,7 @@
}
},
{
- "context": "Editor && vim_mode == visual && !VimWaiting",
+ "context": "Editor && vim_mode == visual && !VimWaiting && !VimObject",
"bindings": {
"u": "editor::Undo",
"o": "vim::OtherEnd",
@@ -377,6 +379,11 @@
"s": "vim::Substitute",
"c": "vim::Substitute",
"~": "vim::ChangeCase",
+ "shift-i": [
+ "vim::SwitchMode",
+ "Insert"
+ ],
+ "shift-a": "vim::InsertAfter",
"r": [
"vim::PushOperator",
"Replace"
@@ -394,7 +401,23 @@
"Normal"
],
">": "editor::Indent",
- "<": "editor::Outdent"
+ "<": "editor::Outdent",
+ "i": [
+ "vim::PushOperator",
+ {
+ "Object": {
+ "around": false
+ }
+ }
+ ],
+ "a": [
+ "vim::PushOperator",
+ {
+ "Object": {
+ "around": true
+ }
+ }
+ ],
}
},
{
diff --git a/assets/settings/default.json b/assets/settings/default.json
index 2ddf4a137f..08faedbed6 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -126,7 +126,7 @@
// Whether to show the collaboration panel button in the status bar.
"button": true,
// Where to dock channels panel. Can be 'left' or 'right'.
- "dock": "right",
+ "dock": "left",
// Default width of the channels panel.
"default_width": 240
},
diff --git a/crates/audio/Cargo.toml b/crates/audio/Cargo.toml
index 182e421eb8..36135a1e76 100644
--- a/crates/audio/Cargo.toml
+++ b/crates/audio/Cargo.toml
@@ -13,7 +13,7 @@ gpui = { path = "../gpui" }
collections = { path = "../collections" }
util = { path = "../util" }
-rodio = "0.17.1"
+rodio ={version = "0.17.1", default-features=false, features = ["wav"]}
log.workspace = true
diff --git a/crates/collab/src/db.rs b/crates/collab/src/db.rs
index b457c4c116..d322b03589 100644
--- a/crates/collab/src/db.rs
+++ b/crates/collab/src/db.rs
@@ -1,56 +1,46 @@
-mod access_token;
-mod channel;
-mod channel_member;
-mod channel_path;
-mod contact;
-mod follower;
-mod language_server;
-mod project;
-mod project_collaborator;
-mod room;
-mod room_participant;
-mod server;
-mod signup;
#[cfg(test)]
-mod tests;
-mod user;
-mod worktree;
-mod worktree_diagnostic_summary;
-mod worktree_entry;
-mod worktree_repository;
-mod worktree_repository_statuses;
-mod worktree_settings_file;
+mod db_tests;
+#[cfg(test)]
+pub mod test_db;
-use crate::executor::Executor;
-use crate::{Error, Result};
+mod ids;
+mod queries;
+mod tables;
+
+use crate::{executor::Executor, Error, Result};
use anyhow::anyhow;
use collections::{BTreeMap, HashMap, HashSet};
-pub use contact::Contact;
use dashmap::DashMap;
use futures::StreamExt;
-use hyper::StatusCode;
-use rand::prelude::StdRng;
-use rand::{Rng, SeedableRng};
+use rand::{prelude::StdRng, Rng, SeedableRng};
use rpc::{proto, ConnectionId};
-use sea_orm::Condition;
-pub use sea_orm::ConnectOptions;
use sea_orm::{
- entity::prelude::*, ActiveValue, ConnectionTrait, DatabaseConnection, DatabaseTransaction,
- DbErr, FromQueryResult, IntoActiveModel, IsolationLevel, JoinType, QueryOrder, QuerySelect,
- Statement, TransactionTrait,
+ entity::prelude::*, ActiveValue, Condition, ConnectionTrait, DatabaseConnection,
+ DatabaseTransaction, DbErr, FromQueryResult, IntoActiveModel, IsolationLevel, JoinType,
+ QueryOrder, QuerySelect, Statement, TransactionTrait,
};
use sea_query::{Alias, Expr, OnConflict, Query};
use serde::{Deserialize, Serialize};
-pub use signup::{Invite, NewSignup, WaitlistSummary};
-use sqlx::migrate::{Migrate, Migration, MigrationSource};
-use sqlx::Connection;
-use std::fmt::Write as _;
-use std::ops::{Deref, DerefMut};
-use std::path::Path;
-use std::time::Duration;
-use std::{future::Future, marker::PhantomData, rc::Rc, sync::Arc};
+use sqlx::{
+ migrate::{Migrate, Migration, MigrationSource},
+ Connection,
+};
+use std::{
+ fmt::Write as _,
+ future::Future,
+ marker::PhantomData,
+ ops::{Deref, DerefMut},
+ path::Path,
+ rc::Rc,
+ sync::Arc,
+ time::Duration,
+};
+use tables::*;
use tokio::sync::{Mutex, OwnedMutexGuard};
-pub use user::Model as User;
+
+pub use ids::*;
+pub use sea_orm::ConnectOptions;
+pub use tables::user::Model as User;
pub struct Database {
options: ConnectOptions,
@@ -121,3732 +111,6 @@ impl Database {
Ok(new_migrations)
}
- pub async fn create_server(&self, environment: &str) -> Result {
- self.transaction(|tx| async move {
- let server = server::ActiveModel {
- environment: ActiveValue::set(environment.into()),
- ..Default::default()
- }
- .insert(&*tx)
- .await?;
- Ok(server.id)
- })
- .await
- }
-
- pub async fn stale_room_ids(
- &self,
- environment: &str,
- new_server_id: ServerId,
- ) -> Result> {
- self.transaction(|tx| async move {
- #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
- enum QueryAs {
- RoomId,
- }
-
- let stale_server_epochs = self
- .stale_server_ids(environment, new_server_id, &tx)
- .await?;
- Ok(room_participant::Entity::find()
- .select_only()
- .column(room_participant::Column::RoomId)
- .distinct()
- .filter(
- room_participant::Column::AnsweringConnectionServerId
- .is_in(stale_server_epochs),
- )
- .into_values::<_, QueryAs>()
- .all(&*tx)
- .await?)
- })
- .await
- }
-
- pub async fn refresh_room(
- &self,
- room_id: RoomId,
- new_server_id: ServerId,
- ) -> Result> {
- self.room_transaction(room_id, |tx| async move {
- let stale_participant_filter = Condition::all()
- .add(room_participant::Column::RoomId.eq(room_id))
- .add(room_participant::Column::AnsweringConnectionId.is_not_null())
- .add(room_participant::Column::AnsweringConnectionServerId.ne(new_server_id));
-
- let stale_participant_user_ids = room_participant::Entity::find()
- .filter(stale_participant_filter.clone())
- .all(&*tx)
- .await?
- .into_iter()
- .map(|participant| participant.user_id)
- .collect::>();
-
- // Delete participants who failed to reconnect and cancel their calls.
- let mut canceled_calls_to_user_ids = Vec::new();
- room_participant::Entity::delete_many()
- .filter(stale_participant_filter)
- .exec(&*tx)
- .await?;
- let called_participants = room_participant::Entity::find()
- .filter(
- Condition::all()
- .add(
- room_participant::Column::CallingUserId
- .is_in(stale_participant_user_ids.iter().copied()),
- )
- .add(room_participant::Column::AnsweringConnectionId.is_null()),
- )
- .all(&*tx)
- .await?;
- room_participant::Entity::delete_many()
- .filter(
- room_participant::Column::Id
- .is_in(called_participants.iter().map(|participant| participant.id)),
- )
- .exec(&*tx)
- .await?;
- canceled_calls_to_user_ids.extend(
- called_participants
- .into_iter()
- .map(|participant| participant.user_id),
- );
-
- let (channel_id, room) = self.get_channel_room(room_id, &tx).await?;
- let channel_members;
- if let Some(channel_id) = channel_id {
- channel_members = self.get_channel_members_internal(channel_id, &tx).await?;
- } else {
- channel_members = Vec::new();
-
- // Delete the room if it becomes empty.
- if room.participants.is_empty() {
- project::Entity::delete_many()
- .filter(project::Column::RoomId.eq(room_id))
- .exec(&*tx)
- .await?;
- room::Entity::delete_by_id(room_id).exec(&*tx).await?;
- }
- };
-
- Ok(RefreshedRoom {
- room,
- channel_id,
- channel_members,
- stale_participant_user_ids,
- canceled_calls_to_user_ids,
- })
- })
- .await
- }
-
- pub async fn delete_stale_servers(
- &self,
- environment: &str,
- new_server_id: ServerId,
- ) -> Result<()> {
- self.transaction(|tx| async move {
- server::Entity::delete_many()
- .filter(
- Condition::all()
- .add(server::Column::Environment.eq(environment))
- .add(server::Column::Id.ne(new_server_id)),
- )
- .exec(&*tx)
- .await?;
- Ok(())
- })
- .await
- }
-
- async fn stale_server_ids(
- &self,
- environment: &str,
- new_server_id: ServerId,
- tx: &DatabaseTransaction,
- ) -> Result> {
- let stale_servers = server::Entity::find()
- .filter(
- Condition::all()
- .add(server::Column::Environment.eq(environment))
- .add(server::Column::Id.ne(new_server_id)),
- )
- .all(&*tx)
- .await?;
- Ok(stale_servers.into_iter().map(|server| server.id).collect())
- }
-
- // users
-
- pub async fn create_user(
- &self,
- email_address: &str,
- admin: bool,
- params: NewUserParams,
- ) -> Result {
- self.transaction(|tx| async {
- let tx = tx;
- let user = user::Entity::insert(user::ActiveModel {
- email_address: ActiveValue::set(Some(email_address.into())),
- github_login: ActiveValue::set(params.github_login.clone()),
- github_user_id: ActiveValue::set(Some(params.github_user_id)),
- admin: ActiveValue::set(admin),
- metrics_id: ActiveValue::set(Uuid::new_v4()),
- ..Default::default()
- })
- .on_conflict(
- OnConflict::column(user::Column::GithubLogin)
- .update_column(user::Column::GithubLogin)
- .to_owned(),
- )
- .exec_with_returning(&*tx)
- .await?;
-
- Ok(NewUserResult {
- user_id: user.id,
- metrics_id: user.metrics_id.to_string(),
- signup_device_id: None,
- inviting_user_id: None,
- })
- })
- .await
- }
-
- pub async fn get_user_by_id(&self, id: UserId) -> Result