Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ namespace ts.Completions {
// each individual type has. This is because we're going to add all identifiers
// anyways. So we might as well elevate the members that were at least part
// of the individual types to a higher status since we know what they are.
symbols.push(...getPropertiesForCompletion(type, typeChecker));
symbols.push(...filter(getPropertiesForCompletion(type, typeChecker), s => typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, s)));
}
else {
for (const symbol of type.getApparentProperties()) {
Expand Down
20 changes: 20 additions & 0 deletions tests/cases/fourslash/completionsPrivateProperties_Js.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/// <reference path="fourslash.ts" />

// @allowJs: true
// @Filename: a.d.ts
////declare namespace A {
//// class Foo {
//// constructor();
////
//// private m1(): void;
//// protected m2(): void;
////
//// m3(): void;
//// }
////}

// @filename: b.js
////let foo = new A.Foo();
////foo./**/

verify.completions({ marker: [""], includes: ["m3"], excludes: ["m1", "m2"] });