stubbing extra completions

This commit is contained in:
Arthur Ozga
2016-11-29 14:33:20 -06:00
parent bf48564cc8
commit ba80ce63ad
7 changed files with 161 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ namespace ts.codefix {
}
const node = declarations[0];
const visibility = getVisibilityPrefix(getModifierFlags(node));
let getOrSetPrefix: string = undefined;
switch (node.kind) {
case SyntaxKind.PropertySignature:
case SyntaxKind.PropertyDeclaration:
@@ -44,6 +45,20 @@ namespace ts.codefix {
const sigString = checker.signatureToString(signatures[0], enclosingDeclaration, TypeFormatFlags.SuppressAnyReturnType, SignatureKind.Call);
return `${visibility}${name}${sigString}${getMethodBodyStub(newlineChar)}`;
case SyntaxKind.GetAccessor:
getOrSetPrefix = "get";
case SyntaxKind.SetAccessor:
getOrSetPrefix = getOrSetPrefix ? getOrSetPrefix : "set";
throw new Error('Not implemented, getter and setter.');
case SyntaxKind.ComputedPropertyName:
if (hasDynamicName(node)) {
return "";
}
throw new Error('Not implemented, computed property name.');
case SyntaxKind.IndexSignature:
throw new Error('Not implemented.');
default:
return "";
}