Logo fantomas

EditorConfig Module

Types and nested modules

Type/Module Description

Reflection

EditorConfigProblem

A setting in an `.editorconfig` that Fantomas read but could not act on.

Functions and values

Function or value Description

configToEditorConfig config

Full Usage: configToEditorConfig config

Parameters:
Returns: string
config : FormatConfig
Returns: string

isFantomasSetting setting

Full Usage: isFantomasSetting setting

Parameters:
Returns: bool

Whether a setting belongs to Fantomas rather than to editorconfig itself or to another tool. Matched without regard to case, as editorconfig matches keys.

setting : string
Returns: bool

isSpecDefinedNonValue setting value

Full Usage: isSpecDefinedNonValue setting value

Parameters:
Returns: bool

Whether a value is one the editorconfig spec gives a meaning that is not a value. `unset` says a setting from a parent file no longer applies, `indent_size = tab` says to follow `tab_width`, and `max_line_length = off` says there is no limit. Fantomas keeps its default for them without reporting a problem: they are not mistakes, and the library derives `indent_size = tab` on its own from `indent_style = tab`, so reporting them blames an author for something they never wrote. The setting and the value are both matched without regard to case, as editorconfig matches them. Only these exact values are excused. Anything else, `indent_size = banana` included, is a mistake and is reported like any other.

setting : string
value : string
Returns: bool

nearestSetting limit setting

Full Usage: nearestSetting limit setting

Parameters:
    limit : int
    setting : string

Returns: string option

The supported setting closest to `setting`, when one is within `limit` edits of it. Two candidates the same distance away are separated by the order of `supportedSettings`.

limit : int
setting : string
Returns: string option

parseOptionsFromEditorConfig fallbackConfig editorConfigProperties

Full Usage: parseOptionsFromEditorConfig fallbackConfig editorConfigProperties

Parameters:
Returns: FormatConfig * EditorConfigProblem list

Read a `FormatConfig` from editorconfig properties, falling back to `fallbackConfig` for anything the properties do not set. Keys and values are both matched without regard to case, as editorconfig defines them, and when two keys fold onto one the last wins. Returns the settings it could not act on alongside the configuration, each named the way it was written, so the caller can decide whether and how to report them.

fallbackConfig : FormatConfig
editorConfigProperties : IReadOnlyDictionary<string, string>
Returns: FormatConfig * EditorConfigProblem list

settingValues config

Full Usage: settingValues config

Parameters:
Returns: (string * string) list

Every setting of a configuration, under the name it is written with and with its value spelled the way an `.editorconfig` would carry it, in record field order.

config : FormatConfig
Returns: (string * string) list

supportedSettings

Full Usage: supportedSettings

Returns: string list

Every .editorconfig setting this build of Fantomas understands, in the order they are worth reading: the settings editorconfig itself defines first, then the ones belonging to Fantomas, each group ordered without regard to case. The former keep their upstream names and are not prefixed, the latter all carry the `fsharp_` prefix.

Returns: string list

toEditorConfigName value

Full Usage: toEditorConfigName value

Parameters:
Returns: string
value : char seq
Returns: string

Type something to start searching.