mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
* Fix #5238 Notebooks should support relative links - Added detection of relative #links inside notebooks - Added handling of these, at least for current notebook Not handled: open other notebook & scroll to position.
This commit is contained in:
@@ -90,6 +90,12 @@ export interface INotebookService {
|
||||
*/
|
||||
serializeNotebookStateChange(notebookUri: URI, changeType: NotebookChangeType): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param notebookUri URI of the notebook to navigate to
|
||||
* @param sectionId ID of the section to navigate to
|
||||
*/
|
||||
navigateTo(notebookUri: URI, sectionId: string): void;
|
||||
}
|
||||
|
||||
export interface INotebookProvider {
|
||||
@@ -117,6 +123,15 @@ export interface INotebookParams extends IBootstrapParams {
|
||||
modelFactory?: ModelFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a section in a notebook as the header text for that section,
|
||||
* the relative URI that can be used to link to it inside Notebook documents
|
||||
*/
|
||||
export interface INotebookSection {
|
||||
header: string;
|
||||
relativeUri: string;
|
||||
}
|
||||
|
||||
export interface INotebookEditor {
|
||||
readonly notebookParams: INotebookParams;
|
||||
readonly id: string;
|
||||
@@ -131,4 +146,6 @@ export interface INotebookEditor {
|
||||
runAllCells(startCell?: ICellModel, endCell?: ICellModel): Promise<boolean>;
|
||||
clearOutput(cell: ICellModel): Promise<boolean>;
|
||||
clearAllOutputs(): Promise<boolean>;
|
||||
getSections(): INotebookSection[];
|
||||
navigateToSection(sectionId: string): void;
|
||||
}
|
||||
|
||||
@@ -619,4 +619,11 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
navigateTo(notebookUri: URI, sectionId: string): void {
|
||||
let editor = this._editors.get(notebookUri.toString());
|
||||
if (editor) {
|
||||
editor.navigateToSection(sectionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user