INNER CODE UNIT · TypeScript
setActiveStyling
prisma/orm · apps/lsp-playground/src/client/main.ts:329
const setActiveStyling = (): void => {
for (const entry of entries) {
entry.button.classList.toggle('active', entry === activeEntry);
}
};
async function openEntry(entry: FileEntry): Promise<void> {
// First selection only: this is the one `didOpen` a never-selected file
// never sends. `openTextDocument` — via vscode-languageclient's
// document-sync feature — is what notifies the language server.
await vscode.workspace.openTextDocument(vscode.Uri.parse(entry.uri));
// Pin a second, independently-held model reference so the document stays
// open server-side even after `updateCodeResources` later disposes its
// own reference while switching to a different file (see the `pin` field
// doc on `FileEntry`).
entry.pin = await createModelReference(vscode.Uri.parse(entry.uri));
entry.opened = true;
}