Skip to main content

Project

Struct Project 

Source
pub struct Project {
    pub include_paths: Vec<PathBuf>,
    pub severities: SeverityMap,
    /* private fields */
}

Fields§

§include_paths: Vec<PathBuf>§severities: SeverityMap

Implementations§

Source§

impl Project

Source

pub fn set_include_paths(&mut self, include_paths: Vec<String>)

Source

pub fn add_file(&mut self, file_name: String) -> Result<(), Error>

Source

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.

Source

pub fn remove_file(&mut self, path: &Path)

Source

pub fn get_diagnostics( &self, path: &Path, ) -> Box<dyn Iterator<Item = &Diagnostic> + '_>

Source

pub fn all_diagnostics(&self) -> impl Iterator<Item = &Diagnostic>

Source

pub fn files(&self) -> impl Iterator<Item = &Path>

Source

pub fn project_files(&self) -> impl Iterator<Item = &ProjectFile>

Source

pub fn get_analysis(&self, path: &Path) -> Option<&AnalysisContext>

Source

pub fn find_at_pos<'a>( &'a self, path: &Path, position: &Position, ) -> Option<ItemAtCursor<'a>>

Source

pub fn document_reference( &self, path: &Path, reference: &Reference, ) -> Option<String>

Source

pub fn get_node_position( &self, path: &Path, reference: &Reference, ) -> Option<(Span, Arc<Path>)>

Source

pub fn get_root(&self, path: &Path) -> Option<&DtsFile>

Source

pub fn get_file(&self, path: &Path) -> Option<&ProjectFile>

Trait Implementations§

Source§

impl Default for Project

Source§

fn default() -> Project

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.