Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | import * as vscode from 'vscode';
import { IDocumentContext } from '@src/services/document/document-context.interface';
import { DocumentIndex } from '@src/services/document/document-context-service';
/**
* Interface for the DocumentContextService.
*/
export interface IDocumentContextService {
/**
* Maps document URIs to loaded document contexts.
*/
readonly contexts: DocumentIndex;
/**
* The currently active document context or `undefined`.
*/
activeContext: IDocumentContext | undefined;
/**
* An event that is fired after the active document context has changed.
*/
readonly onDidChangeDocumentContext: vscode.Event<IDocumentContext | undefined>;
/**
* Dispose the manager and clean up resources.
*/
dispose(): void;
/**
* Get the document context from a URI.
* @param uri A document or workspace URI.
* @returns A document context if the document is loaded, `undefined` otherwise.
*/
getDocumentContextFromUri(uri: string): IDocumentContext | undefined;
/**
* Get the document context from a text document.
* @param document A text document.
* @param contextType The expected type of the document context.
* @returns A document context of the specified type if the document is loaded and matches the type, null otherwise.
*/
getDocumentContext<T extends IDocumentContext>(document: vscode.TextDocument, contextType: new (...args: any[]) => T): T | null;
/**
* Get the document context from a file or workspace URI.
* @param uri A document or workspace URI.
* @returns A document context if the document is loaded, `undefined` otherwise.
*/
getContextFromUri(uri: string): IDocumentContext | undefined;
/**
* Get the document context from a text document.
* @param document A text document.
* @param contextType The expected type of the document context.
* @returns A document context of the specified type if the document is loaded and matches the type, null otherwise.
*/
getContext<T extends IDocumentContext>(document: vscode.TextDocument, contextType: new (...args: any[]) => T): T | null;
/**
* Load a text document into a document context.
* @param document The text document to load.
* @param forceReload Indicates whether a new context should be created for existing contexts.
* @returns A promise that resolves to the document context or undefined if unsupported.
*/
loadDocument(document: vscode.TextDocument, forceReload?: boolean): Promise<IDocumentContext | undefined>;
/**
* Loads the document of the editor that is active when the extension starts and
* makes it the active context. Called once, after all views and providers have
* subscribed to {@link onDidChangeDocumentContext}, so that none of them misses
* the first change.
*/
loadActiveEditorAtStartup(): Promise<void>;
/**
* Indicates whether a load or triple reload of a document is in progress. Readers
* of the triple store then wait with {@link waitUntilLoaded}, so that they see all
* triples of the document, including the inferred ones, and not the state between
* two phases of the load.
* @param uri The document URI.
*/
isLoading(uri: string): boolean;
/**
* Waits until the load or triple reload of a document that is in progress has
* finished. Resolves at once when none is in progress.
* @param uri The document URI.
*/
waitUntilLoaded(uri: string): Promise<void>;
/**
* Activate the document associated with the active context in the editor.
* @returns A promise that resolves to the active text editor or `undefined`.
*/
activateDocument(): Promise<vscode.TextEditor | undefined>;
/**
* Handle active editor changed event.
*/
handleActiveEditorChanged(): Promise<void>;
/**
* Handle active notebook editor changed event.
* @param editor The notebook editor.
*/
handleActiveNotebookEditorChanged(editor: vscode.NotebookEditor | undefined): Promise<void>;
/**
* Handle text document changed event.
* @param e The text document change event.
*/
handleTextDocumentChanged(e: vscode.TextDocumentChangeEvent): Promise<void>;
/**
* Handle text document closed event.
* @param document The closed text document.
*/
handleDocumentClosed(document: vscode.TextDocument): void;
/**
* Handle text document opened event, which is also fired when the language of a document changed.
* @param document The opened text document.
*/
handleTextDocumentOpened(document: vscode.TextDocument): Promise<void>;
/**
* Removes the contexts of documents that no longer exist and deletes their graphs
* from the store. For a notebook file, the contexts of all of its cells are removed.
* @param uris The URIs of the removed files.
*/
removeDocuments(uris: ReadonlyArray<vscode.Uri>): void;
}
|