Added values to enums to make 2.0.3 compiler happy with structural equal enums

This commit is contained in:
Dirk Baeumer
2016-09-23 11:50:22 +02:00
parent 97f5c11267
commit a48d278d19
9 changed files with 130 additions and 117 deletions

View File

@@ -149,23 +149,23 @@ export class ExtHostAPIImplementation {
this.Selection = extHostTypes.Selection;
this.CancellationTokenSource = CancellationTokenSource;
this.Hover = extHostTypes.Hover;
this.SymbolKind = <any>extHostTypes.SymbolKind;
this.SymbolInformation = <any>extHostTypes.SymbolInformation;
this.DocumentHighlightKind = <any>extHostTypes.DocumentHighlightKind;
this.DocumentHighlight = <any>extHostTypes.DocumentHighlight;
this.SymbolKind = extHostTypes.SymbolKind;
this.SymbolInformation = extHostTypes.SymbolInformation;
this.DocumentHighlightKind = extHostTypes.DocumentHighlightKind;
this.DocumentHighlight = extHostTypes.DocumentHighlight;
this.CodeLens = extHostTypes.CodeLens;
this.ParameterInformation = extHostTypes.ParameterInformation;
this.SignatureInformation = extHostTypes.SignatureInformation;
this.SignatureHelp = extHostTypes.SignatureHelp;
this.CompletionItem = <any>extHostTypes.CompletionItem;
this.CompletionItemKind = <any>extHostTypes.CompletionItemKind;
this.CompletionItem = extHostTypes.CompletionItem;
this.CompletionItemKind = extHostTypes.CompletionItemKind;
this.CompletionList = extHostTypes.CompletionList;
this.DocumentLink = extHostTypes.DocumentLink;
this.ViewColumn = extHostTypes.ViewColumn;
this.StatusBarAlignment = <any>extHostTypes.StatusBarAlignment;
this.IndentAction = <any>Modes.IndentAction;
this.StatusBarAlignment = extHostTypes.StatusBarAlignment;
this.IndentAction = Modes.IndentAction;
this.OverviewRulerLane = EditorCommon.OverviewRulerLane;
this.TextEditorRevealType = <any>extHostTypes.TextEditorRevealType;
this.TextEditorRevealType = extHostTypes.TextEditorRevealType;
this.EndOfLine = extHostTypes.EndOfLine;
this.TextEditorCursorStyle = EditorCommon.TextEditorCursorStyle;
this.TextEditorSelectionChangeKind = extHostTypes.TextEditorSelectionChangeKind;

View File

@@ -350,7 +350,7 @@ class ExtHostApiCommands {
incomplete = item.container.incomplete || incomplete;
items.push(typeConverters.Suggest.to(item.container, position, item.suggestion));
}
return new types.CompletionList(<vscode.CompletionItem[]><any>items, incomplete);
return new types.CompletionList(items, incomplete);
}
});
}

View File

@@ -243,7 +243,7 @@ class DocumentHighlightAdapter {
private static _convertDocumentHighlight(documentHighlight: vscode.DocumentHighlight): modes.DocumentHighlight {
return {
range: TypeConverters.fromRange(documentHighlight.range),
kind: <modes.DocumentHighlightKind><any>documentHighlight.kind
kind: documentHighlight.kind
};
}
}
@@ -583,8 +583,8 @@ class SuggestAdapter {
if (!item) {
return TPromise.as(suggestion);
}
return asWinJsPromise(token => this._provider.resolveCompletionItem(<vscode.CompletionItem><any>item, token)).then(resolvedItem => {
return TypeConverters.Suggest.from(resolvedItem || <vscode.CompletionItem><any>item, this._disposables[id]);
return asWinJsPromise(token => this._provider.resolveCompletionItem(item, token)).then(resolvedItem => {
return TypeConverters.Suggest.from(resolvedItem || item, this._disposables[id]);
});
}
}

View File

@@ -220,7 +220,7 @@ export namespace SymbolInformation {
export function toOutlineEntry(symbol: vscode.SymbolInformation): modes.SymbolInformation {
return <modes.SymbolInformation>{
name: symbol.name,
kind: <modes.SymbolKind><any>symbol.kind,
kind: symbol.kind,
containerName: symbol.containerName,
location: {
uri: <URI>symbol.location.uri,
@@ -317,7 +317,7 @@ export const Suggest = {
const suggestion: modes.ISuggestion = {
label: item.label,
insertText: item.insertText || item.label,
type: CompletionItemKind.from(<types.CompletionItemKind><any>item.kind),
type: CompletionItemKind.from(item.kind),
detail: item.detail,
documentation: item.documentation,
sortText: item.sortText,

View File

@@ -611,9 +611,9 @@ export class Hover {
}
export enum DocumentHighlightKind {
Text,
Read,
Write
Text = 0,
Read = 1,
Write = 2
}
export class DocumentHighlight {
@@ -745,24 +745,24 @@ export class SignatureHelp {
}
export enum CompletionItemKind {
Text,
Method,
Function,
Constructor,
Field,
Variable,
Class,
Interface,
Module,
Property,
Unit,
Value,
Enum,
Keyword,
Snippet,
Color,
File,
Reference
Text = 0,
Method = 1,
Function = 2,
Constructor = 3,
Field = 4,
Variable = 5,
Class = 6,
Interface = 7,
Module = 8,
Property = 9,
Unit = 10,
Value = 11,
Enum = 12,
Keyword = 13,
Snippet = 14,
Color = 15,
File = 16,
Reference = 17
}
export class CompletionItem {

View File

@@ -238,10 +238,10 @@ export class MainThreadLanguageFeatures extends MainThreadLanguageFeaturesShape
$setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any> {
if (configuration.__characterPairSupport) {
(<LanguageConfiguration><any> configuration).autoClosingPairs = configuration.__characterPairSupport.autoClosingPairs;
(<LanguageConfiguration>configuration).autoClosingPairs = configuration.__characterPairSupport.autoClosingPairs;
}
this._registrations[handle] = LanguageConfigurationRegistry.register(languageId, <LanguageConfiguration><any>configuration);
this._registrations[handle] = LanguageConfigurationRegistry.register(languageId, <LanguageConfiguration>configuration);
return undefined;
}