Automatically searches for TypeScript definitions in workspace files and provides all known symbols as completion item to allow code completion.
If a TypeScripts ^1.9.0 paths.*
mapping is set in the tsconfig.json, the imports are tried to be resolved absolutly.
Otherwise the imports are resolved relative to the current file.
The current supported symbols are:
export class [name] { ... } export abstract class [name] { ... } export interface [name] { ... } export type [name] = { ... }, export const [name] = ... export var [name] = ... export let [name] = ... export function [name] = ... export function* [name] = ... export enum [name] = ... export default ...
This can be configured in .vscode/settings.json
.
Settings will only be applied on startup or executing the reindex command.
tsimporter.filesToScan - Glob for which files in your workspace to scan, defaults to
['**/*.ts','**/*.tsx']
tsimporter.filesToExclude - Glob for files to exclude from watch and scan, e.g
./out/**
. Defaults to nothingtsimporter.showNotifications - Show status notifications, default is false
tsimporter.doubleQuotes - Use double quotes rather than single
tsimporter.spaceBetweenBraces - Insert spaces between the import braces. (
import {test} from 'test' vs. import { test } from 'test'
)tsimporter.disabled - Disables the extension
tsimporter.removeFileExtensions - File Extensions to remove. default is
'.d.ts,.ts,.tsx'
tsimporter.lowImportance - If true, the code completion items will be sorted back to the build in completion items. default is false
tsimporter.emitSemicolon - If false, no semicolon will be written. default is true
tsimporter.tsconfigName - An alternative tsconfig.json filename. default is 'tsconfig.json'
tsimporter.noStatusBar - True to hide the status bar
tsimporter.preferRelative - When true shorter relative imports will be be prefered instead of absolute imports
noStatusBar
optionpreferRelative
optionopenSymbol
command to open a symbols document. The command filters the search by the word under the cursor or the current selection. addImport
command to add a import manually. The command filters the search by the word under the cursor or the current selection. export function* foo() {...};
generator syntaxexport default X;
syntaximport "reflect-metadata";
tsimporter.tsconfigName
./../module
instead of ../module
emitSemicolon
lowImportance
* as Symbol
syntaxexport default
syntaxexport function
and export enum
///<reference path="..." />
declarationsnode_modules/**/*.d.ts
typings/**/*.d.ts