pub struct Project { /* private fields */ }
Implementations§
source§impl Project
impl Project
pub fn create_terminal( &mut self, working_directory: Option<PathBuf>, window: AnyWindowHandle, cx: &mut ModelContext<'_, Self> ) -> Result<Model<Terminal>>
pub fn find_activate_script_path( &mut self, settings: &VenvSettingsContent<'_>, working_directory: Option<PathBuf> ) -> Option<PathBuf>
pub fn local_terminal_handles(&self) -> &Vec<WeakModel<Terminal>>
source§impl Project
impl Project
pub fn init_settings(cx: &mut AppContext)
pub fn init(client: &Arc<Client>, cx: &mut AppContext)
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>
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>>
pub fn buffer_for_id(&self, remote_id: u64) -> Option<Model<Buffer>>
pub fn languages(&self) -> &Arc<LanguageRegistry>
pub fn client(&self) -> Arc<Client>
pub fn user_store(&self) -> Model<UserStore>
pub fn opened_buffers(&self) -> Vec<Model<Buffer>>
pub fn fs(&self) -> &Arc<dyn Fs>
pub fn remote_id(&self) -> Option<u64>
pub fn replica_id(&self) -> ReplicaId
pub fn collaborators(&self) -> &HashMap<PeerId, Collaborator>
pub fn host(&self) -> Option<&Collaborator>
sourcepub fn worktrees<'a>(
&'a self
) -> impl 'a + DoubleEndedIterator<Item = Model<Worktree>>
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
sourcepub fn visible_worktrees<'a>(
&'a self,
cx: &'a AppContext
) -> impl 'a + DoubleEndedIterator<Item = Model<Worktree>>
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
pub fn worktree_root_names<'a>( &'a self, cx: &'a AppContext ) -> impl Iterator<Item = &'a str>
pub fn worktree_for_id( &self, id: WorktreeId, cx: &AppContext ) -> Option<Model<Worktree>>
pub fn worktree_for_entry( &self, entry_id: ProjectEntryId, cx: &AppContext ) -> Option<Model<Worktree>>
pub fn worktree_id_for_entry( &self, entry_id: ProjectEntryId, cx: &AppContext ) -> Option<WorktreeId>
pub fn contains_paths(&self, paths: &[PathBuf], cx: &AppContext) -> bool
pub fn contains_path(&self, path: &Path, cx: &AppContext) -> bool
pub fn create_entry( &mut self, project_path: impl Into<ProjectPath>, is_directory: bool, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<Entry>>>
pub fn copy_entry( &mut self, entry_id: ProjectEntryId, new_path: impl Into<Arc<Path>>, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<Entry>>>
pub fn rename_entry( &mut self, entry_id: ProjectEntryId, new_path: impl Into<Arc<Path>>, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<Entry>>>
pub fn delete_entry( &mut self, entry_id: ProjectEntryId, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<()>>>
pub fn expand_entry( &mut self, worktree_id: WorktreeId, entry_id: ProjectEntryId, cx: &mut ModelContext<'_, Self> ) -> Option<Task<Result<()>>>
pub fn rejoined( &mut self, message: RejoinedProject, message_id: u32, cx: &mut ModelContext<'_, Self> ) -> Result<()>
pub fn disconnected_from_host(&mut self, cx: &mut ModelContext<'_, Self>)
pub fn close(&mut self, cx: &mut ModelContext<'_, Self>)
pub fn is_read_only(&self) -> bool
pub fn is_local(&self) -> bool
pub fn is_remote(&self) -> bool
pub fn create_buffer( &mut self, text: &str, language: Option<Arc<Language>>, cx: &mut ModelContext<'_, Self> ) -> Result<Model<Buffer>>
pub fn open_path( &mut self, path: impl Into<ProjectPath>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<(ProjectEntryId, AnyModel)>>
pub fn open_local_buffer( &mut self, abs_path: impl AsRef<Path>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>
pub fn open_buffer( &mut self, path: impl Into<ProjectPath>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>
sourcepub 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>>>
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
pub fn open_buffer_by_id( &mut self, id: u64, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>
pub fn save_buffers( &self, buffers: HashSet<Model<Buffer>>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn save_buffer( &self, buffer: Model<Buffer>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn save_buffer_as( &mut self, buffer: Model<Buffer>, abs_path: PathBuf, cx: &mut ModelContext<'_, Self> ) -> Task<Result<()>>
pub fn get_open_buffer( &mut self, path: &ProjectPath, cx: &mut ModelContext<'_, Self> ) -> Option<Model<Buffer>>
pub fn set_language_for_buffer( &mut self, buffer: &Model<Buffer>, new_language: Arc<Language>, cx: &mut ModelContext<'_, Self> )
pub fn restart_language_servers_for_buffers( &mut self, buffers: impl IntoIterator<Item = Model<Buffer>>, cx: &mut ModelContext<'_, Self> ) -> Option<()>
pub fn language_server_statuses( &self ) -> impl DoubleEndedIterator<Item = &LanguageServerStatus>
pub fn update_diagnostics( &mut self, language_server_id: LanguageServerId, params: PublishDiagnosticsParams, disk_based_sources: &[String], cx: &mut ModelContext<'_, Self> ) -> Result<()>
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>
pub fn reload_buffers( &self, buffers: HashSet<Model<Buffer>>, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ProjectTransaction>>
pub fn format( &mut self, buffers: HashSet<Model<Buffer>>, push_to_history: bool, trigger: FormatTrigger, cx: &mut ModelContext<'_, Project> ) -> Task<Result<ProjectTransaction>>
pub fn definition<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<LocationLink>>>
pub fn type_definition<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<LocationLink>>>
pub fn references<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<Location>>>
pub fn document_highlights<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<DocumentHighlight>>>
pub fn symbols( &self, query: &str, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<Symbol>>>
pub fn open_buffer_for_symbol( &mut self, symbol: &Symbol, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Model<Buffer>>>
pub fn hover<T: ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Option<Hover>>>
pub fn completions<T: ToOffset + ToPointUtf16>( &self, buffer: &Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<Completion>>>
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>>>
pub fn code_actions<T: Clone + ToOffset>( &self, buffer_handle: &Model<Buffer>, range: Range<T>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<CodeAction>>>
pub fn apply_code_action( &self, buffer_handle: Model<Buffer>, action: CodeAction, push_to_history: bool, cx: &mut ModelContext<'_, Self> ) -> Task<Result<ProjectTransaction>>
pub fn prepare_rename<T: ToPointUtf16>( &self, buffer: Model<Buffer>, position: T, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Option<Range<Anchor>>>>
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>>
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>>>
pub fn inlay_hints<T: ToOffset>( &self, buffer_handle: Model<Buffer>, range: Range<T>, cx: &mut ModelContext<'_, Self> ) -> Task<Result<Vec<InlayHint>>>
pub fn resolve_inlay_hint( &self, hint: InlayHint, buffer_handle: Model<Buffer>, server_id: LanguageServerId, cx: &mut ModelContext<'_, Self> ) -> Task<Result<InlayHint>>
pub fn search( &self, query: SearchQuery, cx: &mut ModelContext<'_, Self> ) -> Receiver<(Model<Buffer>, Vec<Range<Anchor>>)>
pub fn search_local( &self, query: SearchQuery, cx: &mut ModelContext<'_, Self> ) -> Receiver<(Model<Buffer>, Vec<Range<Anchor>>)>
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)>>
pub fn find_local_worktree( &self, abs_path: &Path, cx: &AppContext ) -> Option<(Model<Worktree>, PathBuf)>
pub fn remove_worktree( &mut self, id_to_remove: WorktreeId, cx: &mut ModelContext<'_, Self> )
pub fn set_active_path( &mut self, entry: Option<ProjectPath>, cx: &mut ModelContext<'_, Self> )
pub fn language_servers_running_disk_based_diagnostics( &self ) -> impl Iterator<Item = LanguageServerId> + '_
pub fn diagnostic_summary(&self, cx: &AppContext) -> DiagnosticSummary
pub fn diagnostic_summaries<'a>( &'a self, cx: &'a AppContext ) -> impl Iterator<Item = (ProjectPath, LanguageServerId, DiagnosticSummary)> + 'a
pub fn disk_based_diagnostics_started( &mut self, language_server_id: LanguageServerId, cx: &mut ModelContext<'_, Self> )
pub fn disk_based_diagnostics_finished( &mut self, language_server_id: LanguageServerId, cx: &mut ModelContext<'_, Self> )
pub fn active_entry(&self) -> Option<ProjectEntryId>
pub fn entry_for_path( &self, path: &ProjectPath, cx: &AppContext ) -> Option<Entry>
pub fn path_for_entry( &self, entry_id: ProjectEntryId, cx: &AppContext ) -> Option<ProjectPath>
pub fn absolute_path( &self, project_path: &ProjectPath, cx: &AppContext ) -> Option<PathBuf>
pub fn worktree_metadata_protos(&self, cx: &AppContext) -> Vec<WorktreeMetadata>
pub fn language_servers( &self ) -> impl '_ + Iterator<Item = (LanguageServerId, LanguageServerName, WorktreeId)>
pub fn supplementary_language_servers( &self ) -> impl '_ + Iterator<Item = (&LanguageServerId, &(LanguageServerName, Arc<LanguageServer>))>
pub fn language_server_for_id( &self, id: LanguageServerId ) -> Option<Arc<LanguageServer>>
pub fn language_servers_for_buffer( &self, buffer: &Buffer, cx: &AppContext ) -> impl Iterator<Item = (&Arc<CachedLspAdapter>, &Arc<LanguageServer>)>
pub fn language_server_for_buffer( &self, buffer: &Buffer, server_id: LanguageServerId, cx: &AppContext ) -> Option<(&Arc<CachedLspAdapter>, &Arc<LanguageServer>)>
Trait Implementations§
impl EventEmitter<Event> for Project
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more