pub enum DiagnosticCode {
Show 19 variants
ParseError,
SyntaxError,
UnexpectedEof,
MissingStrict,
MissingWarnings,
UnusedVariable,
UndefinedVariable,
MissingPackageDeclaration,
DuplicatePackage,
DuplicateSubroutine,
MissingReturn,
BarewordFilehandle,
TwoArgOpen,
ImplicitReturn,
CriticSeverity1,
CriticSeverity2,
CriticSeverity3,
CriticSeverity4,
CriticSeverity5,
}Expand description
Stable diagnostic codes for Perl LSP.
Each code has a fixed string representation and associated metadata.
Variants§
ParseError
General parse error
SyntaxError
Syntax error
UnexpectedEof
Unexpected end-of-file
MissingStrict
Missing ‘use strict’ pragma
MissingWarnings
Missing ‘use warnings’ pragma
UnusedVariable
Unused variable
UndefinedVariable
Undefined variable
MissingPackageDeclaration
Missing package declaration
DuplicatePackage
Duplicate package declaration
DuplicateSubroutine
Duplicate subroutine definition
MissingReturn
Missing explicit return statement
BarewordFilehandle
Bareword filehandle usage
TwoArgOpen
Two-argument open() call
ImplicitReturn
Implicit return value
CriticSeverity1
Perl::Critic brutal (severity 1) violation
CriticSeverity2
Perl::Critic cruel (severity 2) violation
CriticSeverity3
Perl::Critic harsh (severity 3) violation
CriticSeverity4
Perl::Critic stern (severity 4) violation
CriticSeverity5
Perl::Critic gentle (severity 5) violation
Implementations§
Source§impl DiagnosticCode
impl DiagnosticCode
Sourcepub fn documentation_url(&self) -> Option<&'static str>
pub fn documentation_url(&self) -> Option<&'static str>
Get the documentation URL for this code, if available.
Sourcepub fn severity(&self) -> DiagnosticSeverity
pub fn severity(&self) -> DiagnosticSeverity
Get the default severity for this diagnostic code.
Get any diagnostic tags associated with this code.
Sourcepub fn from_message(msg: &str) -> Option<DiagnosticCode>
pub fn from_message(msg: &str) -> Option<DiagnosticCode>
Try to infer a diagnostic code from a message.
Sourcepub fn parse_code(code: &str) -> Option<DiagnosticCode>
pub fn parse_code(code: &str) -> Option<DiagnosticCode>
Try to parse a code string into a DiagnosticCode.
Source§impl DiagnosticCode
impl DiagnosticCode
Sourcepub fn category(&self) -> DiagnosticCategory
pub fn category(&self) -> DiagnosticCategory
Get the category of this diagnostic code.
Trait Implementations§
Source§impl Clone for DiagnosticCode
impl Clone for DiagnosticCode
Source§fn clone(&self) -> DiagnosticCode
fn clone(&self) -> DiagnosticCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more