Project search2 (#3585)

Semantic search and tests are gonna be shipped in a separate PR.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2023-12-11 17:20:13 +01:00 committed by GitHub
commit bc130fd6b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1673 additions and 1545 deletions

23
Cargo.lock generated
View file

@ -1388,11 +1388,10 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.83" version = "1.0.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856"
dependencies = [ dependencies = [
"jobserver",
"libc", "libc",
] ]
@ -4671,15 +4670,6 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "jobserver"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "journal" name = "journal"
version = "0.1.0" version = "0.1.0"
@ -5055,18 +5045,18 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]] [[package]]
name = "linkme" name = "linkme"
version = "0.3.18" version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1e6b0bb9ca88d3c5ae88240beb9683821f903b824ee8381ef9ab4e8522fbfa9" checksum = "91ed2ee9464ff9707af8e9ad834cffa4802f072caad90639c583dd3c62e6e608"
dependencies = [ dependencies = [
"linkme-impl", "linkme-impl",
] ]
[[package]] [[package]]
name = "linkme-impl" name = "linkme-impl"
version = "0.3.18" version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3b3f61e557a617ec6ba36c79431e1f3b5e100d67cfbdb61ed6ef384298af016" checksum = "ba125974b109d512fccbc6c0244e7580143e460895dfd6ea7f8bbb692fd94396"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -8300,6 +8290,7 @@ dependencies = [
"menu2", "menu2",
"postage", "postage",
"project2", "project2",
"semantic_index2",
"serde", "serde",
"serde_derive", "serde_derive",
"serde_json", "serde_json",

View file

@ -8706,13 +8706,13 @@ impl Editor {
); );
} }
// pub fn set_searchable(&mut self, searchable: bool) { pub fn set_searchable(&mut self, searchable: bool) {
// self.searchable = searchable; self.searchable = searchable;
// } }
// pub fn searchable(&self) -> bool { pub fn searchable(&self) -> bool {
// self.searchable self.searchable
// } }
fn open_excerpts(&mut self, _: &OpenExcerpts, cx: &mut ViewContext<Self>) { fn open_excerpts(&mut self, _: &OpenExcerpts, cx: &mut ViewContext<Self>) {
let buffer = self.buffer.read(cx); let buffer = self.buffer.read(cx);

View file

@ -21,7 +21,7 @@ theme = { package = "theme2", path = "../theme2" }
util = { path = "../util" } util = { path = "../util" }
ui = {package = "ui2", path = "../ui2"} ui = {package = "ui2", path = "../ui2"}
workspace = { package = "workspace2", path = "../workspace2" } workspace = { package = "workspace2", path = "../workspace2" }
#semantic_index = { path = "../semantic_index" } semantic_index = { package = "semantic_index2", path = "../semantic_index2" }
anyhow.workspace = true anyhow.workspace = true
futures.workspace = true futures.workspace = true
log.workspace = true log.workspace = true

File diff suppressed because it is too large Load diff

View file

@ -13,12 +13,12 @@ use ui::{ButtonStyle, Icon, IconButton};
pub mod buffer_search; pub mod buffer_search;
mod history; mod history;
mod mode; mod mode;
//pub mod project_search; pub mod project_search;
pub(crate) mod search_bar; pub(crate) mod search_bar;
pub fn init(cx: &mut AppContext) { pub fn init(cx: &mut AppContext) {
buffer_search::init(cx); buffer_search::init(cx);
//project_search::init(cx); project_search::init(cx);
} }
actions!( actions!(
@ -47,6 +47,7 @@ bitflags! {
const NONE = 0b000; const NONE = 0b000;
const WHOLE_WORD = 0b001; const WHOLE_WORD = 0b001;
const CASE_SENSITIVE = 0b010; const CASE_SENSITIVE = 0b010;
const INCLUDE_IGNORED = 0b100;
} }
} }

View file

@ -62,6 +62,7 @@ pub enum Icon {
FileRust, FileRust,
FileToml, FileToml,
FileTree, FileTree,
Filter,
Folder, Folder,
FolderOpen, FolderOpen,
FolderX, FolderX,
@ -140,6 +141,7 @@ impl Icon {
Icon::FileRust => "icons/file_icons/rust.svg", Icon::FileRust => "icons/file_icons/rust.svg",
Icon::FileToml => "icons/file_icons/toml.svg", Icon::FileToml => "icons/file_icons/toml.svg",
Icon::FileTree => "icons/project.svg", Icon::FileTree => "icons/project.svg",
Icon::Filter => "icons/filter.svg",
Icon::Folder => "icons/file_icons/folder.svg", Icon::Folder => "icons/file_icons/folder.svg",
Icon::FolderOpen => "icons/file_icons/folder_open.svg", Icon::FolderOpen => "icons/file_icons/folder_open.svg",
Icon::FolderX => "icons/stop_sharing.svg", Icon::FolderX => "icons/stop_sharing.svg",

View file

@ -24,6 +24,7 @@ use anyhow::{anyhow, Context as _};
use futures::{channel::mpsc, StreamExt}; use futures::{channel::mpsc, StreamExt};
use project_panel::ProjectPanel; use project_panel::ProjectPanel;
use quick_action_bar::QuickActionBar; use quick_action_bar::QuickActionBar;
use search::project_search::ProjectSearchBar;
use settings::{initial_local_settings_content, load_default_keymap, KeymapFile, Settings}; use settings::{initial_local_settings_content, load_default_keymap, KeymapFile, Settings};
use std::{borrow::Cow, ops::Deref, sync::Arc}; use std::{borrow::Cow, ops::Deref, sync::Arc};
use terminal_view::terminal_panel::TerminalPanel; use terminal_view::terminal_panel::TerminalPanel;
@ -429,8 +430,8 @@ fn initialize_pane(workspace: &mut Workspace, pane: &View<Pane>, cx: &mut ViewCo
toolbar.add_item(quick_action_bar, cx); toolbar.add_item(quick_action_bar, cx);
let diagnostic_editor_controls = cx.build_view(|_| diagnostics::ToolbarControls::new()); let diagnostic_editor_controls = cx.build_view(|_| diagnostics::ToolbarControls::new());
// toolbar.add_item(diagnostic_editor_controls, cx); // toolbar.add_item(diagnostic_editor_controls, cx);
// let project_search_bar = cx.add_view(|_| ProjectSearchBar::new()); let project_search_bar = cx.build_view(|_| ProjectSearchBar::new());
// toolbar.add_item(project_search_bar, cx); toolbar.add_item(project_search_bar, cx);
// let lsp_log_item = // let lsp_log_item =
// cx.add_view(|_| language_tools::LspLogToolbarItemView::new()); // cx.add_view(|_| language_tools::LspLogToolbarItemView::new());
// toolbar.add_item(lsp_log_item, cx); // toolbar.add_item(lsp_log_item, cx);