Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Config

Handle the configuration. This includes reading the configurations files, add configurations, update configurations, removing old configurations and etc.

export
class

Config

Hierarchy

  • Config

Index

Constructors

constructor

Properties

config

config: WorkspaceConfiguration = vs.workspace.getConfiguration("EasyDoc")

The configurations for EasyDoc found by vscode settings.

dir

dir: string = vs.extensions.getExtension("Torphage.easydoc").extensionPath

The absolute directory of where the extension is installed.

packageFiles

packageFiles: IPackage

The configurations for EasyDoc found in package.json.

Methods

addConfig

  • addConfig(configName: string): void
  • Dynamically add configurationa to the package.json, only do this to be able to add configurations to the vscode config file instead of having my own.

    memberof

    Config

    Parameters

    • configName: string

      The name of the configuration to be added.

    Returns void

addMissingKeys

  • addMissingKeys(fileConfig: string, missingKeys: Array<object>): void
  • Add the missing keys to a specific configuration.

    memberof

    Config

    Parameters

    • fileConfig: string

      The configuration that keys should be added into.

    • missingKeys: Array<object>

    Returns void

allFilesInDirs

  • allFilesInDirs(dirs: string[]): string[]
  • Get all the files withing multiple directories. Some custom checks have been added.

    memberof

    Config

    Parameters

    • dirs: string[]

      The directories to search in.

    Returns string[]

    A list of all total files within the directories.

dirSync

  • dirSync(dir: string): string[]
  • Get the array of files found within a directory with the file extension ".txt".

    memberof

    Config

    Parameters

    • dir: string

      The directory to search in.

    Returns string[]

    The files within the directory.

getMissingKeys

  • getMissingKeys(fileConfig: string): Array<object>
  • Get keys not found in the current configurations that should be added.

    memberof

    Config

    Parameters

    • fileConfig: string

      The configuration name that should get its keys up to date.

    Returns Array<object>

    } A list of missing keys.

getPackageJSON

  • getPackageJSON(): void

removeConfigWithRemovalOfFile

  • removeConfigWithRemovalOfFile(syntaxDir: string[]): void
  • If a file have been removed, remove the configuration inside package.json to avoid storing unused configuratios.

    memberof

    Config

    Parameters

    • syntaxDir: string[]

      The directories where the template filse is located.

    Returns void

writeToPackage

  • writeToPackage(): void
  • Update package.json with the locally changed package.json object.

    memberof

    Config

    Returns void

Generated using TypeDoc