pub struct Project {
pub include_paths: Vec<PathBuf>,
pub severities: SeverityMap,
/* private fields */
}Fields§
§include_paths: Vec<PathBuf>§severities: SeverityMapImplementations§
Source§impl Project
impl Project
pub fn set_include_paths(&mut self, include_paths: Vec<String>)
pub fn add_file(&mut self, file_name: String) -> Result<(), Error>
Sourcepub fn add_file_with_text(
&mut self,
file_name: PathBuf,
text: String,
file_type: FileType,
)
pub fn add_file_with_text( &mut self, file_name: PathBuf, text: String, file_type: FileType, )
Adds a file to the project with already given text. Re-evaluates the file, if the file is already present. Does not re-evaluate dependencies, if they are cached.
§Parameters
- file_name: The name of the file.
- text: The contents of the file.
- file_type: Defines how the file should be analyzed.
§Panics
If file_name does not point to a valid file.
pub fn remove_file(&mut self, path: &Path)
pub fn get_diagnostics( &self, path: &Path, ) -> Box<dyn Iterator<Item = &Diagnostic> + '_>
pub fn all_diagnostics(&self) -> impl Iterator<Item = &Diagnostic>
pub fn files(&self) -> impl Iterator<Item = &Path>
pub fn project_files(&self) -> impl Iterator<Item = &ProjectFile>
pub fn get_analysis(&self, path: &Path) -> Option<&AnalysisContext>
pub fn find_at_pos<'a>( &'a self, path: &Path, position: &Position, ) -> Option<ItemAtCursor<'a>>
pub fn document_reference( &self, path: &Path, reference: &Reference, ) -> Option<String>
pub fn get_node_position( &self, path: &Path, reference: &Reference, ) -> Option<(Span, Arc<Path>)>
pub fn get_root(&self, path: &Path) -> Option<&DtsFile>
pub fn get_file(&self, path: &Path) -> Option<&ProjectFile>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more