pub struct DiagnosticsProvider { /* private fields */ }Expand description
Diagnostics provider
Analyzes Perl source code and generates diagnostic messages for parse errors, scope issues, and lint warnings.
Implementations§
Source§impl DiagnosticsProvider
impl DiagnosticsProvider
Sourcepub fn new(ast: &Arc<Node>, source: String) -> DiagnosticsProvider
pub fn new(ast: &Arc<Node>, source: String) -> DiagnosticsProvider
Create a new diagnostics provider
Sourcepub fn get_diagnostics(
&self,
ast: &Arc<Node>,
parse_errors: &[ParseError],
source: &str,
module_resolver: Option<&dyn Fn(&str) -> bool>,
) -> Vec<Diagnostic>
pub fn get_diagnostics( &self, ast: &Arc<Node>, parse_errors: &[ParseError], source: &str, module_resolver: Option<&dyn Fn(&str) -> bool>, ) -> Vec<Diagnostic>
Generate diagnostics for the given AST
Analyzes the AST and parse errors to produce a list of diagnostics including parse errors, semantic issues, and lint warnings.
module_resolver is an optional callback used by the missing-module lint
(PL701). When Some, it is called with a bare module name and should return
true if the module is resolvable (workspace or configured include paths).
When None, the missing-module lint is skipped entirely.
Sourcepub fn get_diagnostics_with_path(
&self,
ast: &Arc<Node>,
parse_errors: &[ParseError],
source: &str,
module_resolver: Option<&dyn Fn(&str) -> bool>,
source_path: Option<&Path>,
) -> Vec<Diagnostic>
pub fn get_diagnostics_with_path( &self, ast: &Arc<Node>, parse_errors: &[ParseError], source: &str, module_resolver: Option<&dyn Fn(&str) -> bool>, source_path: Option<&Path>, ) -> Vec<Diagnostic>
Generate diagnostics for the given AST with optional source-path context.
Auto Trait Implementations§
impl Freeze for DiagnosticsProvider
impl RefUnwindSafe for DiagnosticsProvider
impl Send for DiagnosticsProvider
impl Sync for DiagnosticsProvider
impl Unpin for DiagnosticsProvider
impl UnsafeUnpin for DiagnosticsProvider
impl UnwindSafe for DiagnosticsProvider
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