Îõ³h&I“E‹¯      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ®  Safe-Inferred"ÂÚã"hls-cabal-pluginGiven a diagnostic returned by ë, if it represents an "Unknown SPDX license identifier"-error along with a suggestion, then return a ¯Ë for replacing the the incorrect license identifier with the suggestion.#hls-cabal-plugin0License name of every license supported by cabal$hls-cabal-pluginGiven a diagnostic returned by Ú, 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'")6[("BSD3","BSD-3-Clause"),("BSD3","BSD-3-Clause-LBNL")]"hls-cabal-plugin+File for which the diagnostic was generatedhls-cabal-plugin Output of $hls-cabal-plugin Output of hls-cabal-pluginÀ(Original (incorrect) license identifier, suggested replacement)! "#$$"#!  Safe-Inferredu%hls-cabal-pluginUTF-8 encoded bytestring  %%   Safe-Inferred"%Ôè b&hls-cabal-plugin.Produce a diagnostic from a Cabal parser error'hls-cabal-plugin0Produce a diagnostic from a Cabal parser warning°hls-cabal-pluginÛThe Cabal parser does not output a _range_ for a warning/error, only a single source code Ú. We define the range to be _from_ this position _to_ the first column of the next line.(hls-cabal-plugin Convert a  from Cabal to a ± that LSP understands.ìPrefer this function over hand-rolled unpacking/packing, since LSP is zero-based, while Cabal is one-based.,positionFromCabalPosition $ Lib.Position 1 1 Position 0 0²hls-cabal-plugin Create a ²hls-cabal-pluginCabal file pathhls-cabal-plugin$Where does the diagnostic come from?hls-cabal-pluginSeverityhls-cabal-plugin4Which source code range should the editor highlight?hls-cabal-plugin#The message displayed by the editor! &'(&'(!  Safe-Inferred ";ÌÚÜã…)hls-cabal-plugin:Where are the apostrophes around the item to be completed?*Ë means the item to complete already has the necessary apostrophes, while +Ç means, a closing apostrophe has to be added after the completion item.,hls-cabal-plugin3Information regarding the current completion status Example: "dir1/fi7 having been written to the file would correspond to: Ç completionPrefix = "dir1/fi" isStringNotation = LeftSide ... éWe define this type instead of simply using VFS.PosPrefixInfo since e.g. for filepaths we need more than just the word before the cursor (as can be seen above), since we want to capture the whole filepath before the cursor.óWe also use this type to wrap all information necessary to complete filepaths and other values in a cabal file..hls-cabal-plugintext prefix to complete/hls-cabal-pluginúDid the completion happen in the context of a string notation, i.e. are there apostrophes around the item to be completed0hls-cabal-plugin.the current position of the cursor in the file1hls-cabal-plugin(range where completion is to be inserted2hls-cabal-plugin#directory of the handled cabal file3hls-cabal-plugin"filename of the handled cabal file7hls-cabal-plugin Keyword context in a cabal file.5Used to decide whether to suggest values or keywords.8hls-cabal-pluginØKey word context, where a keyword occurs right before the current word to be completed9hls-cabal-pluginÖKeyword context where no keyword occurs right before the current word to be completed:hls-cabal-pluginÈContext inside a cabal file. Used to decide which keywords to suggest.;hls-cabal-plugin*Top level context in a cabal file such as author<hls-cabal-plugin(Nested context in a cabal file, such as library.•Stanzas have their own fields which differ from top-level fields. Each stanza must be named, such as 'executable exe', except for the main library.=hls-cabal-plugin3The context a cursor can be in within a cabal file.’We can be in stanzas or the top level, and additionally we can be in a context where we have already written a keyword but no value for it yetBhls-cabal-pluginßThis should never occur since we extract the word to lookup from the same map we look it up in.Chls-cabal-pluginßThis should never occur since we extract the word to lookup from the same map we look it up in.Ghls-cabal-plugin4Wraps a completion in apostrophes where appropriate.ØIf a completion starts with an apostrophe we want to end it with an apostrophe. If a completed filepath contains a space, it can only be written in the cabal file if it is wrapped in apostrophes, thus we wrap it.)+*,3210/.-456789:<;=>?@FEDCBAG@FEDCBA>?=:<;789654,3210/.-)+*G Safe-InferredÌÚÜcZhls-cabal-plugin.Contains information to be used by completers.\hls-cabal-pluginðAccess to the latest available generic package description for the handled cabal file, relevant for some completion actions which require the file's meta information such as the module completers which require access to source directories]hls-cabal-plugin8Prefix info to be used for constructing completion items^hls-cabal-plugin8The name of the stanza in which the completer is applied_hls-cabal-pluginîTakes information needed to build possible completion items and returns the list of possible completion itemsZ^]\[__Z^]\[ Safe-Inferred"Üþ`hls-cabal-pluginÓCompleter to be used when no completion suggestions are implemented for the fieldahls-cabal-pluginøCompleter to be used when no completion suggestions are implemented for the field and a log message should be emitted.bhls-cabal-pluginÐCompleter to be used when a simple set of values can be completed for a field.chls-cabal-plugin#Completer to be used for the field name: value. This is almost always the name of the cabal file. However, it is not forbidden by the specification to have a different name, it is just forbidden on hackage.dhls-cabal-pluginùCompleter to be used when a set of values with priority weights attached to some values are to be completed for a field.àThe higher the weight, the higher the priority to show the value in the completion suggestion.ÐIf the value does not occur in the weighted map its weight is defaulted to zero.ehls-cabal-pluginåCreates a CompletionItem with the given text as the label where the completion item kind is keyword.fhls-cabal-plugin‘Returns a CompletionItem with the given starting position and text to be inserted, where the displayed text is the same as the inserted text.ghls-cabal-plugin‡Returns a completionItem with the given starting position, text to be inserted and text to be displayed in the completion suggestion.`abcdefg`abcdefg Safe-Inferred"{ihls-cabal-plugin/Maps snippet triggerwords with their completershijihj Safe-Inferred&³ khls-cabal-plugin5Information used to query and build path completions.ÖNote that pathSegment combined with queryDirectory results in the original prefix.*Example: When given the written prefix,  dir1/dir2/fi., the resulting PathCompletionInfo would be:  pathSegment = "fi" queryDirectory = "dir1/dir2/fi" ... mhls-cabal-plugin4Partly written segment of the next part of the path.nhls-cabal-plugin&Written part of path, in posix format.ohls-cabal-pluginÏDirectory relative to which relative paths are interpreted, platform dependent.phls-cabal-pluginòDid the completion happen in the context of a string notation, if yes, contains the state of the string notation.qhls-cabal-pluginéTakes an optional source subdirectory and a prefix info and creates a path completion info accordingly.ëThe source directory represents some subdirectory of the working directory such as a path from the field hs-source-dirs.€If the source subdirectory is empty, then the working directory is simply set to the currently handled cabal file's directory.rhls-cabal-plugin6Extracts the source directories of the library stanza.shls-cabal-pluginÍExtracts the source directories of the executable stanza with the given name.thls-cabal-pluginÍExtracts the source directories of the test suite stanza with the given name.uhls-cabal-pluginÈExtracts the source directories of benchmark stanza with the given name.vhls-cabal-pluginÁTakes a possible stanza name, a GenericPackageDescription, a function to access the stanza information we are interested in and a function to access the build info from the specific stanza.ÕReturns a list of relative source directory paths specified for the extracted stanza. kponmlqrstuv kponmlqrstuv  Safe-InferredÜã/£yhls-cabal-pluginòCompleter to be used when a file path can be completed for a field. Completes file paths as well as directories.{hls-cabal-pluginãCompleter to be used when a directory can be completed for the field. Only completes directories.|hls-cabal-pluginTakes a PathCompletionInfo and returns the list of files and directories in the directory which match the path completion info in posix style.ÐThe directories end with a posix trailing path separator. Since this is used for completions to be written to the cabal file, we use posix separators here. See Note [Using correct file path separators].}hls-cabal-pluginâReturns a list of all (and only) directories in the directory described by path completion info.~hls-cabal-pluginêReturns the directory where files and directories can be queried from for the passed PathCompletionInfo.òReturns the full path to the directory pointed to by the path prefix by combining it with the working directory.„Since this is used for querying paths we use platform compatible separators here. See Note [Using correct file path separators].hls-cabal-plugin‚Returns the full path for the given path segment by combining the working directory with the path prefix and the path segment.„Since this is used for querying paths we use platform compatible separators here. See Note [Using correct file path separators].€hls-cabal-pluginÇTakes a PathCompletionInfo and a directory and returns the complete cabal path to be written on completion action by combining the previously written path prefix and the completed path segment.ñSince this is used for completions we use posix separators here. See Note [Using correct file path separators].hls-cabal-pluginëTakes a PathCompletionInfo and a completed path segment and generates the whole filepath to be completed.§The returned text combines the completion with a relative path generated from a possible previously written path prefix and is relative to the cabal file location.If the completion results in a filepath, we know this is a completed path and can thus apply wrapping of apostrophes if needed. yz{|}~€ yz{|}~€  Safe-Inferred"5`‚hls-cabal-pluginÆCompleter to be used when module paths can be completed for the field.àTakes an extraction function which extracts the source directories to be used by the completer.ƒhls-cabal-pluginžTakes a list of source directories and returns a list of path completions relative to any of the passed source directories which fit the passed prefix info.„hls-cabal-pluginÇTakes a pathCompletionInfo and a path segment and generates the whole filepath to be written on completion including a possibly already written prefix; using the cabal syntax for exposed modules.õExamples: When the partial directory path `Dir.Dir2.` is stored in the PathCompletionInfo and the completed file Å is passed along with that PathCompletionInfo, the result would be éWhen the partial directory path `Dir.` is stored in the PathCompletionInfo and the completed directory Dir2Ñ is passed along with that PathCompletionInfo, the result would be `Dir1.Dir2.`…hls-cabal-plugin£Takes a source directory path and a module path and returns the module path relative to the source directory in exposed module syntax where the separators are ³" and the file ending is removed. Synopsis: … sourceDir modPath.†hls-cabal-pluginßTakes a path in the exposed module syntax and translates it to a platform-compatible file path.‚ƒ„…†‚ƒ„…†  Safe-Inferred"Ü7æ‡hls-cabal-pluginÆKeyword for cabal version; required to be the top line in a cabal fileˆhls-cabal-plugin#Top level keywords of a cabal file.ãTODO: we could add descriptions of field values and then show them when inside the field's context‰hls-cabal-pluginìMap, containing all stanzas in a cabal file as keys and lists of their possible nested keywords as values.’hls-cabal-pluginÐContains a map of the most commonly used licenses, weighted by their popularity.ÓThe data was extracted by Kleidukos from the alternative hackage frontend flora.pm. ‡ˆ‰Š‹ŒŽ‘’“ ‡ˆ‰Š‹ŒŽ‘’“  Safe-Inferred"Ü@ ”hls-cabal-pluginïTakes information about the completion context within the file and finds the correct completer to be applied.•hls-cabal-pluginúTakes prefix info about the previously written text and a rope (representing a file), returns the corresponding context.&Can return Nothing if an error occurs.5TODO: first line can only have cabal-version: keyword–hls-cabal-plugin³Takes information about the current file's file path, and the cursor position in the file; and builds a CabalPrefixInfo with the prefix up to that cursor position. Checks whether a suffix needs to be completed and calculates the range in the document where the completion action should be applied.´hls-cabal-pluginÎTakes prefix info about the previously written text, a list of lines (representing a file) and a map of keywords and returns a keyword context if the previously written keyword matches one in the map.ªFrom a cursor position, we traverse the cabal file upwards to find the latest written keyword if there is any. Values may be written on subsequent lines, in order to allow for this we take the indentation of the current word to be completed into account to find the correct keyword context.µhls-cabal-plugin¼Traverse the given lines (starting before current cursor position up to the start of the file) to find the nearest stanza declaration, if none is found we are in the top level context.˜TODO: this could be merged with getKeyWordContext in order to increase performance by reducing the number of times we have to traverse the cabal file.¶hls-cabal-plugin’Get all lines before the given cursor position in the given file and reverse their order to traverse backwards starting from the given position.·hls-cabal-pluginÒTakes a line of text and removes the last partially written word to be completed.¸hls-cabal-pluginÄCalculates how many spaces the currently completed item is indented.”•–”•–  Safe-Inferred"%'1;ÁÂÃÌÔÚãèE[¹hls-cabal-plugin±Cabal files that are currently open in the lsp-client. Specific actions happen when these files are saved, closed or modified, such as generating diagnostics, re-parsing, etc...ŸWe need to store the open files to parse them again if we restart the shake session. Restarting of the shake session happens whenever these files are modified.ºhls-cabal-plugin¸Helper function to restart the shake session, specifically for modifying .cabal files. No special logic, just group up a bunch of functions you need for the base Notification Handlers.¤To make sure diagnostics are up to date, we need to tell shake that the file was touched and needs to be re-parsed. That's what we do when we record the dirty key that our parsing rule depends on. Then we restart the shake session, so that changes to our virtual files are actually picked up.»hls-cabal-plugin®This is the kick function for the cabal plugin. We run this action, whenever we shake session us run/restarted, which triggers actions to produce diagnostics for cabal files.çIt is paramount that this kick-function can be run quickly, since it is a blocking function invocation.¼hls-cabal-plugin6The rule that initialises the files of interest state.Needs to be run on start-up. —™ ˜š›œžŸ¡ ¡—™ ˜š›œžŸ½ !""#$%&%&'('()*)*+,-./01234534534634734834934:34;34<34=34>?@ABCDEFGHHIJKLMNOPQRSTUVWXYYZ[\]^_`abcdefghijklmnopqrsttuvwxyz{|}~€‚ƒ„„…†‡ˆ‰Š‹ŒŽ ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® Z ¯ ° ± ² ³ ´ µ ¶ · ¸ d ¹ º » ¼ ½ ¾ ¿ À Á  à m3ÄÅÆ3ÇÈÉÊ Ë Ì Í Î Ï Ð Ñ Ò ÓÔ/hls-cabal-plugin-2.2.0.0-A4rBCcpLGvNCUnAbpIikgrIde.Plugin.Cabal.ParseIde.Plugin.Cabal.LicenseSuggestIde.Plugin.Cabal.Diagnostics!Ide.Plugin.Cabal.Completion.Types+Ide.Plugin.Cabal.Completion.Completer.Types,Ide.Plugin.Cabal.Completion.Completer.Simple-Ide.Plugin.Cabal.Completion.Completer.Snippet+Ide.Plugin.Cabal.Completion.Completer.Paths.Ide.Plugin.Cabal.Completion.Completer.FilePath,Ide.Plugin.Cabal.Completion.Completer.Module Ide.Plugin.Cabal.Completion.Data'Ide.Plugin.Cabal.Completion.CompletionsIde.Plugin.CabalIde.Plugin.Cabal.DiagerrorDiagnostic HaskellFilehs Dir1.Dir2baseGHC.BaseNonEmpty:|,Cabal-syntax-3.10.1.0-CzFvy6Vr4NPEeFMO9pQqoE,Distribution.Types.GenericPackageDescriptioncondBenchmarkscondTestSuitescondExecutablescondForeignLibscondSubLibraries condLibrarygenPackageFlagsgpdScannedVersionpackageDescriptionGenericPackageDescriptionDistribution.Types.VersionVersionDistribution.Parsec.ErrorPErrorDistribution.Parsec.WarningPWarningDistribution.Parsec.PositionPositionGHC.IOFilePath text-1.2.5.0Data.Text.InternalText%ghcide-2.2.0.0-819SeHFKsrb5Nl5zRK3Fdr!Development.IDE.Types.DiagnosticsFileDiagnostic(lsp-types-2.0.2.0-5pNSiFGKhkt7TIYGwBRGRu/Language.LSP.Protocol.Internal.Types.Diagnostic Diagnostic$sel:_range:Diagnostic$sel:_severity:Diagnostic$sel:_code:Diagnostic $sel:_codeDescription:Diagnostic$sel:_source:Diagnostic$sel:_message:Diagnostic$sel:_tags:Diagnostic#$sel:_relatedInformation:Diagnostic$sel:_data_:DiagnosticlicenseErrorAction licenseNameslicenseErrorSuggestionparseCabalFileContentswarningDiagnosticpositionFromCabalPosition Apostrophe SurroundedLeftSideCabalPrefixInfocompletionPrefixisStringNotationcompletionCursorPositioncompletionRangecompletionWorkingDircompletionFileName StanzaType StanzaName KeyWordName FieldContextKeyWordNone StanzaContextTopLevelStanzaContext ParseCabalLogLogFileSplitErrorLogUnknownKeyWordInContextError"LogUnknownStanzaNameInContextErrorLogFilePathCompleterIOErrorLogUseWithStaleFastNoResultLogMapLookUpOfKnownKeyFailedapplyStringNotation$fNFDataParseCabal$fHashableParseCabal $fPrettyLog$fEqCabalPrefixInfo$fShowCabalPrefixInfo$fEqApostrophe$fOrdApostrophe$fShowApostrophe$fEqStanzaContext$fShowStanzaContext$fReadStanzaContext $fShowLog$fEqFieldContext$fShowFieldContext$fReadFieldContext$fEqParseCabal$fShowParseCabal$fGenericParseCabal CompleterData getLatestGPDcabalPrefixInfo stanzaName Completer noopCompletererrorNoopCompleterconstantCompleter nameCompleterweightedConstantCompletermkDefaultCompletionItemmkSimpleCompletionItemmkCompletionItem TriggerWordsnippetCompleter snippetMapPathCompletionInfo pathSegmentqueryDirectoryworkingDirectoryisStringNotationPath%pathCompletionInfoFromCabalPrefixInfosourceDirsExtractionLibrarysourceDirsExtractionExecutablesourceDirsExtractionTestSuitesourceDirsExtractionBenchmarkextractRelativeDirsFromStanza$fEqPathCompletionInfo$fShowPathCompletionInfofilePathCompletermainIsCompleterdirectoryCompleterlistFileCompletionslistDirectoryCompletionsmkCompletionDirectory mkDirFromCWDmkPathCompletionDirmkFilePathCompletionmodulesCompleterfilePathsForExposedModulesmkExposedModulePathCompletionfpToExposedModulePathexposedModulePathToFpcabalVersionKeyword cabalKeywordsstanzaKeywordMap libraryFieldsexecutableFieldstestSuiteFieldsbenchmarkFieldsforeignLibraryFieldssourceRepositoryFields flagFieldslibExecTestBenchCommonsweightedLicenseNames ghcOptionscontextToCompleter getContextgetCabalPrefixInfoLogModificationTimeLogShake LogDocOpenedLogDocModified LogDocSaved LogDocClosedLogFOILogCompletionContextLogCompletions descriptor#$fIsIdeGlobalTYPEOfInterestCabalVar$fNFDataIsCabalFileOfInterest$fHashableIsCabalFileOfInterest!$fNFDataCabalFileOfInterestResult#$fHashableCabalFileOfInterestResult$fEqCabalFileOfInterestResult$fShowCabalFileOfInterestResult"$fGenericCabalFileOfInterestResult$fEqIsCabalFileOfInterest$fShowIsCabalFileOfInterest$fGenericIsCabalFileOfInterest/Language.LSP.Protocol.Internal.Types.CodeAction CodeActiontoBeginningOfNextLine*Language.LSP.Protocol.Internal.Types.RangeRangemkDiag.getKeyWordContext currentLevelsplitAtPositionstripPartiallyWrittencompletionIndentationOfInterestCabalVarrestartCabalShakeSessionkickofInterestRules