fix #29469, remove unsued code

This commit is contained in:
Johannes Rieken
2017-07-11 17:54:21 +02:00
parent 2ae81ab6ec
commit 38f0dea2b6
13 changed files with 49 additions and 69 deletions

View File

@@ -464,7 +464,7 @@ export abstract class ExtHostLanguageFeaturesShape {
$provideHover(handle: number, resource: URI, position: IPosition): TPromise<modes.Hover> { throw ni(); }
$provideDocumentHighlights(handle: number, resource: URI, position: IPosition): TPromise<modes.DocumentHighlight[]> { throw ni(); }
$provideReferences(handle: number, resource: URI, position: IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]> { throw ni(); }
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.CodeAction[]> { throw ni(); }
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.Command[]> { throw ni(); }
$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
$provideOnTypeFormattingEdits(handle: number, resource: URI, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }

View File

@@ -399,11 +399,11 @@ export class ExtHostApiCommands {
resource,
range: typeConverters.fromRange(range)
};
return this._commands.executeCommand<modes.CodeAction[]>('_executeCodeActionProvider', args).then(value => {
return this._commands.executeCommand<modes.Command[]>('_executeCodeActionProvider', args).then(value => {
if (!Array.isArray(value)) {
return undefined;
}
return value.map(quickFix => this._commands.converter.fromInternal(quickFix.command));
return value.map(quickFix => this._commands.converter.fromInternal(quickFix));
});
}

View File

@@ -271,7 +271,7 @@ class QuickFixAdapter {
this._provider = provider;
}
provideCodeActions(resource: URI, range: IRange): TPromise<modes.CodeAction[]> {
provideCodeActions(resource: URI, range: IRange): TPromise<modes.Command[]> {
const doc = this._documents.getDocumentData(resource).document;
const ran = TypeConverters.toRange(range);
@@ -291,12 +291,7 @@ class QuickFixAdapter {
if (!Array.isArray(commands)) {
return undefined;
}
return commands.map((command, i) => {
return <modes.CodeAction>{
command: this._commands.toInternal(command),
score: i
};
});
return commands.map(command => this._commands.toInternal(command));
});
}
}
@@ -843,7 +838,7 @@ export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
return this._createDisposable(handle);
}
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.CodeAction[]> {
$provideCodeActions(handle: number, resource: URI, range: IRange): TPromise<modes.Command[]> {
return this._withAdapter(handle, QuickFixAdapter, adapter => adapter.provideCodeActions(resource, range));
}