Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EasyDoc

Make the call to start the program on the correct template file. The template files are read from the specified directories and handled accordingly. Also calls the Config file to make sure the configurations are handled when needed.

export
class

EasyDoc

Hierarchy

  • EasyDoc

Index

Constructors

constructor

Properties

Private config

config: vs.WorkspaceConfiguration

The configurations for EasyDoc found by vscode settings.

type

{vs.WorkspaceConfiguration}

memberof

EasyDoc

Private dir

dir: string

The absolute directory of where the extension is installed.

type

{string}

memberof

EasyDoc

Private document

document: vs.TextEditor

The active text editor.

type

{vs.TextEditor}

memberof

EasyDoc

Methods

checkDoc

  • checkDoc(onEnter: boolean): Promise<void>
  • Handle if the activation was made by a command or by pressing Enter. Should make sure the correct template file is activated and initialize Format with the specified arguments for the template file.

    memberof

    EasyDoc

    Parameters

    • onEnter: boolean

      A boolean value if the extension was triggered by pressing Enter.

    Returns Promise<void>

    void.

Private fixConfig

  • Add, update and remove values from the configurations when needed to.

    memberof

    EasyDoc

    Parameters

    • config: Config

      The local package.json as an object, used to get the configurations.

    • fileName: string

      The filename of the configuration that is handled.

    Returns IDefaultObject

    The configurations for the template file. Will return the package.json if configuration was just created, will return the vscode configuration otherwise.

Private getAllItems

  • getAllItems(config: Config): string[]
  • Get every file's name and diretory inside a given dir based on the configuration.

    memberof

    EasyDoc

    Parameters

    • config: Config

      The configuration of EasyDoc.

    Returns string[]

    List of file's name and directory.

Private getTextBeforeCursor

  • getTextBeforeCursor(triggerText: string): string
  • Get the text of the editor in front of the cursor, with the length of the triggerText.

    memberof

    EasyDoc

    Parameters

    • triggerText: string

      The text that the length of the result will be.

    Returns string

    A string before the cursor with the length of triggerText..

Private quickPick

  • quickPick(config: Config): Thenable<string>
  • Initialize and show a QuickPick menu. This QuickPick will show different files withing the dir attribute of config.

    memberof

    EasyDoc

    Parameters

    • config: Config

      he configuration of EasyDoc.

    Returns Thenable<string>

    A promise that resolves to the selection.

Generated using TypeDoc