Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 83c58a4

Browse filesBrowse files
author
Andy
authored
Don't consider x. a new identifier location just because x has a number index signature (microsoft#24699)
* Don't consider `x.` a new identifier location just because x has a number index signature * Update more tests
1 parent d0ae03c commit 83c58a4
Copy full SHA for 83c58a4

4 files changed

+10-6Lines changed: 10 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/services/completions.ts‎

Copy file name to clipboardExpand all lines: src/services/completions.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ namespace ts.Completions {
10741074
}
10751075

10761076
function addTypeProperties(type: Type): void {
1077-
isNewIdentifierLocation = hasIndexSignature(type);
1077+
isNewIdentifierLocation = !!type.getStringIndexType();
10781078

10791079
if (isUncheckedFile) {
10801080
// In javascript files, for union types, we don't just get the members that
Collapse file

‎tests/cases/fourslash/completionListAfterStringLiteral1.ts‎

Copy file name to clipboardExpand all lines: tests/cases/fourslash/completionListAfterStringLiteral1.ts
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
////"a"./**/
44

5-
goTo.marker();
6-
verify.not.completionListContains('alert');
7-
verify.completionListContains('charAt');
5+
verify.completions({
6+
marker: "",
7+
exact: [
8+
"toString", "charAt", "charCodeAt", "concat", "indexOf", "lastIndexOf", "localeCompare", "match", "replace", "search", "slice",
9+
"split", "substring", "toLowerCase", "toLocaleLowerCase", "toUpperCase", "toLocaleUpperCase", "trim", "length", "substr", "valueOf",
10+
],
11+
});
Collapse file

‎tests/cases/fourslash/getJavaScriptCompletions12.ts‎

Copy file name to clipboardExpand all lines: tests/cases/fourslash/getJavaScriptCompletions12.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
////var test1 = function(x) { return x./*4*/ }, test2 = function(a) { return a./*5*/ };
2525

2626
verify.completions(
27-
{ marker: "1", includes: { name: "charCodeAt", kind: "method" }, isNewIdentifierLocation: true },
27+
{ marker: "1", includes: { name: "charCodeAt", kind: "method" } },
2828
{ marker: ["2", "3", "4"], includes: { name: "toExponential", kind: "method" } },
2929
{ marker: "5", includes: { name: "test1", kind: "warning" } },
3030
);
Collapse file

‎tests/cases/fourslash/javaScriptClass1.ts‎

Copy file name to clipboardExpand all lines: tests/cases/fourslash/javaScriptClass1.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ edit.insert('.');
2222
verify.completions({ exact: ["bar", "thing", "union", "Foo", "x"] });
2323

2424
edit.insert('bar.');
25-
verify.completions({ includes: ["substr"], isNewIdentifierLocation: true });
25+
verify.completions({ includes: ["substr"] });
2626
edit.backspace('bar.'.length);
2727

2828
edit.insert('union.');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.