workspaced.com.importer

Members

Functions

add
ImportModification add(string importName, string code, int pos, bool insertOutermost = true)

Returns a list of code patches for adding an import. If insertOutermost is false, the import will get added to the innermost block.

get
ImportInfo[] get(string code, int pos)

Returns all imports available at some code position.

sortImports
ImportBlock sortImports(string code, int pos)

Sorts the imports in a whitespace separated group of code Returns ImportBlock.init if no changes would be done.

start
void start()

Initializes the import parser. Call with {"cmd": "load", "components": ["importer"]}

stop
void stop()

Has no purpose right now.

Structs

ImportBlock
struct ImportBlock

A block of imports generated by the sort-imports command

ImportInfo
struct ImportInfo

Information about one import statement

ImportModification
struct ImportModification

Information about how to add an import

SelectiveImport
struct SelectiveImport

Name and (if specified) rename of a symbol

Meta