mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Merge pull request #38734 from a-tarasyuk/bug/34934
fix(34934): Completions for private members appear in JavaScript files
This commit is contained in:
commit
463f8e10b9
@ -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()) {
|
||||
|
||||
20
tests/cases/fourslash/completionsPrivateProperties_Js.ts
Normal file
20
tests/cases/fourslash/completionsPrivateProperties_Js.ts
Normal file
@ -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"] });
|
||||
Loading…
x
Reference in New Issue
Block a user