Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- licenseErrorSuggestion :: Text -> [(Text, Text)]
- licenseErrorAction :: Uri -> Diagnostic -> [CodeAction]
- licenseNames :: [Text]
- data Text
- data Diagnostic = Diagnostic {}
Documentation
licenseErrorSuggestion Source #
:: Text | Output of |
-> [(Text, Text)] | (Original (incorrect) license identifier, suggested replacement) |
Given a diagnostic returned by errorDiagnostic
,
provide possible corrections for SPDX license identifiers
based on the list specified in Cabal.
Results are sorted by best fit, and prefer solutions that have smaller
length distance to the original word.
>>>
take 2 $ licenseErrorSuggestion (T.pack "Unknown SPDX license identifier: 'BSD3'")
[("BSD3","BSD-3-Clause"),("BSD3","BSD-3-Clause-LBNL")]
:: Uri | File for which the diagnostic was generated |
-> Diagnostic | Output of |
-> [CodeAction] |
Given a diagnostic returned by errorDiagnostic
,
if it represents an "Unknown SPDX license identifier"-error along
with a suggestion, then return a CodeAction
for replacing the
the incorrect license identifier with the suggestion.
licenseNames :: [Text] Source #
License name of every license supported by cabal
Re-exports
A space efficient, packed, unboxed Unicode text type.
Instances
data Diagnostic #
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
Diagnostic | |
|