hls-cabal-plugin-0.1.0.0: Cabal integration plugin with Haskell Language Server
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ide.Plugin.Cabal.LicenseSuggest

Contents

Synopsis

Documentation

licenseErrorSuggestion Source #

Arguments

:: Text

Output of errorDiagnostic

-> [(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")]

licenseErrorAction Source #

Arguments

:: Uri

File for which the diagnostic was generated

-> Diagnostic

Output of errorDiagnostic

-> [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.

Re-exports

data Text #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
Structured Text 
Instance details

Defined in Distribution.Utils.Structured

Chunk Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

Associated Types

type ChunkElem Text #

Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Text -> Int #

hash :: Text -> Int #

Ixed Text 
Instance details

Defined in Control.Lens.At

AsJSON Text 
Instance details

Defined in Data.Aeson.Lens

Methods

_JSON :: (FromJSON a, ToJSON b) => Prism Text Text a b #

AsNumber Text 
Instance details

Defined in Data.Aeson.Lens

AsValue Text 
Instance details

Defined in Data.Aeson.Lens

IsKey Text 
Instance details

Defined in Data.Aeson.Lens

Methods

_Key :: Iso' Text Key #

Stream Text 
Instance details

Defined in Text.Megaparsec.Stream

Associated Types

type Token Text #

type Tokens Text #

TraversableStream Text 
Instance details

Defined in Text.Megaparsec.Stream

VisualStream Text 
Instance details

Defined in Text.Megaparsec.Stream

Pretty Text

Automatically converts all newlines to line.

>>> pretty ("hello\nworld" :: Text)
hello
world

Note that line can be undone by group:

>>> group (pretty ("hello\nworld" :: Text))
hello world

Manually use hardline if you definitely want newlines.

Instance details

Defined in Prettyprinter.Internal

Methods

pretty :: Text -> Doc ann #

prettyList :: [Text] -> Doc ann #

Extract Text

Since: regex-base-0.94.0.0

Instance details

Defined in Text.Regex.Base.RegexLike

Methods

before :: Int -> Text -> Text #

after :: Int -> Text -> Text #

empty :: Text #

extract :: (Int, Int) -> Text -> Text #

Stream (NoShareInput Text) 
Instance details

Defined in Text.Megaparsec.Stream

Associated Types

type Token (NoShareInput Text) #

type Tokens (NoShareInput Text) #

Stream (ShareInput Text) 
Instance details

Defined in Text.Megaparsec.Stream

Associated Types

type Token (ShareInput Text) #

type Tokens (ShareInput Text) #

type ChunkElem Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

type State Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

type State Text = Buffer
type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char
type Index Text 
Instance details

Defined in Control.Lens.At

type Index Text = Int
type IxValue Text 
Instance details

Defined in Control.Lens.At

type Token Text 
Instance details

Defined in Text.Megaparsec.Stream

type Tokens Text 
Instance details

Defined in Text.Megaparsec.Stream

type Token (NoShareInput Text) 
Instance details

Defined in Text.Megaparsec.Stream

type Token (ShareInput Text) 
Instance details

Defined in Text.Megaparsec.Stream

type Tokens (NoShareInput Text) 
Instance details

Defined in Text.Megaparsec.Stream

type Tokens (ShareInput Text) 
Instance details

Defined in Text.Megaparsec.Stream

data Diagnostic #

Instances

Instances details
FromJSON Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

ToJSON Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Generic Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Associated Types

type Rep Diagnostic :: Type -> Type #

Read Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Show Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

NFData Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Methods

rnf :: Diagnostic -> () #

Eq Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Ord Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

type Rep Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic