Adding Rendered Notebook Diff Option (#14860)

* First attempt nb diff preview

* First attempt nb diff preview

* Simplify everything

* Interim scroll one way

* Double scroll

* Add setting

* Add tests

* Add comment

* Fix tests

* first round PR comments

* Ensure scrollable portion has scrollbar in diff

* Fix sqllint errors, register events

* Fix scrolling, readonly
This commit is contained in:
Chris LaFreniere
2021-04-02 14:49:52 -07:00
committed by GitHub
parent e7be1daf5c
commit 0d3112ef35
9 changed files with 186 additions and 12 deletions

View File

@@ -38,6 +38,9 @@ export class QueryEditorLanguageAssociation implements ILanguageAssociation {
@IQueryEditorService private readonly queryEditorService: IQueryEditorService) { }
async convertInput(activeEditor: IEditorInput): Promise<QueryEditorInput | undefined> {
if (!(activeEditor instanceof FileEditorInput) && !(activeEditor instanceof UntitledTextEditorInput)) {
return undefined;
}
const queryResultsInput = this.instantiationService.createInstance(QueryResultsInput, activeEditor.resource.toString(true));
let queryEditorInput: QueryEditorInput;
if (activeEditor instanceof FileEditorInput) {
@@ -45,8 +48,6 @@ export class QueryEditorLanguageAssociation implements ILanguageAssociation {
} else if (activeEditor instanceof UntitledTextEditorInput) {
const content = (await activeEditor.resolve()).textEditorModel.getValue();
queryEditorInput = await this.queryEditorService.newSqlEditor({ resource: this.editorService.isOpen(activeEditor) ? activeEditor.resource : undefined, open: false, initalContent: content }) as UntitledQueryEditorInput;
} else {
return undefined;
}
const profile = getCurrentGlobalConnection(this.objectExplorerService, this.connectionManagementService, this.editorService);