diff --git a/tests/cases/fourslash/findAllRefsForDefault04.ts b/tests/cases/fourslash/findAllRefsForDefault04.ts new file mode 100644 index 00000000000..45b008b55fe --- /dev/null +++ b/tests/cases/fourslash/findAllRefsForDefault04.ts @@ -0,0 +1,28 @@ +/// + +////function f() { +//// return 100; +////} +//// +////export default [|f|]; +//// +////var x: typeof f; +//// +////var y = f(); +//// +////namespace /**/[|f|] { +////} + +// The function 'f' and the namespace 'f' don't get merged, +// but the 'export default' site, includes both meanings. + +// Here we are testing whether the 'export default' +// site is included in the references to the namespace. + +goTo.marker(); +let ranges = test.ranges(); +verify.referencesCountIs(ranges.length); + +for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); +} diff --git a/tests/cases/fourslash/findAllRefsForDefault05.ts b/tests/cases/fourslash/findAllRefsForDefault05.ts new file mode 100644 index 00000000000..6655138da3b --- /dev/null +++ b/tests/cases/fourslash/findAllRefsForDefault05.ts @@ -0,0 +1,28 @@ +/// + +////function /**/[|f|]() { +//// return 100; +////} +//// +////export default [|f|]; +//// +////var x: typeof [|f|]; +//// +////var y = [|f|](); +//// +////namespace f { +////} + +// The function 'f' and the namespace 'f' don't get merged, +// but the 'export default' site, includes both meanings. + +// Here we are testing whether the 'export default' site +// and all value-uses of 'f' are included in the references to the function. + +goTo.marker(); +let ranges = test.ranges(); +verify.referencesCountIs(ranges.length); + +for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); +} diff --git a/tests/cases/fourslash/findAllRefsForDefault06.ts b/tests/cases/fourslash/findAllRefsForDefault06.ts new file mode 100644 index 00000000000..12c187b4b0c --- /dev/null +++ b/tests/cases/fourslash/findAllRefsForDefault06.ts @@ -0,0 +1,28 @@ +/// + +////function [|f|]() { +//// return 100; +////} +//// +////export default /**/[|f|]; +//// +////var x: typeof [|f|]; +//// +////var y = [|f|](); +//// +////namespace [|f|] { +////} + +// The function 'f' and the namespace 'f' don't get merged, +// but the 'export default' site, includes both meanings. + +// Here we are testing whether the 'export default' site +// and all value-uses of 'f' are included in the references to the function. + +goTo.marker(); +let ranges = test.ranges(); +verify.referencesCountIs(ranges.length); + +for (let expectedReference of ranges) { + verify.referencesAtPositionContains(expectedReference); +} diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportNegative02.ts b/tests/cases/fourslash/findAllRefsForDefault07.ts similarity index 76% rename from tests/cases/fourslash/findAllRefsForDefaultExportNegative02.ts rename to tests/cases/fourslash/findAllRefsForDefault07.ts index 901cc3ffe0f..9534a671316 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExportNegative02.ts +++ b/tests/cases/fourslash/findAllRefsForDefault07.ts @@ -11,5 +11,8 @@ ////namespace /**/DefaultExportedFunction { ////} +// The namespace and function do not merge, +// so the namespace should be all alone. + goTo.marker(); verify.referencesCountIs(1); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportNegative01.ts b/tests/cases/fourslash/findAllRefsForDefault08.ts similarity index 72% rename from tests/cases/fourslash/findAllRefsForDefaultExportNegative01.ts rename to tests/cases/fourslash/findAllRefsForDefault08.ts index b44ab76b292..80eabbe53f4 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExportNegative01.ts +++ b/tests/cases/fourslash/findAllRefsForDefault08.ts @@ -10,5 +10,8 @@ ////namespace /**/DefaultExportedClass { ////} +// The namespace and class do not merge, +// so the namespace should be all alone. + goTo.marker(); verify.referencesCountIs(1); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts b/tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts deleted file mode 100644 index d9364b2193e..00000000000 --- a/tests/cases/fourslash/findAllRefsForDefaultExportNegative03.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////function f() { -//// return 100; -////} -//// -////export default f; -//// -////var x: typeof f; -//// -////var y = f(); -//// -////namespace /**/f { -////} - -goTo.marker(); -verify.referencesCountIs(1);