Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorkShop

Class that handles most functions besides after requirements from EasyDoc class have been met.

export
abstract
class

WorkShop

Hierarchy

Index

Constructors

constructor

  • new WorkShop(syntaxFile: string): WorkShop
  • Creates an instance of WorkShop.

    memberof

    WorkShop

    Parameters

    • syntaxFile: string

      The template file of what to generate documentation dynamically from.

    Returns WorkShop

Properties

Protected block

block: string[] = []

The wanted block from the parser.

type

{string[]}

memberof

WorkShop

Protected config

The configuration of the template file in use.

type

{IDefaultObject}

memberof

WorkShop

Protected docRows

docRows: string

The document rows.

type

{string}

memberof

WorkShop

Protected document

document: vs.TextDocument = vs.window.activeTextEditor.document

The active text editor document..

type

{vs.TextDocument}

memberof

WorkShop

Protected editor

editor: vs.TextEditor = vs.window.activeTextEditor

The active text editor.

type

{vs.TextEditor}

memberof

WorkShop

Protected parse

parse: any

The parser that corresponds the the current class.

type

{*}

memberof

WorkShop

Protected position

position: vs.Position = vs.window.activeTextEditor.selection.active

The cursor's current position within the WorkShop.document

type

{vs.Position}

memberof

WorkShop

Protected syntaxFile

syntaxFile: string

The template file text.

type

{string}

memberof

WorkShop

Protected vars

The available variables.

type

{ISyntaxVariable}

memberof

WorkShop

Methods

Protected Abstract correctlyPlacedFunction

  • correctlyPlacedFunction(functionLineIndex: string): boolean
  • Check if the cursor is correctly placed in the function.

    abstract
    memberof

    WorkShop

    Parameters

    • functionLineIndex: string

      The row to search on.

    Returns boolean

    If cursor is correctly placed.

Private delTriggerString

  • delTriggerString(): Promise<Thenable<__type> | undefined>
  • Delete the triggerText string.

    memberof

    WorkShop

    Returns Promise<Thenable<__type> | undefined>

    |undefined>)} A promise.

generate

  • generate(docType: string, config: any, onEnter: boolean): Promise<void>
  • Start generateFunction, run different functions based on docType.

    memberof

    WorkShop

    Parameters

    • docType: string

      The type of documentation to make.

    • config: any

      The configuration for this specific documentation.

    • onEnter: boolean

      If enter activated the extension.

    Returns Promise<void>

    Promise to return a void.

Private generateFunction

  • generateFunction(onEnter: boolean, strictPlace: boolean): Promise<void>
  • Converts the template file to its correct values, then move cursor to correct place. Then continue to insert the documentation.

    memberof

    WorkShop

    Parameters

    • onEnter: boolean

      If extension was activated by pressing Enter.

    • strictPlace: boolean

      If should place strictly, basically if it should insert directly at the cursor's position.

    Returns Promise<void>

    Promises a void.

Protected getComment

  • getComment(variable: string): string | undefined
  • Get the comment based on the language and the variable wanted.

    memberof

    WorkShop

    Parameters

    • variable: string

      What comment wanted.

    Returns string | undefined

    The comment string.

Protected getCurrentColumn

  • getCurrentColumn(index: number): number
  • Get the current column in the editor

    memberof

    WorkShop

    Parameters

    • index: number

      The line index.

    Returns number

    The column the user is positioned at.

Private getFunctionStartLine

  • getFunctionStartLine(onEnter: boolean): number
  • Get all the rows after function start line.

    memberof

    WorkShop

    Parameters

    • onEnter: boolean

      If extension was activated by pressing enter.

    Returns number

    The index of the function's start line.

Protected Abstract getVariables

  • Get the variables based on the language.

    abstract
    memberof

    WorkShop

    Parameters

    • index: number

      The start index of the function.

    Returns Promise<ISyntaxVariable>

    An promise to return the variables.

Private setCodeBlock

  • setCodeBlock(functionLineIndex: number): void
  • Set the code block.

    memberof

    WorkShop

    Parameters

    • functionLineIndex: number

      The start index of the function.

    Returns void

Private stepDownInEditor

  • stepDownInEditor(): Promise<Thenable<__type> | undefined>
  • Move down cursor in editor and wait for it.

    memberof

    WorkShop

    Returns Promise<Thenable<__type> | undefined>

    |undefined>)} A promise.

Private waitForInsertLine

  • waitForInsertLine(): Promise<Thenable<__type> | undefined>
  • Insert a line and wait for it.

    memberof

    WorkShop

    Returns Promise<Thenable<__type> | undefined>

    |undefined>)} A promise.

Generated using TypeDoc