change how we detect if a untitled query is valid (#6776)

This commit is contained in:
Anthony Dresser
2019-08-17 14:44:16 -07:00
committed by GitHub
parent b4c2acb8d0
commit 7f6839d38e
4 changed files with 23 additions and 41 deletions

View File

@@ -52,7 +52,7 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatusbarEntry } from 'vs/platform/statusbar/common/statusbar';
// {{SQL CARBON EDIT}}
import { QueryEditorService } from 'sql/workbench/services/queryEditor/browser/queryEditorService';
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
class SideBySideEditorEncodingSupport implements IEncodingSupport {
constructor(private master: IEncodingSupport, private details: IEncodingSupport) { }
@@ -864,7 +864,8 @@ export class ChangeModeAction extends Action {
@IQuickInputService private readonly quickInputService: IQuickInputService,
@IPreferencesService private readonly preferencesService: IPreferencesService,
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService
@IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService,
@IQueryEditorService private readonly queryEditorService: IQueryEditorService // {{ SQL CARBON EDIT }}
) {
super(actionId, actionLabel);
}
@@ -985,7 +986,7 @@ export class ChangeModeAction extends Action {
// {{SQL CARBON EDIT}} @anthonydresser preform a check before we actuall set the mode
// Change mode
if (typeof languageSelection !== 'undefined') {
QueryEditorService.sqlLanguageModeCheck(textModel, languageSelection, activeEditor).then(newTextModel => {
this.queryEditorService.sqlLanguageModeCheck(textModel, languageSelection, activeEditor).then(newTextModel => {
if (newTextModel) {
modeSupport.setMode(languageSelection.languageIdentifier.language);
}