Skip to content

Commit 57d57a3

Browse files
author
Andy
authored
Merge pull request #15670 from Microsoft/signatureHelp
Remove old commented-out code from signatureHelp
2 parents a4b9110 + 883ccae commit 57d57a3

File tree

1 file changed

+0
-162
lines changed

1 file changed

+0
-162
lines changed

src/services/signatureHelp.ts

Lines changed: 0 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,6 @@
11
///<reference path='services.ts' />
22
/* @internal */
33
namespace ts.SignatureHelp {
4-
5-
// A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression
6-
// or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference.
7-
// To do this, the method will back parse the expression starting at the position required. it will try to parse the current expression as a generic type expression, if it did succeed it
8-
// will return the generic identifier that started the expression (e.g. "foo" in "foo<any, |"). It is then up to the caller to ensure that this is a valid generic expression through
9-
// looking up the type. The method will also keep track of the parameter index inside the expression.
10-
// public static isInPartiallyWrittenTypeArgumentList(syntaxTree: TypeScript.SyntaxTree, position: number): any {
11-
// let token = Syntax.findTokenOnLeft(syntaxTree.sourceUnit(), position, /*includeSkippedTokens*/ true);
12-
13-
// if (token && TypeScript.Syntax.hasAncestorOfKind(token, TypeScript.SyntaxKind.TypeParameterList)) {
14-
// // We are in the wrong generic list. bail out
15-
// return null;
16-
// }
17-
18-
// let stack = 0;
19-
// let argumentIndex = 0;
20-
21-
// whileLoop:
22-
// while (token) {
23-
// switch (token.kind()) {
24-
// case TypeScript.SyntaxKind.LessThanToken:
25-
// if (stack === 0) {
26-
// // Found the beginning of the generic argument expression
27-
// let lessThanToken = token;
28-
// token = previousToken(token, /*includeSkippedTokens*/ true);
29-
// if (!token || token.kind() !== TypeScript.SyntaxKind.IdentifierName) {
30-
// break whileLoop;
31-
// }
32-
33-
// // Found the name, return the data
34-
// return {
35-
// genericIdentifer: token,
36-
// lessThanToken: lessThanToken,
37-
// argumentIndex: argumentIndex
38-
// };
39-
// }
40-
// else if (stack < 0) {
41-
// // Seen one too many less than tokens, bail out
42-
// break whileLoop;
43-
// }
44-
// else {
45-
// stack--;
46-
// }
47-
48-
// break;
49-
50-
// case TypeScript.SyntaxKind.GreaterThanGreaterThanGreaterThanToken:
51-
// stack++;
52-
53-
// // Intentional fall through
54-
// case TypeScript.SyntaxKind.GreaterThanToken:
55-
// stack++;
56-
// break;
57-
58-
// case TypeScript.SyntaxKind.CommaToken:
59-
// if (stack === 0) {
60-
// argumentIndex++;
61-
// }
62-
63-
// break;
64-
65-
// case TypeScript.SyntaxKind.CloseBraceToken:
66-
// // This can be object type, skip untill we find the matching open brace token
67-
// let unmatchedOpenBraceTokens = 0;
68-
69-
// // Skip untill the matching open brace token
70-
// token = SignatureInfoHelpers.moveBackUpTillMatchingTokenKind(token, TypeScript.SyntaxKind.CloseBraceToken, TypeScript.SyntaxKind.OpenBraceToken);
71-
// if (!token) {
72-
// // No matching token was found. bail out
73-
// break whileLoop;
74-
// }
75-
76-
// break;
77-
78-
// case TypeScript.SyntaxKind.EqualsGreaterThanToken:
79-
// // This can be a function type or a constructor type. In either case, we want to skip the function definition
80-
// token = previousToken(token, /*includeSkippedTokens*/ true);
81-
82-
// if (token && token.kind() === TypeScript.SyntaxKind.CloseParenToken) {
83-
// // Skip untill the matching open paren token
84-
// token = SignatureInfoHelpers.moveBackUpTillMatchingTokenKind(token, TypeScript.SyntaxKind.CloseParenToken, TypeScript.SyntaxKind.OpenParenToken);
85-
86-
// if (token && token.kind() === TypeScript.SyntaxKind.GreaterThanToken) {
87-
// // Another generic type argument list, skip it\
88-
// token = SignatureInfoHelpers.moveBackUpTillMatchingTokenKind(token, TypeScript.SyntaxKind.GreaterThanToken, TypeScript.SyntaxKind.LessThanToken);
89-
// }
90-
91-
// if (token && token.kind() === TypeScript.SyntaxKind.NewKeyword) {
92-
// // In case this was a constructor type, skip the new keyword
93-
// token = previousToken(token, /*includeSkippedTokens*/ true);
94-
// }
95-
96-
// if (!token) {
97-
// // No matching token was found. bail out
98-
// break whileLoop;
99-
// }
100-
// }
101-
// else {
102-
// // This is not a function type. exit the main loop
103-
// break whileLoop;
104-
// }
105-
106-
// break;
107-
108-
// case TypeScript.SyntaxKind.IdentifierName:
109-
// case TypeScript.SyntaxKind.AnyKeyword:
110-
// case TypeScript.SyntaxKind.NumberKeyword:
111-
// case TypeScript.SyntaxKind.StringKeyword:
112-
// case TypeScript.SyntaxKind.VoidKeyword:
113-
// case TypeScript.SyntaxKind.BooleanKeyword:
114-
// case TypeScript.SyntaxKind.DotToken:
115-
// case TypeScript.SyntaxKind.OpenBracketToken:
116-
// case TypeScript.SyntaxKind.CloseBracketToken:
117-
// // Valid tokens in a type name. Skip.
118-
// break;
119-
120-
// default:
121-
// break whileLoop;
122-
// }
123-
124-
// token = previousToken(token, /*includeSkippedTokens*/ true);
125-
// }
126-
127-
// return null;
128-
// }
129-
130-
// private static moveBackUpTillMatchingTokenKind(token: TypeScript.ISyntaxToken, tokenKind: TypeScript.SyntaxKind, matchingTokenKind: TypeScript.SyntaxKind): TypeScript.ISyntaxToken {
131-
// if (!token || token.kind() !== tokenKind) {
132-
// throw TypeScript.Errors.invalidOperation();
133-
// }
134-
135-
// // Skip the current token
136-
// token = previousToken(token, /*includeSkippedTokens*/ true);
137-
138-
// let stack = 0;
139-
140-
// while (token) {
141-
// if (token.kind() === matchingTokenKind) {
142-
// if (stack === 0) {
143-
// // Found the matching token, return
144-
// return token;
145-
// }
146-
// else if (stack < 0) {
147-
// // tokens overlapped.. bail out.
148-
// break;
149-
// }
150-
// else {
151-
// stack--;
152-
// }
153-
// }
154-
// else if (token.kind() === tokenKind) {
155-
// stack++;
156-
// }
157-
158-
// // Move back
159-
// token = previousToken(token, /*includeSkippedTokens*/ true);
160-
// }
161-
162-
// // Did not find matching token
163-
// return null;
164-
// }
165-
1664
const emptyArray: any[] = [];
1675

1686
export const enum ArgumentListKind {

0 commit comments

Comments
 (0)