Struct project2::Project

source ·
pub struct Project { /* private fields */ }

Implementations§

source§

impl Project

source

pub fn create_terminal( &mut self, working_directory: Option<PathBuf>, window: AnyWindowHandle, cx: &mut ModelContext<'_, Self> ) -> Result<Model<Terminal>>

source

pub fn find_activate_script_path( &mut self, settings: &VenvSettingsContent<'_>, working_directory: Option<PathBuf> ) -> Option<PathBuf>

source

pub fn local_terminal_handles(&self) -> &Vec<WeakModel<Terminal>>

source§

impl Project

source

pub fn init_settings(cx: &mut AppContext)

source

pub fn init(client: &Arc<Client>, cx: &mut AppContext)

source

pub fn local( client: Arc<Client>, node: Arc<dyn NodeRuntime>, user_store: Model<UserStore>, languages: Arc<LanguageRegistry>, fs: Arc<dyn Fs>, cx: &mut AppContext ) -> Model<Self>

source

pub async fn remote( remote_id: u64, client: Arc<Client>, user_store: Model<UserStore>, languages: Arc<LanguageRegistry>, fs: Arc<dyn Fs>, cx: AsyncAppContext ) -> Result<Model<Self>>

source

pub fn buffer_for_id(&self, remote_id: u64) -> Option<Model<Buffer>>

source

pub fn languages(&self) -> &Arc<LanguageRegistry>

source

pub fn client(&self) -> Arc<Client>

source

pub fn user_store(&self) -> Model<UserStore>

source

pub fn opened_buffers(&self) -> Vec<Model<Buffer>>

source

pub fn fs(&self) -> &Arc<dyn Fs>

source

pub fn remote_id(&self) -> Option<u64>

source

pub fn replica_id(&self) -> ReplicaId

source

pub fn collaborators(&self) -> &HashMap<PeerId, Collaborator>

source

pub fn host(&self) -> Option<&Collaborator>

source

pub fn worktrees<'a>( &'a self ) -> impl 'a + DoubleEndedIterator<Item = Model<Worktree>>

Collect all worktrees, including ones that don’t appear in the project panel

source

pub fn visible_worktrees<'a>( &'a self, cx: &'a AppContext ) -> impl 'a + DoubleEndedIterator<Item = Model<Worktree>>

Collect all user-visible worktrees, the ones that appear in the project panel

source

pub fn worktree_root_names<'a>( &'a self, cx: &'a AppContext ) -> impl Iterator<Item = &'a str>

source

pub fn worktree_for_id( &self, id: WorktreeId, cx: &AppContext ) -> Option<Model<Worktree>>

source

pub fn worktree_for_entry( &self, entry_id: ProjectEntryId, cx: &AppContext ) -> Option<Model<Worktree>>

source

pub fn worktree_id_for_entry( &self, entry_id: ProjectEntryId, cx: &AppContext ) -> Option<WorktreeId>

source

pub fn contains_paths(&self, paths: &[PathBuf], cx: &AppContext) -> bool

source

pub fn contains_path(&self, path: &Path, cx: &AppContext) -> bool

source

pub fn create_entry( &mut self, project_path: impl Into<ProjectPath>, is_directory: bool, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<Entry>>>

source

pub fn copy_entry( &mut self, entry_id: ProjectEntryId, new_path: impl Into<Arc<Path>>, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<Entry>>>

source

pub fn rename_entry( &mut self, entry_id: ProjectEntryId, new_path: impl Into<Arc<Path>>, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<Entry>>>

source

pub fn delete_entry( &mut self, entry_id: ProjectEntryId, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn expand_entry( &mut self, worktree_id: WorktreeId, entry_id: ProjectEntryId, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn shared( &mut self, project_id: u64, cx: &mut ModelContext<'_, Self> ) -> Result<()>

source

pub fn reshared( &mut self, message: ResharedProject, cx: &mut ModelContext<'_, Self> ) -> Result<()>

source

pub fn rejoined( &mut self, message: RejoinedProject, message_id: u32, cx: &mut ModelContext<'_, Self> ) -> Result<()>

source

pub fn unshare(&mut self, cx: &mut ModelContext<'_, Self>) -> Result<()>

source

pub fn disconnected_from_host(&mut self, cx: &mut ModelContext<'_, Self>)

source

pub fn close(&mut self, cx: &mut ModelContext<'_, Self>)

source

pub fn is_read_only(&self) -> bool

source

pub fn is_local(&self) -> bool

source

pub fn is_remote(&self) -> bool

source

pub fn create_buffer( &mut self, text: &str, language: Option<Arc<Language>>, cx: &mut ModelContext<'_, Self> ) -> Result<Model<Buffer>>

source

pub fn open_path( &mut self, path: impl Into<ProjectPath>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<(ProjectEntryId, AnyModel)>>

source

pub fn open_local_buffer( &mut self, abs_path: impl AsRef<Path>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>

source

pub fn open_buffer( &mut self, path: impl Into<ProjectPath>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>

source

pub fn open_local_buffer_via_lsp( &mut self, abs_path: Url, language_server_id: LanguageServerId, language_server_name: LanguageServerName, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>

LanguageServerName is owned, because it is inserted into a map

source

pub fn open_buffer_by_id( &mut self, id: u64, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>

source

pub fn save_buffers( &self, buffers: HashSet<Model<Buffer>>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn save_buffer( &self, buffer: Model<Buffer>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn save_buffer_as( &mut self, buffer: Model<Buffer>, abs_path: PathBuf, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>

source

pub fn get_open_buffer( &mut self, path: &ProjectPath, cx: &mut ModelContext<'_, Self> ) -> Option<Model<Buffer>>

source

pub fn set_language_for_buffer( &mut self, buffer: &Model<Buffer>, new_language: Arc<Language>, cx: &mut ModelContext<'_, Self> )

source

pub fn restart_language_servers_for_buffers( &mut self, buffers: impl IntoIterator<Item = Model<Buffer>>, cx: &mut ModelContext<'_, Self> ) -> Option<()>

source

pub fn language_server_statuses( &self ) -> impl DoubleEndedIterator<Item = &LanguageServerStatus>

source

pub fn update_diagnostics( &mut self, language_server_id: LanguageServerId, params: PublishDiagnosticsParams, disk_based_sources: &[String], cx: &mut ModelContext<'_, Self> ) -> Result<()>

source

pub fn update_diagnostic_entries( &mut self, server_id: LanguageServerId, abs_path: PathBuf, version: Option<i32>, diagnostics: Vec<DiagnosticEntry<Unclipped<PointUtf16>>>, cx: &mut ModelContext<'_, Project> ) -> Result<(), Error>

source

pub fn reload_buffers( &self, buffers: HashSet<Model<Buffer>>, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ProjectTransaction>>

source

pub fn format( &mut self, buffers: HashSet<Model<Buffer>>, push_to_history: bool, trigger: FormatTrigger, cx: &mut ModelContext<'_, Project> ) -> Task<Result<ProjectTransaction>>

source

pub fn definition<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<LocationLink>>>

source

pub fn type_definition<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<LocationLink>>>

source

pub fn references<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<Location>>>

source

pub fn document_highlights<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<DocumentHighlight>>>

source

pub fn symbols( &self, query: &str, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<Symbol>>>

source

pub fn open_buffer_for_symbol( &mut self, symbol: &Symbol, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>

source

pub fn hover<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Option<Hover>>>

source

pub fn completions<T: ToOffset + ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<Completion>>>

source

pub fn apply_additional_edits_for_completion( &self, buffer_handle: Model<Buffer>, completion: Completion, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Option<Transaction>>>

source

pub fn code_actions<T: Clone + ToOffset>( &self, buffer_handle: &Model<Buffer>, range: Range<T>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<CodeAction>>>

source

pub fn apply_code_action( &self, buffer_handle: Model<Buffer>, action: CodeAction, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ProjectTransaction>>

source

pub fn prepare_rename<T: ToPointUtf16>( &self, buffer: Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Option<Range<Anchor>>>>

source

pub fn perform_rename<T: ToPointUtf16>( &self, buffer: Model<Buffer>, position: T, new_name: String, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ProjectTransaction>>

source

pub fn on_type_format<T: ToPointUtf16>( &self, buffer: Model<Buffer>, position: T, trigger: String, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Option<Transaction>>>

source

pub fn inlay_hints<T: ToOffset>( &self, buffer_handle: Model<Buffer>, range: Range<T>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<InlayHint>>>

source

pub fn resolve_inlay_hint( &self, hint: InlayHint, buffer_handle: Model<Buffer>, server_id: LanguageServerId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<InlayHint>>

source

pub fn search( &self, query: SearchQuery, cx: &mut ModelContext<'_, Self> ) -> Receiver<(Model<Buffer>, Vec<Range<Anchor>>)>

source

pub fn search_local( &self, query: SearchQuery, cx: &mut ModelContext<'_, Self> ) -> Receiver<(Model<Buffer>, Vec<Range<Anchor>>)>

source

pub fn find_or_create_local_worktree( &mut self, abs_path: impl AsRef<Path>, visible: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<(Model<Worktree>, PathBuf)>>

source

pub fn find_local_worktree( &self, abs_path: &Path, cx: &AppContext ) -> Option<(Model<Worktree>, PathBuf)>

source

pub fn is_shared(&self) -> bool

source

pub fn remove_worktree( &mut self, id_to_remove: WorktreeId, cx: &mut ModelContext<'_, Self> )

source

pub fn set_active_path( &mut self, entry: Option<ProjectPath>, cx: &mut ModelContext<'_, Self> )

source

pub fn language_servers_running_disk_based_diagnostics( &self ) -> impl Iterator<Item = LanguageServerId> + '_

source

pub fn diagnostic_summary(&self, cx: &AppContext) -> DiagnosticSummary

source

pub fn diagnostic_summaries<'a>( &'a self, cx: &'a AppContext ) -> impl Iterator<Item = (ProjectPath, LanguageServerId, DiagnosticSummary)> + 'a

source

pub fn disk_based_diagnostics_started( &mut self, language_server_id: LanguageServerId, cx: &mut ModelContext<'_, Self> )

source

pub fn disk_based_diagnostics_finished( &mut self, language_server_id: LanguageServerId, cx: &mut ModelContext<'_, Self> )

source

pub fn active_entry(&self) -> Option<ProjectEntryId>

source

pub fn entry_for_path( &self, path: &ProjectPath, cx: &AppContext ) -> Option<Entry>

source

pub fn path_for_entry( &self, entry_id: ProjectEntryId, cx: &AppContext ) -> Option<ProjectPath>

source

pub fn absolute_path( &self, project_path: &ProjectPath, cx: &AppContext ) -> Option<PathBuf>

source

pub fn worktree_metadata_protos(&self, cx: &AppContext) -> Vec<WorktreeMetadata>

source

pub fn language_servers( &self ) -> impl '_ + Iterator<Item = (LanguageServerId, LanguageServerName, WorktreeId)>

source

pub fn supplementary_language_servers( &self ) -> impl '_ + Iterator<Item = (&LanguageServerId, &(LanguageServerName, Arc<LanguageServer>))>

source

pub fn language_server_for_id( &self, id: LanguageServerId ) -> Option<Arc<LanguageServer>>

source

pub fn language_servers_for_buffer( &self, buffer: &Buffer, cx: &AppContext ) -> impl Iterator<Item = (&Arc<CachedLspAdapter>, &Arc<LanguageServer>)>

source

pub fn language_server_for_buffer( &self, buffer: &Buffer, server_id: LanguageServerId, cx: &AppContext ) -> Option<(&Arc<CachedLspAdapter>, &Arc<LanguageServer>)>

Trait Implementations§

Auto Trait Implementations§

§

impl !RefUnwindSafe for Project

§

impl !Send for Project

§

impl !Sync for Project

§

impl Unpin for Project

§

impl !UnwindSafe for Project

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more