Codelet logoCodelet

Full reference

Every namespace member, value type and helper codelet's extension API answers

Every member of vscode, every member of codelet, every constructor and enum reached off vscode.X, and the free helpers exported from codelet/extensions — one line each. The pages before this one explain how to use them; this page is for finding the name you already know you want, and for checking what is not here at all.

#vscode.window

Every `vscode.window` member
MemberDescription
activeTextEditorThe TextEditor for the file showing, or undefined. See Editors.
onDidChangeActiveTextEditorFires whenever that changes.
visibleTextEditorsactiveTextEditor in an array, or an empty one — one active editor however many groups.
onDidChangeVisibleTextEditorsThe same moment as above, said the other way.
tabGroupsEvery tab the reader has open, in every group. See Editors.
onDidChangeTextEditorSelectionThe caret or selection moved.
activeColorThemeThe theme showing. See Prompts and UI.
onDidChangeActiveColorThemeFires when the theme's kind changes.
createTextEditorDecorationTypeRegisters an appearance for TextEditor.setDecorations.
registerTreeDataProviderFills a "tree" view with rows. See Views.
createTreeViewSame, and returns a TreeView you can set message, title, badge on.
registerWebviewViewProviderFills a "webview" view. See Views.
registerCustomEditorProviderFills a tab for a file contributes.customEditors claimed.
createWebviewPanelOpens a tab with no file under it. See Editors.
showTextDocumentOpens a file in the editor.
createStatusBarItemA StatusBarItem, hidden until .show(). See Prompts and UI.
setStatusBarMessageA status bar item and a timeout in one call.
createOutputChannelAn OutputChannel, or a LogOutputChannel with { log: true }.
registerFileDecorationProviderBadges and colors on explorer and tree rows.
registerTerminalProfileProviderAnswers a contributes.terminal.profiles entry. See Tasks, source control and terminals.
createTerminalA Terminal backed by a Pseudoterminal you already hold.
terminalsEvery terminal createTerminal made.
activeTerminal / onDidChangeActiveTerminalWhich terminal the reader is in.
onDidOpenTerminal / onDidCloseTerminalA terminal was made, or is gone.
onDidChangeTerminalStateThe first thing was typed into it.
withProgressRuns a task and says so in the status bar. See Prompts and UI.
showQuickPickPuts a list to the reader. See Prompts and UI.
showInputBoxAsks for a line of text.
createQuickPick / createInputBoxThe same two fields, held open.
showWorkspaceFolderPickThe one folder there is, put to the reader.
registerUriHandlerTakes links the embedding host delivers with workbench.handleUri.
showInformationMessage / showWarningMessage / showErrorMessageA message, and the buttons on it. See Prompts and UI.

#vscode.workspace

Every `vscode.workspace` member
MemberDescription
fsA FileSystem: stat, readDirectory, createDirectory, readFile, writeFile, delete, rename, copy.
applyEditApplies a WorkspaceEdit as one transaction per file.
nameWhat the tree is called, or undefined.
workspaceFoldersThe one root, in an array.
getWorkspaceFolderWhich folder a Uri is in — the one there is.
asRelativePathA path without the root in front of it.
findFilesGlob search over the tree.
openTextDocumentReads a file as a TextDocument.
textDocumentsEvery document with a tab open on it.
onDidOpenTextDocument / onDidCloseTextDocumentA tab opened or closed onto a document.
onDidChangeTextDocumentFires on every write, contentChanges included.
onDidSaveTextDocument / onWillSaveTextDocumentThe reader saved, or is about to.
save / saveAllMarks a document (or every open one) as saved.
onDidCreateFiles / onDidDeleteFiles / onDidRenameFilesA file gesture happened.
onWillCreateFiles / onWillDeleteFiles / onWillRenameFilesThe moment before each.
createFileSystemWatcherA FileSystemWatcher scoped to a glob.
registerFileSystemProviderServes documents outside the tree, over a scheme of your own.
registerTextDocumentContentProviderServes a scheme by text alone, read once per document.
getConfigurationSettings, over the manifests' defaults and what the reader wrote.
onDidChangeConfigurationA setting moved.

#vscode.commands

MemberDescription
registerCommandRegisters a handler. Paired with a manifest declaration, this puts it in the palette.
registerTextEditorCommandThe same, handed the active editor and an edit builder; does nothing without one.
executeCommandRuns any registered command, yours or another extension's.
getCommandsEvery registered command id. filterInternal drops ones starting with _.
Read more in API > Commands.

#vscode.languages

Every `vscode.languages` member
MemberDescription
getLanguagesEvery language id codelet knows.
setTextDocumentLanguageOverrides what a file is treated as.
createDiagnosticCollectionA DiagnosticCollection for errors and warnings against files.
getDiagnosticsEverything anyone published, for one file or every file.
onDidChangeDiagnosticsSomebody published.
matchHow well a document answers a selector, VS Code's own scoring.
createLanguageStatusItemWhat a language says about the file showing, in the status bar.
registerDefinitionProvider / registerTypeDefinitionProvider / registerImplementationProvider / registerDeclarationProviderGo-to-X, each its own command and its own first answer.
registerReferenceProviderEverywhere a name is used. Lands in the Search view.
registerDocumentSymbolProviderThe names in a file — the palette's @.
registerWorkspaceSymbolProviderThe same across the tree — the palette's #.
registerHoverProviderHover tooltips.
registerDocumentHighlightProviderEvery other occurrence of the name under the caret.
registerFoldingRangeProviderWhere the file folds, narrowing the editor's own guess.
registerInlayHintsProviderText drawn into the lines showing that is not in the file.
registerCodeLensProviderThe commands drawn above a line.
registerDocumentLinkProviderThe spans of a file that lead somewhere.
registerColorProviderThe colors in a file, as swatches.
registerSelectionRangeProviderWhere the selection goes when it is widened.
registerOnTypeFormattingEditProviderThe formatter that runs on a keystroke.
registerCompletionItemProviderCompletion lists.
registerSignatureHelpProviderSignature help as a call is typed.
registerDocumentFormattingEditProvider / registerDocumentRangeFormattingEditProviderFormat the whole file, or the selection.
registerRenameProviderF2.
registerCodeActionsProviderFixes and refactors offered at a range.
registerDocumentPasteEditProvider / registerDocumentDropEditProviderWhat a paste or a drop inserts.
Read more in API > Languages.

#vscode.tasks

MemberDescription
registerTaskProviderWhat answers for one type.
fetchTasksEvery provider's answer, filtered by type.
executeTaskRuns a task and resolves with its TaskExecution.
taskExecutionsEvery task currently running.
onDidStartTask / onDidEndTaskA task started, or its terminal ended.
Read more in API > Integrations#tasks.

#vscode.scm

MemberDescription
createSourceControlRegisters a SourceControl.
Read more in API > Integrations#source Control.

#vscode.authentication

MemberDescription
registerAuthenticationProviderRegisters a provider under an id. One per id.
getSessionA session for those scopes, or for a WWW-Authenticate challenge.
getAccountsEvery account a provider is signed in as.
onDidChangeSessionsA provider said its sessions moved.

Nothing ships a provider — a page owns no redirect address, so one is the host's to mount. getSession asks the reader once per extension per provider ("The extension 'X' wants to sign in using Y") and remembers the answer; the token itself never passes through the workbench.

An Accounts item appears at the foot of the activity bar once a provider registers: signing in to one (no scopes and no consent gate — the reader is the one asking, and an extension that wants the session is still asked about separately), signing out of an account, revoking an extension's access, and a badge counting whichever is the reader's to act on — extensions waiting, else accounts signed in, else sign-ins kept on the device and not yet unlocked (drawn hollow, that count being read off the store's record rather than from any provider). An extension that asks for a session with neither createIfNone nor forceNewSession is answered undefined and put in the menu as a row, which is where the reader can allow it afterwards; the extension is told through onDidChangeSessions when they do.

#vscode.extensions

MemberDescription
allEvery extension the workbench was given, as ExtensionInfo.
getExtensionThe one with that id, or undefined.
onDidChangeOne was stopped or started, or installed.

#vscode.env

Every `vscode.env` member
MemberDescription
appName / appHost / uiKindWhat this is: "codelet", "web", UIKind.Web.
languageThe browser's own language.
sessionIdOne per page load.
isTelemetryEnabledAlways false.
clipboardreadText() / writeText(). See Prompts and UI.
openExternalOpens a Uri in a new tab. See Prompts and UI.
uriSchemeThe page's own protocol.
asExternalUriAn address for a link that has to come back into this workbench.

#The codelet namespace

The handful of calls VS Code has no answer for — a call is here rather than on vscode because nothing there could have meant the same thing in a browser tab.

#codelet.window

MemberDescription
registerComponentViewFills a type: "component" view with a preact component.
createComponentViewThe same, with a handle for description and badge.
registerLocationsViewWhere a reference search (or anything like it) draws its rows.
createBrowserPanelA tab over a page served elsewhere — a real cross-origin frame.
decorationOfWhat a FileDecorationProvider answered for a path.
onDidChangeFileDecorationsA decoration landed, went, or a provider registered.

#codelet.views

MemberDescription
filterThe filter box a view contributed, if its manifest declared one.
selectThe dropdown beside it, if its manifest declared one.

#codelet.workspace

MemberDescription
onDidExpandDirectoryA directory was just unfolded in the explorer.
markSavedThat file is what was last saved — the unsaved dot goes.
setReadonlyThat file cannot be written where it really lives.
openA tree of this extension's own, shown until it is closed.
onDidChangeWorkspaceThe tree this extension is speaking to is a different one now.

#codelet.terminal

Every `codelet.terminal` member
MemberDescription
profilesEvery shell an active manifest declared, paired with its provider.
terminals / onDidChangeTerminalsEvery terminal an extension made with createTerminal.
tabs / onDidChangeTabsEvery tab the terminal extension is actually showing.
presentThe terminal extension publishing what it is showing.
expect / expectingHold the panel open for tabs that are still arriving.
onDidChangeExpectingThe last claim on expect() lapsed.
onDidShowTerminal / onDidHideTerminalThat id asked to be shown — with the maker's preserveFocus — or hidden.
focusWhich tab the reader is in, published by whoever draws them.
Read more in API > Integrations#terminals.

#codelet.scm

MemberDescription
sources / onDidChangeSourcesEvery registered source control, with its groups attached.
actionsThe buttons contributed to one of the four scm/* menus.
Read more in API > Integrations#source Control.

#codelet.ports

MemberDescription
registerA server is up: number, address, an optional label, show() and stop().
servers / onDidChangeServersEvery port there is, and anything about one moving.
Read more in Extensions > Ports.

#codelet.extensions

MemberDescription
setActiveStop an extension, or start it again.
installRun an extension the workbench was not built with, for this window only.

#Value types and constructors

Reached as vscode.X, never imported — new vscode.TreeItem(...), vscode.Uri.file(...).

Every value type and constructor
TypeDescription
UriUri.file(path), Uri.parse(value), Uri.joinPath(base, ...segments), Uri.from(components).
Positionline, character (both 0-based), translate(), with(), comparisons.
Rangestart, end, contains(), intersection(), union(), with().
SelectionA Range with anchor and active.
ThemeIconNames one of codelet's icons. .File and .Folder are built in.
ThemeColorNames a color from codelet's fixed table.
EventEmitter.event to subscribe, .fire(value) to emit, .dispose() to clear listeners.
DisposableWraps a teardown function; Disposable.from(...disposables) combines several.
CancellationTokenSourceThe one token an extension can make for itself, everywhere else handed one.
TreeItemA row: label, iconPath, description, resourceUri, tooltip, command, collapsibleState, contextValue, checkboxState.
TreeItemCollapsibleState / TreeItemCheckboxStateNone/Collapsed/Expanded, Unchecked/Checked.
MarkdownString.appendText(), .appendMarkdown(), .appendCodeblock().
HoverMarkdown or code shown on hover.
LocationA Uri plus a Range or Position.
DocumentSymbolA name in a file: name, detail, kind, range, selectionRange, children.
SymbolInformationThe flat form a workspace search answers in.
SymbolKind / SymbolTagVS Code's own numbering, and Deprecated.
DocumentHighlight / DocumentHighlightKindAn occurrence of the name under the caret.
FoldingRange / FoldingRangeKindWhat registerFoldingRangeProvider answers with.
InlayHint / InlayHintKind / InlayHintLabelPartWhat registerInlayHintsProvider answers with.
CodeLensOne line of registerCodeLensProvider's answer.
Color / ColorInformation / ColorPresentationWhat registerColorProvider reads and answers with.
DocumentLinkA span of a file that leads somewhere.
SelectionRangeA link in the chain registerSelectionRangeProvider answers with.
CompletionItemlabel, kind, detail, documentation, insertText (plain text only), range, additionalTextEdits.
CompletionItemKind / CompletionTriggerKindVS Code's own numbering, and how a completion round started.
CodeAction / CodeActionKind / CodeActionTriggerKindA fix or refactor, its category, and how it was asked for.
Diagnosticrange, message, severity (Error by default).
DiagnosticSeverity / DiagnosticTagError/Warning/Information/Hint, and Deprecated/Unnecessary.
DiagnosticRelatedInformationA second location a diagnostic points at.
TextEditTextEdit.replace(range, newText), .insert(position, newText), .delete(range).
WorkspaceEditreplace/insert/delete per Uri, plus createFile/deleteFile/renameFile. Hand it to applyEdit.
FileDecorationbadge, tooltip, color, propagate.
FileType / FilePermissionBitmask values for a FileStat.
FileChangeTypeChanged/Created/Deleted, for a FileSystemProvider's own watcher.
FileSystemErrorThrown by a FileSystemProvider answering a missing file.
QuickPickItemKindDefault or Separator.
QuickInputButtons.Back, the one predefined button — compared by identity.
InputBoxValidationSeverityInfo/Warning/Error; only Error refuses Enter.
StatusBarAlignmentLeft, Right.
LanguageStatusSeverityInformation/Warning/Error, for a LanguageStatusItem.
SignatureHelpTriggerKindHow a signature help popup was asked for.
ConfigurationTargetNamed by update(); all three land in the one layer there is.
ExtensionModeWhat ExtensionContext.extensionMode is compared against.
ColorThemeKindLight and Dark — the two ever answered, of VS Code's four.
UIKindDesktop and Web; env.uiKind is always Web.
ViewColumnTaken by createWebviewPanel and never read — a panel opens in the group the reader is in.
TabInputText / TabInputTextDiff / TabInputCustom / TabInputWebviewWhat a Tab is showing, read with instanceof.
Task / CustomExecution / TaskScope / TaskGroupWhat a task provider answers with. See Tasks, source control and terminals.
TerminalProfileWraps the Pseudoterminal a profile provider hands back.
TerminalExitReasonProcess, User, Extension or Unknown — why a terminal ended.
DataTransfer / DataTransferItemWhat a drag or a paste carries.
DocumentDropEdit / DocumentPasteEditBuilt by a drop or paste provider's answer.
DocumentDropOrPasteEditKindNames the kind of edit one of those is.
DocumentPasteTriggerKindAlways Automatic — there is no explicit "paste as" to ask for a different kind.
EndOfLineCompared to rather than built — document.eol is read against it.
TextDocumentSaveReasonDeclared for a listener written against VS Code; codelet only ever fires Manual.

#Helpers exported from codelet/extensions

Free functions, alongside defineExtension — not reached through vscode.

ExportDescription
defineExtension(extension)Identity at runtime; types activate's parameters against your manifest.
positionOf(place) / placeOf(position)Converts between codelet's 1-based [line, column] Place and vscode's 0-based Position.
rangeOf(cursor) / cursorOf(range)The same conversion for the editor's own Cursor and a Range.
languageIdOf(path)The language id a path implies, from its extension or full name.
hasLanguage(id)Whether that id is known, versus a name passed through as-is.
labelOf(id)The display label for a language id — "typescript" → "TypeScript".
languageIds()Every language id codelet knows, as an array.

#Not implemented

Whole namespaces are absent: vscode.debug, vscode.notebooks, vscode.comments, vscode.l10n and vscode.tests.

vscode.chat and vscode.lm are here — participants, the request the workbench mints, the response stream, model providers and tools. What consumes them is codelet.chat on CodeletApi, since the thing that draws a conversation is an extension rather than the workbench: codelet/extensions/chat is the pane, and codelet/extensions/pi-agent is what answers it — pi's loop, pi's tools, and the models it answers over.

authentication: every member is here, and no provider ships with it — a page owns no address a redirect could come back to. contributes.authentication is not read either, since nothing in codelet activates lazily. The Accounts menu has no "manage trusted extensions": a page is one origin, so the record is which extension the reader meant to sign in with rather than anything containing it, and revoking it changes what the next getSession is answered rather than taking back a token an extension already holds.

env: machineId, remoteName, appRoot, shell, onDidChangeShell, isNewAppInstall, isAppPortable, logLevel, onDidChangeLogLevel, onDidChangeTelemetryEnabled and createTelemetryLogger are all about a machine or a telemetry pipeline a page has neither of.

scm: scm.inputBox, VS Code's own deprecated global, is the one member missing — SourceControl.inputBox is the box.

Settings: one layer of written values under the manifests' defaults. ConfigurationScope, [language]-scoped sections, and the workspaceValue / workspaceFolderValue / *LanguageValue members of inspect() are all absent with the second tree they would answer.

Multi-root: workspace.workspaceFolders is one entry forever. updateWorkspaceFolders, workspaceFile and onDidChangeWorkspaceFolders are absent with the concept.

File dialogs: no showOpenDialog or showSaveDialog — both mean the machine's own filesystem, and a page cannot reach it.

Progress: ProgressLocation.Window is the only location, and there is no cancellation — the task takes a Progress and no CancellationToken, and ProgressOptions.cancellable is absent.

Editing: TextEditor.selection and .selections are read-only, and there is no revealRange(), insertSnippet(), viewColumn, visibleRanges, options, show() or hide(). TextEdit has no setEndOfLine, and WorkspaceEdit's entries carry no WorkspaceEditEntryMetadata for a refactor preview that does not exist. CompletionItem.insertText is plain text only, never a SnippetString.

The filesystem: workspace.fs has no isWritableFileSystem; delete is always recursive with no option, and rename never overwrites. Only one FileSystemProvider is allowed per scheme, and registering one for file: throws — that scheme is the workbench's own tree. A registerTextDocumentContentProvider has no onDidChange — its content is read once.

Views and webviews: TreeItem.tooltip is a plain string, never a MarkdownString, and its checkbox carries no tooltip of its own. WebviewOptions has no portMapping; WebviewPanel has no iconPath, no options (retainContextWhenHidden included), and no way to change its viewColumn. A custom editor provider is readonly-only — no edit stack, no backups, no onDidChangeCustomDocument.

Terminals and tasks: Terminal has no shellIntegration or creationOptions. ExtensionTerminalOptions takes name and pty alone — no color, iconPath, isTransient or location. tasks.onDidStartTaskProcess and .onDidEndTaskProcess are absent: what a task runs in is a terminal, and a Pseudoterminal is not a process.

Extension context: no asAbsolutePath, extensionPath/extensionUri, storagePath/storageUri/globalStoragePath/globalStorageUri, environmentVariableCollection or languageModelAccessInformation — all about a filesystem or a model access an extension in a page has no path to.

Everything else: no LocationLink (Definition is Location | Location[]), no StatusBarItem.accessibilityInformation, no OutputChannel.logLevel / onDidChangeLogLevel. when clauses understand a fixed handful of keys rather than VS Code's full context-key vocabulary, though setContext is here for an extension to drive its own.