INNER CODE UNIT · TypeScript
openEntry
prisma/orm · apps/lsp-playground/src/client/main.ts:335
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;
}
async function selectEntry(entry: FileEntry): Promise<void> {
if (entry === activeEntry) {
return;
}
if (!entry.opened) {