fix query plan doc failed to load issue (#14943)

* fix query plan doc failed to load issue

* organize imports
This commit is contained in:
Alan Ren
2021-04-01 09:41:41 -07:00
committed by GitHub
parent fc13fb2200
commit ef8396f783

View File

@@ -3,13 +3,13 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import { EditorInput, EditorModel, IEditorInput } from 'vs/workbench/common/editor';
import { IFileService } from 'vs/platform/files/common/files';
import { URI } from 'vs/base/common/uri';
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ILanguageAssociation } from 'sql/workbench/services/languageAssociation/common/languageAssociation'; import { ILanguageAssociation } from 'sql/workbench/services/languageAssociation/common/languageAssociation';
import { URI } from 'vs/base/common/uri';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { EditorInput, EditorModel, IEditorInput } from 'vs/workbench/common/editor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
export class QueryPlanConverter implements ILanguageAssociation { export class QueryPlanConverter implements ILanguageAssociation {
static readonly languages = ['sqlplan']; static readonly languages = ['sqlplan'];
@@ -40,7 +40,7 @@ export class QueryPlanInput extends EditorInput {
constructor( constructor(
private _uri: URI, private _uri: URI,
@IFileService private readonly fileService: IFileService @ITextFileService private readonly fileService: ITextFileService
) { ) {
super(); super();
} }
@@ -67,7 +67,7 @@ export class QueryPlanInput extends EditorInput {
public async resolve(refresh?: boolean): Promise<EditorModel | null> { public async resolve(refresh?: boolean): Promise<EditorModel | null> {
if (!this._xml) { if (!this._xml) {
this._xml = (await this.fileService.readFile(this._uri)).value.toString(); this._xml = (await this.fileService.read(this._uri, { acceptTextOnly: true })).value;
} }
return null; return null;
} }