mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 52dcb723a39ae75bee1bd56b3312d7fcdc87aeed (#6719)
This commit is contained in:
@@ -21,6 +21,7 @@ export class IPadShowKeyboard extends Disposable implements IEditorContribution
|
||||
constructor(editor: ICodeEditor) {
|
||||
super();
|
||||
this.editor = editor;
|
||||
this.widget = null;
|
||||
if (browser.isIPad) {
|
||||
this._register(editor.onDidChangeConfiguration(() => this.update()));
|
||||
this.update();
|
||||
|
||||
@@ -31,9 +31,9 @@ export class QuickOpenController implements editorCommon.IEditorContribution, ID
|
||||
}
|
||||
|
||||
private readonly editor: ICodeEditor;
|
||||
private widget: QuickOpenEditorWidget | null;
|
||||
private rangeHighlightDecorationId: string | null;
|
||||
private lastKnownEditorSelection: Selection | null;
|
||||
private widget: QuickOpenEditorWidget | null = null;
|
||||
private rangeHighlightDecorationId: string | null = null;
|
||||
private lastKnownEditorSelection: Selection | null = null;
|
||||
|
||||
constructor(editor: ICodeEditor, @IThemeService private readonly themeService: IThemeService) {
|
||||
this.editor = editor;
|
||||
|
||||
@@ -98,17 +98,20 @@ function withTypedEditor<T>(widget: editorCommon.IEditor, codeEditorCallback: (e
|
||||
export class SimpleEditorModelResolverService implements ITextModelService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private editor: editorCommon.IEditor;
|
||||
private editor?: editorCommon.IEditor;
|
||||
|
||||
public setEditor(editor: editorCommon.IEditor): void {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public createModelReference(resource: URI): Promise<IReference<IResolvedTextEditorModel>> {
|
||||
let model: ITextModel | null = withTypedEditor(this.editor,
|
||||
(editor) => this.findModel(editor, resource),
|
||||
(diffEditor) => this.findModel(diffEditor.getOriginalEditor(), resource) || this.findModel(diffEditor.getModifiedEditor(), resource)
|
||||
);
|
||||
let model: ITextModel | null = null;
|
||||
if (this.editor) {
|
||||
model = withTypedEditor(this.editor,
|
||||
(editor) => this.findModel(editor, resource),
|
||||
(diffEditor) => this.findModel(diffEditor.getOriginalEditor(), resource) || this.findModel(diffEditor.getModifiedEditor(), resource)
|
||||
);
|
||||
}
|
||||
|
||||
if (!model) {
|
||||
return Promise.reject(new Error(`Model not found`));
|
||||
@@ -477,12 +480,12 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
|
||||
private readonly _onDidChangeConfigurationEmitter = new Emitter();
|
||||
private readonly _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
|
||||
public readonly onDidChangeConfiguration = this._onDidChangeConfiguration.event;
|
||||
|
||||
constructor(private readonly configurationService: SimpleConfigurationService) {
|
||||
this.configurationService.onDidChangeConfiguration((e) => {
|
||||
this._onDidChangeConfigurationEmitter.fire(e);
|
||||
this._onDidChangeConfiguration.fire(e);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -519,7 +522,7 @@ export class SimpleResourcePropertiesService implements ITextResourcePropertiesS
|
||||
}
|
||||
|
||||
export class StandaloneTelemetryService implements ITelemetryService {
|
||||
_serviceBrand: void;
|
||||
_serviceBrand: void = undefined;
|
||||
|
||||
public isOptedIn = false;
|
||||
|
||||
@@ -687,7 +690,7 @@ export class SimpleLayoutService implements ILayoutService {
|
||||
|
||||
public onLayout = Event.None;
|
||||
|
||||
private _dimension: IDimension;
|
||||
private _dimension?: IDimension;
|
||||
get dimension(): IDimension {
|
||||
if (!this._dimension) {
|
||||
this._dimension = dom.getClientArea(window.document.body);
|
||||
|
||||
@@ -153,7 +153,7 @@ function createAriaDomNode() {
|
||||
*/
|
||||
export class StandaloneCodeEditor extends CodeEditorWidget implements IStandaloneCodeEditor {
|
||||
|
||||
private readonly _standaloneKeybindingService: StandaloneKeybindingService;
|
||||
private readonly _standaloneKeybindingService: StandaloneKeybindingService | null;
|
||||
|
||||
constructor(
|
||||
domElement: HTMLElement,
|
||||
@@ -178,6 +178,8 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
||||
|
||||
if (keybindingService instanceof StandaloneKeybindingService) {
|
||||
this._standaloneKeybindingService = keybindingService;
|
||||
} else {
|
||||
this._standaloneKeybindingService = null;
|
||||
}
|
||||
|
||||
// Create the ARIA dom node as soon as the first editor is instantiated
|
||||
|
||||
@@ -482,6 +482,20 @@ export function registerFoldingRangeProvider(languageId: string, provider: modes
|
||||
return modes.FoldingRangeProviderRegistry.register(languageId, provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a declaration provider
|
||||
*/
|
||||
export function registerDeclarationProvider(languageId: string, provider: modes.DeclarationProvider): IDisposable {
|
||||
return modes.DeclarationProviderRegistry.register(languageId, provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a selection range provider
|
||||
*/
|
||||
export function registerSelectionRangeProvider(languageId: string, provider: modes.SelectionRangeProvider): IDisposable {
|
||||
return modes.SelectionRangeRegistry.register(languageId, provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains additional diagnostic information about the context in which
|
||||
* a [code action](#CodeActionProvider.provideCodeActions) is run.
|
||||
@@ -542,6 +556,8 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages {
|
||||
registerLinkProvider: <any>registerLinkProvider,
|
||||
registerColorProvider: <any>registerColorProvider,
|
||||
registerFoldingRangeProvider: <any>registerFoldingRangeProvider,
|
||||
registerDeclarationProvider: <any>registerDeclarationProvider,
|
||||
registerSelectionRangeProvider: <any>registerSelectionRangeProvider,
|
||||
|
||||
// enums
|
||||
DocumentHighlightKind: standaloneEnums.DocumentHighlightKind,
|
||||
|
||||
@@ -160,7 +160,7 @@ export class StandaloneThemeServiceImpl implements IStandaloneThemeService {
|
||||
|
||||
private readonly _knownThemes: Map<string, StandaloneTheme>;
|
||||
private readonly _styleElement: HTMLStyleElement;
|
||||
private _theme: IStandaloneTheme;
|
||||
private _theme!: IStandaloneTheme;
|
||||
private readonly _onThemeChange: Emitter<IStandaloneTheme>;
|
||||
private readonly _onIconThemeChange: Emitter<IIconTheme>;
|
||||
private readonly environment: IEnvironmentService = Object.create(null);
|
||||
|
||||
Reference in New Issue
Block a user