vscode APIs
- workspace
- window
- ExtensionContext
- Uri
- commands
- Range
- Position
- TextDocument
- Disposable
- CancellationToken
- languages
- TextEditor
- EventEmitter
- ViewColumn
- QuickPickItem
- Event
- OutputChannel
- MarkdownString
- extensions
- ProviderResult
- env
- StatusBarItem
- StatusBarAlignment
- WorkspaceConfiguration
- Location
- TreeItemCollapsibleState
- TreeItem
- Selection
- CompletionItem
- WorkspaceFolder
- TreeDataProvider
- TextEdit
- CompletionItemKind
- Command
- Hover
- WorkspaceEdit
- WebviewPanel
- Diagnostic
- DiagnosticSeverity
- ConfigurationTarget
- ProgressLocation
- ThemeColor
- TextEditorDecorationType
- TextDocumentChangeEvent
- CodeActionProvider
- HoverProvider
- ThemeIcon
- SnippetString
- CompletionList
- DecorationOptions
- RelativePattern
- DiagnosticCollection
- CompletionContext
- CompletionItemProvider
- CodeAction
- CodeActionKind
- InputBoxOptions
- ColorThemeKind
- ConfigurationChangeEvent
- FileSystemWatcher
- TextEditorEdit
- TextDocumentContentChangeEvent
- Extension
- CodeActionContext
- FileStat
- QuickPickOptions
- DocumentSymbol
- SymbolKind
- QuickInputButton
- Webview
- IndentAction
- debug
- FileSystemError
- TreeView
- TextEditorRevealType
- FileSystemProvider
- FileChangeEvent
- Memento
- Definition
- FormattingOptions
- DocumentFilter
- DecorationRenderOptions
- QuickPick
- WebviewView
- WebviewViewProvider
- DocumentHighlight
- DebugConfiguration
- Terminal
- FileType
- TextDocumentWillSaveEvent
- FileChangeType
- OpenDialogOptions
- DocumentSelector
- DefinitionProvider
- LocationLink
- TextDocumentShowOptions
- DecorationRangeBehavior
- OverviewRulerLane
- SignatureHelp
- SemanticTokens
- Progress
- DocumentFormattingEditProvider
- SemanticTokensBuilder
- WebviewViewResolveContext
- CustomDocument
- DebugSession
- CodeLens
- CodeLensProvider
- WebviewOptions
- WebviewPanelOptions
- FileRenameEvent
- TextDocumentSaveReason
- CancellationTokenSource
- CustomTextEditorProvider
- QuickPickItemKind
- DocumentLink
- DocumentHighlightKind
- FileDecoration
- FileDecorationProvider
- TextDocumentContentProvider
- GlobPattern
- FileDeleteEvent
- SaveDialogOptions
- SignatureInformation
- CompletionItemTag
- FileCreateEvent
- ReferenceContext
- SemanticTokensLegend
- TreeViewVisibilityChangeEvent
- QuickInput
- QuickInputButtons
- CustomReadonlyEditorProvider
- DiagnosticRelatedInformation
- DebugConfigurationProvider
- DebugAdapterExecutable
- DebugAdapterDescriptor
- DebugAdapterDescriptorFactory
- DebugAdapterServer
- FileSearchOptions
- FileSearchProvider
- FileSearchQuery
- TextSearchComplete
- TextSearchOptions
- TextSearchProvider
- TextSearchQuery
- TextSearchResult
- EndOfLine
- FileWillRenameEvent
- FoldingRangeKind
- MessageItem
- TextEditorVisibleRangesChangeEvent
- ColorTheme
- CustomEditorProvider
- CustomDocumentBackupContext
- CustomDocumentBackup
- CustomDocumentOpenContext
- CustomDocumentContentChangeEvent
- SymbolInformation
- DecorationInstanceRenderOptions
- DefinitionLink
- DocumentLinkProvider
- TerminalOptions
- CodeActionProviderMetadata
- MarkedString
- tasks
- Task
- TaskDefinition
- ShellExecution
- TaskGroup
- DocumentRangeFormattingEditProvider
- TaskScope
- TextEditorSelectionChangeKind
- RenameProvider
- TextLine
- WorkspaceFoldersChangeEvent
- TreeItemLabel
Other Related APIs
vscode#TreeViewVisibilityChangeEvent TypeScript Examples
The following examples show how to use
vscode#TreeViewVisibilityChangeEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: extension.ts From cloudmusic-vscode with MIT License | 5 votes |
export async function activate(context: ExtensionContext): Promise<void> {
/* process.setUncaughtExceptionCaptureCallback(({ message }) =>
console.error(message)
); */
process.on("unhandledRejection", console.error);
await mkdir(SETTING_DIR, { recursive: true }).catch();
context.globalState.setKeysForSync([BUTTON_KEY]);
AccountViewProvider.context = context;
AccountManager.context = context;
ButtonManager.context = context;
State.context = context;
Webview.extUri = context.extensionUri;
// Check mode
if (!State.wasm) {
const buildUri = Uri.joinPath(context.extensionUri, "build");
const files = await workspace.fs.readDirectory(buildUri);
State.wasm = files.findIndex(([file]) => file === NATIVE_MODULE) === -1;
if (!State.wasm) State.downInit(); // 3
}
console.log("Cloudmusic:", State.wasm ? "wasm" : "native", "mode.");
const createTreeView = <T>(
viewId: string,
treeDataProvider: TreeDataProvider<T>
) => window.createTreeView(viewId, { treeDataProvider });
const queue = createTreeView("queue", QueueProvider.getInstance());
const local = createTreeView("local", LocalProvider.getInstance());
const playlist = createTreeView("playlist", PlaylistProvider.getInstance());
const radio = createTreeView("radio", RadioProvider.getInstance());
context.subscriptions.push(queue, local, playlist, radio);
// Only checking the visibility of the queue treeview is enough.
if (AUTO_START || queue.visible) {
await realActivate(context);
} else {
let done = false;
const disposables: Disposable[] = [];
const callback = ({ visible }: TreeViewVisibilityChangeEvent) => {
if (done || !visible) return;
done = true;
void realActivate(context);
let disposable: Disposable | undefined;
while ((disposable = disposables.pop())) disposable.dispose();
};
disposables.push(queue.onDidChangeVisibility(callback));
}
}