Skip to content

Commit d353d62

Browse files
Addressed CR feedback.
1 parent f20cc83 commit d353d62

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/services/services.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,12 @@ namespace ts {
32043204
return false;
32053205
}
32063206

3207+
/**
3208+
* Aggregates relevant symbols for completion in object literals and object binding patterns.
3209+
* Relevant symbols are stored in the captured 'symbols' variable.
3210+
*
3211+
* @returns true if 'symbols' was successfully populated; false otherwise.
3212+
*/
32073213
function tryGetObjectLikeCompletionSymbols(objectLikeContainer: ObjectLiteralExpression | BindingPattern): boolean {
32083214
// We're looking up possible property names from contextual/inferred/declared type.
32093215
isMemberCompletion = true;
@@ -3242,6 +3248,15 @@ namespace ts {
32423248
return true;
32433249
}
32443250

3251+
/**
3252+
* Aggregates relevant symbols for completion in import clauses; for instance,
3253+
*
3254+
* import { $ } from "moduleName";
3255+
*
3256+
* Relevant symbols are stored in the captured 'symbols' variable.
3257+
*
3258+
* @returns true if 'symbols' was successfully populated; false otherwise.
3259+
*/
32453260
function tryGetImportClauseCompletionSymbols(importClause: ImportClause): boolean {
32463261
// cursor is in import clause
32473262
// try to show exported member for imported module

tests/cases/fourslash/completionListInImportClause01.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
function verifyCompletionAtMarker(marker: string, showBuilder: boolean, ...completions: string[]) {
1515
goTo.marker(marker);
1616
if (completions.length) {
17-
for (let i = 0; i < completions.length; ++i) {
18-
verify.completionListContains(completions[i]);
17+
for (let completion of completions) {
18+
verify.completionListContains(completion);
1919
}
2020
}
2121
else {

0 commit comments

Comments
 (0)