workspaced.com.importer
-
Declaration
void
start
();Initializes the import parser. Call with
{"cmd": "load", "components": ["importer"]}
-
Declaration
void
stop
();Has no purpose right now.
-
Declaration
ImportInfo[]
get
(stringcode
, intpos
);Returns all imports available at some
code
position.Call With:
{"subcmd": "
get
"} -
Declaration
ImportModification
add
(stringimportName
, stringcode
, intpos
, boolinsertOutermost
= true);Returns a list of
code
patches for adding an import. If
isinsertOutermost
false
, the import will get added to the innermost block.Call With:
{"subcmd": "
add
"} -
Declaration
struct
ImportModification
;Information about how to add an import
-
Declaration
string
rename
;Set if there was already an import which was renamed. (for example import io = std.stdio; would be "io")
-
Declaration
CodeReplacement[]
replacements
;Array of
replacements
to add the import to the code
-
-
Declaration
struct
SelectiveImport
; -
Declaration
struct
ImportInfo
;Information about one import statement
-
Declaration
string[]
name
;Parts of the imported module. (std.stdio -> ["std", "stdio"])
-
Declaration
string
rename
;Available if the module has been imported renamed
-
Declaration
SelectiveImport[]
selectives
;Array of selective imports or empty if the entire module has been imported
-