Finished refactoring out fs and rope

This commit is contained in:
Mikayla Maki 2022-10-11 15:25:54 -07:00
parent 0a8e2f6bb0
commit 0beb97547e
58 changed files with 328 additions and 223 deletions

View file

@ -1,4 +1,3 @@
pub mod fs;
mod ignore;
mod lsp_command;
pub mod search;
@ -25,9 +24,8 @@ use language::{
},
range_from_lsp, range_to_lsp, Anchor, Bias, Buffer, CachedLspAdapter, CharKind, CodeAction,
CodeLabel, Completion, Diagnostic, DiagnosticEntry, DiagnosticSet, Event as BufferEvent,
File as _, Language, LanguageRegistry, LanguageServerName, LineEnding, LocalFile,
OffsetRangeExt, Operation, Patch, PointUtf16, TextBufferSnapshot, ToOffset, ToPointUtf16,
Transaction,
File as _, Language, LanguageRegistry, LanguageServerName, LocalFile, OffsetRangeExt,
Operation, Patch, TextBufferSnapshot, ToOffset, ToPointUtf16, Transaction,
};
use lsp::{
DiagnosticSeverity, DiagnosticTag, DocumentHighlightKind, LanguageServer, LanguageString,
@ -37,6 +35,7 @@ use lsp_command::*;
use parking_lot::Mutex;
use postage::watch;
use rand::prelude::*;
use rope::point_utf16::PointUtf16;
use search::SearchQuery;
use serde::Serialize;
use settings::{FormatOnSave, Formatter, Settings};
@ -6019,33 +6018,6 @@ impl<P: AsRef<Path>> From<(WorktreeId, P)> for ProjectPath {
}
}
impl From<lsp::CreateFileOptions> for fs::CreateOptions {
fn from(options: lsp::CreateFileOptions) -> Self {
Self {
overwrite: options.overwrite.unwrap_or(false),
ignore_if_exists: options.ignore_if_exists.unwrap_or(false),
}
}
}
impl From<lsp::RenameFileOptions> for fs::RenameOptions {
fn from(options: lsp::RenameFileOptions) -> Self {
Self {
overwrite: options.overwrite.unwrap_or(false),
ignore_if_exists: options.ignore_if_exists.unwrap_or(false),
}
}
}
impl From<lsp::DeleteFileOptions> for fs::RemoveOptions {
fn from(options: lsp::DeleteFileOptions) -> Self {
Self {
recursive: options.recursive.unwrap_or(false),
ignore_if_not_exists: options.ignore_if_not_exists.unwrap_or(false),
}
}
}
fn serialize_symbol(symbol: &Symbol) -> proto::Symbol {
proto::Symbol {
language_server_name: symbol.language_server_name.0.to_string(),