mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Disallow completion in interface declarations
This commit is contained in:
parent
463b2392b7
commit
3dc6072f58
@ -2403,7 +2403,7 @@ module ts {
|
||||
case SyntaxKind.CommaToken:
|
||||
return containingNodeKind === SyntaxKind.VariableDeclaration ||
|
||||
containingNodeKind === SyntaxKind.VariableStatement ||
|
||||
containingNodeKind === SyntaxKind.EnumDeclaration || // enum { foo, |
|
||||
containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, |
|
||||
isFunction(containingNodeKind);
|
||||
|
||||
case SyntaxKind.OpenParenToken:
|
||||
@ -2411,8 +2411,12 @@ module ts {
|
||||
isFunction(containingNodeKind);
|
||||
|
||||
case SyntaxKind.OpenBraceToken:
|
||||
return containingNodeKind === SyntaxKind.EnumDeclaration; // enum { |
|
||||
// containingNodeKind === SyntaxKind.InterfaceDeclaration;
|
||||
return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { |
|
||||
containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { |
|
||||
|
||||
case SyntaxKind.SemicolonToken:
|
||||
return containingNodeKind === SyntaxKind.Property &&
|
||||
previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; |
|
||||
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////var aa = 1;
|
||||
|
||||
////interface a { /*interfaceValue1*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////var aa = 1;
|
||||
|
||||
////interface a { f/*interfaceValue2*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////var aa = 1;
|
||||
|
||||
////interface a { f; /*interfaceValue3*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user