mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
stubbing extra completions
This commit is contained in:
@@ -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 "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user