Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Interaction.Highlighting.Generate

Description

Generates data used for precise syntax highlighting.

Synopsis

- data Level
  - = Full
  - | Partial
- generateAndPrintSyntaxInfo :: Declaration -> Level -> TCM ()
- generateTokenInfo :: AbsolutePath -> TCM CompressedFile
- generateTokenInfoFromString :: Range -> String -> TCM CompressedFile
- printSyntaxInfo :: Range -> TCM ()
- printErrorInfo :: TCErr -> TCM ()
- errorHighlighting :: TCErr -> TCM File
- printUnsolvedInfo :: TCM ()
- printHighlightingInfo :: MonadTCM tcm => HighlightingInfo -> tcm ()
- highlightAsTypeChecked :: MonadTCM tcm => Range -> Range -> tcm a -> tcm a
- computeUnsolvedMetaWarnings :: TCM File
- computeUnsolvedConstraints :: TCM File
- storeDisambiguatedName :: QName -> TCM ()

# Documentation

data Level #

Highlighting levels.

Constructors

Full | Full highlighting. Should only be used after typechecking has completed successfully.
Partial | Highlighting without disambiguation of overloaded constructors.

generateAndPrintSyntaxInfo :: Declaration -> Level -> TCM () #

Generate syntax highlighting information for the given declaration, and (if appropriate) print it. If the `HighlightingLevel` is ``Full``, then the state is additionally updated with the new highlighting info (in case of a conflict new info takes precedence over old info).

The procedure makes use of some of the token highlighting info in `stTokens` (that corresponding to the interval covered by the declaration). If the `HighlightingLevel` is ``Full``, then this token highlighting info is additionally removed from `stTokens`.

generateTokenInfo #

Arguments

:: AbsolutePath | The module to highlight.
-> TCM CompressedFile |

Generate and return the syntax highlighting information for the tokens in the given file.

generateTokenInfoFromString :: Range -> String -> TCM CompressedFile #

Same as `generateTokenInfo` but takes a string instead of a filename.

printSyntaxInfo :: Range -> TCM () #

printErrorInfo :: TCErr -> TCM () #

Prints syntax highlighting info for an error.

errorHighlighting :: TCErr -> TCM File #

Generate highlighting for error. Does something special for termination errors.

printUnsolvedInfo :: TCM () #

Generates and prints syntax highlighting information for unsolved meta-variables and certain unsolved constraints.

printHighlightingInfo :: MonadTCM tcm => HighlightingInfo -> tcm () #

Lispify and print the given highlighting information.

highlightAsTypeChecked :: MonadTCM tcm => Range -> Range -> tcm a -> tcm a #

`highlightAsTypeChecked rPre r m` runs `m` and returns its result. Additionally, some code may be highlighted:

- If `r` is non-empty and not a sub-range of `rPre` (after `continuousPerLine` has been applied to both): `r` is highlighted as being type-checked while `m` is running (this highlighting is removed if `m` completes successfully).
- Otherwise: Highlighting is removed for `rPre - r` before `m` runs, and if `m` completes successfully, then `rPre - r` is highlighted as being type-checked.

computeUnsolvedMetaWarnings :: TCM File #

Generates syntax highlighting information for unsolved meta variables.

computeUnsolvedConstraints :: TCM File #

Generates syntax highlighting information for unsolved constraints that are not connected to a meta variable.

storeDisambiguatedName :: QName -> TCM () #

Remember a name disambiguation (during type checking). To be used later during syntax highlighting.