diff --git a/.github/workflows/accept-baselines-fix-lints.yaml b/.github/workflows/accept-baselines-fix-lints.yaml index ede8eaaa05f2b..333348156fbf1 100644 --- a/.github/workflows/accept-baselines-fix-lints.yaml +++ b/.github/workflows/accept-baselines-fix-lints.yaml @@ -17,10 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e3223d8e8b88..b30351dc24db6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,9 +49,9 @@ jobs: name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }} steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Use node version ${{ matrix.node-version }} - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: ${{ matrix.node-version }} check-latest: true @@ -80,8 +80,8 @@ jobs: contents: read steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -90,14 +90,14 @@ jobs: run: npm test -- --no-lint --coverage - name: Upload coverage artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: coverage path: coverage - - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 + - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 with: - use_oidc: true + use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} disable_search: true files: ./coverage/codecov.json @@ -105,8 +105,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -118,8 +118,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -131,13 +131,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci - - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ~/.cache/dprint key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }} @@ -151,8 +151,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -167,8 +167,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -180,9 +180,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | @@ -221,16 +221,16 @@ jobs: if: github.event_name == 'pull_request' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: pr - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: base ref: ${{ github.base_ref }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | @@ -262,8 +262,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -278,8 +278,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -297,8 +297,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: npm ci @@ -334,7 +334,7 @@ jobs: - name: Upload baseline diff artifact if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }} - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: fix_baselines.patch path: fix_baselines.patch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3cc1c74a19577..249d7f87cbfbb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,11 +42,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,4 +70,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 diff --git a/.github/workflows/create-cherry-pick-pr.yml b/.github/workflows/create-cherry-pick-pr.yml index c96bb251c5ca8..81090f3ecaf12 100644 --- a/.github/workflows/create-cherry-pick-pr.yml +++ b/.github/workflows/create-cherry-pick-pr.yml @@ -47,7 +47,7 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. diff --git a/.github/workflows/insiders.yaml b/.github/workflows/insiders.yaml index 42044e56cf588..dc23cc43673b8 100644 --- a/.github/workflows/insiders.yaml +++ b/.github/workflows/insiders.yaml @@ -20,8 +20,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | @@ -42,8 +42,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' # Use NODE_AUTH_TOKEN environment variable to authenticate to this registry. diff --git a/.github/workflows/lkg.yml b/.github/workflows/lkg.yml index 590e0a56f87b3..26fe358473e22 100644 --- a/.github/workflows/lkg.yml +++ b/.github/workflows/lkg.yml @@ -27,11 +27,11 @@ jobs: exit 1 fi - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.branch_name }} token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml index 1ac0e6d812844..17bffe12ee4c1 100644 --- a/.github/workflows/new-release-branch.yaml +++ b/.github/workflows/new-release-branch.yaml @@ -50,12 +50,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 8ea7d7102765e..375a8255ae67b 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -21,8 +21,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | @@ -42,8 +42,8 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' # Use NODE_AUTH_TOKEN environment variable to authenticate to this registry. diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml index 1ffb516f81108..8ccdfb282043a 100644 --- a/.github/workflows/release-branch-artifact.yaml +++ b/.github/workflows/release-branch-artifact.yaml @@ -19,8 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | @@ -44,7 +44,7 @@ jobs: npm pack ./ mv typescript-*.tgz typescript.tgz - name: Upload built tarfile - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: tgz path: typescript.tgz diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c31237e451a7e..942edbd7bbd4a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -29,7 +29,7 @@ jobs: steps: - name: 'Checkout code' - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false @@ -47,7 +47,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: 'Upload artifact' - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: SARIF file path: results.sarif @@ -55,6 +55,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 with: sarif_file: results.sarif diff --git a/.github/workflows/set-version.yaml b/.github/workflows/set-version.yaml index 2237c87c6428b..145a717383d47 100644 --- a/.github/workflows/set-version.yaml +++ b/.github/workflows/set-version.yaml @@ -49,11 +49,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.branch_name }} token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | diff --git a/.github/workflows/sync-branch.yaml b/.github/workflows/sync-branch.yaml index 4e5b2e66b2f4e..e5baa9b763142 100644 --- a/.github/workflows/sync-branch.yaml +++ b/.github/workflows/sync-branch.yaml @@ -42,10 +42,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.branch_name }} filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ diff --git a/.github/workflows/sync-wiki.yml b/.github/workflows/sync-wiki.yml index d2f738cf95b7d..d96b1db60974f 100644 --- a/.github/workflows/sync-wiki.yml +++ b/.github/workflows/sync-wiki.yml @@ -18,7 +18,7 @@ jobs: - name: Get repo name run: R=${GITHUB_REPOSITORY%?wiki}; echo "BASENAME=${R##*/}" >> $GITHUB_ENV - name: Checkout ${{ env.BASENAME }}-wiki - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: '${{ GITHUB.repository_owner }}/${{ env.BASENAME }}-wiki' token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index 2547f4788fbad..08a9e42e3dd14 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -49,13 +49,13 @@ jobs: runs-on: ubuntu-latest steps: - if: ${{ github.event.inputs.bisect }} - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. - if: ${{ !github.event.inputs.bisect }} - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - uses: microsoft/TypeScript-Twoslash-Repro-Action@8680b5b290d48a7badbc7ba65971d526c61b86b8 # master diff --git a/.github/workflows/update-package-lock.yaml b/.github/workflows/update-package-lock.yaml index ef44217382b9a..abf340d4f3360 100644 --- a/.github/workflows/update-package-lock.yaml +++ b/.github/workflows/update-package-lock.yaml @@ -22,10 +22,10 @@ jobs: if: github.repository == 'microsoft/TypeScript' steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - run: | diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4aba38f9f476c..ce0291367b510 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -171,6 +171,7 @@ import { EnumMember, EnumType, equateValues, + ErrorOutputContainer, escapeLeadingUnderscores, escapeString, EvaluatorResult, @@ -5565,7 +5566,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const cache = (links.accessibleChainCache ||= new Map()); // Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more const firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, (_, __, ___, node) => node); - const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation && getNodeId(firstRelevantLocation)}|${meaning}`; + const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation ? getNodeId(firstRelevantLocation) : 0}|${meaning}`; if (cache.has(key)) { return cache.get(key); } @@ -6240,6 +6241,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } let annotationType = getTypeFromTypeNodeWithoutContext(existing); + if (isErrorType(annotationType)) { + // allow "reusing" type nodes that resolve to error types + // those can't truly be reused but it prevents cascading errors in isolatedDeclarations + // for source with errors there is no guarantee to emit correct code anyway + return true; + } if (requiresAddingUndefined && annotationType) { annotationType = getOptionalType(annotationType, !isParameter(node)); } @@ -7362,7 +7369,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const signatures = getSignaturesOfType(filterType(propertyType, t => !(t.flags & TypeFlags.Undefined)), SignatureKind.Call); for (const signature of signatures) { const methodDeclaration = signatureToSignatureDeclarationHelper(signature, SyntaxKind.MethodSignature, context, { name: propertyName, questionToken: optionalToken }) as MethodSignature; - typeElements.push(preserveCommentsOn(methodDeclaration)); + typeElements.push(preserveCommentsOn(methodDeclaration, signature.declaration || propertySymbol.valueDeclaration)); } if (signatures.length || !optionalToken) { return; @@ -7394,9 +7401,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { propertyTypeNode, ); - typeElements.push(preserveCommentsOn(propertySignature)); + typeElements.push(preserveCommentsOn(propertySignature, propertySymbol.valueDeclaration)); - function preserveCommentsOn(node: T) { + function preserveCommentsOn(node: T, range: Node | undefined) { const jsdocPropertyTag = propertySymbol.declarations?.find((d): d is JSDocPropertyTag => d.kind === SyntaxKind.JSDocPropertyTag); if (jsdocPropertyTag) { const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment); @@ -7404,9 +7411,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { setSyntheticLeadingComments(node, [{ kind: SyntaxKind.MultiLineCommentTrivia, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); } } - else if (propertySymbol.valueDeclaration) { + else if (range) { // Copy comments to node for declaration emit - setCommentRange(context, node, propertySymbol.valueDeclaration); + setCommentRange(context, node, range); } return node; } @@ -11633,7 +11640,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // contextual type or, if the element itself is a binding pattern, with the type implied by that binding // pattern. const contextualType = isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType; - return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, CheckMode.Normal, contextualType))); + return addOptionality(getWidenedLiteralTypeForInitializer(element, checkDeclarationInitializer(element, CheckMode.Normal, contextualType))); } if (isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); @@ -11670,7 +11677,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const flags = SymbolFlags.Property | (e.initializer ? SymbolFlags.Optional : 0); const symbol = createSymbol(flags, text); symbol.links.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); - symbol.links.bindingElement = e; members.set(symbol.escapedName, symbol); }); const result = createAnonymousType(/*symbol*/ undefined, members, emptyArray, emptyArray, stringIndexInfo ? [stringIndexInfo] : emptyArray); @@ -11999,7 +12005,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || - accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration(accessor, /*reportErrors*/ true); + accessor && getWidenedTypeForVariableLikeDeclaration(accessor, /*reportErrors*/ true); if (!type) { if (setter && !isPrivateWithinAmbient(setter)) { errorOrSuggestion(noImplicitAny, setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); @@ -19355,7 +19361,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers const aliasSymbol = getAliasSymbolForTypeNode(node); - if (getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { + if (!node.symbol || getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { links.resolvedType = emptyTypeLiteralType; } else { @@ -20602,7 +20608,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { expr: Expression | undefined, headMessage: DiagnosticMessage | undefined, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ): boolean { if (isTypeRelatedTo(source, target, relation)) return true; if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { @@ -20622,7 +20628,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { relation: Map, headMessage: DiagnosticMessage | undefined, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ): boolean { if (!node || isOrHasGenericConditional(target)) return false; if ( @@ -20666,7 +20672,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { relation: Map, headMessage: DiagnosticMessage | undefined, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ): boolean { const callSignatures = getSignaturesOfType(source, SignatureKind.Call); const constructSignatures = getSignaturesOfType(source, SignatureKind.Construct); @@ -20699,7 +20705,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Type, relation: Map, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ): boolean { // Don't elaborate blocks if (isBlock(node.body)) { @@ -20790,7 +20796,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Type, relation: Map, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ) { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; @@ -20870,7 +20876,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Type, relation: Map, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ) { const tupleOrArrayLikeTargetParts = filterType(target, isArrayOrTupleLikeType); const nonTupleOrArrayLikeTargetParts = filterType(target, t => !isArrayOrTupleLikeType(t)); @@ -20972,7 +20978,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Type, relation: Map, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ) { let result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); let invalidTextDiagnostic: DiagnosticMessage | undefined; @@ -21086,7 +21092,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Type, relation: Map, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ) { if (target.flags & (TypeFlags.Primitive | TypeFlags.Never)) return false; if (isTupleLikeType(source)) { @@ -21133,7 +21139,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { target: Type, relation: Map, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } | undefined, + errorOutputContainer: ErrorOutputContainer | undefined, ) { if (target.flags & (TypeFlags.Primitive | TypeFlags.Never)) return false; return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); @@ -21631,7 +21637,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, - errorOutputContainer?: { errors?: Diagnostic[]; skipLogging?: boolean; }, + errorOutputContainer?: ErrorOutputContainer, ): boolean { let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]] | undefined; @@ -29873,10 +29879,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const jsxFactoryNamespace = getJsxNamespace(node); const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node; - // allow null as jsxFragmentFactory + // #38720/60122, allow null as jsxFragmentFactory let jsxFactorySym: Symbol | undefined; if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, SymbolFlags.Value, jsxFactoryRefErr, /*isUse*/ true); + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, compilerOptions.jsx === JsxEmit.Preserve ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, jsxFactoryRefErr, /*isUse*/ true); } if (jsxFactorySym) { @@ -29890,12 +29896,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - // For JsxFragment, mark jsx pragma as referenced via resolveName + // if JsxFragment, additionally mark jsx pragma as referenced, since `getJsxNamespace` above would have resolved to only the fragment factory if they are distinct if (isJsxOpeningFragment(node)) { const file = getSourceFileOfNode(node); const localJsxNamespace = getLocalJsxNamespace(file); if (localJsxNamespace) { - resolveName(jsxFactoryLocation, localJsxNamespace, SymbolFlags.Value, jsxFactoryRefErr, /*isUse*/ true); + resolveName(jsxFactoryLocation, localJsxNamespace, compilerOptions.jsx === JsxEmit.Preserve ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, jsxFactoryRefErr, /*isUse*/ true); } } } @@ -32918,7 +32924,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } checkJsxChildren(node); - return getJsxElementTypeAt(node) || anyType; + const jsxElementType = getJsxElementTypeAt(node); + return isErrorType(jsxElementType) ? anyType : jsxElementType; } function isHyphenatedJsxName(name: string | __String) { @@ -35179,7 +35186,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { checkMode: CheckMode, reportErrors: boolean, containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, - errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; }, + errorOutputContainer: ErrorOutputContainer, ) { // Stateless function components can have maximum of three arguments: "props", "context", and "updater". // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props, @@ -35295,7 +35302,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { containingMessageChain: (() => DiagnosticMessageChain | undefined) | undefined, inferenceContext: InferenceContext | undefined, ): readonly Diagnostic[] | undefined { - const errorOutputContainer: { errors?: Diagnostic[]; skipLogging?: boolean; } = { errors: undefined, skipLogging: true }; + const errorOutputContainer: ErrorOutputContainer = { errors: undefined, skipLogging: true }; if (isJsxCallLike(node)) { if (!checkApplicableSignatureForJsxCallLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) { Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); @@ -36643,9 +36650,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (sourceFileLinks.jsxFragmentType !== undefined) return sourceFileLinks.jsxFragmentType; const jsxFragmentFactoryName = getJsxNamespace(node); + // #38720/60122, allow null as jsxFragmentFactory + if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType; + const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : undefined; const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? - resolveName(node, jsxFragmentFactoryName, SymbolFlags.Value, /*nameNotFoundMessage*/ jsxFactoryRefErr, /*isUse*/ true); + resolveName(node, jsxFragmentFactoryName, compilerOptions.jsx === JsxEmit.Preserve ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, /*nameNotFoundMessage*/ jsxFactoryRefErr, /*isUse*/ true); if (jsxFactorySymbol === undefined) return sourceFileLinks.jsxFragmentType = errorType; if (jsxFactorySymbol.escapedName === ReactNames.Fragment) return sourceFileLinks.jsxFragmentType = getTypeOfSymbol(jsxFactorySymbol); @@ -38617,7 +38627,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function checkIfExpressionRefinesParameter(func: FunctionLikeDeclaration, expr: Expression, param: ParameterDeclaration, initType: Type): Type | undefined { - const antecedent = (expr as Expression & { flowNode?: FlowNode; }).flowNode || + const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === SyntaxKind.ReturnStatement && (expr.parent as ReturnStatement).flowNode || createFlowNode(FlowFlags.Start, /*node*/ undefined, /*antecedent*/ undefined); const trueCondition = createFlowNode(FlowFlags.TrueCondition, expr, antecedent); @@ -40523,7 +40533,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function widenTypeInferredFromInitializer(declaration: HasExpressionInitializer, type: Type) { - const widened = getCombinedNodeFlagsCached(declaration) & NodeFlags.Constant || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type); + const widened = getWidenedLiteralTypeForInitializer(declaration, type); if (isInJSFile(declaration)) { if (isEmptyLiteralType(widened)) { reportImplicitAny(declaration, anyType); @@ -40537,6 +40547,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return widened; } + function getWidenedLiteralTypeForInitializer(declaration: HasExpressionInitializer, type: Type) { + return getCombinedNodeFlagsCached(declaration) & NodeFlags.Constant || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type); + } + function isLiteralOfContextualType(candidateType: Type, contextualType: Type | undefined): boolean { if (contextualType) { if (contextualType.flags & TypeFlags.UnionOrIntersection) { @@ -44920,7 +44934,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } if (!(type.flags & TypeFlags.Union)) { - const errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined = errorNode ? { errors: undefined } : undefined; + const errorOutputContainer: ErrorOutputContainer | undefined = errorNode ? { errors: undefined, skipLogging: true } : undefined; const iterationTypes = getIterationTypesOfIterableWorker(type, use, errorNode, errorOutputContainer); if (iterationTypes === noIterationTypes) { if (errorNode) { @@ -44945,7 +44959,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { let allIterationTypes: IterationTypes[] | undefined; for (const constituent of (type as UnionType).types) { - const errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined = errorNode ? { errors: undefined } : undefined; + const errorOutputContainer: ErrorOutputContainer | undefined = errorNode ? { errors: undefined } : undefined; const iterationTypes = getIterationTypesOfIterableWorker(constituent, use, errorNode, errorOutputContainer); if (iterationTypes === noIterationTypes) { if (errorNode) { @@ -44996,7 +45010,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { * NOTE: You probably don't want to call this directly and should be calling * `getIterationTypesOfIterable` instead. */ - function getIterationTypesOfIterableWorker(type: Type, use: IterationUse, errorNode: Node | undefined, errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined) { + function getIterationTypesOfIterableWorker(type: Type, use: IterationUse, errorNode: Node | undefined, errorOutputContainer: ErrorOutputContainer | undefined) { if (isTypeAny(type)) { return anyIterationTypes; } @@ -45138,19 +45152,23 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { * NOTE: You probably don't want to call this directly and should be calling * `getIterationTypesOfIterable` instead. */ - function getIterationTypesOfIterableSlow(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined, noCache: boolean) { + function getIterationTypesOfIterableSlow(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: ErrorOutputContainer | undefined, noCache: boolean) { const method = getPropertyOfType(type, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName)); const methodType = method && !(method.flags & SymbolFlags.Optional) ? getTypeOfSymbol(method) : undefined; if (isTypeAny(methodType)) { return noCache ? anyIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes); } - const signatures = methodType ? getSignaturesOfType(methodType, SignatureKind.Call) : undefined; - if (!some(signatures)) { + const allSignatures = methodType ? getSignaturesOfType(methodType, SignatureKind.Call) : undefined; + const validSignatures = filter(allSignatures, sig => getMinArgumentCount(sig) === 0); + if (!some(validSignatures)) { + if (errorNode && some(allSignatures)) { + checkTypeAssignableTo(type, resolver.getGlobalIterableType(/*reportErrors*/ true), errorNode, /*headMessage*/ undefined, /*containingMessageChain*/ undefined, errorOutputContainer); + } return noCache ? noIterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes); } - const iteratorType = getIntersectionType(map(signatures, getReturnTypeOfSignature)); + const iteratorType = getIntersectionType(map(validSignatures, getReturnTypeOfSignature)); const iterationTypes = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache) ?? noIterationTypes; return noCache ? iterationTypes : setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes); } @@ -45179,7 +45197,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` * record is returned. Otherwise, `undefined` is returned. */ - function getIterationTypesOfIterator(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined) { + function getIterationTypesOfIterator(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: ErrorOutputContainer | undefined) { return getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, /*noCache*/ false); } @@ -45192,7 +45210,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { * NOTE: You probably don't want to call this directly and should be calling * `getIterationTypesOfIterator` instead. */ - function getIterationTypesOfIteratorWorker(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined, noCache: boolean) { + function getIterationTypesOfIteratorWorker(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: ErrorOutputContainer | undefined, noCache: boolean) { if (isTypeAny(type)) { return anyIterationTypes; } @@ -45334,7 +45352,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes` * record is returned. Otherwise, we return `undefined`. */ - function getIterationTypesOfMethod(type: Type, resolver: IterationTypesResolver, methodName: "next" | "return" | "throw", errorNode: Node | undefined, errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined): IterationTypes | undefined { + function getIterationTypesOfMethod(type: Type, resolver: IterationTypesResolver, methodName: "next" | "return" | "throw", errorNode: Node | undefined, errorOutputContainer: ErrorOutputContainer | undefined): IterationTypes | undefined { const method = getPropertyOfType(type, methodName as __String); // Ignore 'return' or 'throw' if they are missing. @@ -45454,7 +45472,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { * NOTE: You probably don't want to call this directly and should be calling * `getIterationTypesOfIterator` instead. */ - function getIterationTypesOfIteratorSlow(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: { errors: Diagnostic[] | undefined; } | undefined, noCache: boolean) { + function getIterationTypesOfIteratorSlow(type: Type, resolver: IterationTypesResolver, errorNode: Node | undefined, errorOutputContainer: ErrorOutputContainer | undefined, noCache: boolean) { const iterationTypes = combineIterationTypes([ getIterationTypesOfMethod(type, resolver, "next", errorNode, errorOutputContainer), getIterationTypesOfMethod(type, resolver, "return", errorNode, errorOutputContainer), @@ -46760,6 +46778,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function checkInterfaceDeclaration(node: InterfaceDeclaration) { // Grammar checking if (!checkGrammarModifiers(node)) checkGrammarInterfaceDeclaration(node); + if (!allowBlockDeclarations(node.parent)) { + grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, "interface"); + } checkTypeParameters(node.typeParameters); addLazyDiagnostic(() => { @@ -46803,6 +46824,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // Grammar checking checkGrammarModifiers(node); checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); + if (!allowBlockDeclarations(node.parent)) { + grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, "type"); + } checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); if (node.type.kind === SyntaxKind.IntrinsicKeyword) { @@ -49673,7 +49697,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const typeNode = getNonlocalEffectiveTypeAnnotationNode(parameter); if (!typeNode) return false; const type = getTypeFromTypeNode(typeNode); - return containsUndefinedType(type); + // allow error type here to avoid confusing errors that the annotation has to contain undefined when it does in cases like this: + // + // export function fn(x?: Unresolved | undefined): void {} + return isErrorType(type) || containsUndefinedType(type); } function requiresAddingImplicitUndefined(parameter: ParameterDeclaration | JSDocParameterTag, enclosingDeclaration: Node | undefined) { @@ -52034,7 +52061,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return false; } - function allowLetAndConstDeclarations(parent: Node): boolean { + function allowBlockDeclarations(parent: Node): boolean { switch (parent.kind) { case SyntaxKind.IfStatement: case SyntaxKind.DoStatement: @@ -52045,14 +52072,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { case SyntaxKind.ForOfStatement: return false; case SyntaxKind.LabeledStatement: - return allowLetAndConstDeclarations(parent.parent); + return allowBlockDeclarations(parent.parent); } return true; } function checkGrammarForDisallowedBlockScopedVariableStatement(node: VariableStatement) { - if (!allowLetAndConstDeclarations(node.parent)) { + if (!allowBlockDeclarations(node.parent)) { const blockScopeKind = getCombinedNodeFlagsCached(node.declarationList) & NodeFlags.BlockScoped; if (blockScopeKind) { const keyword = blockScopeKind === NodeFlags.Let ? "let" : diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 6bb5e981e0470..b3c10e3c84951 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1,4 +1,5 @@ import { + addToSeen, AlternateModeDiagnostics, append, arrayFrom, @@ -2629,7 +2630,7 @@ export function convertToTSConfig(configParseResult: ParsedCommandLine, configFi const providedKeys = new Set(optionMap.keys()); const impliedCompilerOptions: Record = {}; for (const option in computedOptions) { - if (!providedKeys.has(option) && some(computedOptions[option].dependencies, dep => providedKeys.has(dep))) { + if (!providedKeys.has(option) && optionDependsOn(option, providedKeys)) { const implied = computedOptions[option].computeValue(configParseResult.options); const defaultValue = computedOptions[option].computeValue({}); if (implied !== defaultValue) { @@ -2641,6 +2642,18 @@ export function convertToTSConfig(configParseResult: ParsedCommandLine, configFi return config; } +function optionDependsOn(option: string, dependsOn: Set): boolean { + const seen = new Set(); + return optionDependsOnRecursive(option); + + function optionDependsOnRecursive(option: string): boolean { + if (addToSeen(seen, option)) { + return some(computedOptions[option]?.dependencies, dep => dependsOn.has(dep) || optionDependsOnRecursive(dep)); + } + return false; + } +} + /** @internal */ export function optionMapToObject(optionMap: Map): object { return Object.fromEntries(optionMap); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cab78bae9e082..7f686076f1824 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -7058,7 +7058,7 @@ "category": "Error", "code": 9023 }, - "Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.": { + "Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.": { "category": "Error", "code": 9025 }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 417ed4c2470f4..01a96579861f4 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3226,17 +3226,90 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri * Wraps an expression in parens if we would emit a leading comment that would introduce a line separator * between the node and its parent. */ - function parenthesizeExpressionForNoAsi(node: Expression) { - if (!commentsDisabled && isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) { - const parseNode = getParseTreeNode(node); - if (parseNode && isParenthesizedExpression(parseNode)) { - // If the original node was a parenthesized expression, restore it to preserve comment and source map emit - const parens = factory.createParenthesizedExpression(node.expression); - setOriginalNode(parens, node); - setTextRange(parens, parseNode); - return parens; + function parenthesizeExpressionForNoAsi(node: Expression): Expression { + if (!commentsDisabled) { + switch (node.kind) { + case SyntaxKind.PartiallyEmittedExpression: + if (willEmitLeadingNewLine(node)) { + const parseNode = getParseTreeNode(node); + if (parseNode && isParenthesizedExpression(parseNode)) { + // If the original node was a parenthesized expression, restore it to preserve comment and source map emit + const parens = factory.createParenthesizedExpression((node as PartiallyEmittedExpression).expression); + setOriginalNode(parens, node); + setTextRange(parens, parseNode); + return parens; + } + return factory.createParenthesizedExpression(node); + } + return factory.updatePartiallyEmittedExpression( + node as PartiallyEmittedExpression, + parenthesizeExpressionForNoAsi((node as PartiallyEmittedExpression).expression), + ); + case SyntaxKind.PropertyAccessExpression: + return factory.updatePropertyAccessExpression( + node as PropertyAccessExpression, + parenthesizeExpressionForNoAsi((node as PropertyAccessExpression).expression), + (node as PropertyAccessExpression).name, + ); + case SyntaxKind.ElementAccessExpression: + return factory.updateElementAccessExpression( + node as ElementAccessExpression, + parenthesizeExpressionForNoAsi((node as ElementAccessExpression).expression), + (node as ElementAccessExpression).argumentExpression, + ); + case SyntaxKind.CallExpression: + return factory.updateCallExpression( + node as CallExpression, + parenthesizeExpressionForNoAsi((node as CallExpression).expression), + (node as CallExpression).typeArguments, + (node as CallExpression).arguments, + ); + case SyntaxKind.TaggedTemplateExpression: + return factory.updateTaggedTemplateExpression( + node as TaggedTemplateExpression, + parenthesizeExpressionForNoAsi((node as TaggedTemplateExpression).tag), + (node as TaggedTemplateExpression).typeArguments, + (node as TaggedTemplateExpression).template, + ); + case SyntaxKind.PostfixUnaryExpression: + return factory.updatePostfixUnaryExpression( + node as PostfixUnaryExpression, + parenthesizeExpressionForNoAsi((node as PostfixUnaryExpression).operand), + ); + case SyntaxKind.BinaryExpression: + return factory.updateBinaryExpression( + node as BinaryExpression, + parenthesizeExpressionForNoAsi((node as BinaryExpression).left), + (node as BinaryExpression).operatorToken, + (node as BinaryExpression).right, + ); + case SyntaxKind.ConditionalExpression: + return factory.updateConditionalExpression( + node as ConditionalExpression, + parenthesizeExpressionForNoAsi((node as ConditionalExpression).condition), + (node as ConditionalExpression).questionToken, + (node as ConditionalExpression).whenTrue, + (node as ConditionalExpression).colonToken, + (node as ConditionalExpression).whenFalse, + ); + case SyntaxKind.AsExpression: + return factory.updateAsExpression( + node as AsExpression, + parenthesizeExpressionForNoAsi((node as AsExpression).expression), + (node as AsExpression).type, + ); + case SyntaxKind.SatisfiesExpression: + return factory.updateSatisfiesExpression( + node as SatisfiesExpression, + parenthesizeExpressionForNoAsi((node as SatisfiesExpression).expression), + (node as SatisfiesExpression).type, + ); + case SyntaxKind.NonNullExpression: + return factory.updateNonNullExpression( + node as NonNullExpression, + parenthesizeExpressionForNoAsi((node as NonNullExpression).expression), + ); } - return factory.createParenthesizedExpression(node); } return node; } diff --git a/src/compiler/factory/emitHelpers.ts b/src/compiler/factory/emitHelpers.ts index 2dc6a55441e8b..255518a2842cf 100644 --- a/src/compiler/factory/emitHelpers.ts +++ b/src/compiler/factory/emitHelpers.ts @@ -1188,13 +1188,23 @@ const importStarHelper: UnscopedEmitHelper = { dependencies: [createBindingHelper, setModuleDefaultHelper], priority: 2, text: ` - var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - };`, + var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + })();`, }; // emit helper for `import Name from "foo"` diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 75dd9a5465764..bf68c9d57ad22 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -1910,25 +1910,31 @@ function nodeModuleNameResolverWorker( } if (!isExternalModuleNameRelative(moduleName)) { - let resolved: SearchResult | undefined; if (features & NodeResolutionFeatures.Imports && startsWith(moduleName, "#")) { - resolved = loadModuleFromImports(extensions, moduleName, containingDirectory, state, cache, redirectedReference); - } - if (!resolved && features & NodeResolutionFeatures.SelfName) { - resolved = loadModuleFromSelfNameReference(extensions, moduleName, containingDirectory, state, cache, redirectedReference); + const resolved = loadModuleFromImports(extensions, moduleName, containingDirectory, state, cache, redirectedReference); + if (resolved) { + return resolved.value && { value: { resolved: resolved.value, isExternalLibraryImport: false } }; + } } - if (!resolved) { - if (moduleName.includes(":")) { - if (traceEnabled) { - trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions)); - } - return undefined; + + if (features & NodeResolutionFeatures.SelfName) { + const resolved = loadModuleFromSelfNameReference(extensions, moduleName, containingDirectory, state, cache, redirectedReference); + if (resolved) { + return resolved.value && { value: { resolved: resolved.value, isExternalLibraryImport: false } }; } + } + + if (moduleName.includes(":")) { if (traceEnabled) { - trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions)); + trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions)); } - resolved = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference); + return undefined; + } + + if (traceEnabled) { + trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions)); } + let resolved = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference); if (extensions & Extensions.Declaration) { resolved ??= resolveFromTypeRoot(moduleName, state); } @@ -2618,8 +2624,8 @@ function loadModuleFromExports(scope: PackageJsonInfo, extensions: Extensions, s mainExport = (scope.contents.packageJsonContent.exports as MapLike)["."]; } if (mainExport) { - const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, /*isImports*/ false); - return loadModuleFromTargetImportOrExport(mainExport, "", /*pattern*/ false, "."); + const loadModuleFromTargetExportOrImport = getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, subpath, scope, /*isImports*/ false); + return loadModuleFromTargetExportOrImport(mainExport, "", /*pattern*/ false, "."); } } else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports as MapLike)) { @@ -2629,7 +2635,7 @@ function loadModuleFromExports(scope: PackageJsonInfo, extensions: Extensions, s } return toSearchResult(/*value*/ undefined); } - const result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.contents.packageJsonContent.exports, scope, /*isImports*/ false); + const result = loadModuleFromExportsOrImports(extensions, state, cache, redirectedReference, subpath, scope.contents.packageJsonContent.exports, scope, /*isImports*/ false); if (result) { return result; } @@ -2663,7 +2669,7 @@ function loadModuleFromImports(extensions: Extensions, moduleName: string, direc return toSearchResult(/*value*/ undefined); } - const result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.contents.packageJsonContent.imports, scope, /*isImports*/ true); + const result = loadModuleFromExportsOrImports(extensions, state, cache, redirectedReference, moduleName, scope.contents.packageJsonContent.imports, scope, /*isImports*/ true); if (result) { return result; } @@ -2693,30 +2699,30 @@ export function comparePatternKeys(a: string, b: string): Comparison { return Comparison.EqualTo; } -function loadModuleFromImportsOrExports(extensions: Extensions, state: ModuleResolutionState, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined, moduleName: string, lookupTable: object, scope: PackageJsonInfo, isImports: boolean): SearchResult | undefined { - const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports); +function loadModuleFromExportsOrImports(extensions: Extensions, state: ModuleResolutionState, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined, moduleName: string, lookupTable: object, scope: PackageJsonInfo, isImports: boolean): SearchResult | undefined { + const loadModuleFromTargetExportOrImport = getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, moduleName, scope, isImports); if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) { - const target = (lookupTable as { [idx: string]: unknown; })[moduleName]; - return loadModuleFromTargetImportOrExport(target, /*subpath*/ "", /*pattern*/ false, moduleName); + const target = (lookupTable as MapLike)[moduleName]; + return loadModuleFromTargetExportOrImport(target, /*subpath*/ "", /*pattern*/ false, moduleName); } const expandingKeys = toSorted(filter(getOwnKeys(lookupTable as MapLike), k => hasOneAsterisk(k) || endsWith(k, "/")), comparePatternKeys); for (const potentialTarget of expandingKeys) { if (state.features & NodeResolutionFeatures.ExportsPatternTrailers && matchesPatternWithTrailer(potentialTarget, moduleName)) { - const target = (lookupTable as { [idx: string]: unknown; })[potentialTarget]; + const target = (lookupTable as MapLike)[potentialTarget]; const starPos = potentialTarget.indexOf("*"); const subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos)); - return loadModuleFromTargetImportOrExport(target, subpath, /*pattern*/ true, potentialTarget); + return loadModuleFromTargetExportOrImport(target, subpath, /*pattern*/ true, potentialTarget); } else if (endsWith(potentialTarget, "*") && startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) { - const target = (lookupTable as { [idx: string]: unknown; })[potentialTarget]; + const target = (lookupTable as MapLike)[potentialTarget]; const subpath = moduleName.substring(potentialTarget.length - 1); - return loadModuleFromTargetImportOrExport(target, subpath, /*pattern*/ true, potentialTarget); + return loadModuleFromTargetExportOrImport(target, subpath, /*pattern*/ true, potentialTarget); } else if (startsWith(moduleName, potentialTarget)) { - const target = (lookupTable as { [idx: string]: unknown; })[potentialTarget]; + const target = (lookupTable as MapLike)[potentialTarget]; const subpath = moduleName.substring(potentialTarget.length); - return loadModuleFromTargetImportOrExport(target, subpath, /*pattern*/ false, potentialTarget); + return loadModuleFromTargetExportOrImport(target, subpath, /*pattern*/ false, potentialTarget); } } @@ -2736,9 +2742,9 @@ function hasOneAsterisk(patternKey: string): boolean { /** * Gets the self-recursive function specialized to retrieving the targeted import/export element for the given resolution configuration */ -function getLoadModuleFromTargetImportOrExport(extensions: Extensions, state: ModuleResolutionState, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined, moduleName: string, scope: PackageJsonInfo, isImports: boolean) { - return loadModuleFromTargetImportOrExport; - function loadModuleFromTargetImportOrExport(target: unknown, subpath: string, pattern: boolean, key: string): SearchResult | undefined { +function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: ModuleResolutionState, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined, moduleName: string, scope: PackageJsonInfo, isImports: boolean) { + return loadModuleFromTargetExportOrImport; + function loadModuleFromTargetExportOrImport(target: unknown, subpath: string, pattern: boolean, key: string): SearchResult | undefined { if (typeof target === "string") { if (!pattern && subpath.length > 0 && !endsWith(target, "/")) { if (state.traceEnabled) { @@ -2801,7 +2807,7 @@ function getLoadModuleFromTargetImportOrExport(extensions: Extensions, state: Mo if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = (target as MapLike)[condition]; - const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); + const result = loadModuleFromTargetExportOrImport(subTarget, subpath, pattern, key); if (result) { traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); @@ -2826,7 +2832,7 @@ function getLoadModuleFromTargetImportOrExport(extensions: Extensions, state: Mo return toSearchResult(/*value*/ undefined); } for (const elem of target) { - const result = loadModuleFromTargetImportOrExport(elem, subpath, pattern, key); + const result = loadModuleFromTargetExportOrImport(elem, subpath, pattern, key); if (result) { return result; } diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index ac433ba8fed10..eacba122e496c 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -508,46 +508,44 @@ function computeModuleSpecifiers( } } - if (!specifier) { - const local = getLocalModuleSpecifier( - modulePath.path, - info, - compilerOptions, - host, - options.overrideImportMode || importingSourceFile.impliedNodeFormat, - preferences, - /*pathsOnly*/ modulePath.isRedirect, - ); - if (!local || forAutoImport && isExcludedByRegex(local, preferences.excludeRegexes)) { - continue; - } - if (modulePath.isRedirect) { - redirectPathsSpecifiers = append(redirectPathsSpecifiers, local); - } - else if (pathIsBareSpecifier(local)) { - if (pathContainsNodeModules(local)) { - // We could be in this branch due to inappropriate use of `baseUrl`, not intentional `paths` - // usage. It's impossible to reason about where to prioritize baseUrl-generated module - // specifiers, but if they contain `/node_modules/`, they're going to trigger a portability - // error, so *at least* don't prioritize those. - relativeSpecifiers = append(relativeSpecifiers, local); - } - else { - pathsSpecifiers = append(pathsSpecifiers, local); - } - } - else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) { - // Why this extra conditional, not just an `else`? If some path to the file contained - // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), - // that means we had to go through a *sibling's* node_modules, not one we can access directly. - // If some path to the file was in node_modules but another was not, this likely indicates that - // we have a monorepo structure with symlinks. In this case, the non-node_modules path is - // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package - // in a monorepo is probably not portable. So, the module specifier we actually go with will be - // the relative path through node_modules, so that the declaration emitter can produce a - // portability error. (See declarationEmitReexportedSymlinkReference3) + const local = getLocalModuleSpecifier( + modulePath.path, + info, + compilerOptions, + host, + options.overrideImportMode || importingSourceFile.impliedNodeFormat, + preferences, + /*pathsOnly*/ modulePath.isRedirect || !!specifier, + ); + if (!local || forAutoImport && isExcludedByRegex(local, preferences.excludeRegexes)) { + continue; + } + if (modulePath.isRedirect) { + redirectPathsSpecifiers = append(redirectPathsSpecifiers, local); + } + else if (pathIsBareSpecifier(local)) { + if (pathContainsNodeModules(local)) { + // We could be in this branch due to inappropriate use of `baseUrl`, not intentional `paths` + // usage. It's impossible to reason about where to prioritize baseUrl-generated module + // specifiers, but if they contain `/node_modules/`, they're going to trigger a portability + // error, so *at least* don't prioritize those. relativeSpecifiers = append(relativeSpecifiers, local); } + else { + pathsSpecifiers = append(pathsSpecifiers, local); + } + } + else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) { + // Why this extra conditional, not just an `else`? If some path to the file contained + // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), + // that means we had to go through a *sibling's* node_modules, not one we can access directly. + // If some path to the file was in node_modules but another was not, this likely indicates that + // we have a monorepo structure with symlinks. In this case, the non-node_modules path is + // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package + // in a monorepo is probably not portable. So, the module specifier we actually go with will be + // the relative path through node_modules, so that the declaration emitter can produce a + // portability error. (See declarationEmitReexportedSymlinkReference3) + relativeSpecifiers = append(relativeSpecifiers, local); } } @@ -613,7 +611,7 @@ function getLocalModuleSpecifier(moduleFileName: string, info: Info, compilerOpt prefersTsExtension(allowedEndings), ); - const fromPaths = pathsOnly || fromPackageJsonImports === undefined ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : undefined; + const fromPaths = pathsOnly || fromPackageJsonImports === undefined ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, baseDirectory, getCanonicalFileName, host, compilerOptions) : undefined; if (pathsOnly) { return fromPaths; } @@ -925,10 +923,11 @@ function tryGetModuleNameFromAmbientModule(moduleSymbol: Symbol, checker: TypeCh } } -function tryGetModuleNameFromPaths(relativeToBaseUrl: string, paths: MapLike, allowedEndings: ModuleSpecifierEnding[], host: ModuleSpecifierResolutionHost, compilerOptions: CompilerOptions): string | undefined { +function tryGetModuleNameFromPaths(relativeToBaseUrl: string, paths: MapLike, allowedEndings: ModuleSpecifierEnding[], baseDirectory: string, getCanonicalFileName: GetCanonicalFileName, host: ModuleSpecifierResolutionHost, compilerOptions: CompilerOptions): string | undefined { for (const key in paths) { for (const patternText of paths[key]) { - const pattern = normalizePath(patternText); + const normalized = normalizePath(patternText); + const pattern = getRelativePathIfInSameVolume(normalized, baseDirectory, getCanonicalFileName) ?? normalized; const indexOfStar = pattern.indexOf("*"); // In module resolution, if `pattern` itself has an extension, a file with that extension is looked up directly, // meaning a '.ts' or '.d.ts' extension is allowed to resolve. This is distinct from the case where a '*' substitution @@ -1290,6 +1289,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }: ModulePath, { getCan subModuleName, versionPaths.paths, allowedEndings, + packageRootPath, + getCanonicalFileName, host, options, ); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index a842766f058ac..59ad1f030220f 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2779,10 +2779,12 @@ namespace Parser { case SyntaxKind.DefaultKeyword: return nextTokenCanFollowDefaultKeyword(); case SyntaxKind.StaticKeyword: + nextToken(); + return canFollowModifier(); case SyntaxKind.GetKeyword: case SyntaxKind.SetKeyword: nextToken(); - return canFollowModifier(); + return canFollowGetOrSetKeyword(); default: return nextTokenIsOnSameLineAndCanFollowModifier(); } @@ -2813,6 +2815,11 @@ namespace Parser { || isLiteralPropertyName(); } + function canFollowGetOrSetKeyword(): boolean { + return token() === SyntaxKind.OpenBracketToken + || isLiteralPropertyName(); + } + function nextTokenCanFollowDefaultKeyword(): boolean { nextToken(); return token() === SyntaxKind.ClassKeyword diff --git a/src/compiler/transformers/declarations/diagnostics.ts b/src/compiler/transformers/declarations/diagnostics.ts index ccd95b06651a4..84e952da136df 100644 --- a/src/compiler/transformers/declarations/diagnostics.ts +++ b/src/compiler/transformers/declarations/diagnostics.ts @@ -772,7 +772,7 @@ export function createGetIsolatedDeclarationErrors(resolver: EmitResolver): (nod return createExpressionError(node.initializer); } const message = addUndefined ? - Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations : + Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations : errorByDeclarationKind[node.kind]; const diag = createDiagnosticForNode(node, message); const targetStr = getTextOfNode(node.name, /*includeTrivia*/ false); diff --git a/src/compiler/transformers/esDecorators.ts b/src/compiler/transformers/esDecorators.ts index 7609ab957a0c5..9f76d6f07beca 100644 --- a/src/compiler/transformers/esDecorators.ts +++ b/src/compiler/transformers/esDecorators.ts @@ -686,7 +686,7 @@ export function transformESDecorators(context: TransformationContext): (x: Sourc let shouldTransformPrivateStaticElementsInClass = false; // 1. Class decorators are evaluated outside of the private name scope of the class. - const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); + const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node, /*useLegacyDecorators*/ false)); if (classDecorators) { // - Since class decorators don't have privileged access to private names defined inside the class, // they must be evaluated outside of the class body. diff --git a/src/compiler/transformers/legacyDecorators.ts b/src/compiler/transformers/legacyDecorators.ts index 6ef7745dfd301..8edba2affaab3 100644 --- a/src/compiler/transformers/legacyDecorators.ts +++ b/src/compiler/transformers/legacyDecorators.ts @@ -679,7 +679,7 @@ export function transformLegacyDecorators(context: TransformationContext): (x: S * @param node The class node. */ function generateConstructorDecorationExpression(node: ClassExpression | ClassDeclaration) { - const allDecorators = getAllDecoratorsOfClass(node); + const allDecorators = getAllDecoratorsOfClass(node, /*useLegacyDecorators*/ true); const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); if (!decoratorExpressions) { return undefined; diff --git a/src/compiler/transformers/utilities.ts b/src/compiler/transformers/utilities.ts index 0658ae8b857a2..584cb865e403d 100644 --- a/src/compiler/transformers/utilities.ts +++ b/src/compiler/transformers/utilities.ts @@ -679,9 +679,9 @@ function getDecoratorsOfParameters(node: FunctionLikeDeclaration | undefined) { * * @internal */ -export function getAllDecoratorsOfClass(node: ClassLikeDeclaration): AllDecorators | undefined { +export function getAllDecoratorsOfClass(node: ClassLikeDeclaration, useLegacyDecorators: boolean): AllDecorators | undefined { const decorators = getDecorators(node); - const parameters = getDecoratorsOfParameters(getFirstConstructorWithBody(node)); + const parameters = useLegacyDecorators ? getDecoratorsOfParameters(getFirstConstructorWithBody(node)) : undefined; if (!some(decorators) && !some(parameters)) { return undefined; } @@ -705,12 +705,12 @@ export function getAllDecoratorsOfClassElement(member: ClassElement, parent: Cla case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: if (!useLegacyDecorators) { - return getAllDecoratorsOfMethod(member as AccessorDeclaration); + return getAllDecoratorsOfMethod(member as AccessorDeclaration, /*useLegacyDecorators*/ false); } - return getAllDecoratorsOfAccessors(member as AccessorDeclaration, parent); + return getAllDecoratorsOfAccessors(member as AccessorDeclaration, parent, /*useLegacyDecorators*/ true); case SyntaxKind.MethodDeclaration: - return getAllDecoratorsOfMethod(member as MethodDeclaration); + return getAllDecoratorsOfMethod(member as MethodDeclaration, useLegacyDecorators); case SyntaxKind.PropertyDeclaration: return getAllDecoratorsOfProperty(member as PropertyDeclaration); @@ -726,7 +726,7 @@ export function getAllDecoratorsOfClassElement(member: ClassElement, parent: Cla * @param parent The class node that contains the accessor. * @param accessor The class accessor member. */ -function getAllDecoratorsOfAccessors(accessor: AccessorDeclaration, parent: ClassExpression | ClassDeclaration): AllDecorators | undefined { +function getAllDecoratorsOfAccessors(accessor: AccessorDeclaration, parent: ClassExpression | ClassDeclaration, useLegacyDecorators: boolean): AllDecorators | undefined { if (!accessor.body) { return undefined; } @@ -741,7 +741,7 @@ function getAllDecoratorsOfAccessors(accessor: AccessorDeclaration, parent: Clas } const decorators = getDecorators(firstAccessorWithDecorators); - const parameters = getDecoratorsOfParameters(setAccessor); + const parameters = useLegacyDecorators ? getDecoratorsOfParameters(setAccessor) : undefined; if (!some(decorators) && !some(parameters)) { return undefined; } @@ -759,13 +759,13 @@ function getAllDecoratorsOfAccessors(accessor: AccessorDeclaration, parent: Clas * * @param method The class method member. */ -function getAllDecoratorsOfMethod(method: MethodDeclaration | AccessorDeclaration): AllDecorators | undefined { +function getAllDecoratorsOfMethod(method: MethodDeclaration | AccessorDeclaration, useLegacyDecorators: boolean): AllDecorators | undefined { if (!method.body) { return undefined; } const decorators = getDecorators(method); - const parameters = getDecoratorsOfParameters(method); + const parameters = useLegacyDecorators ? getDecoratorsOfParameters(method) : undefined; if (!some(decorators) && !some(parameters)) { return undefined; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 374451a2aadb1..9b5908d71d9bc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6016,7 +6016,6 @@ export interface SymbolLinks { exportsChecked?: boolean; // True if exports of external module have been checked typeParametersChecked?: boolean; // True if type parameters of merged class and interface declarations have been checked. isDeclarationWithCollidingName?: boolean; // True if symbol is block scoped redeclaration - bindingElement?: BindingElement; // Binding element associated with property symbol originatingImport?: ImportDeclaration | ImportCall; // Import declaration which produced the symbol, present if the symbol is marked as uncallable but had call signatures in `resolveESModuleSymbol` lateSymbol?: Symbol; // Late-bound symbol for a computed property specifierCache?: Map; // For symbols corresponding to external modules, a cache of incoming path -> module specifier name mappings @@ -9981,6 +9980,12 @@ export interface TextChangeRange { newLength: number; } +/** @internal */ +export interface ErrorOutputContainer { + errors?: Diagnostic[]; + skipLogging?: boolean; +} + /** @internal */ export interface DiagnosticCollection { // Adds a diagnostic to this diagnostic collection. diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index fc55fb1411772..75862dde0b9db 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -201,6 +201,7 @@ import { getParseTreeNode, getPathComponents, getPathFromPathComponents, + getRelativePathFromDirectory, getRelativePathToDirectoryOrUrl, getResolutionModeOverride, getRootLength, @@ -498,6 +499,7 @@ import { ResolvedModuleWithFailedLookupLocations, ResolvedTypeReferenceDirective, ResolvedTypeReferenceDirectiveWithFailedLookupLocations, + resolvePath, returnFalse, ReturnStatement, returnUndefined, @@ -6064,7 +6066,7 @@ export function hasInvalidEscape(template: TemplateLiteral): boolean { const doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\u2028\u2029\u0085]/g; const singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\u2028\u2029\u0085]/g; // Template strings preserve simple LF newlines, still encode CRLF (or CR) -const backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\u2028\u2029\u0085]/g; +const backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u0009\u000b-\u001f\u2028\u2029\u0085]/g; const escapedCharsMap = new Map(Object.entries({ "\t": "\\t", "\v": "\\v", @@ -6490,6 +6492,21 @@ export function getPossibleOriginalInputExtensionForExtension(path: string): Ext [Extension.Tsx, Extension.Ts, Extension.Jsx, Extension.Js]; } +/** @internal */ +export function getPossibleOriginalInputPathWithoutChangingExt( + filePath: string, + ignoreCase: boolean, + outputDir: string | undefined, + getCommonSourceDirectory: () => string, +): string { + return outputDir ? + resolvePath( + getCommonSourceDirectory(), + getRelativePathFromDirectory(outputDir, filePath, ignoreCase), + ) : + filePath; +} + /** * Returns 'undefined' if and only if 'options.paths' is undefined. * @@ -8193,15 +8210,11 @@ export function getLastChild(node: Node): Node | undefined { * * @internal */ -export function addToSeen(seen: Map, key: K): boolean; -/** @internal */ -export function addToSeen(seen: Map, key: K, value: T): boolean; -/** @internal */ -export function addToSeen(seen: Map, key: K, value: T = true as any): boolean { +export function addToSeen(seen: Set, key: K): boolean { if (seen.has(key)) { return false; } - seen.set(key, value); + seen.add(key); return true; } diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index 89b0e236a2485..e83d4bf1d5124 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -3069,7 +3069,7 @@ export class TestState { private verifyFileContent(fileName: string, text: string) { const actual = this.getFileContent(fileName); if (actual !== text) { - throw new Error(`verifyFileContent failed:\n${showTextDiff(text, actual)}`); + throw new Error(`verifyFileContent in file '${fileName}' failed:\n${showTextDiff(text, actual)}`); } } @@ -3404,10 +3404,11 @@ export class TestState { return ts.first(ranges); } - private verifyTextMatches(actualText: string, includeWhitespace: boolean, expectedText: string) { + private verifyTextMatches(actualText: string, includeWhitespace: boolean, expectedText: string, fileName?: string) { const removeWhitespace = (s: string): string => includeWhitespace ? s : this.removeWhitespace(s); if (removeWhitespace(actualText) !== removeWhitespace(expectedText)) { - this.raiseError(`Actual range text doesn't match expected text.\n${showTextDiff(expectedText, actualText)}`); + const addFileName = fileName ? ` in file '${fileName}'` : ""; + this.raiseError(`Actual range text${addFileName} doesn't match expected text.\n${showTextDiff(expectedText, actualText)}`); } } @@ -3485,7 +3486,7 @@ export class TestState { const newText = ts.textChanges.applyChanges(this.getFileContent(this.activeFile.fileName), change.textChanges); const newRange = updateTextRangeForTextChanges(this.getOnlyRange(this.activeFile.fileName), change.textChanges); const actualText = newText.slice(newRange.pos, newRange.end); - this.verifyTextMatches(actualText, /*includeWhitespace*/ true, newRangeContent); + this.verifyTextMatches(actualText, /*includeWhitespace*/ true, newRangeContent, change.fileName); } else { if (newFileContent === undefined) throw ts.Debug.fail(); @@ -3497,7 +3498,7 @@ export class TestState { } const oldText = this.tryGetFileContent(change.fileName); const newContent = change.isNewFile ? ts.first(change.textChanges).newText : ts.textChanges.applyChanges(oldText!, change.textChanges); - this.verifyTextMatches(newContent, /*includeWhitespace*/ true, expectedNewContent); + this.verifyTextMatches(newContent, /*includeWhitespace*/ true, expectedNewContent, change.fileName); } for (const newFileName in newFileContent) { ts.Debug.assert(changes.some(c => c.fileName === newFileName), "No change in file", () => newFileName); diff --git a/src/harness/vfsUtil.ts b/src/harness/vfsUtil.ts index 1995d79ab6da0..4799927a70a14 100644 --- a/src/harness/vfsUtil.ts +++ b/src/harness/vfsUtil.ts @@ -1148,7 +1148,7 @@ export class FileSystem { for (const key of Object.keys(files)) { const value = normalizeFileSetEntry(files[key]); const path = dirname ? vpath.resolve(dirname, key) : key; - vpath.validate(path, vpath.ValidationFlags.Absolute); + vpath.validate(path, vpath.ValidationFlags.Absolute | vpath.ValidationFlags.AllowWildcard); // eslint-disable-next-line no-restricted-syntax if (value === null || value === undefined || value instanceof Rmdir || value instanceof Unlink) { diff --git a/src/lib/decorators.d.ts b/src/lib/decorators.d.ts index 69b2d9ec3d970..f417f8909778c 100644 --- a/src/lib/decorators.d.ts +++ b/src/lib/decorators.d.ts @@ -92,9 +92,9 @@ interface ClassMethodDecoratorContext< }; /** - * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` element), or before instance initializers are run (when - * decorating a non-`static` element). + * Adds a callback to be invoked either after static methods are defined but before + * static initializers are run (when decorating a `static` element), or before instance + * initializers are run (when decorating a non-`static` element). * * @example * ```ts @@ -158,9 +158,9 @@ interface ClassGetterDecoratorContext< }; /** - * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` element), or before instance initializers are run (when - * decorating a non-`static` element). + * Adds a callback to be invoked either after static methods are defined but before + * static initializers are run (when decorating a `static` element), or before instance + * initializers are run (when decorating a non-`static` element). */ addInitializer(initializer: (this: This) => void): void; @@ -205,9 +205,9 @@ interface ClassSetterDecoratorContext< }; /** - * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` element), or before instance initializers are run (when - * decorating a non-`static` element). + * Adds a callback to be invoked either after static methods are defined but before + * static initializers are run (when decorating a `static` element), or before instance + * initializers are run (when decorating a non-`static` element). */ addInitializer(initializer: (this: This) => void): void; @@ -261,9 +261,8 @@ interface ClassAccessorDecoratorContext< }; /** - * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` element), or before instance initializers are run (when - * decorating a non-`static` element). + * Adds a callback to be invoked immediately after the auto `accessor` being + * decorated is initialized (regardless if the `accessor` is `static` or not). */ addInitializer(initializer: (this: This) => void): void; @@ -358,9 +357,8 @@ interface ClassFieldDecoratorContext< }; /** - * Adds a callback to be invoked either before static initializers are run (when - * decorating a `static` element), or before instance initializers are run (when - * decorating a non-`static` element). + * Adds a callback to be invoked immediately after the field being decorated + * is initialized (regardless if the field is `static` or not). */ addInitializer(initializer: (this: This) => void): void; diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index c964eed79fa08..05fbbf12ce146 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -373,6 +373,7 @@ interface BigInt64ArrayConstructor { new (length?: number): BigInt64Array; new (array: ArrayLike | Iterable): BigInt64Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): BigInt64Array; + new (array: ArrayLike | ArrayBuffer): BigInt64Array; /** The size in bytes of each element in the array. */ readonly BYTES_PER_ELEMENT: number; @@ -649,6 +650,7 @@ interface BigUint64ArrayConstructor { new (length?: number): BigUint64Array; new (array: ArrayLike | Iterable): BigUint64Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): BigUint64Array; + new (array: ArrayLike | ArrayBuffer): BigUint64Array; /** The size in bytes of each element in the array. */ readonly BYTES_PER_ELEMENT: number; diff --git a/src/lib/es2024.sharedmemory.d.ts b/src/lib/es2024.sharedmemory.d.ts index e520374568c68..672c714508b0d 100644 --- a/src/lib/es2024.sharedmemory.d.ts +++ b/src/lib/es2024.sharedmemory.d.ts @@ -28,7 +28,7 @@ interface SharedArrayBuffer { * * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/growable) */ - get growable(): number; + get growable(): boolean; /** * If this SharedArrayBuffer is growable, returns the maximum byte length given during construction; returns the byte length if not. diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9705d9116b4bf..9fc8214143d81 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2784,11 +2784,11 @@ - + - + - + @@ -5040,11 +5040,11 @@ - + - + - + @@ -7884,11 +7884,11 @@ - + - + - + @@ -8424,6 +8424,15 @@ + + + + + + + + + @@ -9840,6 +9849,15 @@ + + + + + + + + + @@ -10602,15 +10620,6 @@ - - - - - - - - - @@ -11539,7 +11548,7 @@ - + @@ -13059,6 +13068,15 @@ + + + + + + + + + @@ -15090,6 +15108,24 @@ + + + + + + + + + + + + + + + + + + @@ -15243,6 +15279,24 @@ + + + + + + + + + + + + + + + + + + @@ -15450,6 +15504,15 @@ + + + + + + + + + @@ -17025,6 +17088,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 7a30d14280077..29b5b6df78089 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2784,11 +2784,11 @@ - + - + - + @@ -5040,11 +5040,11 @@ - + - + - + @@ -7884,11 +7884,11 @@ - + - + - + @@ -8424,6 +8424,15 @@ + + + + + + + + + @@ -9840,6 +9849,15 @@ + + + + + + + + + @@ -10602,15 +10620,6 @@ - - - - - - - - - @@ -13059,6 +13068,15 @@ + + + + + + + + + @@ -15090,6 +15108,24 @@ + + + + + + + + + + + + + + + + + + @@ -15243,6 +15279,24 @@ + + + + + + + + + + + + + + + + + + @@ -15450,6 +15504,15 @@ + + + + + + + + + @@ -17025,6 +17088,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 92a31eccdc9aa..266ee953659d9 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2793,11 +2793,11 @@ - + - + - + @@ -5049,11 +5049,11 @@ - + - + - + @@ -7893,11 +7893,11 @@ - + - + - + @@ -8433,6 +8433,15 @@ + + + + + + + + + @@ -9849,6 +9858,15 @@ + + + + + + + + + @@ -10611,15 +10629,6 @@ - - - - - - - - - @@ -13068,6 +13077,15 @@ + + + + + + + + + @@ -15099,6 +15117,24 @@ + + + + + + + + + + + + + + + + + + @@ -15252,6 +15288,24 @@ + + + + + + + + + + + + + + + + + + @@ -15459,6 +15513,15 @@ + + + + + + + + + @@ -17034,6 +17097,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index 59390eb598c2b..ba23d0392aac1 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2781,11 +2781,11 @@ - + - + - + @@ -5037,11 +5037,11 @@ - + - + - + @@ -7881,11 +7881,11 @@ - + - + - + @@ -8421,6 +8421,15 @@ + + + + + + + + + @@ -9837,6 +9846,15 @@ + + + + + + + + + @@ -10599,15 +10617,6 @@ - - - - - - - - - @@ -13053,6 +13062,15 @@ + + + + + + + + + @@ -15084,6 +15102,24 @@ + + + + + + + + + + + + + + + + + + @@ -15237,6 +15273,24 @@ + + + + + + + + + + + + + + + + + + @@ -15444,6 +15498,15 @@ + + + + + + + + + @@ -17019,6 +17082,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index f6338184e6109..d7c8533e119d4 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2796,11 +2796,11 @@ - + - + - + @@ -5052,9 +5052,9 @@ - + - + @@ -7896,11 +7896,11 @@ - + - + - + @@ -8436,6 +8436,15 @@ + + + + + + + + + @@ -9852,6 +9861,15 @@ + + + + + + + + + @@ -10614,15 +10632,6 @@ - - - - - - - - - @@ -13071,6 +13080,15 @@ + + + + + + + + + @@ -15102,6 +15120,24 @@ + + + + + + + + + + + + + + + + + + @@ -15255,6 +15291,24 @@ + + + + + + + + + + + + + + + + + + @@ -15462,6 +15516,15 @@ + + + + + + + + + @@ -17037,6 +17100,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index f2aa23fb7b503..97df1cdcaca7f 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2796,11 +2796,11 @@ - + - + - + @@ -5052,11 +5052,11 @@ - + - + - + @@ -7896,11 +7896,11 @@ - + - + - + @@ -8436,6 +8436,15 @@ + + + + + + + + + @@ -9852,6 +9861,15 @@ + + + + + + + + + @@ -10614,15 +10632,6 @@ - - - - - - - - - @@ -13071,6 +13080,15 @@ + + + + + + + + + @@ -15102,6 +15120,24 @@ + + + + + + + + + + + + + + + + + + @@ -15255,6 +15291,24 @@ + + + + + + + + + + + + + + + + + + @@ -15462,6 +15516,15 @@ + + + + + + + + + @@ -17037,6 +17100,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0a6ad17d33e8e..a545736da880a 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2784,11 +2784,11 @@ - + - + - + @@ -5040,9 +5040,9 @@ - + - + @@ -7884,11 +7884,11 @@ - + - + - + @@ -8424,6 +8424,15 @@ + + + + + + + + + @@ -9840,6 +9849,15 @@ + + + + + + + + + @@ -10602,15 +10620,6 @@ - - - - - - - - - @@ -13059,6 +13068,15 @@ + + + + + + + + + @@ -15090,6 +15108,24 @@ + + + + + + + + + + + + + + + + + + @@ -15243,6 +15279,24 @@ + + + + + + + + + + + + + + + + + + @@ -15450,6 +15504,15 @@ + + + + + + + + + @@ -17025,6 +17088,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index fedcd8093ae06..4ac9ca5d2d18b 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2784,11 +2784,11 @@ - + - + - + @@ -5040,9 +5040,9 @@ - + - + @@ -7884,11 +7884,11 @@ - + - + - + @@ -8424,6 +8424,15 @@ + + + + + + + + + @@ -9840,6 +9849,15 @@ + + + + + + + + + @@ -10602,15 +10620,6 @@ - - - - - - - - - @@ -13059,6 +13068,15 @@ + + + + + + + + + @@ -15090,6 +15108,24 @@ + + + + + + + + + + + + + + + + + + @@ -15243,6 +15279,24 @@ + + + + + + + + + + + + + + + + + + @@ -15450,6 +15504,15 @@ + + + + + + + + + @@ -17025,6 +17088,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index b4fb91054eea1..0112bb4853d22 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2784,11 +2784,11 @@ - + - + - + @@ -5040,9 +5040,9 @@ - + - + @@ -7884,11 +7884,11 @@ - + - + - + @@ -8424,6 +8424,15 @@ + + + + + + + + + @@ -9840,6 +9849,15 @@ + + + + + + + + + @@ -10602,15 +10620,6 @@ - - - - - - - - - @@ -13059,6 +13068,15 @@ + + + + + + + + + @@ -15090,6 +15108,24 @@ + + + + + + + + + + + + + + + + + + @@ -15243,6 +15279,24 @@ + + + + + + + + + + + + + + + + + + @@ -15450,6 +15504,15 @@ + + + + + + + + + @@ -17025,6 +17088,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6d486d5c84687..605b3c8049d88 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2774,11 +2774,11 @@ - + - + - + @@ -5030,11 +5030,11 @@ - + - + - + @@ -7874,11 +7874,11 @@ - + - + - + @@ -8414,6 +8414,15 @@ + + + + + + + + + @@ -9830,6 +9839,15 @@ + + + + + + + + + @@ -10592,15 +10610,6 @@ - - - - - - - - - @@ -13046,6 +13055,15 @@ + + + + + + + + + @@ -15077,6 +15095,24 @@ + + + + + + + + + + + + + + + + + + @@ -15230,6 +15266,24 @@ + + + + + + + + + + + + + + + + + + @@ -15437,6 +15491,15 @@ + + + + + + + + + @@ -17012,6 +17075,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6ae46444d5970..4b9bb462fe834 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2777,11 +2777,11 @@ - + - + - + @@ -5033,11 +5033,11 @@ - + - + - + @@ -7877,11 +7877,11 @@ - + - + - + @@ -8417,6 +8417,15 @@ + + + + + + + + + @@ -9833,6 +9842,15 @@ + + + + + + + + + @@ -10595,15 +10613,6 @@ - - - - - - - - - @@ -13049,6 +13058,15 @@ + + + + + + + + + @@ -15080,6 +15098,24 @@ + + + + + + + + + + + + + + + + + + @@ -15233,6 +15269,24 @@ + + + + + + + + + + + + + + + + + + @@ -15440,6 +15494,15 @@ + + + + + + + + + @@ -17015,6 +17078,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 381804d59e134..a7e54d070f910 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2783,11 +2783,11 @@ - + - + - + @@ -5039,9 +5039,9 @@ - + - + @@ -7883,11 +7883,11 @@ - + - + - + @@ -8423,6 +8423,15 @@ + + + + + + + + + @@ -9839,6 +9848,15 @@ + + + + + + + + + @@ -10601,15 +10619,6 @@ - - - - - - - - - @@ -13058,6 +13067,15 @@ + + + + + + + + + @@ -15089,6 +15107,24 @@ + + + + + + + + + + + + + + + + + + @@ -15242,6 +15278,24 @@ + + + + + + + + + + + + + + + + + + @@ -15449,6 +15503,15 @@ + + + + + + + + + @@ -17024,6 +17087,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 2b1f61470e6a4..e6c4b5f4216e0 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -2777,11 +2777,11 @@ - + - + - + @@ -5033,11 +5033,11 @@ - + - + - + @@ -7877,11 +7877,11 @@ - + - + - + @@ -8417,6 +8417,15 @@ + + + + + + + + + @@ -9833,6 +9842,15 @@ + + + + + + + + + @@ -10595,15 +10613,6 @@ - - - - - - - - - @@ -13052,6 +13061,15 @@ + + + + + + + + + @@ -15083,6 +15101,24 @@ + + + + + + + + + + + + + + + + + + @@ -15236,6 +15272,24 @@ + + + + + + + + + + + + + + + + + + @@ -15443,6 +15497,15 @@ + + + + + + + + + @@ -17018,6 +17081,15 @@ + + + + + + + + + diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index ae25654acaf3a..23f8d844c9856 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1297,7 +1297,7 @@ export class ProjectService { */ private readonly filenameToScriptInfoVersion = new Map(); // Set of all '.js' files ever opened. - private readonly allJsFilesForOpenFileTelemetry = new Map(); + private readonly allJsFilesForOpenFileTelemetry = new Set(); /** * Map to the real path of the infos diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index 55a957928a1ae..1a0c8713db2fb 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -632,6 +632,7 @@ export class LineNode implements LineCollection { walk(rangeStart: number, rangeLength: number, walkFns: LineIndexWalker): void { // assume (rangeStart < this.totalChars) && (rangeLength <= this.totalChars) + if (this.children.length === 0) return; let childIndex = 0; let childCharCount = this.children[childIndex].charCount(); // find sub-tree containing start diff --git a/src/server/session.ts b/src/server/session.ts index 2c2f2895f01a4..d03f18037a7f2 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -156,6 +156,7 @@ import { indent, isConfigFile, isConfiguredProject, + isDynamicFileName, isExternalProject, isInferredProject, ITypingsInstaller, @@ -2981,6 +2982,7 @@ export class Session implements EventSender { } private getPasteEdits(args: protocol.GetPasteEditsRequestArgs): protocol.PasteEditsAction | undefined { const { file, project } = this.getFileAndProject(args); + if (isDynamicFileName(file)) return undefined; const copiedFrom = args.copiedFrom ? { file: args.copiedFrom.file, range: args.copiedFrom.spans.map(copies => this.getRange({ file: args.copiedFrom!.file, startLine: copies.start.line, startOffset: copies.start.offset, endLine: copies.end.line, endOffset: copies.end.offset }, project.getScriptInfoForNormalizedPath(toNormalizedPath(args.copiedFrom!.file))!)) } : undefined; diff --git a/src/services/codefixes/convertConstToLet.ts b/src/services/codefixes/convertConstToLet.ts index 8497cb2ee8053..9337c0819e26d 100644 --- a/src/services/codefixes/convertConstToLet.ts +++ b/src/services/codefixes/convertConstToLet.ts @@ -36,7 +36,7 @@ registerCodeFix({ }, getAllCodeActions: context => { const { program } = context; - const seen = new Map(); + const seen = new Set(); return createCombinedCodeActions(textChanges.ChangeTracker.with(context, changes => { eachDiagnostic(context, errorCodes, diag => { diff --git a/src/services/codefixes/convertToTypeOnlyExport.ts b/src/services/codefixes/convertToTypeOnlyExport.ts index 5f2e80f4c8481..c5f0d6b3d92ba 100644 --- a/src/services/codefixes/convertToTypeOnlyExport.ts +++ b/src/services/codefixes/convertToTypeOnlyExport.ts @@ -36,7 +36,7 @@ registerCodeFix({ }, fixIds: [fixId], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context) { - const fixedExportDeclarations = new Map(); + const fixedExportDeclarations = new Set(); return codeFixAll(context, errorCodes, (changes, diag) => { const exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile); if (exportSpecifier && addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) { diff --git a/src/services/codefixes/fixAddMissingConstraint.ts b/src/services/codefixes/fixAddMissingConstraint.ts index ba1e7aa0279c2..34c0bf9ab2bb5 100644 --- a/src/services/codefixes/fixAddMissingConstraint.ts +++ b/src/services/codefixes/fixAddMissingConstraint.ts @@ -63,7 +63,7 @@ registerCodeFix({ fixIds: [fixId], getAllCodeActions: context => { const { program, preferences, host } = context; - const seen = new Map(); + const seen = new Set(); return createCombinedCodeActions(textChanges.ChangeTracker.with(context, changes => { eachDiagnostic(context, errorCodes, diag => { diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index 77bec1ed7f173..c57d2a37fd355 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -182,7 +182,7 @@ registerCodeFix({ getAllCodeActions: context => { const { program, fixId } = context; const checker = program.getTypeChecker(); - const seen = new Map(); + const seen = new Set(); const typeDeclToMembers = new Map(); return createCombinedCodeActions(textChanges.ChangeTracker.with(context, changes => { @@ -315,13 +315,13 @@ function getInfo(sourceFile: SourceFile, tokenPos: number, errorCode: number, ch const param = signature.parameters[argIndex].valueDeclaration; if (!(param && isParameter(param) && isIdentifier(param.name))) return undefined; - const properties = arrayFrom(checker.getUnmatchedProperties(checker.getTypeAtLocation(parent), checker.getParameterType(signature, argIndex), /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ false)); + const properties = arrayFrom(checker.getUnmatchedProperties(checker.getTypeAtLocation(parent), checker.getParameterType(signature, argIndex).getNonNullableType(), /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ false)); if (!length(properties)) return undefined; return { kind: InfoKind.ObjectLiteral, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent }; } if (token.kind === SyntaxKind.OpenBraceToken && isObjectLiteralExpression(parent)) { - const targetType = checker.getContextualType(parent) || checker.getTypeAtLocation(parent); + const targetType = (checker.getContextualType(parent) || checker.getTypeAtLocation(parent))?.getNonNullableType(); const properties = arrayFrom(checker.getUnmatchedProperties(checker.getTypeAtLocation(parent), targetType, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ false)); if (!length(properties)) return undefined; @@ -334,7 +334,7 @@ function getInfo(sourceFile: SourceFile, tokenPos: number, errorCode: number, ch if (!isMemberName(token)) return undefined; if (isIdentifier(token) && hasInitializer(parent) && parent.initializer && isObjectLiteralExpression(parent.initializer)) { - const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token); + const targetType = (checker.getContextualType(token) || checker.getTypeAtLocation(token))?.getNonNullableType(); const properties = arrayFrom(checker.getUnmatchedProperties(checker.getTypeAtLocation(parent.initializer), targetType, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ false)); if (!length(properties)) return undefined; @@ -681,7 +681,8 @@ function tryGetValueFromType(context: CodeFixContextBase, checker: TypeChecker, } if (type.flags & TypeFlags.EnumLike) { const enumMember = type.symbol.exports ? firstOrUndefinedIterator(type.symbol.exports.values()) : type.symbol; - const name = checker.symbolToExpression(type.symbol.parent ? type.symbol.parent : type.symbol, SymbolFlags.Value, /*enclosingDeclaration*/ undefined, /*flags*/ NodeBuilderFlags.UseFullyQualifiedType); + const symbol = type.symbol.parent && type.symbol.parent.flags & SymbolFlags.RegularEnum ? type.symbol.parent : type.symbol; + const name = checker.symbolToExpression(symbol, SymbolFlags.Value, /*enclosingDeclaration*/ undefined, /*flags*/ NodeBuilderFlags.UseFullyQualifiedType); return enumMember === undefined || name === undefined ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name, checker.symbolToString(enumMember)); } if (type.flags & TypeFlags.NumberLiteral) { diff --git a/src/services/codefixes/fixAwaitInSyncFunction.ts b/src/services/codefixes/fixAwaitInSyncFunction.ts index d6b5d766caf12..ffcbeaed776ab 100644 --- a/src/services/codefixes/fixAwaitInSyncFunction.ts +++ b/src/services/codefixes/fixAwaitInSyncFunction.ts @@ -44,7 +44,7 @@ registerCodeFix({ }, fixIds: [fixId], getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) { - const seen = new Map(); + const seen = new Set(); return codeFixAll(context, errorCodes, (changes, diag) => { const nodes = getNodes(diag.file, diag.start); if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return; diff --git a/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts b/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts index 8f77976267f1b..5ebecd78f1c96 100644 --- a/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts +++ b/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts @@ -44,7 +44,7 @@ registerCodeFix({ }, fixIds: [fixId], getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context) { - const seenClassDeclarations = new Map(); + const seenClassDeclarations = new Set(); return codeFixAll(context, errorCodes, (changes, diag) => { const classDeclaration = getClass(diag.file, diag.start); if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { diff --git a/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts b/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts index a0dd5aa5e5899..49298f9058053 100644 --- a/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts +++ b/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts @@ -55,7 +55,7 @@ registerCodeFix({ }, fixIds: [fixId], getAllCodeActions(context) { - const seenClassDeclarations = new Map(); + const seenClassDeclarations = new Set(); return codeFixAll(context, errorCodes, (changes, diag) => { const classDeclaration = getClass(diag.file, diag.start); if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { diff --git a/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts b/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts index a3585ace24d79..cf54c1c3d4753 100644 --- a/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts +++ b/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts @@ -38,7 +38,7 @@ registerCodeFix({ fixIds: [fixId], getAllCodeActions(context) { const { sourceFile } = context; - const seenClasses = new Map(); // Ensure we only do this once per class. + const seenClasses = new Set(); // Ensure we only do this once per class. return codeFixAll(context, errorCodes, (changes, diag) => { const nodes = getNodes(diag.file, diag.start); if (!nodes) return; diff --git a/src/services/codefixes/fixMissingTypeAnnotationOnExports.ts b/src/services/codefixes/fixMissingTypeAnnotationOnExports.ts index 3a76444aa8266..a82ccb01f00ff 100644 --- a/src/services/codefixes/fixMissingTypeAnnotationOnExports.ts +++ b/src/services/codefixes/fixMissingTypeAnnotationOnExports.ts @@ -135,7 +135,7 @@ const errorCodes = [ Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code, Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code, Diagnostics.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code, - Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations.code, + Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations.code, Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code, Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code, ]; diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index f0a86cb0a20c8..b23b7c127e872 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -80,12 +80,15 @@ import { ImportSpecifier, insertImports, InternalSymbolName, + isDefaultImport, isExternalModuleReference, isFullSourceFile, isIdentifier, isImportable, + isImportClause, isImportDeclaration, isImportEqualsDeclaration, + isImportSpecifier, isIntrinsicJsxName, isJSDocImportTag, isJsxClosingElement, @@ -228,6 +231,7 @@ export interface ImportAdder { addImportFromDiagnostic: (diagnostic: DiagnosticWithLocation, context: CodeFixContextBase) => void; addImportFromExportedSymbol: (exportedSymbol: Symbol, isValidTypeOnlyUseSite?: boolean, referenceImport?: ImportOrRequireAliasDeclaration) => void; addImportForNonExistentExport: (exportName: string, exportingFileName: string, exportKind: ExportKind, exportedMeanings: SymbolFlags, isImportUsageValidAsTypeOnly: boolean) => void; + addImportForModuleSymbol: (symbolAlias: Symbol, isValidTypeOnlyUseSite: boolean, referenceImport: ImportOrRequireAliasDeclaration) => void; addImportForUnresolvedIdentifier: (context: CodeFixContextBase, symbolToken: Identifier, useAutoImportProvider: boolean) => void; addVerbatimImport: (declaration: AnyImportOrRequireStatement | ImportOrRequireAliasDeclaration) => void; removeExistingImport: (declaration: ImportOrRequireAliasDeclaration) => void; @@ -257,7 +261,7 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog type NewImportsKey = `${0 | 1}|${string}`; /** Use `getNewImportEntry` for access */ const newImports = new Map>(); - return { addImportFromDiagnostic, addImportFromExportedSymbol, writeFixes, hasFixes, addImportForUnresolvedIdentifier, addImportForNonExistentExport, removeExistingImport, addVerbatimImport }; + return { addImportFromDiagnostic, addImportFromExportedSymbol, addImportForModuleSymbol, writeFixes, hasFixes, addImportForUnresolvedIdentifier, addImportForNonExistentExport, removeExistingImport, addVerbatimImport }; function addVerbatimImport(declaration: AnyImportOrRequireStatement | ImportOrRequireAliasDeclaration) { verbatimImports.add(declaration); @@ -276,7 +280,7 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog } function addImportFromExportedSymbol(exportedSymbol: Symbol, isValidTypeOnlyUseSite?: boolean, referenceImport?: ImportOrRequireAliasDeclaration) { - const moduleSymbol = Debug.checkDefined(exportedSymbol.parent); + const moduleSymbol = Debug.checkDefined(exportedSymbol.parent, "Expected exported symbol to have module symbol as parent"); const symbolName = getNameForExportedSymbol(exportedSymbol, getEmitScriptTarget(compilerOptions)); const checker = program.getTypeChecker(); const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker)); @@ -317,6 +321,74 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog } } + function addImportForModuleSymbol(symbolAlias: Symbol, isValidTypeOnlyUseSite: boolean, referenceImport: ImportOrRequireAliasDeclaration) { + // Adds import for module, import alias will be symbolAlias.name + const checker = program.getTypeChecker(); + const moduleSymbol = checker.getAliasedSymbol(symbolAlias); + Debug.assert(moduleSymbol.flags & SymbolFlags.Module, "Expected symbol to be a module"); + const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); + const moduleSpecifierResult = moduleSpecifiers.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences, /*options*/ undefined, /*forAutoImport*/ true); + + const useRequire = shouldUseRequire(sourceFile, program); + + // Copy the type-only status from the reference import + let addAsTypeOnly = getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ true, + /*symbol*/ undefined, + symbolAlias.flags, + program.getTypeChecker(), + compilerOptions, + ); + addAsTypeOnly = addAsTypeOnly === AddAsTypeOnly.Allowed && isTypeOnlyImportDeclaration(referenceImport) ? AddAsTypeOnly.Required : AddAsTypeOnly.Allowed; + + // Copy the kind of import + const importKind = isImportDeclaration(referenceImport) ? + isDefaultImport(referenceImport) ? ImportKind.Default : ImportKind.Namespace : + isImportSpecifier(referenceImport) ? ImportKind.Named : + isImportClause(referenceImport) && !!referenceImport.name ? ImportKind.Default : ImportKind.Namespace; + + const exportInfo = [{ + symbol: symbolAlias, + moduleSymbol, + moduleFileName: moduleSymbol.declarations?.[0]?.getSourceFile()?.fileName, + exportKind: ExportKind.Module, + targetFlags: symbolAlias.flags, + isFromPackageJson: false, + }]; + + const existingFix = getImportFixForSymbol( + sourceFile, + exportInfo, + program, + /*position*/ undefined, + !!isValidTypeOnlyUseSite, + useRequire, + host, + preferences, + ); + + let fix: FixAddNewImport | ImportFixWithModuleSpecifier; + if (existingFix && importKind !== ImportKind.Namespace) { + fix = { + ...existingFix, + addAsTypeOnly, + importKind, + }; + } + else { + fix = { + kind: ImportFixKind.AddNew, + moduleSpecifierKind: existingFix !== undefined ? existingFix.moduleSpecifierKind : moduleSpecifierResult.kind, + moduleSpecifier: existingFix !== undefined ? existingFix.moduleSpecifier : first(moduleSpecifierResult.moduleSpecifiers), + importKind, + addAsTypeOnly, + useRequire, + }; + } + addImport({ fix, symbolName: symbolAlias.name, errorIdentifierText: undefined }); + } + function addImportForNonExistentExport(exportName: string, exportingFileName: string, exportKind: ExportKind, exportedMeanings: SymbolFlags, isImportUsageValidAsTypeOnly: boolean) { const exportingSourceFile = program.getSourceFile(exportingFileName); const useRequire = shouldUseRequire(sourceFile, program); @@ -494,8 +566,8 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog function writeFixes(changeTracker: textChanges.ChangeTracker, oldFileQuotePreference?: QuotePreference) { let quotePreference: QuotePreference; - if (isFullSourceFile(sourceFile) && sourceFile.imports.length === 0 && oldFileQuotePreference !== undefined) { - // If the target file has no imports, we must use the same quote preference as the file we are importing from. + if (sourceFile.imports !== undefined && sourceFile.imports.length === 0 && oldFileQuotePreference !== undefined) { + // If the target file (including future files) has no imports, we must use the same quote preference as the file we are importing from. quotePreference = oldFileQuotePreference; } else { @@ -891,9 +963,10 @@ function getAllExportInfoForSymbol(importingFile: SourceFile | FutureSourceFile, const moduleSymbolExcluded = moduleSourceFile && isFileExcluded(moduleSourceFile as SourceFile); return getExportInfoMap(importingFile, host, program, preferences, cancellationToken) .search(importingFile.path, preferCapitalized, name => name === symbolName, info => { + const checker = getChecker(info[0].isFromPackageJson); if ( - getChecker(info[0].isFromPackageJson).getMergedSymbol(skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson))) === symbol - && (moduleSymbolExcluded || info.some(i => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) + checker.getMergedSymbol(skipAlias(info[0].symbol, checker)) === symbol + && (moduleSymbolExcluded || info.some(i => checker.getMergedSymbol(i.moduleSymbol) === moduleSymbol || i.symbol.parent === moduleSymbol)) ) { return info; } @@ -1451,6 +1524,8 @@ export function getImportKind(importingFile: SourceFile | FutureSourceFile, expo return getExportEqualsImportKind(importingFile, program.getCompilerOptions(), !!forceImportKeyword); case ExportKind.UMD: return getUmdImportKind(importingFile, program, !!forceImportKeyword); + case ExportKind.Module: + return ImportKind.Namespace; default: return Debug.assertNever(exportKind); } diff --git a/src/services/completions.ts b/src/services/completions.ts index 3291902986fa0..30e9ad40bf3f1 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -3585,7 +3585,7 @@ function getCompletionData( let importSpecifierResolver: codefix.ImportSpecifierResolver | undefined; const symbolToOriginInfoMap: SymbolOriginInfoMap = []; const symbolToSortTextMap: SymbolSortTextMap = []; - const seenPropertySymbols = new Map(); + const seenPropertySymbols = new Set(); const isTypeOnlyLocation = isTypeOnlyCompletion(); const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson: boolean) => { return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider!()! : program, host); @@ -6051,14 +6051,14 @@ function isArrowFunctionBody(node: Node) { } /** True if symbol is a type or a module containing at least one type. */ -function symbolCanBeReferencedAtTypeLocation(symbol: Symbol, checker: TypeChecker, seenModules = new Map()): boolean { +function symbolCanBeReferencedAtTypeLocation(symbol: Symbol, checker: TypeChecker, seenModules = new Set()): boolean { // Since an alias can be merged with a local declaration, we need to test both the alias and its target. // This code used to just test the result of `skipAlias`, but that would ignore any locally introduced meanings. return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(skipAlias(symbol.exportSymbol || symbol, checker)); function nonAliasCanBeReferencedAtTypeLocation(symbol: Symbol): boolean { return !!(symbol.flags & SymbolFlags.Type) || checker.isUnknownSymbol(symbol) || - !!(symbol.flags & SymbolFlags.Module) && addToSeen(seenModules, getSymbolId(symbol)) && + !!(symbol.flags & SymbolFlags.Module) && addToSeen(seenModules, symbol) && checker.getExportsOfModule(symbol).some(e => symbolCanBeReferencedAtTypeLocation(e, checker, seenModules)); } } diff --git a/src/services/exportInfoMap.ts b/src/services/exportInfoMap.ts index 1bfa8ab018580..dfd00ce2e9170 100644 --- a/src/services/exportInfoMap.ts +++ b/src/services/exportInfoMap.ts @@ -74,6 +74,7 @@ export const enum ExportKind { Default, ExportEquals, UMD, + Module, } /** @internal */ @@ -555,7 +556,7 @@ export function getExportInfoMap(importingFile: SourceFile | FutureSourceFile, h try { forEachExternalModuleToImportFrom(program, host, preferences, /*useAutoImportProvider*/ true, (moduleSymbol, moduleFile, program, isFromPackageJson) => { if (++moduleCount % 100 === 0) cancellationToken?.throwIfCancellationRequested(); - const seenExports = new Map<__String, true>(); + const seenExports = new Set<__String>(); const checker = program.getTypeChecker(); const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker); // Note: I think we shouldn't actually see resolved module symbols here, but weird merges @@ -604,7 +605,11 @@ export function getDefaultLikeExportInfo(moduleSymbol: Symbol, checker: TypeChec exportKind: ExportKind; } | undefined { const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol); - if (exportEquals !== moduleSymbol) return { symbol: exportEquals, exportKind: ExportKind.ExportEquals }; + if (exportEquals !== moduleSymbol) { + const defaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, exportEquals); + if (defaultExport) return { symbol: defaultExport, exportKind: ExportKind.Default }; + return { symbol: exportEquals, exportKind: ExportKind.ExportEquals }; + } const defaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol); if (defaultExport) return { symbol: defaultExport, exportKind: ExportKind.Default }; } @@ -630,7 +635,7 @@ function getNamesForExportedSymbol(defaultExport: Symbol, checker: TypeChecker, export function forEachNameOfDefaultExport(defaultExport: Symbol, checker: TypeChecker, scriptTarget: ScriptTarget | undefined, cb: (name: string, capitalizedName?: string) => T | undefined): T | undefined { let chain: Symbol[] | undefined; let current: Symbol | undefined = defaultExport; - const seen = new Map(); + const seen = new Set(); while (current) { // The predecessor to this function also looked for a name on the `localSymbol` diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 74aeb9c5be05c..710a01b1c2dea 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -251,7 +251,6 @@ import { SymbolDisplayPart, SymbolDisplayPartKind, SymbolFlags, - SymbolId, symbolName, SyntaxKind, textPart, @@ -544,7 +543,7 @@ export function getImplementationsAtPosition(program: Program, cancellationToken } else if (entries) { const queue = createQueue(entries); - const seenNodes = new Map(); + const seenNodes = new Set(); while (!queue.isEmpty()) { const entry = queue.dequeue() as NodeEntry; if (!addToSeen(seenNodes, getNodeId(entry.node))) { @@ -2666,7 +2665,7 @@ export namespace Core { * The value of previousIterationSymbol is undefined when the function is first called. */ function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined { - const seen = new Map(); + const seen = new Set(); return recur(symbol); function recur(symbol: Symbol): T | undefined { @@ -2674,7 +2673,7 @@ export namespace Core { // interface C extends C { // /*findRef*/propName: string; // } - if (!(symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) || !addToSeen(seen, getSymbolId(symbol))) return; + if (!(symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) || !addToSeen(seen, symbol)) return; return firstDefined(symbol.declarations, declaration => firstDefined(getAllSuperTypeNodes(declaration), typeReference => { diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 806dc6003f510..45d80841d1894 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -933,6 +933,13 @@ function isSemicolonDeletionContext(context: FormattingContext): boolean { || nextTokenKind === SyntaxKind.EndOfFileToken; } + if ( + nextTokenKind === SyntaxKind.SemicolonToken && + context.currentTokenSpan.kind === SyntaxKind.SemicolonToken + ) { + return true; + } + if ( nextTokenKind === SyntaxKind.SemicolonClassElement || nextTokenKind === SyntaxKind.SemicolonToken diff --git a/src/services/inlayHints.ts b/src/services/inlayHints.ts index a3e54cf237896..f5a29b332b595 100644 --- a/src/services/inlayHints.ts +++ b/src/services/inlayHints.ts @@ -106,7 +106,6 @@ import { PrefixUnaryExpression, PropertyDeclaration, QuotePreference, - Signature, SignatureDeclarationBase, skipParentheses, some, @@ -296,11 +295,8 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] { return; } - const candidates: Signature[] = []; - const signature = checker.getResolvedSignatureForSignatureHelp(expr, candidates); - if (!signature || !candidates.length) { - return; - } + const signature = checker.getResolvedSignature(expr); + if (signature === undefined) return; let signatureParamPos = 0; for (const originalArg of args) { diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 6ca2a1804a8ce..b4c32d566b126 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -760,6 +760,7 @@ function isSynthesized(node: Node) { // We want to merge own children like `I` in in `module A { interface I {} } module A { interface I {} }` // We don't want to merge unrelated children like `m` in `const o = { a: { m() {} }, b: { m() {} } };` function isOwnChild(n: Node, parent: NavigationBarNode): boolean { + if (n.parent === undefined) return false; const par = isModuleBlock(n.parent) ? n.parent.parent : n.parent; return par === parent.node || contains(parent.additionalNodes, par); } diff --git a/src/services/pasteEdits.ts b/src/services/pasteEdits.ts index d3c84b118aa8e..3fffc8c5a1403 100644 --- a/src/services/pasteEdits.ts +++ b/src/services/pasteEdits.ts @@ -5,6 +5,7 @@ import { fileShouldUseJavaScriptRequire, findAncestor, findIndex, + findTokenOnLeftOfPosition, forEachChild, formatting, getNewLineOrDefaultFromHost, @@ -50,11 +51,16 @@ export function pasteEditsProvider( return { edits: changes, fixId }; } +interface CopiedFromInfo { + file: SourceFile; + range: TextRange[]; +} + function pasteEdits( targetFile: SourceFile, pastedText: string[], pasteLocations: TextRange[], - copiedFrom: { file: SourceFile; range: TextRange[]; } | undefined, + copiedFrom: CopiedFromInfo | undefined, host: LanguageServiceHost, preferences: UserPreferences, formatContext: formatting.FormatContext, @@ -93,11 +99,13 @@ function pasteEdits( } statements.push(...statementsInSourceFile.slice(startNodeIndex, endNodeIndex === -1 ? statementsInSourceFile.length : endNodeIndex + 1)); }); - const usage = getUsageInfo(copiedFrom.file, statements, originalProgram!.getTypeChecker(), getExistingLocals(updatedFile, statements, originalProgram!.getTypeChecker()), { pos: copiedFrom.range[0].pos, end: copiedFrom.range[copiedFrom.range.length - 1].end }); - Debug.assertIsDefined(originalProgram); + Debug.assertIsDefined(originalProgram, "no original program found"); + const originalProgramTypeChecker = originalProgram.getTypeChecker(); + const usageInfoRange = getUsageInfoRangeForPasteEdits(copiedFrom); + const usage = getUsageInfo(copiedFrom.file, statements, originalProgramTypeChecker, getExistingLocals(updatedFile, statements, originalProgramTypeChecker), usageInfoRange); const useEsModuleSyntax = !fileShouldUseJavaScriptRequire(targetFile.fileName, originalProgram, host, !!copiedFrom.file.commonJsModuleIndicator); addExportsInOldFile(copiedFrom.file, usage.targetFileImportsFromOldFile, changes, useEsModuleSyntax); - addTargetFileImports(copiedFrom.file, usage.oldImportsNeededByTargetFile, usage.targetFileImportsFromOldFile, originalProgram.getTypeChecker(), updatedProgram, importAdder); + addTargetFileImports(copiedFrom.file, usage.oldImportsNeededByTargetFile, usage.targetFileImportsFromOldFile, originalProgramTypeChecker, updatedProgram, importAdder); } else { const context: CodeFixContextBase = { @@ -167,3 +175,18 @@ function pasteEdits( ); }); } + +/** + * Adjusts the range for `getUsageInfo` to correctly include identifiers at the edges of the copied text. + */ +function getUsageInfoRangeForPasteEdits({ file: sourceFile, range }: CopiedFromInfo) { + const pos = range[0].pos; + const end = range[range.length - 1].end; + const startToken = getTokenAtPosition(sourceFile, pos); + const endToken = findTokenOnLeftOfPosition(sourceFile, pos) ?? getTokenAtPosition(sourceFile, end); + // Since the range is only used to check identifiers, we do not need to adjust range when the tokens at the edges are not identifiers. + return { + pos: isIdentifier(startToken) && pos <= startToken.getStart(sourceFile) ? startToken.getFullStart() : pos, + end: isIdentifier(endToken) && end === endToken.getEnd() ? textChanges.getAdjustedEndPosition(sourceFile, endToken, {}) : end, + }; +} diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index b6f4c97b55a5d..5201313f97288 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -247,7 +247,7 @@ function flattenTypeLiteralNodeReference(checker: TypeChecker, selection: TypeNo } if (isIntersectionTypeNode(selection)) { const result: TypeElement[] = []; - const seen = new Map(); + const seen = new Set(); for (const type of selection.types) { const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type); if (!flattenedTypeMembers || !flattenedTypeMembers.every(type => type.name && addToSeen(seen, getNameFromPropertyName(type.name) as string))) { diff --git a/src/services/refactors/helpers.ts b/src/services/refactors/helpers.ts index 38fc8b965f4b9..9779b8559f89b 100644 --- a/src/services/refactors/helpers.ts +++ b/src/services/refactors/helpers.ts @@ -80,6 +80,10 @@ export function addTargetFileImports( if (checker.isUnknownSymbol(targetSymbol)) { importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor(symbol.declarations?.[0], isAnyImportOrRequireStatement))); } + else if (targetSymbol.parent === undefined) { + Debug.assert(declaration !== undefined, "expected module symbol to have a declaration"); + importAdder.addImportForModuleSymbol(symbol, isValidTypeOnlyUseSite, declaration); + } else { importAdder.addImportFromExportedSymbol(targetSymbol, isValidTypeOnlyUseSite, declaration); } diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index 7c41dd5e103cf..63cac4d49cca2 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -27,9 +27,11 @@ import { CompletionEntry, CompletionEntryDetails, CompletionInfo, + concatenate, contains, containsPath, ContextFlags, + createModuleSpecifierResolutionHost, createSortedArray, createTextSpan, createTextSpanFromStringLiteralLikeContent, @@ -66,8 +68,11 @@ import { getPackageJsonTypesVersionsPaths, getPathComponents, getPathsBasePath, + getPossibleOriginalInputExtensionForExtension, + getPossibleOriginalInputPathWithoutChangingExt, getReplacementSpanForContextToken, getResolvePackageJsonExports, + getResolvePackageJsonImports, getSupportedExtensions, getSupportedExtensionsWithJsonIfResolveJsonModule, getTextOfJsxAttributeName, @@ -77,6 +82,7 @@ import { hasProperty, hasTrailingDirectorySeparator, hostGetCanonicalFileName, + hostUsesCaseSensitiveFileNames, ImportOrExportSpecifier, IndexedAccessTypeNode, InternalSymbolName, @@ -109,6 +115,7 @@ import { moduleExportNameTextEscaped, moduleResolutionUsesNodeModules, ModuleSpecifierEnding, + ModuleSpecifierResolutionHost, moduleSpecifiers, newCaseClauseTracker, Node, @@ -200,7 +207,7 @@ export function getStringLiteralCompletions( includeSymbol: boolean, ): CompletionInfo | undefined { if (isInReferenceComment(sourceFile, position)) { - const entries = getTripleSlashReferenceCompletion(sourceFile, position, program, host); + const entries = getTripleSlashReferenceCompletion(sourceFile, position, program, host, createModuleSpecifierResolutionHost(program, host)); return entries && convertPathCompletions(entries); } if (isInString(sourceFile, position, contextToken)) { @@ -555,7 +562,7 @@ function getAlreadyUsedTypesInStringLiteralUnion(union: UnionTypeNode, current: function getStringLiteralCompletionsFromSignature(call: CallLikeExpression, arg: StringLiteralLike, argumentInfo: SignatureHelp.ArgumentInfoForCompletions, checker: TypeChecker): StringLiteralCompletionsFromTypes | undefined { let isNewIdentifier = false; - const uniques = new Map(); + const uniques = new Set(); const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg; const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument); const types = flatMap(candidates, candidate => { @@ -600,7 +607,7 @@ function stringLiteralCompletionsForObjectLiteral(checker: TypeChecker, objectLi }; } -function getStringLiteralTypes(type: Type | undefined, uniques = new Map()): readonly StringLiteralType[] { +function getStringLiteralTypes(type: Type | undefined, uniques = new Set()): readonly StringLiteralType[] { if (!type) return emptyArray; type = skipConstraint(type); return type.isUnion() ? flatMap(type.types, t => getStringLiteralTypes(t, uniques)) : @@ -641,11 +648,12 @@ function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile: SourceFile const scriptDirectory = getDirectoryPath(scriptPath); const compilerOptions = program.getCompilerOptions(); const typeChecker = program.getTypeChecker(); + const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); const extensionOptions = getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile, typeChecker, preferences, mode); return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && !compilerOptions.paths && (isRootedDiskPath(literalValue) || isUrl(literalValue)) - ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, program, host, scriptPath, extensionOptions) - : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, program, host, extensionOptions); + ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, program, host, moduleSpecifierResolutionHost, scriptPath, extensionOptions) + : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, program, host, moduleSpecifierResolutionHost, extensionOptions); } interface ExtensionOptions { @@ -665,7 +673,7 @@ function getExtensionOptions(compilerOptions: CompilerOptions, referenceKind: Re resolutionMode, }; } -function getCompletionEntriesForRelativeModules(literalValue: string, scriptDirectory: string, program: Program, host: LanguageServiceHost, scriptPath: Path, extensionOptions: ExtensionOptions) { +function getCompletionEntriesForRelativeModules(literalValue: string, scriptDirectory: string, program: Program, host: LanguageServiceHost, moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, scriptPath: Path, extensionOptions: ExtensionOptions) { const compilerOptions = program.getCompilerOptions(); if (compilerOptions.rootDirs) { return getCompletionEntriesForDirectoryFragmentWithRootDirs( @@ -675,11 +683,12 @@ function getCompletionEntriesForRelativeModules(literalValue: string, scriptDire extensionOptions, program, host, + moduleSpecifierResolutionHost, scriptPath, ); } else { - return arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, program, host, /*moduleSpecifierIsRelative*/ true, scriptPath).values()); + return arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, /*moduleSpecifierIsRelative*/ true, scriptPath).values()); } } @@ -717,13 +726,13 @@ function getBaseDirectoriesFromRootDirs(rootDirs: string[], basePath: string, sc ); } -function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs: string[], fragment: string, scriptDirectory: string, extensionOptions: ExtensionOptions, program: Program, host: LanguageServiceHost, exclude: string): readonly NameAndKind[] { +function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs: string[], fragment: string, scriptDirectory: string, extensionOptions: ExtensionOptions, program: Program, host: LanguageServiceHost, moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, exclude: string): readonly NameAndKind[] { const compilerOptions = program.getCompilerOptions(); const basePath = compilerOptions.project || host.getCurrentDirectory(); const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); return deduplicate( - flatMap(baseDirectories, baseDirectory => arrayFrom(getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, program, host, /*moduleSpecifierIsRelative*/ true, exclude).values())), + flatMap(baseDirectories, baseDirectory => arrayFrom(getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, /*moduleSpecifierIsRelative*/ true, exclude).values())), (itemA, itemB) => itemA.name === itemB.name && itemA.kind === itemB.kind && itemA.extension === itemB.extension, ); } @@ -741,6 +750,7 @@ function getCompletionEntriesForDirectoryFragment( extensionOptions: ExtensionOptions, program: Program, host: LanguageServiceHost, + moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, moduleSpecifierIsRelative: boolean, exclude?: string, result = createNameAndKindSet(), @@ -779,7 +789,7 @@ function getCompletionEntriesForDirectoryFragment( if (versionPaths) { const packageDirectory = getDirectoryPath(packageJsonPath); const pathInPackage = absolutePath.slice(ensureTrailingDirectorySeparator(packageDirectory).length); - if (addCompletionEntriesFromPaths(result, pathInPackage, packageDirectory, extensionOptions, program, host, versionPaths)) { + if (addCompletionEntriesFromPaths(result, pathInPackage, packageDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, versionPaths)) { // A true result means one of the `versionPaths` was matched, which will block relative resolution // to files and folders from here. All reachable paths given the pattern match are already added. return result; @@ -802,7 +812,7 @@ function getCompletionEntriesForDirectoryFragment( continue; } - const { name, extension } = getFilenameWithExtensionOption(getBaseFileName(filePath), program, extensionOptions, /*isExportsWildcard*/ false); + const { name, extension } = getFilenameWithExtensionOption(getBaseFileName(filePath), program, extensionOptions, /*isExportsOrImportsWildcard*/ false); result.add(nameAndKind(name, ScriptElementKind.scriptElement, extension)); } } @@ -822,7 +832,7 @@ function getCompletionEntriesForDirectoryFragment( return result; } -function getFilenameWithExtensionOption(name: string, program: Program, extensionOptions: ExtensionOptions, isExportsWildcard: boolean): { name: string; extension: Extension | undefined; } { +function getFilenameWithExtensionOption(name: string, program: Program, extensionOptions: ExtensionOptions, isExportsOrImportsWildcard: boolean): { name: string; extension: Extension | undefined; } { const nonJsResult = moduleSpecifiers.tryGetRealFileNameForNonJsDeclarationFileName(name); if (nonJsResult) { return { name: nonJsResult, extension: tryGetExtensionFromPath(nonJsResult) }; @@ -838,7 +848,7 @@ function getFilenameWithExtensionOption(name: string, program: Program, extensio extensionOptions.importingSourceFile, ).getAllowedEndingsInPreferredOrder(extensionOptions.resolutionMode); - if (isExportsWildcard) { + if (isExportsOrImportsWildcard) { // If we're completing `import {} from "foo/|"` and subpaths are available via `"exports": { "./*": "./src/*" }`, // the completion must be a (potentially extension-swapped) file name. Dropping extensions and index files is not allowed. allowedEndings = allowedEndings.filter(e => e !== ModuleSpecifierEnding.Minimal && e !== ModuleSpecifierEnding.Index); @@ -855,7 +865,7 @@ function getFilenameWithExtensionOption(name: string, program: Program, extensio } if ( - !isExportsWildcard && + !isExportsOrImportsWildcard && (allowedEndings[0] === ModuleSpecifierEnding.Minimal || allowedEndings[0] === ModuleSpecifierEnding.Index) && fileExtensionIsOneOf(name, [Extension.Js, Extension.Jsx, Extension.Ts, Extension.Tsx, Extension.Dts]) ) { @@ -876,6 +886,7 @@ function addCompletionEntriesFromPaths( extensionOptions: ExtensionOptions, program: Program, host: LanguageServiceHost, + moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, paths: MapLike, ) { const getPatternsForKey = (key: string) => paths[key]; @@ -886,18 +897,20 @@ function addCompletionEntriesFromPaths( const lengthB = typeof patternB === "object" ? patternB.prefix.length : b.length; return compareValues(lengthB, lengthA); }; - return addCompletionEntriesFromPathsOrExports(result, /*isExports*/ false, fragment, baseDirectory, extensionOptions, program, host, getOwnKeys(paths), getPatternsForKey, comparePaths); + return addCompletionEntriesFromPathsOrExportsOrImports(result, /*isExports*/ false, /*isImports*/ false, fragment, baseDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, getOwnKeys(paths), getPatternsForKey, comparePaths); } /** @returns whether `fragment` was a match for any `paths` (which should indicate whether any other path completions should be offered) */ -function addCompletionEntriesFromPathsOrExports( +function addCompletionEntriesFromPathsOrExportsOrImports( result: NameAndKindSet, isExports: boolean, + isImports: boolean, fragment: string, baseDirectory: string, extensionOptions: ExtensionOptions, program: Program, host: LanguageServiceHost, + moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, keys: readonly string[], getPatternsForKey: (key: string) => string[] | undefined, comparePaths: (a: string, b: string) => Comparison, @@ -906,13 +919,15 @@ function addCompletionEntriesFromPathsOrExports( let matchedPath: string | undefined; for (const key of keys) { if (key === ".") continue; - const keyWithoutLeadingDotSlash = key.replace(/^\.\//, ""); // remove leading "./" + const keyWithoutLeadingDotSlash = key + .replace(/^\.\//, "") // remove leading "./" + + ((isExports || isImports) && endsWith(key, "/") ? "*" : ""); // normalize trailing `/` to `/*` const patterns = getPatternsForKey(key); if (patterns) { const pathPattern = tryParsePattern(keyWithoutLeadingDotSlash); if (!pathPattern) continue; const isMatch = typeof pathPattern === "object" && isPatternMatch(pathPattern, fragment); - const isLongestMatch = isMatch && (matchedPath === undefined || comparePaths(key, matchedPath) === Comparison.LessThan); + const isLongestMatch = isMatch && (matchedPath === undefined || comparePaths(keyWithoutLeadingDotSlash, matchedPath) === Comparison.LessThan); if (isLongestMatch) { // If this is a higher priority match than anything we've seen so far, previous results from matches are invalid, e.g. // for `import {} from "some-package/|"` with a typesVersions: @@ -925,13 +940,13 @@ function addCompletionEntriesFromPathsOrExports( // added by the '*' match, after typing `"some-package/foo/|"` we would get file results from both // ./dist/foo and ./foo, when only the latter will actually be resolvable. // See pathCompletionsTypesVersionsWildcard6.ts. - matchedPath = key; + matchedPath = keyWithoutLeadingDotSlash; pathResults = pathResults.filter(r => !r.matchedPattern); } - if (typeof pathPattern === "string" || matchedPath === undefined || comparePaths(key, matchedPath) !== Comparison.GreaterThan) { + if (typeof pathPattern === "string" || matchedPath === undefined || comparePaths(keyWithoutLeadingDotSlash, matchedPath) !== Comparison.GreaterThan) { pathResults.push({ matchedPattern: isMatch, - results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports && isMatch, program, host) + results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost) .map(({ name, kind, extension }) => nameAndKind(name, kind, extension)), }); } @@ -955,6 +970,7 @@ function getCompletionEntriesForNonRelativeModules( mode: ResolutionMode, program: Program, host: LanguageServiceHost, + moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, extensionOptions: ExtensionOptions, ): readonly NameAndKind[] { const typeChecker = program.getTypeChecker(); @@ -966,12 +982,12 @@ function getCompletionEntriesForNonRelativeModules( if (baseUrl) { const absolute = normalizePath(combinePaths(host.getCurrentDirectory(), baseUrl)); - getCompletionEntriesForDirectoryFragment(fragment, absolute, extensionOptions, program, host, /*moduleSpecifierIsRelative*/ false, /*exclude*/ undefined, result); + getCompletionEntriesForDirectoryFragment(fragment, absolute, extensionOptions, program, host, moduleSpecifierResolutionHost, /*moduleSpecifierIsRelative*/ false, /*exclude*/ undefined, result); } if (paths) { const absolute = getPathsBasePath(compilerOptions, host)!; - addCompletionEntriesFromPaths(result, fragment, absolute, extensionOptions, program, host, paths); + addCompletionEntriesFromPaths(result, fragment, absolute, extensionOptions, program, host, moduleSpecifierResolutionHost, paths); } const fragmentDirectory = getFragmentDirectory(fragment); @@ -979,7 +995,7 @@ function getCompletionEntriesForNonRelativeModules( result.add(nameAndKind(ambientName, ScriptElementKind.externalModuleName, /*extension*/ undefined)); } - getCompletionEntriesFromTypings(host, program, scriptPath, fragmentDirectory, extensionOptions, result); + getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, fragmentDirectory, extensionOptions, result); if (moduleResolutionUsesNodeModules(moduleResolution)) { // If looking for a global package name, don't just include everything in `node_modules` because that includes dependencies' own dependencies. @@ -995,56 +1011,55 @@ function getCompletionEntriesForNonRelativeModules( } } if (!foundGlobal) { + const resolvePackageJsonExports = getResolvePackageJsonExports(compilerOptions); + const resolvePackageJsonImports = getResolvePackageJsonImports(compilerOptions); + let seenPackageScope = false; + + const importsLookup = (directory: string) => { + if (resolvePackageJsonImports && !seenPackageScope) { + const packageFile = combinePaths(directory, "package.json"); + if (seenPackageScope = tryFileExists(host, packageFile)) { + const packageJson = readJson(packageFile, host); + exportsOrImportsLookup((packageJson as MapLike).imports, fragment, directory, /*isExports*/ false, /*isImports*/ true); + } + } + }; + let ancestorLookup: (directory: string) => void | undefined = ancestor => { const nodeModules = combinePaths(ancestor, "node_modules"); if (tryDirectoryExists(host, nodeModules)) { - getCompletionEntriesForDirectoryFragment(fragment, nodeModules, extensionOptions, program, host, /*moduleSpecifierIsRelative*/ false, /*exclude*/ undefined, result); + getCompletionEntriesForDirectoryFragment(fragment, nodeModules, extensionOptions, program, host, moduleSpecifierResolutionHost, /*moduleSpecifierIsRelative*/ false, /*exclude*/ undefined, result); } + importsLookup(ancestor); }; - if (fragmentDirectory && getResolvePackageJsonExports(compilerOptions)) { - const nodeModulesDirectoryLookup = ancestorLookup; + if (fragmentDirectory && resolvePackageJsonExports) { + const nodeModulesDirectoryOrImportsLookup = ancestorLookup; ancestorLookup = ancestor => { const components = getPathComponents(fragment); components.shift(); // shift off empty root let packagePath = components.shift(); if (!packagePath) { - return nodeModulesDirectoryLookup(ancestor); + return nodeModulesDirectoryOrImportsLookup(ancestor); } if (startsWith(packagePath, "@")) { const subName = components.shift(); if (!subName) { - return nodeModulesDirectoryLookup(ancestor); + return nodeModulesDirectoryOrImportsLookup(ancestor); } packagePath = combinePaths(packagePath, subName); } + if (resolvePackageJsonImports && startsWith(packagePath, "#")) { + return importsLookup(ancestor); + } const packageDirectory = combinePaths(ancestor, "node_modules", packagePath); const packageFile = combinePaths(packageDirectory, "package.json"); if (tryFileExists(host, packageFile)) { const packageJson = readJson(packageFile, host); - const exports = (packageJson as any).exports; - if (exports) { - if (typeof exports !== "object" || exports === null) { // eslint-disable-line no-restricted-syntax - return; // null exports or entrypoint only, no sub-modules available - } - const keys = getOwnKeys(exports); - const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : ""); - const conditions = getConditions(compilerOptions, mode); - addCompletionEntriesFromPathsOrExports( - result, - /*isExports*/ true, - fragmentSubpath, - packageDirectory, - extensionOptions, - program, - host, - keys, - key => singleElementArray(getPatternFromFirstMatchingCondition(exports[key], conditions)), - comparePatternKeys, - ); - return; - } + const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : ""); + exportsOrImportsLookup((packageJson as MapLike).exports, fragmentSubpath, packageDirectory, /*isExports*/ true, /*isImports*/ false); + return; } - return nodeModulesDirectoryLookup(ancestor); + return nodeModulesDirectoryOrImportsLookup(ancestor); }; } forEachAncestorDirectoryStoppingAtGlobalCache(host, scriptPath, ancestorLookup); @@ -1052,6 +1067,34 @@ function getCompletionEntriesForNonRelativeModules( } return arrayFrom(result.values()); + + function exportsOrImportsLookup(lookupTable: unknown, fragment: string, baseDirectory: string, isExports: boolean, isImports: boolean) { + if (typeof lookupTable !== "object" || lookupTable === null) { // eslint-disable-line no-restricted-syntax + return; // null lookupTable or entrypoint only + } + const keys = getOwnKeys(lookupTable as MapLike); + const conditions = getConditions(compilerOptions, mode); + addCompletionEntriesFromPathsOrExportsOrImports( + result, + isExports, + isImports, + fragment, + baseDirectory, + extensionOptions, + program, + host, + moduleSpecifierResolutionHost, + keys, + key => { + const pattern = getPatternFromFirstMatchingCondition((lookupTable as MapLike)[key], conditions); + if (pattern === undefined) { + return undefined; + } + return singleElementArray(endsWith(key, "/") && endsWith(pattern, "/") ? pattern + "*" : pattern); + }, + comparePatternKeys, + ); + } } function getPatternFromFirstMatchingCondition(target: unknown, conditions: readonly string[]): string | undefined { @@ -1078,22 +1121,27 @@ function getCompletionsForPathMapping( fragment: string, packageDirectory: string, extensionOptions: ExtensionOptions, - isExportsWildcard: boolean, + isExports: boolean, + isImports: boolean, program: Program, host: LanguageServiceHost, + moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, ): readonly NameAndKind[] { - if (!endsWith(path, "*")) { + const parsedPath = tryParsePattern(path); + if (!parsedPath) { + return emptyArray; + } + // no stars in the pattern + if (typeof parsedPath === "string") { // For a path mapping "foo": ["/x/y/z.ts"], add "foo" itself as a completion. - return !path.includes("*") ? justPathMappingName(path, ScriptElementKind.scriptElement) : emptyArray; + return justPathMappingName(path, ScriptElementKind.scriptElement); } - - const pathPrefix = path.slice(0, path.length - 1); - const remainingFragment = tryRemovePrefix(fragment, pathPrefix); + const remainingFragment = tryRemovePrefix(fragment, parsedPath.prefix); if (remainingFragment === undefined) { - const starIsFullPathComponent = path[path.length - 2] === "/"; - return starIsFullPathComponent ? justPathMappingName(pathPrefix, ScriptElementKind.directory) : flatMap(patterns, pattern => getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExportsWildcard, program, host)?.map(({ name, ...rest }) => ({ name: pathPrefix + name, ...rest }))); + const starIsFullPathComponent = endsWith(path, "/*"); + return starIsFullPathComponent ? justPathMappingName(parsedPath.prefix, ScriptElementKind.directory) : flatMap(patterns, pattern => getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost)?.map(({ name, ...rest }) => ({ name: parsedPath.prefix + name + parsedPath.suffix, ...rest }))); } - return flatMap(patterns, pattern => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, program, host)); + return flatMap(patterns, pattern => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExports, isImports, program, host, moduleSpecifierResolutionHost)); function justPathMappingName(name: string, kind: ScriptElementKind.directory | ScriptElementKind.scriptElement): readonly NameAndKind[] { return startsWith(name, fragment) ? [{ name: removeTrailingDirectorySeparator(name), kind, extension: undefined }] : emptyArray; @@ -1105,9 +1153,11 @@ function getModulesForPathsPattern( packageDirectory: string, pattern: string, extensionOptions: ExtensionOptions, - isExportsWildcard: boolean, + isExports: boolean, + isImports: boolean, program: Program, host: LanguageServiceHost, + moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, ): readonly NameAndKind[] | undefined { if (!host.readDirectory) { return undefined; @@ -1127,15 +1177,25 @@ function getModulesForPathsPattern( const fragmentHasPath = containsSlash(fragment); const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : undefined; + const getCommonSourceDirectory = () => moduleSpecifierResolutionHost.getCommonSourceDirectory(); + const ignoreCase = !hostUsesCaseSensitiveFileNames(moduleSpecifierResolutionHost); + const outDir = program.getCompilerOptions().outDir; + const declarationDir = program.getCompilerOptions().declarationDir; + // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory; - - const normalizedSuffix = normalizePath(parsed.suffix); - const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix); - const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix]; // Need to normalize after combining: If we combinePaths("a", "../b"), we want "b" and not "a/../b". const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory)); - const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + const possibleInputBaseDirectoryForOutDir = isImports && outDir && getPossibleOriginalInputPathWithoutChangingExt(baseDirectory, ignoreCase, outDir, getCommonSourceDirectory); + const possibleInputBaseDirectoryForDeclarationDir = isImports && declarationDir && getPossibleOriginalInputPathWithoutChangingExt(baseDirectory, ignoreCase, declarationDir, getCommonSourceDirectory); + const normalizedSuffix = normalizePath(parsed.suffix); + const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix); + const inputExtension = normalizedSuffix ? getPossibleOriginalInputExtensionForExtension("_" + normalizedSuffix) : undefined; + const matchingSuffixes = [ + declarationExtension && changeExtension(normalizedSuffix, declarationExtension), + ...(inputExtension ? inputExtension.map(ext => changeExtension(normalizedSuffix, ext)) : []), + normalizedSuffix, + ].filter(isString); // If we have a suffix, then we read the directory all the way down to avoid returning completions for // directories that don't contain files that would match the suffix. A previous comment here was concerned @@ -1149,28 +1209,53 @@ function getModulesForPathsPattern( ? matchingSuffixes.map(suffix => "**/*" + suffix) : ["./*"]; - const matches = mapDefined(tryReadDirectory(host, baseDirectory, extensionOptions.extensionsToSearch, /*exclude*/ undefined, includeGlobs), match => { - const trimmedWithPattern = trimPrefixAndSuffix(match); - if (trimmedWithPattern) { - if (containsSlash(trimmedWithPattern)) { - return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]); - } - const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, program, extensionOptions, isExportsWildcard); - return nameAndKind(name, ScriptElementKind.scriptElement, extension); - } - }); + const isExportsOrImportsWildcard = (isExports || isImports) && endsWith(pattern, "/*"); + + let matches = getMatchesWithPrefix(baseDirectory); + + if (possibleInputBaseDirectoryForOutDir) { + matches = concatenate(matches, getMatchesWithPrefix(possibleInputBaseDirectoryForOutDir)); + } + if (possibleInputBaseDirectoryForDeclarationDir) { + matches = concatenate(matches, getMatchesWithPrefix(possibleInputBaseDirectoryForDeclarationDir)); + } // If we had a suffix, we already recursively searched for all possible files that could match // it and returned the directories leading to those files. Otherwise, assume any directory could // have something valid to import. - const directories = normalizedSuffix - ? emptyArray - : mapDefined(tryGetDirectories(host, baseDirectory), dir => dir === "node_modules" ? undefined : directoryResult(dir)); - return [...matches, ...directories]; + if (!normalizedSuffix) { + matches = concatenate(matches, getDirectoryMatches(baseDirectory)); + if (possibleInputBaseDirectoryForOutDir) { + matches = concatenate(matches, getDirectoryMatches(possibleInputBaseDirectoryForOutDir)); + } + if (possibleInputBaseDirectoryForDeclarationDir) { + matches = concatenate(matches, getDirectoryMatches(possibleInputBaseDirectoryForDeclarationDir)); + } + } + + return matches; + + function getMatchesWithPrefix(directory: string) { + const completePrefix = fragmentHasPath ? directory : ensureTrailingDirectorySeparator(directory) + normalizedPrefixBase; + return mapDefined(tryReadDirectory(host, directory, extensionOptions.extensionsToSearch, /*exclude*/ undefined, includeGlobs), match => { + const trimmedWithPattern = trimPrefixAndSuffix(match, completePrefix); + if (trimmedWithPattern) { + if (containsSlash(trimmedWithPattern)) { + return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]); + } + const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, program, extensionOptions, isExportsOrImportsWildcard); + return nameAndKind(name, ScriptElementKind.scriptElement, extension); + } + }); + } + + function getDirectoryMatches(directoryName: string) { + return mapDefined(tryGetDirectories(host, directoryName), dir => dir === "node_modules" ? undefined : directoryResult(dir)); + } - function trimPrefixAndSuffix(path: string): string | undefined { + function trimPrefixAndSuffix(path: string, prefix: string): string | undefined { return firstDefined(matchingSuffixes, suffix => { - const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix); + const inner = withoutStartAndEnd(normalizePath(path), prefix, suffix); return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner); }); } @@ -1199,7 +1284,7 @@ function getAmbientModuleCompletions(fragment: string, fragmentDirectory: string return nonRelativeModuleNames; } -function getTripleSlashReferenceCompletion(sourceFile: SourceFile, position: number, program: Program, host: LanguageServiceHost): readonly PathCompletion[] | undefined { +function getTripleSlashReferenceCompletion(sourceFile: SourceFile, position: number, program: Program, host: LanguageServiceHost, moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost): readonly PathCompletion[] | undefined { const compilerOptions = program.getCompilerOptions(); const token = getTokenAtPosition(sourceFile, position); const commentRanges = getLeadingCommentRanges(sourceFile.text, token.pos); @@ -1215,13 +1300,13 @@ function getTripleSlashReferenceCompletion(sourceFile: SourceFile, position: num const [, prefix, kind, toComplete] = match; const scriptPath = getDirectoryPath(sourceFile.path); - const names = kind === "path" ? getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getExtensionOptions(compilerOptions, ReferenceKind.Filename, sourceFile), program, host, /*moduleSpecifierIsRelative*/ true, sourceFile.path) - : kind === "types" ? getCompletionEntriesFromTypings(host, program, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile)) + const names = kind === "path" ? getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getExtensionOptions(compilerOptions, ReferenceKind.Filename, sourceFile), program, host, moduleSpecifierResolutionHost, /*moduleSpecifierIsRelative*/ true, sourceFile.path) + : kind === "types" ? getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile)) : Debug.fail(); return addReplacementSpans(toComplete, range.pos + prefix.length, arrayFrom(names.values())); } -function getCompletionEntriesFromTypings(host: LanguageServiceHost, program: Program, scriptPath: string, fragmentDirectory: string | undefined, extensionOptions: ExtensionOptions, result = createNameAndKindSet()): NameAndKindSet { +function getCompletionEntriesFromTypings(program: Program, host: LanguageServiceHost, moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost, scriptPath: string, fragmentDirectory: string | undefined, extensionOptions: ExtensionOptions, result = createNameAndKindSet()): NameAndKindSet { const options = program.getCompilerOptions(); // Check for typings specified in compiler options const seen = new Map(); @@ -1257,7 +1342,7 @@ function getCompletionEntriesFromTypings(host: LanguageServiceHost, program: Pro const baseDirectory = combinePaths(directory, typeDirectoryName); const remainingFragment = tryRemoveDirectoryPrefix(fragmentDirectory, packageName, hostGetCanonicalFileName(host)); if (remainingFragment !== undefined) { - getCompletionEntriesForDirectoryFragment(remainingFragment, baseDirectory, extensionOptions, program, host, /*moduleSpecifierIsRelative*/ false, /*exclude*/ undefined, result); + getCompletionEntriesForDirectoryFragment(remainingFragment, baseDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, /*moduleSpecifierIsRelative*/ false, /*exclude*/ undefined, result); } } } diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index e73da8490b683..cca568d1c872b 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -1,5 +1,4 @@ import { - addToSeen, ArrowFunction, BindingElement, CharacterCodes, @@ -353,7 +352,7 @@ function getAdjustedRange(sourceFile: SourceFile, startNode: Node, endNode: Node return { pos: getAdjustedStartPosition(sourceFile, startNode, options), end: getAdjustedEndPosition(sourceFile, endNode, options) }; } -function getAdjustedStartPosition(sourceFile: SourceFile, node: Node, options: ConfigurableStartEnd, hasTrailingComment = false) { +function getAdjustedStartPosition(sourceFile: SourceFile, node: Node, options: ConfigurableStartEnd, hasTrailingComment = false): number { const { leadingTriviaOption } = options; if (leadingTriviaOption === LeadingTriviaOption.Exclude) { return node.getStart(sourceFile); @@ -437,7 +436,8 @@ function getEndPositionOfMultilineTrailingComment(sourceFile: SourceFile, node: return undefined; } -function getAdjustedEndPosition(sourceFile: SourceFile, node: Node, options: ConfigurableEnd): number { +/** @internal */ +export function getAdjustedEndPosition(sourceFile: SourceFile, node: Node, options: ConfigurableEnd): number { const { end } = node; const { trailingTriviaOption } = options; if (trailingTriviaOption === TrailingTriviaOption.Exclude) { @@ -493,7 +493,7 @@ export function isThisTypeAnnotatable(containingFunction: SignatureDeclaration): export class ChangeTracker { private readonly changes: Change[] = []; private newFileChanges?: MultiMap; - private readonly classesWithNodesInsertedAtStart = new Map(); // Set implemented as Map + private readonly classesWithNodesInsertedAtStart = new Map(); // Set implemented as Map private readonly deletedNodes: { readonly sourceFile: SourceFile; readonly node: Node | NodeArray; }[] = []; public static fromContext(context: TextChangesContext): ChangeTracker { @@ -903,7 +903,10 @@ export class ChangeTracker { const members = getMembersOrProperties(node); const isEmpty = members.length === 0; - const isFirstInsertion = addToSeen(this.classesWithNodesInsertedAtStart, getNodeId(node), { node, sourceFile }); + const isFirstInsertion = !this.classesWithNodesInsertedAtStart.has(getNodeId(node)); + if (isFirstInsertion) { + this.classesWithNodesInsertedAtStart.set(getNodeId(node), { node, sourceFile }); + } const insertTrailingComma = isObjectLiteralExpression(node) && (!isJsonSourceFile(sourceFile) || !isEmpty); const insertLeadingComma = isObjectLiteralExpression(node) && isJsonSourceFile(sourceFile) && isEmpty && !isFirstInsertion; return { @@ -1246,7 +1249,7 @@ function endPositionToDeleteNodeInList(sourceFile: SourceFile, node: Node, prevN return end; } -function getClassOrObjectBraceEnds(cls: ClassLikeDeclaration | InterfaceDeclaration | ObjectLiteralExpression, sourceFile: SourceFile): [number | undefined, number | undefined] { +function getClassOrObjectBraceEnds(cls: ClassLikeDeclaration | InterfaceDeclaration | ObjectLiteralExpression | TypeLiteralNode | EnumDeclaration, sourceFile: SourceFile): [number | undefined, number | undefined] { const open = findChildOfKind(cls, SyntaxKind.OpenBraceToken, sourceFile); const close = findChildOfKind(cls, SyntaxKind.CloseBraceToken, sourceFile); return [open?.end, close?.end]; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 356c2878c90b8..d9dd9e8c05ec8 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -169,6 +169,7 @@ import { isExternalModule, isExternalModuleImportEqualsDeclaration, isExternalModuleReference, + isExternalModuleSymbol, isFileLevelUniqueName, isForInStatement, isForOfStatement, @@ -4027,7 +4028,13 @@ export function getDefaultLikeExportNameFromDeclaration(symbol: Symbol): string return tryCast(d.propertyName, isIdentifier)?.text; } // GH#52694 - return tryCast(getNameOfDeclaration(d), isIdentifier)?.text; + const name = tryCast(getNameOfDeclaration(d), isIdentifier)?.text; + if (name) { + return name; + } + if (symbol.parent && !isExternalModuleSymbol(symbol.parent)) { + return symbol.parent.getName(); + } }); } diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index 350b18c06edd8..9000ce035cb62 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -57,6 +57,8 @@ describe("unittests:: config:: showConfig", () => { showTSConfigCorrectly("Show TSConfig with advanced options", ["--showConfig", "--declaration", "--declarationDir", "lib", "--skipLibCheck", "--noErrorTruncation"]); + showTSConfigCorrectly("Show TSConfig with transitively implied options", ["--showConfig", "--module", "nodenext"]); + showTSConfigCorrectly("Show TSConfig with compileOnSave and more", ["-p", "tsconfig.json"], { compilerOptions: { esModuleInterop: true, diff --git a/src/testRunner/unittests/printer.ts b/src/testRunner/unittests/printer.ts index 2e44c6cb73a3c..cff0ce2e47f3e 100644 --- a/src/testRunner/unittests/printer.ts +++ b/src/testRunner/unittests/printer.ts @@ -358,5 +358,13 @@ describe("unittests:: PrinterAPI", () => { ), ts.createSourceFile("source.ts", "", ts.ScriptTarget.ES2015), )); + + // https://github.com/microsoft/TypeScript/issues/59150 + printsCorrectly("template string", {}, printer => + printer.printNode( + ts.EmitHint.Unspecified, + ts.factory.createNoSubstitutionTemplateLiteral("\n"), + ts.createSourceFile("source.ts", "", ts.ScriptTarget.ESNext), + )); }); }); diff --git a/src/testRunner/unittests/tsserver/pasteEdits.ts b/src/testRunner/unittests/tsserver/pasteEdits.ts index 252ceb46c5675..c722a772d40bb 100644 --- a/src/testRunner/unittests/tsserver/pasteEdits.ts +++ b/src/testRunner/unittests/tsserver/pasteEdits.ts @@ -46,4 +46,42 @@ const f = r + s;`; verifyGetErrRequest({ session, files: [target.path] }); baselineTsserverLogs("pasteEdits", "adds paste edits", session); }); + it("should not error", () => { + const file1: File = { + path: "/home/src/projects/project/file1.ts", + content: `export const r = 1; +console.log(r);`, + }; + const tsconfig: File = { + path: "/home/src/projects/project/tsconfig.json", + content: "{}", + }; + const host = TestServerHost.createServerHost([file1, tsconfig]); + const session = new TestSession(host); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.UpdateOpen, + arguments: { + changedFiles: [], + closedFiles: [], + openFiles: [ + { + file: "^/untitled/ts-nul-authority/Untitled-1", + fileContent: "function foo(){}\r\n \r\n", + scriptKindName: "TS", + }, + ], + }, + }); + session.executeCommandSeq({ + command: ts.server.protocol.CommandTypes.GetPasteEdits, + arguments: { + file: "^/untitled/ts-nul-authority/Untitled-1", + pastedText: ["console.log(r);"], + pasteLocations: [{ start: { line: 1, offset: 0 }, end: { line: 1, offset: 0 } }], + copiedFrom: { file: file1.path, spans: [{ start: { line: 2, offset: 0 }, end: { line: 2, offset: 13 } }] }, + }, + }); + verifyGetErrRequest({ session, files: ["^/untitled/ts-nul-authority/Untitled-1"] }); + baselineTsserverLogs("pasteEdits", "should not error", session); + }); }); diff --git a/src/typingsInstaller/nodeTypingsInstaller.ts b/src/typingsInstaller/nodeTypingsInstaller.ts index 7c66ca29f56d6..ea34149c9037b 100644 --- a/src/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/typingsInstaller/nodeTypingsInstaller.ts @@ -1,4 +1,4 @@ -import { execFileSync } from "child_process"; +import { execSync } from "child_process"; import * as fs from "fs"; import * as path from "path"; @@ -172,7 +172,7 @@ class NodeTypingsInstaller extends ts.server.typingsInstaller.TypingsInstaller { this.log.writeLine(`Exec: ${command}`); } try { - const stdout = execFileSync(command, { ...options, encoding: "utf-8" }); + const stdout = execSync(command, { ...options, encoding: "utf-8" }); if (this.log.isEnabled()) { this.log.writeLine(` Succeeded. stdout:${indent(sys.newLine, stdout)}`); } diff --git a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node16).js b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node16).js index d209a96d665e4..311a983aea48a 100644 --- a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node16).js +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node16).js @@ -50,13 +50,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports[""] = exports[""] = exports[""] = void 0; const someValue = "someValue"; diff --git a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=nodenext).js b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=nodenext).js index d209a96d665e4..311a983aea48a 100644 --- a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=nodenext).js +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=nodenext).js @@ -50,13 +50,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports[""] = exports[""] = exports[""] = void 0; const someValue = "someValue"; diff --git a/tests/baselines/reference/asyncIteratorExtraParameters.errors.txt b/tests/baselines/reference/asyncIteratorExtraParameters.errors.txt new file mode 100644 index 0000000000000..9a2965d54afaf --- /dev/null +++ b/tests/baselines/reference/asyncIteratorExtraParameters.errors.txt @@ -0,0 +1,32 @@ +asyncIteratorExtraParameters.ts(11,27): error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. +asyncIteratorExtraParameters.ts(13,12): error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. + + +==== asyncIteratorExtraParameters.ts (2 errors) ==== + // https://github.com/microsoft/TypeScript/issues/57130 + const iter = { + async *[Symbol.asyncIterator](_: number) { + yield 0; + } + }; + + declare function g(...args: any): any; + + async function* f() { + for await (const _ of iter); + ~~~~ +!!! error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. +!!! related TS2322 asyncIteratorExtraParameters.ts:11:27: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator; }' is not assignable to type 'AsyncIterable'. + Types of property '[Symbol.asyncIterator]' are incompatible. + Type '(_: number) => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Target signature provides too few arguments. Expected 1 or more, but got 0. + + yield* iter; + ~~~~ +!!! error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. +!!! related TS2322 asyncIteratorExtraParameters.ts:13:12: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator; }' is not assignable to type 'AsyncIterable'. + Types of property '[Symbol.asyncIterator]' are incompatible. + Type '(_: number) => AsyncGenerator' is not assignable to type '() => AsyncIterator'. + Target signature provides too few arguments. Expected 1 or more, but got 0. + } + \ No newline at end of file diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 4a3ec90cf09f9..be3aed49704a8 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,39 +1,41 @@ bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. -bigintWithLib.ts(19,33): error TS2769: No overload matches this call. - Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'number'. - Overload 2 of 3, '(array: ArrayLike | Iterable): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayLike | Iterable'. - Type 'number[]' is not assignable to type 'Iterable'. - The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. - Type 'number' is not assignable to type 'bigint'. - Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. - Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +bigintWithLib.ts(19,34): error TS2769: No overload matches this call. + The last overload gave the following error. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. +bigintWithLib.ts(19,37): error TS2769: No overload matches this call. + The last overload gave the following error. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. +bigintWithLib.ts(19,40): error TS2769: No overload matches this call. + The last overload gave the following error. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. bigintWithLib.ts(24,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -bigintWithLib.ts(31,35): error TS2769: No overload matches this call. - Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'number'. - Overload 2 of 3, '(array: ArrayLike | Iterable): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayLike | Iterable'. - Type 'number[]' is not assignable to type 'Iterable'. - The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. - Type 'number' is not assignable to type 'bigint'. - Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. - Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +bigintWithLib.ts(31,36): error TS2769: No overload matches this call. + The last overload gave the following error. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. +bigintWithLib.ts(31,39): error TS2769: No overload matches this call. + The last overload gave the following error. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. +bigintWithLib.ts(31,42): error TS2769: No overload matches this call. + The last overload gave the following error. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. + Type 'number' is not assignable to type 'bigint'. bigintWithLib.ts(36,13): error TS2540: Cannot assign to 'length' because it is a read-only property. bigintWithLib.ts(43,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'bigint'. bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'bigint'. -==== bigintWithLib.ts (7 errors) ==== +==== bigintWithLib.ts (11 errors) ==== // Test BigInt functions let bigintVal: bigint = BigInt(123); bigintVal = BigInt("456"); @@ -55,21 +57,27 @@ bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignab bigIntArray = new BigInt64Array(10); bigIntArray = new BigInt64Array([1n, 2n, 3n]); bigIntArray = new BigInt64Array([1, 2, 3]); // should error - ~~~~~~~~~ + ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 3, '(array: ArrayLike | Iterable): BigInt64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayLike | Iterable'. -!!! error TS2769: Type 'number[]' is not assignable to type 'Iterable'. -!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -!!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. -!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. -!!! error TS2769: Type 'number' is not assignable to type 'bigint'. -!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. -!!! error TS2769: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! related TS2771 lib.es2020.bigint.d.ts:--:--: The last overload is declared here. + ~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! related TS2771 lib.es2020.bigint.d.ts:--:--: The last overload is declared here. + ~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! related TS2771 lib.es2020.bigint.d.ts:--:--: The last overload is declared here. bigIntArray = new BigInt64Array(new ArrayBuffer(80)); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3); @@ -84,21 +92,27 @@ bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignab bigUintArray = new BigUint64Array(10); bigUintArray = new BigUint64Array([1n, 2n, 3n]); bigUintArray = new BigUint64Array([1, 2, 3]); // should error - ~~~~~~~~~ + ~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! related TS2771 lib.es2020.bigint.d.ts:--:--: The last overload is declared here. + ~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! related TS2771 lib.es2020.bigint.d.ts:--:--: The last overload is declared here. + ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 3, '(array: ArrayLike | Iterable): BigUint64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayLike | Iterable'. -!!! error TS2769: Type 'number[]' is not assignable to type 'Iterable'. -!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -!!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. -!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. -!!! error TS2769: Type 'number' is not assignable to type 'bigint'. -!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. -!!! error TS2769: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! error TS2769: Type 'number' is not assignable to type 'bigint'. +!!! related TS2771 lib.es2020.bigint.d.ts:--:--: The last overload is declared here. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3); diff --git a/tests/baselines/reference/canFollowGetSetKeyword.errors.txt b/tests/baselines/reference/canFollowGetSetKeyword.errors.txt new file mode 100644 index 0000000000000..6994b68f4970b --- /dev/null +++ b/tests/baselines/reference/canFollowGetSetKeyword.errors.txt @@ -0,0 +1,33 @@ +error TS2318: Cannot find global type 'IterableIterator'. +canFollowGetSetKeyword.ts(10,5): error TS18004: No value exists in scope for the shorthand property 'get'. Either declare one or provide an initializer. +canFollowGetSetKeyword.ts(11,5): error TS1005: ',' expected. +canFollowGetSetKeyword.ts(14,5): error TS18004: No value exists in scope for the shorthand property 'set'. Either declare one or provide an initializer. +canFollowGetSetKeyword.ts(15,5): error TS1005: ',' expected. + + +!!! error TS2318: Cannot find global type 'IterableIterator'. +==== canFollowGetSetKeyword.ts (4 errors) ==== + class A { + get + *x() {} + } + class B { + set + *x() {} + } + const c = { + get + ~~~ +!!! error TS18004: No value exists in scope for the shorthand property 'get'. Either declare one or provide an initializer. + *x() {} + ~ +!!! error TS1005: ',' expected. + }; + const d = { + set + ~~~ +!!! error TS18004: No value exists in scope for the shorthand property 'set'. Either declare one or provide an initializer. + *x() {} + ~ +!!! error TS1005: ',' expected. + }; \ No newline at end of file diff --git a/tests/baselines/reference/canFollowGetSetKeyword.js b/tests/baselines/reference/canFollowGetSetKeyword.js new file mode 100644 index 0000000000000..261125fc938b0 --- /dev/null +++ b/tests/baselines/reference/canFollowGetSetKeyword.js @@ -0,0 +1,76 @@ +//// [tests/cases/conformance/classes/propertyMemberDeclarations/canFollowGetSetKeyword.ts] //// + +//// [canFollowGetSetKeyword.ts] +class A { + get + *x() {} +} +class B { + set + *x() {} +} +const c = { + get + *x() {} +}; +const d = { + set + *x() {} +}; + +//// [canFollowGetSetKeyword.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var A = /** @class */ (function () { + function A() { + } + A.prototype.x = function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }; + return A; +}()); +var B = /** @class */ (function () { + function B() { + } + B.prototype.x = function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }; + return B; +}()); +var c = { + get: get, + x: function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); } +}; +var d = { + set: set, + x: function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); } +}; diff --git a/tests/baselines/reference/circularTypeofWithVarOrFunc.types b/tests/baselines/reference/circularTypeofWithVarOrFunc.types index 823cd27cbd554..4c23e013d7626 100644 --- a/tests/baselines/reference/circularTypeofWithVarOrFunc.types +++ b/tests/baselines/reference/circularTypeofWithVarOrFunc.types @@ -22,16 +22,16 @@ type typeAlias2 = typeof varOfAliasedType2; > : ^^^ function func(): typeAlias3 { return null; } ->func : () => any -> : ^^^^^^^^^ +>func : () => typeAlias3 +> : ^^^^^^ var varOfAliasedType3 = func(); >varOfAliasedType3 : any > : ^^^ >func() : any > : ^^^ ->func : () => any -> : ^^^^^^^^^ +>func : () => typeAlias3 +> : ^^^^^^ type typeAlias3 = typeof varOfAliasedType3; >typeAlias3 : any @@ -54,12 +54,12 @@ interface Input { type R = ReturnType; >R : any > : ^^^ ->mul : (input: Input) => any -> : ^ ^^ ^^^^^^^^ +>mul : (input: Input) => R +> : ^ ^^ ^^^^^ function mul(input: Input): R { ->mul : (input: Input) => any -> : ^ ^^ ^^^^^^^^ +>mul : (input: Input) => R +> : ^ ^^ ^^^^^ >input : Input > : ^^^^^ @@ -85,12 +85,12 @@ function mul(input: Input): R { type R2 = ReturnType; >R2 : any > : ^^^ ->f : () => any -> : ^^^^^^^^^ +>f : () => R2 +> : ^^^^^^ function f(): R2 { return 0; } ->f : () => any -> : ^^^^^^^^^ +>f : () => R2 +> : ^^^^^^ >0 : 0 > : ^ diff --git a/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.js b/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.js new file mode 100644 index 0000000000000..1f0d50879c723 --- /dev/null +++ b/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.js @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/classAccessorInitializationInferenceWithElementAccess1.ts] //// + +//// [classAccessorInitializationInferenceWithElementAccess1.ts] +export class Cls { + accessor x; + accessor y; + accessor z; + + accessor 0; + + constructor(seed: number) { + this['x'] = [seed]; + this['y'] = { seed }; + this['z'] = `${seed}`; + + this[0] = [seed]; + } +} + + +//// [classAccessorInitializationInferenceWithElementAccess1.js] +export class Cls { + accessor x; + accessor y; + accessor z; + accessor 0; + constructor(seed) { + this['x'] = [seed]; + this['y'] = { seed }; + this['z'] = `${seed}`; + this[0] = [seed]; + } +} + + +//// [classAccessorInitializationInferenceWithElementAccess1.d.ts] +export declare class Cls { + accessor x: number[]; + accessor y: { + seed: number; + }; + accessor z: string; + accessor 0: number[]; + constructor(seed: number); +} diff --git a/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.symbols b/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.symbols new file mode 100644 index 0000000000000..4f328fa9da5b3 --- /dev/null +++ b/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.symbols @@ -0,0 +1,43 @@ +//// [tests/cases/compiler/classAccessorInitializationInferenceWithElementAccess1.ts] //// + +=== classAccessorInitializationInferenceWithElementAccess1.ts === +export class Cls { +>Cls : Symbol(Cls, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 0)) + + accessor x; +>x : Symbol(Cls.x, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 18)) + + accessor y; +>y : Symbol(Cls.y, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 1, 15)) + + accessor z; +>z : Symbol(Cls.z, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 2, 15)) + + accessor 0; +>0 : Symbol(Cls[0], Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 3, 15)) + + constructor(seed: number) { +>seed : Symbol(seed, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 7, 16)) + + this['x'] = [seed]; +>this : Symbol(Cls, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 0)) +>'x' : Symbol(Cls.x, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 18)) +>seed : Symbol(seed, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 7, 16)) + + this['y'] = { seed }; +>this : Symbol(Cls, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 0)) +>'y' : Symbol(Cls.y, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 1, 15)) +>seed : Symbol(seed, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 9, 21)) + + this['z'] = `${seed}`; +>this : Symbol(Cls, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 0)) +>'z' : Symbol(Cls.z, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 2, 15)) +>seed : Symbol(seed, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 7, 16)) + + this[0] = [seed]; +>this : Symbol(Cls, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 0, 0)) +>0 : Symbol(Cls[0], Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 3, 15)) +>seed : Symbol(seed, Decl(classAccessorInitializationInferenceWithElementAccess1.ts, 7, 16)) + } +} + diff --git a/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.types b/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.types new file mode 100644 index 0000000000000..63ed461d086ca --- /dev/null +++ b/tests/baselines/reference/classAccessorInitializationInferenceWithElementAccess1.types @@ -0,0 +1,85 @@ +//// [tests/cases/compiler/classAccessorInitializationInferenceWithElementAccess1.ts] //// + +=== classAccessorInitializationInferenceWithElementAccess1.ts === +export class Cls { +>Cls : Cls +> : ^^^ + + accessor x; +>x : number[] +> : ^^^^^^^^ + + accessor y; +>y : { seed: number; } +> : ^^^^^^^^^^^^^^^^^ + + accessor z; +>z : string +> : ^^^^^^ + + accessor 0; +>0 : number[] +> : ^^^^^^^^ + + constructor(seed: number) { +>seed : number +> : ^^^^^^ + + this['x'] = [seed]; +>this['x'] = [seed] : number[] +> : ^^^^^^^^ +>this['x'] : number[] +> : ^^^^^^^^ +>this : this +> : ^^^^ +>'x' : "x" +> : ^^^ +>[seed] : number[] +> : ^^^^^^^^ +>seed : number +> : ^^^^^^ + + this['y'] = { seed }; +>this['y'] = { seed } : { seed: number; } +> : ^^^^^^^^^^^^^^^^^ +>this['y'] : { seed: number; } +> : ^^^^^^^^^^^^^^^^^ +>this : this +> : ^^^^ +>'y' : "y" +> : ^^^ +>{ seed } : { seed: number; } +> : ^^^^^^^^^^^^^^^^^ +>seed : number +> : ^^^^^^ + + this['z'] = `${seed}`; +>this['z'] = `${seed}` : string +> : ^^^^^^ +>this['z'] : string +> : ^^^^^^ +>this : this +> : ^^^^ +>'z' : "z" +> : ^^^ +>`${seed}` : string +> : ^^^^^^ +>seed : number +> : ^^^^^^ + + this[0] = [seed]; +>this[0] = [seed] : number[] +> : ^^^^^^^^ +>this[0] : number[] +> : ^^^^^^^^ +>this : this +> : ^^^^ +>0 : 0 +> : ^ +>[seed] : number[] +> : ^^^^^^^^ +>seed : number +> : ^^^^^^ + } +} + diff --git a/tests/baselines/reference/classAttributeInferenceTemplate.js b/tests/baselines/reference/classAttributeInferenceTemplate.js index 32ff0e31ef017..60da0b173d391 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplate.js +++ b/tests/baselines/reference/classAttributeInferenceTemplate.js @@ -13,16 +13,42 @@ class MyClass { const localProperty = `foo-${variable}`; // Correctly inferred as `string` } -} +} + +class MyClass2 { + accessor property; + accessor property2; + + constructor() { + const variable = 'something' + + this.property = `foo`; // Correctly inferred as `string` + this.property2 = `foo-${variable}`; // Causes an error + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` + } +} + //// [classAttributeInferenceTemplate.js] "use strict"; -var MyClass = /** @class */ (function () { - function MyClass() { - var variable = 'something'; - this.property = "foo"; // Correctly inferred as `string` - this.property2 = "foo-".concat(variable); // Causes an error - var localProperty = "foo-".concat(variable); // Correctly inferred as `string` +class MyClass { + property; + property2; + constructor() { + const variable = 'something'; + this.property = `foo`; // Correctly inferred as `string` + this.property2 = `foo-${variable}`; // Causes an error + const localProperty = `foo-${variable}`; // Correctly inferred as `string` } - return MyClass; -}()); +} +class MyClass2 { + accessor property; + accessor property2; + constructor() { + const variable = 'something'; + this.property = `foo`; // Correctly inferred as `string` + this.property2 = `foo-${variable}`; // Causes an error + const localProperty = `foo-${variable}`; // Correctly inferred as `string` + } +} diff --git a/tests/baselines/reference/classAttributeInferenceTemplate.symbols b/tests/baselines/reference/classAttributeInferenceTemplate.symbols index ed3b4c672147e..a5b2df3334bfc 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplate.symbols +++ b/tests/baselines/reference/classAttributeInferenceTemplate.symbols @@ -30,3 +30,34 @@ class MyClass { >variable : Symbol(variable, Decl(classAttributeInferenceTemplate.ts, 5, 13)) } } + +class MyClass2 { +>MyClass2 : Symbol(MyClass2, Decl(classAttributeInferenceTemplate.ts, 12, 1)) + + accessor property; +>property : Symbol(MyClass2.property, Decl(classAttributeInferenceTemplate.ts, 14, 16)) + + accessor property2; +>property2 : Symbol(MyClass2.property2, Decl(classAttributeInferenceTemplate.ts, 15, 22)) + + constructor() { + const variable = 'something' +>variable : Symbol(variable, Decl(classAttributeInferenceTemplate.ts, 19, 13)) + + this.property = `foo`; // Correctly inferred as `string` +>this.property : Symbol(MyClass2.property, Decl(classAttributeInferenceTemplate.ts, 14, 16)) +>this : Symbol(MyClass2, Decl(classAttributeInferenceTemplate.ts, 12, 1)) +>property : Symbol(MyClass2.property, Decl(classAttributeInferenceTemplate.ts, 14, 16)) + + this.property2 = `foo-${variable}`; // Causes an error +>this.property2 : Symbol(MyClass2.property2, Decl(classAttributeInferenceTemplate.ts, 15, 22)) +>this : Symbol(MyClass2, Decl(classAttributeInferenceTemplate.ts, 12, 1)) +>property2 : Symbol(MyClass2.property2, Decl(classAttributeInferenceTemplate.ts, 15, 22)) +>variable : Symbol(variable, Decl(classAttributeInferenceTemplate.ts, 19, 13)) + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` +>localProperty : Symbol(localProperty, Decl(classAttributeInferenceTemplate.ts, 24, 13)) +>variable : Symbol(variable, Decl(classAttributeInferenceTemplate.ts, 19, 13)) + } +} + diff --git a/tests/baselines/reference/classAttributeInferenceTemplate.types b/tests/baselines/reference/classAttributeInferenceTemplate.types index 67829632ec79a..1386ee62d417a 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplate.types +++ b/tests/baselines/reference/classAttributeInferenceTemplate.types @@ -55,3 +55,59 @@ class MyClass { > : ^^^^^^^^^^^ } } + +class MyClass2 { +>MyClass2 : MyClass2 +> : ^^^^^^^^ + + accessor property; +>property : string +> : ^^^^^^ + + accessor property2; +>property2 : string +> : ^^^^^^ + + constructor() { + const variable = 'something' +>variable : "something" +> : ^^^^^^^^^^^ +>'something' : "something" +> : ^^^^^^^^^^^ + + this.property = `foo`; // Correctly inferred as `string` +>this.property = `foo` : "foo" +> : ^^^^^ +>this.property : string +> : ^^^^^^ +>this : this +> : ^^^^ +>property : string +> : ^^^^^^ +>`foo` : "foo" +> : ^^^^^ + + this.property2 = `foo-${variable}`; // Causes an error +>this.property2 = `foo-${variable}` : "foo-something" +> : ^^^^^^^^^^^^^^^ +>this.property2 : string +> : ^^^^^^ +>this : this +> : ^^^^ +>property2 : string +> : ^^^^^^ +>`foo-${variable}` : "foo-something" +> : ^^^^^^^^^^^^^^^ +>variable : "something" +> : ^^^^^^^^^^^ + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` +>localProperty : "foo-something" +> : ^^^^^^^^^^^^^^^ +>`foo-${variable}` : "foo-something" +> : ^^^^^^^^^^^^^^^ +>variable : "something" +> : ^^^^^^^^^^^ + } +} + diff --git a/tests/baselines/reference/classAttributeInferenceTemplateJS.symbols b/tests/baselines/reference/classAttributeInferenceTemplateJS.symbols index f9a44243c9a2c..96e45c51a750a 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplateJS.symbols +++ b/tests/baselines/reference/classAttributeInferenceTemplateJS.symbols @@ -30,3 +30,34 @@ class MyClass { >variable : Symbol(variable, Decl(index.js, 5, 13)) } } + +class MyClass2 { +>MyClass2 : Symbol(MyClass2, Decl(index.js, 12, 1)) + + accessor property; +>property : Symbol(MyClass2.property, Decl(index.js, 14, 16)) + + accessor property2; +>property2 : Symbol(MyClass2.property2, Decl(index.js, 15, 22)) + + constructor() { + const variable = 'something' +>variable : Symbol(variable, Decl(index.js, 19, 13)) + + this.property = `foo`; // Correctly inferred as `string` +>this.property : Symbol(MyClass2.property, Decl(index.js, 14, 16)) +>this : Symbol(MyClass2, Decl(index.js, 12, 1)) +>property : Symbol(MyClass2.property, Decl(index.js, 14, 16)) + + this.property2 = `foo-${variable}`; // Causes an error +>this.property2 : Symbol(MyClass2.property2, Decl(index.js, 15, 22)) +>this : Symbol(MyClass2, Decl(index.js, 12, 1)) +>property2 : Symbol(MyClass2.property2, Decl(index.js, 15, 22)) +>variable : Symbol(variable, Decl(index.js, 19, 13)) + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` +>localProperty : Symbol(localProperty, Decl(index.js, 24, 13)) +>variable : Symbol(variable, Decl(index.js, 19, 13)) + } +} + diff --git a/tests/baselines/reference/classAttributeInferenceTemplateJS.types b/tests/baselines/reference/classAttributeInferenceTemplateJS.types index ded33a9e2977e..74d16a8c1409d 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplateJS.types +++ b/tests/baselines/reference/classAttributeInferenceTemplateJS.types @@ -55,3 +55,59 @@ class MyClass { > : ^^^^^^^^^^^ } } + +class MyClass2 { +>MyClass2 : MyClass2 +> : ^^^^^^^^ + + accessor property; +>property : string +> : ^^^^^^ + + accessor property2; +>property2 : string +> : ^^^^^^ + + constructor() { + const variable = 'something' +>variable : "something" +> : ^^^^^^^^^^^ +>'something' : "something" +> : ^^^^^^^^^^^ + + this.property = `foo`; // Correctly inferred as `string` +>this.property = `foo` : "foo" +> : ^^^^^ +>this.property : string +> : ^^^^^^ +>this : this +> : ^^^^ +>property : string +> : ^^^^^^ +>`foo` : "foo" +> : ^^^^^ + + this.property2 = `foo-${variable}`; // Causes an error +>this.property2 = `foo-${variable}` : "foo-something" +> : ^^^^^^^^^^^^^^^ +>this.property2 : string +> : ^^^^^^ +>this : this +> : ^^^^ +>property2 : string +> : ^^^^^^ +>`foo-${variable}` : "foo-something" +> : ^^^^^^^^^^^^^^^ +>variable : "something" +> : ^^^^^^^^^^^ + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` +>localProperty : "foo-something" +> : ^^^^^^^^^^^^^^^ +>`foo-${variable}` : "foo-something" +> : ^^^^^^^^^^^^^^^ +>variable : "something" +> : ^^^^^^^^^^^ + } +} + diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef4.js b/tests/baselines/reference/classStaticBlockUseBeforeDef4.js new file mode 100644 index 0000000000000..242781c8c80b4 --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef4.js @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef4.ts] //// + +//// [classStaticBlockUseBeforeDef4.ts] +class C { + static accessor x; + static { + this.x = 1; + } + static accessor y = this.x; + static accessor z; + static { + this.z = this.y; + } +} + + +//// [classStaticBlockUseBeforeDef4.js] +"use strict"; +class C { + static accessor x; + static { + this.x = 1; + } + static accessor y = this.x; + static accessor z; + static { + this.z = this.y; + } +} + + +//// [classStaticBlockUseBeforeDef4.d.ts] +declare class C { + static accessor x: number; + static accessor y: number; + static accessor z: number; +} diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef4.symbols b/tests/baselines/reference/classStaticBlockUseBeforeDef4.symbols new file mode 100644 index 0000000000000..7bc81ad4b8c0e --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef4.symbols @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef4.ts] //// + +=== classStaticBlockUseBeforeDef4.ts === +class C { +>C : Symbol(C, Decl(classStaticBlockUseBeforeDef4.ts, 0, 0)) + + static accessor x; +>x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef4.ts, 0, 9)) + + static { + this.x = 1; +>this.x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef4.ts, 0, 9)) +>this : Symbol(C, Decl(classStaticBlockUseBeforeDef4.ts, 0, 0)) +>x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef4.ts, 0, 9)) + } + static accessor y = this.x; +>y : Symbol(C.y, Decl(classStaticBlockUseBeforeDef4.ts, 4, 5)) +>this.x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef4.ts, 0, 9)) +>this : Symbol(C, Decl(classStaticBlockUseBeforeDef4.ts, 0, 0)) +>x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef4.ts, 0, 9)) + + static accessor z; +>z : Symbol(C.z, Decl(classStaticBlockUseBeforeDef4.ts, 5, 31)) + + static { + this.z = this.y; +>this.z : Symbol(C.z, Decl(classStaticBlockUseBeforeDef4.ts, 5, 31)) +>this : Symbol(C, Decl(classStaticBlockUseBeforeDef4.ts, 0, 0)) +>z : Symbol(C.z, Decl(classStaticBlockUseBeforeDef4.ts, 5, 31)) +>this.y : Symbol(C.y, Decl(classStaticBlockUseBeforeDef4.ts, 4, 5)) +>this : Symbol(C, Decl(classStaticBlockUseBeforeDef4.ts, 0, 0)) +>y : Symbol(C.y, Decl(classStaticBlockUseBeforeDef4.ts, 4, 5)) + } +} + diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef4.types b/tests/baselines/reference/classStaticBlockUseBeforeDef4.types new file mode 100644 index 0000000000000..ccee65bd4e0ae --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef4.types @@ -0,0 +1,57 @@ +//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef4.ts] //// + +=== classStaticBlockUseBeforeDef4.ts === +class C { +>C : C +> : ^ + + static accessor x; +>x : number +> : ^^^^^^ + + static { + this.x = 1; +>this.x = 1 : 1 +> : ^ +>this.x : number +> : ^^^^^^ +>this : typeof C +> : ^^^^^^^^ +>x : number +> : ^^^^^^ +>1 : 1 +> : ^ + } + static accessor y = this.x; +>y : number +> : ^^^^^^ +>this.x : number +> : ^^^^^^ +>this : typeof C +> : ^^^^^^^^ +>x : number +> : ^^^^^^ + + static accessor z; +>z : number +> : ^^^^^^ + + static { + this.z = this.y; +>this.z = this.y : number +> : ^^^^^^ +>this.z : number +> : ^^^^^^ +>this : typeof C +> : ^^^^^^^^ +>z : number +> : ^^^^^^ +>this.y : number +> : ^^^^^^ +>this : typeof C +> : ^^^^^^^^ +>y : number +> : ^^^^^^ + } +} + diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef5.errors.txt b/tests/baselines/reference/classStaticBlockUseBeforeDef5.errors.txt new file mode 100644 index 0000000000000..22f9582e4ad44 --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef5.errors.txt @@ -0,0 +1,14 @@ +classStaticBlockUseBeforeDef5.ts(3,14): error TS2729: Property 'x' is used before its initialization. + + +==== classStaticBlockUseBeforeDef5.ts (1 errors) ==== + class C { + static { + this.x = 1; + ~ +!!! error TS2729: Property 'x' is used before its initialization. +!!! related TS2728 classStaticBlockUseBeforeDef5.ts:5:21: 'x' is declared here. + } + static accessor x; + } + \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef5.js b/tests/baselines/reference/classStaticBlockUseBeforeDef5.js new file mode 100644 index 0000000000000..d120f33abd216 --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef5.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef5.ts] //// + +//// [classStaticBlockUseBeforeDef5.ts] +class C { + static { + this.x = 1; + } + static accessor x; +} + + +//// [classStaticBlockUseBeforeDef5.js] +"use strict"; +class C { + static { + this.x = 1; + } + static accessor x; +} + + +//// [classStaticBlockUseBeforeDef5.d.ts] +declare class C { + static accessor x: number; +} diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef5.symbols b/tests/baselines/reference/classStaticBlockUseBeforeDef5.symbols new file mode 100644 index 0000000000000..1b187623a4428 --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef5.symbols @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef5.ts] //// + +=== classStaticBlockUseBeforeDef5.ts === +class C { +>C : Symbol(C, Decl(classStaticBlockUseBeforeDef5.ts, 0, 0)) + + static { + this.x = 1; +>this.x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef5.ts, 3, 5)) +>this : Symbol(C, Decl(classStaticBlockUseBeforeDef5.ts, 0, 0)) +>x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef5.ts, 3, 5)) + } + static accessor x; +>x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef5.ts, 3, 5)) +} + diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef5.types b/tests/baselines/reference/classStaticBlockUseBeforeDef5.types new file mode 100644 index 0000000000000..284e1a746434c --- /dev/null +++ b/tests/baselines/reference/classStaticBlockUseBeforeDef5.types @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef5.ts] //// + +=== classStaticBlockUseBeforeDef5.ts === +class C { +>C : C +> : ^ + + static { + this.x = 1; +>this.x = 1 : 1 +> : ^ +>this.x : number +> : ^^^^^^ +>this : typeof C +> : ^^^^^^^^ +>x : number +> : ^^^^^^ +>1 : 1 +> : ^ + } + static accessor x; +>x : number +> : ^^^^^^ +} + diff --git a/tests/baselines/reference/computedPropertiesWithSetterAssignment.js b/tests/baselines/reference/computedPropertiesWithSetterAssignment.js new file mode 100644 index 0000000000000..6c61698aa026e --- /dev/null +++ b/tests/baselines/reference/computedPropertiesWithSetterAssignment.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/computedPropertiesWithSetterAssignment.ts] //// + +//// [a.ts] +const k = Symbol(); + +const enum Props { + k = 'k', +} + +interface Foo { + get k(): Set; + set k(v: Iterable); + + get [k](): Set; + set [k](v: Iterable); +} + +declare const foo: Foo; + +foo.k = ['foo']; +foo['k'] = ['foo']; +foo[Props.k] = ['foo']; +foo[k] = ['foo']; + + +//// [a.js] +"use strict"; +const k = Symbol(); +foo.k = ['foo']; +foo['k'] = ['foo']; +foo["k" /* Props.k */] = ['foo']; +foo[k] = ['foo']; diff --git a/tests/baselines/reference/computedPropertiesWithSetterAssignment.symbols b/tests/baselines/reference/computedPropertiesWithSetterAssignment.symbols new file mode 100644 index 0000000000000..cc82a9dc99a58 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesWithSetterAssignment.symbols @@ -0,0 +1,61 @@ +//// [tests/cases/compiler/computedPropertiesWithSetterAssignment.ts] //// + +=== /a.ts === +const k = Symbol(); +>k : Symbol(k, Decl(a.ts, 0, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + +const enum Props { +>Props : Symbol(Props, Decl(a.ts, 0, 19)) + + k = 'k', +>k : Symbol(Props.k, Decl(a.ts, 2, 18)) +} + +interface Foo { +>Foo : Symbol(Foo, Decl(a.ts, 4, 1)) + + get k(): Set; +>k : Symbol(Foo.k, Decl(a.ts, 6, 15), Decl(a.ts, 7, 25)) +>Set : Symbol(Set, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.collection.d.ts, --, --)) + + set k(v: Iterable); +>k : Symbol(Foo.k, Decl(a.ts, 6, 15), Decl(a.ts, 7, 25)) +>v : Symbol(v, Decl(a.ts, 8, 10)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) + + get [k](): Set; +>[k] : Symbol(Foo[k], Decl(a.ts, 8, 31), Decl(a.ts, 10, 27)) +>k : Symbol(k, Decl(a.ts, 0, 5)) +>Set : Symbol(Set, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.collection.d.ts, --, --)) + + set [k](v: Iterable); +>[k] : Symbol(Foo[k], Decl(a.ts, 8, 31), Decl(a.ts, 10, 27)) +>k : Symbol(k, Decl(a.ts, 0, 5)) +>v : Symbol(v, Decl(a.ts, 11, 12)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +} + +declare const foo: Foo; +>foo : Symbol(foo, Decl(a.ts, 14, 13)) +>Foo : Symbol(Foo, Decl(a.ts, 4, 1)) + +foo.k = ['foo']; +>foo.k : Symbol(Foo.k, Decl(a.ts, 6, 15), Decl(a.ts, 7, 25)) +>foo : Symbol(foo, Decl(a.ts, 14, 13)) +>k : Symbol(Foo.k, Decl(a.ts, 6, 15), Decl(a.ts, 7, 25)) + +foo['k'] = ['foo']; +>foo : Symbol(foo, Decl(a.ts, 14, 13)) +>'k' : Symbol(Foo.k, Decl(a.ts, 6, 15), Decl(a.ts, 7, 25)) + +foo[Props.k] = ['foo']; +>foo : Symbol(foo, Decl(a.ts, 14, 13)) +>Props.k : Symbol(Props.k, Decl(a.ts, 2, 18)) +>Props : Symbol(Props, Decl(a.ts, 0, 19)) +>k : Symbol(Props.k, Decl(a.ts, 2, 18)) + +foo[k] = ['foo']; +>foo : Symbol(foo, Decl(a.ts, 14, 13)) +>k : Symbol(k, Decl(a.ts, 0, 5)) + diff --git a/tests/baselines/reference/computedPropertiesWithSetterAssignment.types b/tests/baselines/reference/computedPropertiesWithSetterAssignment.types new file mode 100644 index 0000000000000..92c0df4cfc46d --- /dev/null +++ b/tests/baselines/reference/computedPropertiesWithSetterAssignment.types @@ -0,0 +1,112 @@ +//// [tests/cases/compiler/computedPropertiesWithSetterAssignment.ts] //// + +=== /a.ts === +const k = Symbol(); +>k : unique symbol +> : ^^^^^^^^^^^^^ +>Symbol() : unique symbol +> : ^^^^^^^^^^^^^ +>Symbol : SymbolConstructor +> : ^^^^^^^^^^^^^^^^^ + +const enum Props { +>Props : Props +> : ^^^^^ + + k = 'k', +>k : Props.k +> : ^^^^^^^ +>'k' : "k" +> : ^^^ +} + +interface Foo { + get k(): Set; +>k : Set +> : ^^^^^^^^^^^ + + set k(v: Iterable); +>k : Set +> : ^^^^^^^^^^^ +>v : Iterable +> : ^^^^^^^^^^^^^^^^ + + get [k](): Set; +>[k] : Set +> : ^^^^^^^^^^^ +>k : unique symbol +> : ^^^^^^^^^^^^^ + + set [k](v: Iterable); +>[k] : Set +> : ^^^^^^^^^^^ +>k : unique symbol +> : ^^^^^^^^^^^^^ +>v : Iterable +> : ^^^^^^^^^^^^^^^^ +} + +declare const foo: Foo; +>foo : Foo +> : ^^^ + +foo.k = ['foo']; +>foo.k = ['foo'] : string[] +> : ^^^^^^^^ +>foo.k : Iterable +> : ^^^^^^^^^^^^^^^^ +>foo : Foo +> : ^^^ +>k : Iterable +> : ^^^^^^^^^^^^^^^^ +>['foo'] : string[] +> : ^^^^^^^^ +>'foo' : "foo" +> : ^^^^^ + +foo['k'] = ['foo']; +>foo['k'] = ['foo'] : string[] +> : ^^^^^^^^ +>foo['k'] : Iterable +> : ^^^^^^^^^^^^^^^^ +>foo : Foo +> : ^^^ +>'k' : "k" +> : ^^^ +>['foo'] : string[] +> : ^^^^^^^^ +>'foo' : "foo" +> : ^^^^^ + +foo[Props.k] = ['foo']; +>foo[Props.k] = ['foo'] : string[] +> : ^^^^^^^^ +>foo[Props.k] : Iterable +> : ^^^^^^^^^^^^^^^^ +>foo : Foo +> : ^^^ +>Props.k : Props +> : ^^^^^ +>Props : typeof Props +> : ^^^^^^^^^^^^ +>k : Props +> : ^^^^^ +>['foo'] : string[] +> : ^^^^^^^^ +>'foo' : "foo" +> : ^^^^^ + +foo[k] = ['foo']; +>foo[k] = ['foo'] : string[] +> : ^^^^^^^^ +>foo[k] : Iterable +> : ^^^^^^^^^^^^^^^^ +>foo : Foo +> : ^^^ +>k : unique symbol +> : ^^^^^^^^^^^^^ +>['foo'] : string[] +> : ^^^^^^^^ +>'foo' : "foo" +> : ^^^^^ + diff --git a/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json b/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json new file mode 100644 index 0000000000000..3afdb1cd6278d --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "nodenext", + "target": "esnext", + "moduleResolution": "nodenext", + "moduleDetection": "force", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + "useDefineForClassFields": true + } +} diff --git a/tests/baselines/reference/controlFlowAutoAccessor1.errors.txt b/tests/baselines/reference/controlFlowAutoAccessor1.errors.txt new file mode 100644 index 0000000000000..b9898bc54b5d6 --- /dev/null +++ b/tests/baselines/reference/controlFlowAutoAccessor1.errors.txt @@ -0,0 +1,64 @@ +controlFlowAutoAccessor1.ts(54,19): error TS7008: Member 'value' implicitly has an 'any' type. + + +==== controlFlowAutoAccessor1.ts (1 errors) ==== + class Example { + accessor test; + + constructor(test: number) { + this.test = test; + } + + getTest() { + return this.test; + } + } + + class Example2 { + accessor test; + + constructor(test: number | undefined) { + this.test = test; + } + + getTest() { + if (this.test) { + return this.test; + } + return 0; + } + } + + // https://github.com/microsoft/TypeScript/issues/59728 + + class Example3 { + accessor value; + + constructor(n: number) { + this.value = n; + + if (n < 0) { + this.value = null; + } + } + } + + declare var n: number; + class Example4 { + static accessor value; + static { + this.value = n; + if (n < 0) { + this.value = null; + } + } + } + + class Example5 { + static accessor value; // error + ~~~~~ +!!! error TS7008: Member 'value' implicitly has an 'any' type. + } + Example5.value = 123; + Example5.value++; + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowAutoAccessor1.js b/tests/baselines/reference/controlFlowAutoAccessor1.js new file mode 100644 index 0000000000000..c106226250f95 --- /dev/null +++ b/tests/baselines/reference/controlFlowAutoAccessor1.js @@ -0,0 +1,133 @@ +//// [tests/cases/compiler/controlFlowAutoAccessor1.ts] //// + +//// [controlFlowAutoAccessor1.ts] +class Example { + accessor test; + + constructor(test: number) { + this.test = test; + } + + getTest() { + return this.test; + } +} + +class Example2 { + accessor test; + + constructor(test: number | undefined) { + this.test = test; + } + + getTest() { + if (this.test) { + return this.test; + } + return 0; + } +} + +// https://github.com/microsoft/TypeScript/issues/59728 + +class Example3 { + accessor value; + + constructor(n: number) { + this.value = n; + + if (n < 0) { + this.value = null; + } + } +} + +declare var n: number; +class Example4 { + static accessor value; + static { + this.value = n; + if (n < 0) { + this.value = null; + } + } +} + +class Example5 { + static accessor value; // error +} +Example5.value = 123; +Example5.value++; + + +//// [controlFlowAutoAccessor1.js] +"use strict"; +class Example { + accessor test; + constructor(test) { + this.test = test; + } + getTest() { + return this.test; + } +} +class Example2 { + accessor test; + constructor(test) { + this.test = test; + } + getTest() { + if (this.test) { + return this.test; + } + return 0; + } +} +// https://github.com/microsoft/TypeScript/issues/59728 +class Example3 { + accessor value; + constructor(n) { + this.value = n; + if (n < 0) { + this.value = null; + } + } +} +class Example4 { + static accessor value; + static { + this.value = n; + if (n < 0) { + this.value = null; + } + } +} +class Example5 { + static accessor value; // error +} +Example5.value = 123; +Example5.value++; + + +//// [controlFlowAutoAccessor1.d.ts] +declare class Example { + accessor test: number; + constructor(test: number); + getTest(): number; +} +declare class Example2 { + accessor test: number | undefined; + constructor(test: number | undefined); + getTest(): number; +} +declare class Example3 { + accessor value: number | null; + constructor(n: number); +} +declare var n: number; +declare class Example4 { + static accessor value: number | null; +} +declare class Example5 { + static accessor value: any; +} diff --git a/tests/baselines/reference/controlFlowAutoAccessor1.symbols b/tests/baselines/reference/controlFlowAutoAccessor1.symbols new file mode 100644 index 0000000000000..138653ad30485 --- /dev/null +++ b/tests/baselines/reference/controlFlowAutoAccessor1.symbols @@ -0,0 +1,133 @@ +//// [tests/cases/compiler/controlFlowAutoAccessor1.ts] //// + +=== controlFlowAutoAccessor1.ts === +class Example { +>Example : Symbol(Example, Decl(controlFlowAutoAccessor1.ts, 0, 0)) + + accessor test; +>test : Symbol(Example.test, Decl(controlFlowAutoAccessor1.ts, 0, 15)) + + constructor(test: number) { +>test : Symbol(test, Decl(controlFlowAutoAccessor1.ts, 3, 14)) + + this.test = test; +>this.test : Symbol(Example.test, Decl(controlFlowAutoAccessor1.ts, 0, 15)) +>this : Symbol(Example, Decl(controlFlowAutoAccessor1.ts, 0, 0)) +>test : Symbol(Example.test, Decl(controlFlowAutoAccessor1.ts, 0, 15)) +>test : Symbol(test, Decl(controlFlowAutoAccessor1.ts, 3, 14)) + } + + getTest() { +>getTest : Symbol(Example.getTest, Decl(controlFlowAutoAccessor1.ts, 5, 3)) + + return this.test; +>this.test : Symbol(Example.test, Decl(controlFlowAutoAccessor1.ts, 0, 15)) +>this : Symbol(Example, Decl(controlFlowAutoAccessor1.ts, 0, 0)) +>test : Symbol(Example.test, Decl(controlFlowAutoAccessor1.ts, 0, 15)) + } +} + +class Example2 { +>Example2 : Symbol(Example2, Decl(controlFlowAutoAccessor1.ts, 10, 1)) + + accessor test; +>test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) + + constructor(test: number | undefined) { +>test : Symbol(test, Decl(controlFlowAutoAccessor1.ts, 15, 14)) + + this.test = test; +>this.test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) +>this : Symbol(Example2, Decl(controlFlowAutoAccessor1.ts, 10, 1)) +>test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) +>test : Symbol(test, Decl(controlFlowAutoAccessor1.ts, 15, 14)) + } + + getTest() { +>getTest : Symbol(Example2.getTest, Decl(controlFlowAutoAccessor1.ts, 17, 3)) + + if (this.test) { +>this.test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) +>this : Symbol(Example2, Decl(controlFlowAutoAccessor1.ts, 10, 1)) +>test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) + + return this.test; +>this.test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) +>this : Symbol(Example2, Decl(controlFlowAutoAccessor1.ts, 10, 1)) +>test : Symbol(Example2.test, Decl(controlFlowAutoAccessor1.ts, 12, 16)) + } + return 0; + } +} + +// https://github.com/microsoft/TypeScript/issues/59728 + +class Example3 { +>Example3 : Symbol(Example3, Decl(controlFlowAutoAccessor1.ts, 25, 1)) + + accessor value; +>value : Symbol(Example3.value, Decl(controlFlowAutoAccessor1.ts, 29, 16)) + + constructor(n: number) { +>n : Symbol(n, Decl(controlFlowAutoAccessor1.ts, 32, 14)) + + this.value = n; +>this.value : Symbol(Example3.value, Decl(controlFlowAutoAccessor1.ts, 29, 16)) +>this : Symbol(Example3, Decl(controlFlowAutoAccessor1.ts, 25, 1)) +>value : Symbol(Example3.value, Decl(controlFlowAutoAccessor1.ts, 29, 16)) +>n : Symbol(n, Decl(controlFlowAutoAccessor1.ts, 32, 14)) + + if (n < 0) { +>n : Symbol(n, Decl(controlFlowAutoAccessor1.ts, 32, 14)) + + this.value = null; +>this.value : Symbol(Example3.value, Decl(controlFlowAutoAccessor1.ts, 29, 16)) +>this : Symbol(Example3, Decl(controlFlowAutoAccessor1.ts, 25, 1)) +>value : Symbol(Example3.value, Decl(controlFlowAutoAccessor1.ts, 29, 16)) + } + } +} + +declare var n: number; +>n : Symbol(n, Decl(controlFlowAutoAccessor1.ts, 41, 11)) + +class Example4 { +>Example4 : Symbol(Example4, Decl(controlFlowAutoAccessor1.ts, 41, 22)) + + static accessor value; +>value : Symbol(Example4.value, Decl(controlFlowAutoAccessor1.ts, 42, 16)) + + static { + this.value = n; +>this.value : Symbol(Example4.value, Decl(controlFlowAutoAccessor1.ts, 42, 16)) +>this : Symbol(Example4, Decl(controlFlowAutoAccessor1.ts, 41, 22)) +>value : Symbol(Example4.value, Decl(controlFlowAutoAccessor1.ts, 42, 16)) +>n : Symbol(n, Decl(controlFlowAutoAccessor1.ts, 41, 11)) + + if (n < 0) { +>n : Symbol(n, Decl(controlFlowAutoAccessor1.ts, 41, 11)) + + this.value = null; +>this.value : Symbol(Example4.value, Decl(controlFlowAutoAccessor1.ts, 42, 16)) +>this : Symbol(Example4, Decl(controlFlowAutoAccessor1.ts, 41, 22)) +>value : Symbol(Example4.value, Decl(controlFlowAutoAccessor1.ts, 42, 16)) + } + } +} + +class Example5 { +>Example5 : Symbol(Example5, Decl(controlFlowAutoAccessor1.ts, 50, 1)) + + static accessor value; // error +>value : Symbol(Example5.value, Decl(controlFlowAutoAccessor1.ts, 52, 16)) +} +Example5.value = 123; +>Example5.value : Symbol(Example5.value, Decl(controlFlowAutoAccessor1.ts, 52, 16)) +>Example5 : Symbol(Example5, Decl(controlFlowAutoAccessor1.ts, 50, 1)) +>value : Symbol(Example5.value, Decl(controlFlowAutoAccessor1.ts, 52, 16)) + +Example5.value++; +>Example5.value : Symbol(Example5.value, Decl(controlFlowAutoAccessor1.ts, 52, 16)) +>Example5 : Symbol(Example5, Decl(controlFlowAutoAccessor1.ts, 50, 1)) +>value : Symbol(Example5.value, Decl(controlFlowAutoAccessor1.ts, 52, 16)) + diff --git a/tests/baselines/reference/controlFlowAutoAccessor1.types b/tests/baselines/reference/controlFlowAutoAccessor1.types new file mode 100644 index 0000000000000..c4e8c3865f43f --- /dev/null +++ b/tests/baselines/reference/controlFlowAutoAccessor1.types @@ -0,0 +1,216 @@ +//// [tests/cases/compiler/controlFlowAutoAccessor1.ts] //// + +=== controlFlowAutoAccessor1.ts === +class Example { +>Example : Example +> : ^^^^^^^ + + accessor test; +>test : number +> : ^^^^^^ + + constructor(test: number) { +>test : number +> : ^^^^^^ + + this.test = test; +>this.test = test : number +> : ^^^^^^ +>this.test : number +> : ^^^^^^ +>this : this +> : ^^^^ +>test : number +> : ^^^^^^ +>test : number +> : ^^^^^^ + } + + getTest() { +>getTest : () => number +> : ^^^^^^^^^^^^ + + return this.test; +>this.test : number +> : ^^^^^^ +>this : this +> : ^^^^ +>test : number +> : ^^^^^^ + } +} + +class Example2 { +>Example2 : Example2 +> : ^^^^^^^^ + + accessor test; +>test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + constructor(test: number | undefined) { +>test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + this.test = test; +>this.test = test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>this.test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>this : this +> : ^^^^ +>test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + } + + getTest() { +>getTest : () => number +> : ^^^^^^^^^^^^ + + if (this.test) { +>this.test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>this : this +> : ^^^^ +>test : number | undefined +> : ^^^^^^^^^^^^^^^^^^ + + return this.test; +>this.test : number +> : ^^^^^^ +>this : this +> : ^^^^ +>test : number +> : ^^^^^^ + } + return 0; +>0 : 0 +> : ^ + } +} + +// https://github.com/microsoft/TypeScript/issues/59728 + +class Example3 { +>Example3 : Example3 +> : ^^^^^^^^ + + accessor value; +>value : number | null +> : ^^^^^^^^^^^^^ + + constructor(n: number) { +>n : number +> : ^^^^^^ + + this.value = n; +>this.value = n : number +> : ^^^^^^ +>this.value : number | null +> : ^^^^^^^^^^^^^ +>this : this +> : ^^^^ +>value : number | null +> : ^^^^^^^^^^^^^ +>n : number +> : ^^^^^^ + + if (n < 0) { +>n < 0 : boolean +> : ^^^^^^^ +>n : number +> : ^^^^^^ +>0 : 0 +> : ^ + + this.value = null; +>this.value = null : null +> : ^^^^ +>this.value : number | null +> : ^^^^^^^^^^^^^ +>this : this +> : ^^^^ +>value : number | null +> : ^^^^^^^^^^^^^ + } + } +} + +declare var n: number; +>n : number +> : ^^^^^^ + +class Example4 { +>Example4 : Example4 +> : ^^^^^^^^ + + static accessor value; +>value : number | null +> : ^^^^^^^^^^^^^ + + static { + this.value = n; +>this.value = n : number +> : ^^^^^^ +>this.value : number | null +> : ^^^^^^^^^^^^^ +>this : typeof Example4 +> : ^^^^^^^^^^^^^^^ +>value : number | null +> : ^^^^^^^^^^^^^ +>n : number +> : ^^^^^^ + + if (n < 0) { +>n < 0 : boolean +> : ^^^^^^^ +>n : number +> : ^^^^^^ +>0 : 0 +> : ^ + + this.value = null; +>this.value = null : null +> : ^^^^ +>this.value : number | null +> : ^^^^^^^^^^^^^ +>this : typeof Example4 +> : ^^^^^^^^^^^^^^^ +>value : number | null +> : ^^^^^^^^^^^^^ + } + } +} + +class Example5 { +>Example5 : Example5 +> : ^^^^^^^^ + + static accessor value; // error +>value : any +> : ^^^ +} +Example5.value = 123; +>Example5.value = 123 : 123 +> : ^^^ +>Example5.value : any +> : ^^^ +>Example5 : typeof Example5 +> : ^^^^^^^^^^^^^^^ +>value : any +> : ^^^ +>123 : 123 +> : ^^^ + +Example5.value++; +>Example5.value++ : number +> : ^^^^^^ +>Example5.value : any +> : ^^^ +>Example5 : typeof Example5 +> : ^^^^^^^^^^^^^^^ +>value : any +> : ^^^ + diff --git a/tests/baselines/reference/destructuringParameterDeclaration10(strict=false).symbols b/tests/baselines/reference/destructuringParameterDeclaration10(strict=false).symbols new file mode 100644 index 0000000000000..a0da095b3f6de --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration10(strict=false).symbols @@ -0,0 +1,61 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts] //// + +=== destructuringParameterDeclaration10.ts === +export function prepareConfig({ +>prepareConfig : Symbol(prepareConfig, Decl(destructuringParameterDeclaration10.ts, 0, 0)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 4, 4)) + + json = [] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 1, 22)) + + } = {} +}: { + additionalFiles?: Partial>; +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 4, 4)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +} = {}) { + json // string[] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 1, 22)) +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : Symbol(prepareConfigWithoutAnnotation, Decl(destructuringParameterDeclaration10.ts, 8, 1)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles) + + json = [] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 11, 22)) + + } = {} +} = {}) { + json +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 11, 22)) +} + +export const prepareConfigWithContextualSignature: (param:{ +>prepareConfigWithContextualSignature : Symbol(prepareConfigWithContextualSignature, Decl(destructuringParameterDeclaration10.ts, 18, 12)) +>param : Symbol(param, Decl(destructuringParameterDeclaration10.ts, 18, 52)) + + additionalFiles?: Partial>; +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 18, 59)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +}) => void = ({ + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 18, 59)) + + json = [] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 21, 22)) + + } = {} +} = {}) => { + json // string[] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 21, 22)) +} + diff --git a/tests/baselines/reference/destructuringParameterDeclaration10(strict=false).types b/tests/baselines/reference/destructuringParameterDeclaration10(strict=false).types new file mode 100644 index 0000000000000..721d45fc041df --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration10(strict=false).types @@ -0,0 +1,99 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts] //// + +=== destructuringParameterDeclaration10.ts === +export function prepareConfig({ +>prepareConfig : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>; }) => void +> : ^ ^^^ ^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +}: { + additionalFiles?: Partial>; +>additionalFiles : Partial> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +} = {}) { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : ({ additionalFiles: { json } }?: { additionalFiles?: { json?: any[]; }; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : any[] +> : ^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) { +>{} : {} +> : ^^ + + json +>json : any[] +> : ^^^^^ +} + +export const prepareConfigWithContextualSignature: (param:{ +>prepareConfigWithContextualSignature : (param: { additionalFiles?: Partial>; }) => void +> : ^ ^^ ^^^^^ +>param : { additionalFiles?: Partial>; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^ + + additionalFiles?: Partial>; +>additionalFiles : Partial> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +}) => void = ({ +>({ additionalFiles: { json = [] } = {}} = {}) => { json // string[]} : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) => { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + diff --git a/tests/baselines/reference/destructuringParameterDeclaration10(strict=true).symbols b/tests/baselines/reference/destructuringParameterDeclaration10(strict=true).symbols new file mode 100644 index 0000000000000..a0da095b3f6de --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration10(strict=true).symbols @@ -0,0 +1,61 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts] //// + +=== destructuringParameterDeclaration10.ts === +export function prepareConfig({ +>prepareConfig : Symbol(prepareConfig, Decl(destructuringParameterDeclaration10.ts, 0, 0)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 4, 4)) + + json = [] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 1, 22)) + + } = {} +}: { + additionalFiles?: Partial>; +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 4, 4)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +} = {}) { + json // string[] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 1, 22)) +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : Symbol(prepareConfigWithoutAnnotation, Decl(destructuringParameterDeclaration10.ts, 8, 1)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles) + + json = [] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 11, 22)) + + } = {} +} = {}) { + json +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 11, 22)) +} + +export const prepareConfigWithContextualSignature: (param:{ +>prepareConfigWithContextualSignature : Symbol(prepareConfigWithContextualSignature, Decl(destructuringParameterDeclaration10.ts, 18, 12)) +>param : Symbol(param, Decl(destructuringParameterDeclaration10.ts, 18, 52)) + + additionalFiles?: Partial>; +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 18, 59)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +}) => void = ({ + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(destructuringParameterDeclaration10.ts, 18, 59)) + + json = [] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 21, 22)) + + } = {} +} = {}) => { + json // string[] +>json : Symbol(json, Decl(destructuringParameterDeclaration10.ts, 21, 22)) +} + diff --git a/tests/baselines/reference/destructuringParameterDeclaration10(strict=true).types b/tests/baselines/reference/destructuringParameterDeclaration10(strict=true).types new file mode 100644 index 0000000000000..6eabd387b0b59 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration10(strict=true).types @@ -0,0 +1,99 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts] //// + +=== destructuringParameterDeclaration10.ts === +export function prepareConfig({ +>prepareConfig : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>; }) => void +> : ^ ^^^ ^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : never[] +> : ^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +}: { + additionalFiles?: Partial>; +>additionalFiles : Partial> | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +} = {}) { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : ({ additionalFiles: { json } }?: { additionalFiles?: { json?: never[] | undefined; } | undefined; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : never[] +> : ^^^^^^^ +>[] : never[] +> : ^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) { +>{} : {} +> : ^^ + + json +>json : never[] +> : ^^^^^^^ +} + +export const prepareConfigWithContextualSignature: (param:{ +>prepareConfigWithContextualSignature : (param: { additionalFiles?: Partial>; }) => void +> : ^ ^^ ^^^^^ +>param : { additionalFiles?: Partial>; } +> : ^^^^^^^^^^^^^^^^^^^^ ^^^ + + additionalFiles?: Partial>; +>additionalFiles : Partial> | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +}) => void = ({ +>({ additionalFiles: { json = [] } = {}} = {}) => { json // string[]} : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : never[] +> : ^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) => { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + diff --git a/tests/baselines/reference/destructuringParameterDeclaration9(strict=false).symbols b/tests/baselines/reference/destructuringParameterDeclaration9(strict=false).symbols new file mode 100644 index 0000000000000..da7a5cc68b4bb --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration9(strict=false).symbols @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts] //// + +=== index.js === +/** + * @param {Object} [config] + * @param {Partial>} [config.additionalFiles] + */ +export function prepareConfig({ +>prepareConfig : Symbol(prepareConfig, Decl(index.js, 0, 0)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(index.js, 2, 3)) + + json = [] +>json : Symbol(json, Decl(index.js, 5, 22)) + + } = {} +} = {}) { + json // string[] +>json : Symbol(json, Decl(index.js, 5, 22)) +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : Symbol(prepareConfigWithoutAnnotation, Decl(index.js, 10, 1)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles) + + json = [] +>json : Symbol(json, Decl(index.js, 13, 22)) + + } = {} +} = {}) { + json +>json : Symbol(json, Decl(index.js, 13, 22)) +} + +/** @type {(param: { + additionalFiles?: Partial>; +}) => void} */ +export const prepareConfigWithContextualSignature = ({ +>prepareConfigWithContextualSignature : Symbol(prepareConfigWithContextualSignature, Decl(index.js, 23, 12)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(index.js, 20, 20)) + + json = [] +>json : Symbol(json, Decl(index.js, 24, 22)) + + } = {} +} = {})=> { + json // string[] +>json : Symbol(json, Decl(index.js, 24, 22)) +} + +// Additional repros from https://github.com/microsoft/TypeScript/issues/59936 + +/** + * @param {{ a?: { json?: string[] }}} [config] + */ +function f1({ a: { json = [] } = {} } = {}) { return json } +>f1 : Symbol(f1, Decl(index.js, 29, 1)) +>a : Symbol(a, Decl(index.js, 34, 12)) +>json : Symbol(json, Decl(index.js, 36, 18)) +>json : Symbol(json, Decl(index.js, 36, 18)) + +/** + * @param {[[string[]?]?]} [x] + */ +function f2([[json = []] = []] = []) { return json } +>f2 : Symbol(f2, Decl(index.js, 36, 59)) +>json : Symbol(json, Decl(index.js, 41, 14)) +>json : Symbol(json, Decl(index.js, 41, 14)) + diff --git a/tests/baselines/reference/destructuringParameterDeclaration9(strict=false).types b/tests/baselines/reference/destructuringParameterDeclaration9(strict=false).types new file mode 100644 index 0000000000000..e827977063d76 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration9(strict=false).types @@ -0,0 +1,131 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts] //// + +=== index.js === +/** + * @param {Object} [config] + * @param {Partial>} [config.additionalFiles] + */ +export function prepareConfig({ +>prepareConfig : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>;}) => void +> : ^ ^^^ ^^^ ^ ^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : ({ additionalFiles: { json } }?: { additionalFiles?: { json?: any[]; }; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : any[] +> : ^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) { +>{} : {} +> : ^^ + + json +>json : any[] +> : ^^^^^ +} + +/** @type {(param: { + additionalFiles?: Partial>; +}) => void} */ +export const prepareConfigWithContextualSignature = ({ +>prepareConfigWithContextualSignature : (param: { additionalFiles?: Partial>; }) => void +> : ^ ^^ ^^^^^ +>({ additionalFiles: { json = [] } = {}} = {})=> { json // string[]} : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {})=> { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + +// Additional repros from https://github.com/microsoft/TypeScript/issues/59936 + +/** + * @param {{ a?: { json?: string[] }}} [config] + */ +function f1({ a: { json = [] } = {} } = {}) { return json } +>f1 : ({ a: { json } }?: { a?: { json?: string[]; }; }) => string[] +> : ^ ^^^ ^^^^^^^^^^^^^ +>a : any +> : ^^^ +>json : string[] +> : ^^^^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ +>{} : {} +> : ^^ +>{} : {} +> : ^^ +>json : string[] +> : ^^^^^^^^ + +/** + * @param {[[string[]?]?]} [x] + */ +function f2([[json = []] = []] = []) { return json } +>f2 : ([[json]]?: [[string[]?]?]) => string[] +> : ^ ^^^ ^^^^^^^^^^^^^ +>json : string[] +> : ^^^^^^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ +>[] : [] +> : ^^ +>[] : [] +> : ^^ +>json : string[] +> : ^^^^^^^^ + diff --git a/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).errors.txt b/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).errors.txt new file mode 100644 index 0000000000000..6f0315e55926d --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).errors.txt @@ -0,0 +1,49 @@ +index.js(15,9): error TS7031: Binding element 'json' implicitly has an 'any[]' type. + + +==== index.js (1 errors) ==== + /** + * @param {Object} [config] + * @param {Partial>} [config.additionalFiles] + */ + export function prepareConfig({ + additionalFiles: { + json = [] + } = {} + } = {}) { + json // string[] + } + + export function prepareConfigWithoutAnnotation({ + additionalFiles: { + json = [] + ~~~~ +!!! error TS7031: Binding element 'json' implicitly has an 'any[]' type. + } = {} + } = {}) { + json + } + + /** @type {(param: { + additionalFiles?: Partial>; + }) => void} */ + export const prepareConfigWithContextualSignature = ({ + additionalFiles: { + json = [] + } = {} + } = {})=> { + json // string[] + } + + // Additional repros from https://github.com/microsoft/TypeScript/issues/59936 + + /** + * @param {{ a?: { json?: string[] }}} [config] + */ + function f1({ a: { json = [] } = {} } = {}) { return json } + + /** + * @param {[[string[]?]?]} [x] + */ + function f2([[json = []] = []] = []) { return json } + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).symbols b/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).symbols new file mode 100644 index 0000000000000..648e03984cab4 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).symbols @@ -0,0 +1,71 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts] //// + +=== index.js === +/** + * @param {Object} [config] + * @param {Partial>} [config.additionalFiles] + */ +export function prepareConfig({ +>prepareConfig : Symbol(prepareConfig, Decl(index.js, 0, 0)) + + additionalFiles: { + json = [] +>json : Symbol(json, Decl(index.js, 5, 22)) + + } = {} +} = {}) { + json // string[] +>json : Symbol(json, Decl(index.js, 5, 22)) +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : Symbol(prepareConfigWithoutAnnotation, Decl(index.js, 10, 1)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles) + + json = [] +>json : Symbol(json, Decl(index.js, 13, 22)) + + } = {} +} = {}) { + json +>json : Symbol(json, Decl(index.js, 13, 22)) +} + +/** @type {(param: { + additionalFiles?: Partial>; +}) => void} */ +export const prepareConfigWithContextualSignature = ({ +>prepareConfigWithContextualSignature : Symbol(prepareConfigWithContextualSignature, Decl(index.js, 23, 12)) + + additionalFiles: { +>additionalFiles : Symbol(additionalFiles, Decl(index.js, 20, 20)) + + json = [] +>json : Symbol(json, Decl(index.js, 24, 22)) + + } = {} +} = {})=> { + json // string[] +>json : Symbol(json, Decl(index.js, 24, 22)) +} + +// Additional repros from https://github.com/microsoft/TypeScript/issues/59936 + +/** + * @param {{ a?: { json?: string[] }}} [config] + */ +function f1({ a: { json = [] } = {} } = {}) { return json } +>f1 : Symbol(f1, Decl(index.js, 29, 1)) +>json : Symbol(json, Decl(index.js, 36, 18)) +>json : Symbol(json, Decl(index.js, 36, 18)) + +/** + * @param {[[string[]?]?]} [x] + */ +function f2([[json = []] = []] = []) { return json } +>f2 : Symbol(f2, Decl(index.js, 36, 59)) +>json : Symbol(json, Decl(index.js, 41, 14)) +>json : Symbol(json, Decl(index.js, 41, 14)) + diff --git a/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).types b/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).types new file mode 100644 index 0000000000000..e95d65bd2dff4 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration9(strict=true).types @@ -0,0 +1,131 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts] //// + +=== index.js === +/** + * @param {Object} [config] + * @param {Partial>} [config.additionalFiles] + */ +export function prepareConfig({ +>prepareConfig : ({ additionalFiles: { json } }?: { additionalFiles?: Partial> | undefined;}) => void +> : ^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : never[] +> : ^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + +export function prepareConfigWithoutAnnotation({ +>prepareConfigWithoutAnnotation : ({ additionalFiles: { json } }?: { additionalFiles?: { json?: never[] | undefined; } | undefined; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : any[] +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {}) { +>{} : {} +> : ^^ + + json +>json : any[] +> : ^^^^^ +} + +/** @type {(param: { + additionalFiles?: Partial>; +}) => void} */ +export const prepareConfigWithContextualSignature = ({ +>prepareConfigWithContextualSignature : (param: { additionalFiles?: Partial>; }) => void +> : ^ ^^ ^^^^^ +>({ additionalFiles: { json = [] } = {}} = {})=> { json // string[]} : ({ additionalFiles: { json } }?: { additionalFiles?: Partial>; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ + + additionalFiles: { +>additionalFiles : any +> : ^^^ + + json = [] +>json : string[] +> : ^^^^^^^^ +>[] : never[] +> : ^^^^^^^ + + } = {} +>{} : {} +> : ^^ + +} = {})=> { +>{} : {} +> : ^^ + + json // string[] +>json : string[] +> : ^^^^^^^^ +} + +// Additional repros from https://github.com/microsoft/TypeScript/issues/59936 + +/** + * @param {{ a?: { json?: string[] }}} [config] + */ +function f1({ a: { json = [] } = {} } = {}) { return json } +>f1 : ({ a: { json } }?: { a?: { json?: string[]; }; }) => string[] +> : ^ ^^^ ^^^^^^^^^^^^^ +>a : any +> : ^^^ +>json : string[] +> : ^^^^^^^^ +>[] : never[] +> : ^^^^^^^ +>{} : {} +> : ^^ +>{} : {} +> : ^^ +>json : string[] +> : ^^^^^^^^ + +/** + * @param {[[string[]?]?]} [x] + */ +function f2([[json = []] = []] = []) { return json } +>f2 : ([[json]]?: [[string[]?]?]) => string[] +> : ^ ^^^ ^^^^^^^^^^^^^ +>json : string[] +> : ^^^^^^^^ +>[] : never[] +> : ^^^^^^^ +>[] : [] +> : ^^ +>[] : [] +> : ^^ +>json : string[] +> : ^^^^^^^^ + diff --git a/tests/baselines/reference/elidedJSImport2(module=commonjs).js b/tests/baselines/reference/elidedJSImport2(module=commonjs).js index 6cfa0b9cdd53f..6709fa9d1e452 100644 --- a/tests/baselines/reference/elidedJSImport2(module=commonjs).js +++ b/tests/baselines/reference/elidedJSImport2(module=commonjs).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/esModuleInterop.js b/tests/baselines/reference/esModuleInterop.js index 7fc4766128144..dfa6714dfb553 100644 --- a/tests/baselines/reference/esModuleInterop.js +++ b/tests/baselines/reference/esModuleInterop.js @@ -36,13 +36,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/esModuleInteropDefaultImports.js b/tests/baselines/reference/esModuleInteropDefaultImports.js index eafda0be85ead..bdbca9c602068 100644 --- a/tests/baselines/reference/esModuleInteropDefaultImports.js +++ b/tests/baselines/reference/esModuleInteropDefaultImports.js @@ -62,13 +62,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/esModuleInteropImportCall.js b/tests/baselines/reference/esModuleInteropImportCall.js index 0defb7297d999..3b77991c066a8 100644 --- a/tests/baselines/reference/esModuleInteropImportCall.js +++ b/tests/baselines/reference/esModuleInteropImportCall.js @@ -27,13 +27,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Promise.resolve().then(function () { return __importStar(require("./foo")); }).then(function (f) { f.default; }); diff --git a/tests/baselines/reference/esModuleInteropImportNamespace.js b/tests/baselines/reference/esModuleInteropImportNamespace.js index 3bbcde7aa65cb..f87145c51b80a 100644 --- a/tests/baselines/reference/esModuleInteropImportNamespace.js +++ b/tests/baselines/reference/esModuleInteropImportNamespace.js @@ -28,13 +28,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var foo = __importStar(require("./foo")); foo.default; diff --git a/tests/baselines/reference/esModuleInteropNamedDefaultImports.js b/tests/baselines/reference/esModuleInteropNamedDefaultImports.js index 3d46bb0bd2263..3e6d66ca8d17a 100644 --- a/tests/baselines/reference/esModuleInteropNamedDefaultImports.js +++ b/tests/baselines/reference/esModuleInteropNamedDefaultImports.js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.js b/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.js index 903fe6cfedb9e..c771d97ce68b8 100644 --- a/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.js +++ b/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.js @@ -28,13 +28,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var foo = __importStar(require("./foo")); function invoke(f) { f(); } diff --git a/tests/baselines/reference/esModuleInteropUsesExportStarWhenDefaultPlusNames.js b/tests/baselines/reference/esModuleInteropUsesExportStarWhenDefaultPlusNames.js index 41377087f314a..47a596f509127 100644 --- a/tests/baselines/reference/esModuleInteropUsesExportStarWhenDefaultPlusNames.js +++ b/tests/baselines/reference/esModuleInteropUsesExportStarWhenDefaultPlusNames.js @@ -23,13 +23,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var dep_1 = __importStar(require("./dep")); void dep_1.default; diff --git a/tests/baselines/reference/esModuleInteropWithExportStar.js b/tests/baselines/reference/esModuleInteropWithExportStar.js index b52b84ecbf484..afca8d846cb6f 100644 --- a/tests/baselines/reference/esModuleInteropWithExportStar.js +++ b/tests/baselines/reference/esModuleInteropWithExportStar.js @@ -30,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; diff --git a/tests/baselines/reference/esModuleIntersectionCrash.js b/tests/baselines/reference/esModuleIntersectionCrash.js index 54644a786816e..9dda130c9be33 100644 --- a/tests/baselines/reference/esModuleIntersectionCrash.js +++ b/tests/baselines/reference/esModuleIntersectionCrash.js @@ -30,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var mod = __importStar(require("./mod")); mod.a; diff --git a/tests/baselines/reference/exportAsNamespace2(module=amd).js b/tests/baselines/reference/exportAsNamespace2(module=amd).js index 206ebc540ec03..6d96465116c40 100644 --- a/tests/baselines/reference/exportAsNamespace2(module=amd).js +++ b/tests/baselines/reference/exportAsNamespace2(module=amd).js @@ -40,13 +40,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); define(["require", "exports", "./0"], function (require, exports, ns) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -72,13 +82,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); define(["require", "exports", "./1"], function (require, exports, foo) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/exportAsNamespace2(module=commonjs).js b/tests/baselines/reference/exportAsNamespace2(module=commonjs).js index 1b01d88024ba0..2a30d56343dc1 100644 --- a/tests/baselines/reference/exportAsNamespace2(module=commonjs).js +++ b/tests/baselines/reference/exportAsNamespace2(module=commonjs).js @@ -39,13 +39,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ns = void 0; exports.ns = __importStar(require("./0")); @@ -69,13 +79,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var foo = __importStar(require("./1")); foo.ns.a; diff --git a/tests/baselines/reference/exportAsNamespace2(module=umd).js b/tests/baselines/reference/exportAsNamespace2(module=umd).js index df4d21d62d05e..0d00483e33978 100644 --- a/tests/baselines/reference/exportAsNamespace2(module=umd).js +++ b/tests/baselines/reference/exportAsNamespace2(module=umd).js @@ -48,13 +48,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); @@ -88,13 +98,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); diff --git a/tests/baselines/reference/exportAsNamespace3(module=amd).js b/tests/baselines/reference/exportAsNamespace3(module=amd).js index 499fca43328b2..5534074ddcd5d 100644 --- a/tests/baselines/reference/exportAsNamespace3(module=amd).js +++ b/tests/baselines/reference/exportAsNamespace3(module=amd).js @@ -43,13 +43,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); define(["require", "exports", "./0"], function (require, exports, ns) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -78,13 +88,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); define(["require", "exports", "./1"], function (require, exports, foo) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/exportAsNamespace3(module=commonjs).js b/tests/baselines/reference/exportAsNamespace3(module=commonjs).js index e4b2d67ce91af..6041d7ed9d048 100644 --- a/tests/baselines/reference/exportAsNamespace3(module=commonjs).js +++ b/tests/baselines/reference/exportAsNamespace3(module=commonjs).js @@ -42,13 +42,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ns = void 0; exports.ns = __importStar(require("./0")); @@ -75,13 +85,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var foo = __importStar(require("./1")); foo.ns.a; diff --git a/tests/baselines/reference/exportAsNamespace3(module=umd).js b/tests/baselines/reference/exportAsNamespace3(module=umd).js index af2aad50c8cc0..6429a7572635c 100644 --- a/tests/baselines/reference/exportAsNamespace3(module=umd).js +++ b/tests/baselines/reference/exportAsNamespace3(module=umd).js @@ -51,13 +51,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); @@ -94,13 +104,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); diff --git a/tests/baselines/reference/exportAsNamespace4(module=amd).js b/tests/baselines/reference/exportAsNamespace4(module=amd).js index d9e6470b31a1d..7f33f01907b06 100644 --- a/tests/baselines/reference/exportAsNamespace4(module=amd).js +++ b/tests/baselines/reference/exportAsNamespace4(module=amd).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); define(["require", "exports", "./0"], function (require, exports, _0_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -76,13 +86,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); define(["require", "exports", "./0"], function (require, exports, ns) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/exportAsNamespace4(module=commonjs).js b/tests/baselines/reference/exportAsNamespace4(module=commonjs).js index 60f213ca826c4..626bb73714ea0 100644 --- a/tests/baselines/reference/exportAsNamespace4(module=commonjs).js +++ b/tests/baselines/reference/exportAsNamespace4(module=commonjs).js @@ -45,13 +45,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.default = __importStar(require("./0")); @@ -73,13 +83,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var ns = __importStar(require("./0")); exports.default = ns; diff --git a/tests/baselines/reference/exportAsNamespace4(module=umd).js b/tests/baselines/reference/exportAsNamespace4(module=umd).js index 2f550d39b3590..84e1399466514 100644 --- a/tests/baselines/reference/exportAsNamespace4(module=umd).js +++ b/tests/baselines/reference/exportAsNamespace4(module=umd).js @@ -54,13 +54,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); @@ -92,13 +102,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); diff --git a/tests/baselines/reference/exportAsNamespace_exportAssignment.js b/tests/baselines/reference/exportAsNamespace_exportAssignment.js index 635f9cc875320..993a12b6d9c07 100644 --- a/tests/baselines/reference/exportAsNamespace_exportAssignment.js +++ b/tests/baselines/reference/exportAsNamespace_exportAssignment.js @@ -28,13 +28,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ns = void 0; exports.ns = __importStar(require("./a")); diff --git a/tests/baselines/reference/exportDefault.js b/tests/baselines/reference/exportDefault.js index 4bf273d4cbf59..479fb55596ee3 100644 --- a/tests/baselines/reference/exportDefault.js +++ b/tests/baselines/reference/exportDefault.js @@ -59,13 +59,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var types = __importStar(require("./a")); exports.default = types; @@ -96,13 +106,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); var types = __importStar(require("./b")); new types.default.A(); // Error diff --git a/tests/baselines/reference/importEquals1.js b/tests/baselines/reference/importEquals1.js index e711e198cfcdd..0335086770cc5 100644 --- a/tests/baselines/reference/importEquals1.js +++ b/tests/baselines/reference/importEquals1.js @@ -59,13 +59,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var types = __importStar(require("./a")); module.exports = types; //// [d.js] diff --git a/tests/baselines/reference/importEquals2.js b/tests/baselines/reference/importEquals2.js index 7479a96ab254b..54b2b804e9b58 100644 --- a/tests/baselines/reference/importEquals2.js +++ b/tests/baselines/reference/importEquals2.js @@ -39,13 +39,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var a = __importStar(require("./a")); module.exports = a; //// [c.js] diff --git a/tests/baselines/reference/inferTypesWithExtendsDependingOnTypeVariables.symbols b/tests/baselines/reference/inferTypesWithExtendsDependingOnTypeVariables.symbols new file mode 100644 index 0000000000000..20a17c8c279af --- /dev/null +++ b/tests/baselines/reference/inferTypesWithExtendsDependingOnTypeVariables.symbols @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/types/conditional/inferTypesWithExtendsDependingOnTypeVariables.ts] //// + +=== inferTypesWithExtendsDependingOnTypeVariables.ts === +// repro from https://github.com/microsoft/TypeScript/issues/54197 + +type Bar = T extends readonly [any, ...infer X extends readonly K[]] ? X : never; +>Bar : Symbol(Bar, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 0, 0)) +>K : Symbol(K, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 9)) +>T : Symbol(T, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 11)) +>T : Symbol(T, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 11)) +>X : Symbol(X, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 77)) +>K : Symbol(K, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 9)) +>X : Symbol(X, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 77)) + +type Res1 = Bar<"a" | "b", ["a", "b", "b"]> +>Res1 : Symbol(Res1, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 2, 114)) +>Bar : Symbol(Bar, Decl(inferTypesWithExtendsDependingOnTypeVariables.ts, 0, 0)) + diff --git a/tests/baselines/reference/inferTypesWithExtendsDependingOnTypeVariables.types b/tests/baselines/reference/inferTypesWithExtendsDependingOnTypeVariables.types new file mode 100644 index 0000000000000..d891ae6597fca --- /dev/null +++ b/tests/baselines/reference/inferTypesWithExtendsDependingOnTypeVariables.types @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/types/conditional/inferTypesWithExtendsDependingOnTypeVariables.ts] //// + +=== inferTypesWithExtendsDependingOnTypeVariables.ts === +// repro from https://github.com/microsoft/TypeScript/issues/54197 + +type Bar = T extends readonly [any, ...infer X extends readonly K[]] ? X : never; +>Bar : Bar +> : ^^^^^^^^^ + +type Res1 = Bar<"a" | "b", ["a", "b", "b"]> +>Res1 : ["b", "b"] +> : ^^^^^^^^^^ + diff --git a/tests/baselines/reference/inlayHintsOverloadCall.baseline b/tests/baselines/reference/inlayHintsOverloadCall1.baseline similarity index 100% rename from tests/baselines/reference/inlayHintsOverloadCall.baseline rename to tests/baselines/reference/inlayHintsOverloadCall1.baseline diff --git a/tests/baselines/reference/inlayHintsOverloadCall2.baseline b/tests/baselines/reference/inlayHintsOverloadCall2.baseline new file mode 100644 index 0000000000000..37cb8b498eb4d --- /dev/null +++ b/tests/baselines/reference/inlayHintsOverloadCall2.baseline @@ -0,0 +1,18 @@ +// === Inlay Hints === + { n: [1, 2, 3] }, + ^ +{ + "text": "ok_1:", + "position": 195, + "kind": "Parameter", + "whitespaceAfter": true +} + + { + ^ +{ + "text": "ok_2:", + "position": 217, + "kind": "Parameter", + "whitespaceAfter": true +} \ No newline at end of file diff --git a/tests/baselines/reference/inlayHintsPropertyDeclarations2.baseline b/tests/baselines/reference/inlayHintsPropertyDeclarations2.baseline new file mode 100644 index 0000000000000..01fb0862317cf --- /dev/null +++ b/tests/baselines/reference/inlayHintsPropertyDeclarations2.baseline @@ -0,0 +1,18 @@ +// === Inlay Hints === + accessor a = 1 + ^ +{ + "text": ": number", + "position": 24, + "kind": "Type", + "whitespaceBefore": true +} + + accessor d; + ^ +{ + "text": ": number | null", + "position": 86, + "kind": "Type", + "whitespaceBefore": true +} \ No newline at end of file diff --git a/tests/baselines/reference/inlineJsxAndJsxFragPragma.errors.txt b/tests/baselines/reference/inlineJsxAndJsxFragPragma.errors.txt index 6dd5e9c1454eb..7867b75bdd8fc 100644 --- a/tests/baselines/reference/inlineJsxAndJsxFragPragma.errors.txt +++ b/tests/baselines/reference/inlineJsxAndJsxFragPragma.errors.txt @@ -1,9 +1,6 @@ preacty-no-fragment.tsx(5,12): error TS6133: 'Fragment' is declared but its value is never read. preacty-only-fragment-no-jsx.tsx(6,1): error TS2874: This JSX tag requires 'h' to be in scope, but it could not be found. snabbdomy-only-fragment-no-jsx.tsx(4,1): error TS2874: This JSX tag requires 'jsx' to be in scope, but it could not be found. -snabbdomy-only-fragment-no-jsx.tsx(4,1): error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. -snabbdomy-only-fragment.tsx(4,1): error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. -snabbdomy.tsx(4,1): error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. ==== renderer.d.ts (0 errors) ==== @@ -26,13 +23,11 @@ snabbdomy.tsx(4,1): error TS2879: Using JSX fragments requires fragment factory import {h, Fragment} from "./renderer"; <>
-==== snabbdomy.tsx (1 errors) ==== +==== snabbdomy.tsx (0 errors) ==== /* @jsx jsx */ /* @jsxfrag null */ import {jsx} from "./renderer"; <> - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. ==== preacty-only-fragment.tsx (0 errors) ==== /** @@ -42,13 +37,11 @@ snabbdomy.tsx(4,1): error TS2879: Using JSX fragments requires fragment factory import {h, Fragment} from "./renderer"; <> -==== snabbdomy-only-fragment.tsx (1 errors) ==== +==== snabbdomy-only-fragment.tsx (0 errors) ==== /* @jsx jsx */ /* @jsxfrag null */ import {jsx} from "./renderer"; <> - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. ==== preacty-only-fragment-no-jsx.tsx (1 errors) ==== /** @@ -60,15 +53,13 @@ snabbdomy.tsx(4,1): error TS2879: Using JSX fragments requires fragment factory ~~ !!! error TS2874: This JSX tag requires 'h' to be in scope, but it could not be found. -==== snabbdomy-only-fragment-no-jsx.tsx (2 errors) ==== +==== snabbdomy-only-fragment-no-jsx.tsx (1 errors) ==== /* @jsx jsx */ /* @jsxfrag null */ import {} from "./renderer"; <> ~~ !!! error TS2874: This JSX tag requires 'jsx' to be in scope, but it could not be found. - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. ==== preacty-no-fragment.tsx (1 errors) ==== /** diff --git a/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.errors.txt b/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.errors.txt deleted file mode 100644 index 19ba24340e2da..0000000000000 --- a/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.errors.txt +++ /dev/null @@ -1,49 +0,0 @@ -snabbdomy.tsx(6,1): error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. - - -==== react.d.ts (0 errors) ==== - declare global { - namespace JSX { - interface IntrinsicElements { - [e: string]: any; - } - } - } - export function createElement(): void; - export function Fragment(): void; - -==== preact.d.ts (0 errors) ==== - export function h(): void; - export function Frag(): void; - -==== snabbdom.d.ts (0 errors) ==== - export function h(): void; - -==== reacty.tsx (0 errors) ==== - import {createElement, Fragment} from "./react"; - <> - -==== preacty.tsx (0 errors) ==== - /** - * @jsx h - * @jsxFrag Frag - */ - import {h, Frag} from "./preact"; - <>
- -==== snabbdomy.tsx (1 errors) ==== - /** - * @jsx h - * @jsxfrag null - */ - import {h} from "./snabbdom"; - <>
- ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. - -==== mix-n-match.tsx (0 errors) ==== - /* @jsx h */ - /* @jsxFrag Fragment */ - import {h} from "./preact"; - import {Fragment} from "./react"; - <> \ No newline at end of file diff --git a/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.types b/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.types index 7920f66d89cee..819a7cc2b3e3b 100644 --- a/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.types +++ b/tests/baselines/reference/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.types @@ -44,9 +44,7 @@ import {createElement, Fragment} from "./react"; <> ><> : any -> : ^^^ -> : any -> : ^^^ +> : error >span : any > : ^^^ >span : any @@ -65,9 +63,7 @@ import {h, Frag} from "./preact"; <>
><>
: any -> : ^^^ ->
: any -> : ^^^ +>
: error >div : any > : ^^^ >div : any @@ -84,9 +80,7 @@ import {h} from "./snabbdom"; <>
><>
: any -> : ^^^ ->
: any -> : ^^^ +>
: error >div : any > : ^^^ >div : any @@ -105,9 +99,7 @@ import {Fragment} from "./react"; <> ><> : any -> : ^^^ -> : any -> : ^^^ +> : error >span : any > : ^^^ >span : any diff --git a/tests/baselines/reference/intersectionsAndEmptyObjects.js b/tests/baselines/reference/intersectionsAndEmptyObjects.js index 7fad0d891b3cc..bb786ece46e72 100644 --- a/tests/baselines/reference/intersectionsAndEmptyObjects.js +++ b/tests/baselines/reference/intersectionsAndEmptyObjects.js @@ -111,13 +111,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); let x01; let x02; let x03; diff --git a/tests/baselines/reference/isolatedDeclarationErrorTypes1.errors.txt b/tests/baselines/reference/isolatedDeclarationErrorTypes1.errors.txt new file mode 100644 index 0000000000000..f89ec2f8264de --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationErrorTypes1.errors.txt @@ -0,0 +1,14 @@ +isolatedDeclarationErrorTypes1.ts(3,28): error TS2307: Cannot find module 'foo' or its corresponding type declarations. + + +==== isolatedDeclarationErrorTypes1.ts (1 errors) ==== + // https://github.com/microsoft/TypeScript/issues/60192 + + import { Unresolved } from "foo"; + ~~~~~ +!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations. + + export const foo1 = (type?: Unresolved): void => {}; + export const foo2 = (type?: Unresolved | undefined): void => {}; + export const foo3 = (type: Unresolved): void => {}; + \ No newline at end of file diff --git a/tests/baselines/reference/isolatedDeclarationErrorTypes1.js b/tests/baselines/reference/isolatedDeclarationErrorTypes1.js new file mode 100644 index 0000000000000..1949d31f6b9dd --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationErrorTypes1.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/isolatedDeclarationErrorTypes1.ts] //// + +//// [isolatedDeclarationErrorTypes1.ts] +// https://github.com/microsoft/TypeScript/issues/60192 + +import { Unresolved } from "foo"; + +export const foo1 = (type?: Unresolved): void => {}; +export const foo2 = (type?: Unresolved | undefined): void => {}; +export const foo3 = (type: Unresolved): void => {}; + + +//// [isolatedDeclarationErrorTypes1.js] +"use strict"; +// https://github.com/microsoft/TypeScript/issues/60192 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo3 = exports.foo2 = exports.foo1 = void 0; +const foo1 = (type) => { }; +exports.foo1 = foo1; +const foo2 = (type) => { }; +exports.foo2 = foo2; +const foo3 = (type) => { }; +exports.foo3 = foo3; + + +//// [isolatedDeclarationErrorTypes1.d.ts] +import { Unresolved } from "foo"; +export declare const foo1: (type?: Unresolved) => void; +export declare const foo2: (type?: Unresolved | undefined) => void; +export declare const foo3: (type: Unresolved) => void; diff --git a/tests/baselines/reference/isolatedDeclarationErrorTypes1.symbols b/tests/baselines/reference/isolatedDeclarationErrorTypes1.symbols new file mode 100644 index 0000000000000..c7da06e14380b --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationErrorTypes1.symbols @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/isolatedDeclarationErrorTypes1.ts] //// + +=== isolatedDeclarationErrorTypes1.ts === +// https://github.com/microsoft/TypeScript/issues/60192 + +import { Unresolved } from "foo"; +>Unresolved : Symbol(Unresolved, Decl(isolatedDeclarationErrorTypes1.ts, 2, 8)) + +export const foo1 = (type?: Unresolved): void => {}; +>foo1 : Symbol(foo1, Decl(isolatedDeclarationErrorTypes1.ts, 4, 12)) +>type : Symbol(type, Decl(isolatedDeclarationErrorTypes1.ts, 4, 21)) +>Unresolved : Symbol(Unresolved, Decl(isolatedDeclarationErrorTypes1.ts, 2, 8)) + +export const foo2 = (type?: Unresolved | undefined): void => {}; +>foo2 : Symbol(foo2, Decl(isolatedDeclarationErrorTypes1.ts, 5, 12)) +>type : Symbol(type, Decl(isolatedDeclarationErrorTypes1.ts, 5, 21)) +>Unresolved : Symbol(Unresolved, Decl(isolatedDeclarationErrorTypes1.ts, 2, 8)) + +export const foo3 = (type: Unresolved): void => {}; +>foo3 : Symbol(foo3, Decl(isolatedDeclarationErrorTypes1.ts, 6, 12)) +>type : Symbol(type, Decl(isolatedDeclarationErrorTypes1.ts, 6, 21)) +>Unresolved : Symbol(Unresolved, Decl(isolatedDeclarationErrorTypes1.ts, 2, 8)) + diff --git a/tests/baselines/reference/isolatedDeclarationErrorTypes1.types b/tests/baselines/reference/isolatedDeclarationErrorTypes1.types new file mode 100644 index 0000000000000..2e388cf0a734a --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationErrorTypes1.types @@ -0,0 +1,33 @@ +//// [tests/cases/compiler/isolatedDeclarationErrorTypes1.ts] //// + +=== isolatedDeclarationErrorTypes1.ts === +// https://github.com/microsoft/TypeScript/issues/60192 + +import { Unresolved } from "foo"; +>Unresolved : any +> : ^^^ + +export const foo1 = (type?: Unresolved): void => {}; +>foo1 : (type?: Unresolved) => void +> : ^ ^^^ ^^^^^ +>(type?: Unresolved): void => {} : (type?: Unresolved) => void +> : ^ ^^^ ^^^^^ +>type : any +> : ^^^ + +export const foo2 = (type?: Unresolved | undefined): void => {}; +>foo2 : (type?: Unresolved | undefined) => void +> : ^ ^^^ ^^^^^ +>(type?: Unresolved | undefined): void => {} : (type?: Unresolved | undefined) => void +> : ^ ^^^ ^^^^^ +>type : any +> : ^^^ + +export const foo3 = (type: Unresolved): void => {}; +>foo3 : (type: Unresolved) => void +> : ^ ^^ ^^^^^ +>(type: Unresolved): void => {} : (type: Unresolved) => void +> : ^ ^^ ^^^^^ +>type : Unresolved +> : ^^^^^^^^^^ + diff --git a/tests/baselines/reference/isolatedDeclarationsAddUndefined2.errors.txt b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.errors.txt new file mode 100644 index 0000000000000..638ebb2a8865c --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.errors.txt @@ -0,0 +1,48 @@ +isolatedDeclarationsAddUndefined2.ts(4,29): error TS2314: Generic type 'Array' requires 1 type argument(s). +isolatedDeclarationsAddUndefined2.ts(8,29): error TS2314: Generic type 'Array' requires 1 type argument(s). +isolatedDeclarationsAddUndefined2.ts(12,28): error TS2314: Generic type 'Array' requires 1 type argument(s). +isolatedDeclarationsAddUndefined2.ts(16,28): error TS2314: Generic type 'Array' requires 1 type argument(s). +isolatedDeclarationsAddUndefined2.ts(19,27): error TS2314: Generic type 'Array' requires 1 type argument(s). +isolatedDeclarationsAddUndefined2.ts(21,27): error TS2304: Cannot find name 'Unresolved'. +isolatedDeclarationsAddUndefined2.ts(23,27): error TS2304: Cannot find name 'Unresolved'. + + +==== isolatedDeclarationsAddUndefined2.ts (7 errors) ==== + // https://github.com/microsoft/TypeScript/issues/60123 + + export class Bar { + constructor(private x?: Array | undefined) {} + ~~~~~ +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). + } + + export class Bar2 { + constructor(private x?: Array) {} + ~~~~~ +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). + } + + export class Bar3 { + constructor(private x: Array | undefined) {} + ~~~~~ +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). + } + + export class Bar4 { + constructor(private x: Array) {} + ~~~~~ +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). + } + + export function test1(x?: Array | undefined): void {} + ~~~~~ +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). + + export function test2(x?: Unresolved | undefined): void {} + ~~~~~~~~~~ +!!! error TS2304: Cannot find name 'Unresolved'. + + export function test3(x?: Unresolved): void {} + ~~~~~~~~~~ +!!! error TS2304: Cannot find name 'Unresolved'. + \ No newline at end of file diff --git a/tests/baselines/reference/isolatedDeclarationsAddUndefined2.js b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.js new file mode 100644 index 0000000000000..e3f3f7ef3dbcd --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.js @@ -0,0 +1,89 @@ +//// [tests/cases/compiler/isolatedDeclarationsAddUndefined2.ts] //// + +//// [isolatedDeclarationsAddUndefined2.ts] +// https://github.com/microsoft/TypeScript/issues/60123 + +export class Bar { + constructor(private x?: Array | undefined) {} +} + +export class Bar2 { + constructor(private x?: Array) {} +} + +export class Bar3 { + constructor(private x: Array | undefined) {} +} + +export class Bar4 { + constructor(private x: Array) {} +} + +export function test1(x?: Array | undefined): void {} + +export function test2(x?: Unresolved | undefined): void {} + +export function test3(x?: Unresolved): void {} + + +//// [isolatedDeclarationsAddUndefined2.js] +"use strict"; +// https://github.com/microsoft/TypeScript/issues/60123 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Bar4 = exports.Bar3 = exports.Bar2 = exports.Bar = void 0; +exports.test1 = test1; +exports.test2 = test2; +exports.test3 = test3; +var Bar = /** @class */ (function () { + function Bar(x) { + this.x = x; + } + return Bar; +}()); +exports.Bar = Bar; +var Bar2 = /** @class */ (function () { + function Bar2(x) { + this.x = x; + } + return Bar2; +}()); +exports.Bar2 = Bar2; +var Bar3 = /** @class */ (function () { + function Bar3(x) { + this.x = x; + } + return Bar3; +}()); +exports.Bar3 = Bar3; +var Bar4 = /** @class */ (function () { + function Bar4(x) { + this.x = x; + } + return Bar4; +}()); +exports.Bar4 = Bar4; +function test1(x) { } +function test2(x) { } +function test3(x) { } + + +//// [isolatedDeclarationsAddUndefined2.d.ts] +export declare class Bar { + private x?; + constructor(x?: Array | undefined); +} +export declare class Bar2 { + private x?; + constructor(x?: Array); +} +export declare class Bar3 { + private x; + constructor(x: Array | undefined); +} +export declare class Bar4 { + private x; + constructor(x: Array); +} +export declare function test1(x?: Array | undefined): void; +export declare function test2(x?: Unresolved | undefined): void; +export declare function test3(x?: Unresolved): void; diff --git a/tests/baselines/reference/isolatedDeclarationsAddUndefined2.symbols b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.symbols new file mode 100644 index 0000000000000..9778b309c7495 --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.symbols @@ -0,0 +1,52 @@ +//// [tests/cases/compiler/isolatedDeclarationsAddUndefined2.ts] //// + +=== isolatedDeclarationsAddUndefined2.ts === +// https://github.com/microsoft/TypeScript/issues/60123 + +export class Bar { +>Bar : Symbol(Bar, Decl(isolatedDeclarationsAddUndefined2.ts, 0, 0)) + + constructor(private x?: Array | undefined) {} +>x : Symbol(Bar.x, Decl(isolatedDeclarationsAddUndefined2.ts, 3, 16)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +} + +export class Bar2 { +>Bar2 : Symbol(Bar2, Decl(isolatedDeclarationsAddUndefined2.ts, 4, 1)) + + constructor(private x?: Array) {} +>x : Symbol(Bar2.x, Decl(isolatedDeclarationsAddUndefined2.ts, 7, 16)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +} + +export class Bar3 { +>Bar3 : Symbol(Bar3, Decl(isolatedDeclarationsAddUndefined2.ts, 8, 1)) + + constructor(private x: Array | undefined) {} +>x : Symbol(Bar3.x, Decl(isolatedDeclarationsAddUndefined2.ts, 11, 16)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +} + +export class Bar4 { +>Bar4 : Symbol(Bar4, Decl(isolatedDeclarationsAddUndefined2.ts, 12, 1)) + + constructor(private x: Array) {} +>x : Symbol(Bar4.x, Decl(isolatedDeclarationsAddUndefined2.ts, 15, 16)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +} + +export function test1(x?: Array | undefined): void {} +>test1 : Symbol(test1, Decl(isolatedDeclarationsAddUndefined2.ts, 16, 1)) +>x : Symbol(x, Decl(isolatedDeclarationsAddUndefined2.ts, 18, 22)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +export function test2(x?: Unresolved | undefined): void {} +>test2 : Symbol(test2, Decl(isolatedDeclarationsAddUndefined2.ts, 18, 53)) +>x : Symbol(x, Decl(isolatedDeclarationsAddUndefined2.ts, 20, 22)) +>Unresolved : Symbol(Unresolved) + +export function test3(x?: Unresolved): void {} +>test3 : Symbol(test3, Decl(isolatedDeclarationsAddUndefined2.ts, 20, 58)) +>x : Symbol(x, Decl(isolatedDeclarationsAddUndefined2.ts, 22, 22)) +>Unresolved : Symbol(Unresolved) + diff --git a/tests/baselines/reference/isolatedDeclarationsAddUndefined2.types b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.types new file mode 100644 index 0000000000000..6ddcad9a53930 --- /dev/null +++ b/tests/baselines/reference/isolatedDeclarationsAddUndefined2.types @@ -0,0 +1,59 @@ +//// [tests/cases/compiler/isolatedDeclarationsAddUndefined2.ts] //// + +=== isolatedDeclarationsAddUndefined2.ts === +// https://github.com/microsoft/TypeScript/issues/60123 + +export class Bar { +>Bar : Bar +> : ^^^ + + constructor(private x?: Array | undefined) {} +>x : any +> : ^^^ +} + +export class Bar2 { +>Bar2 : Bar2 +> : ^^^^ + + constructor(private x?: Array) {} +>x : any +> : ^^^ +} + +export class Bar3 { +>Bar3 : Bar3 +> : ^^^^ + + constructor(private x: Array | undefined) {} +>x : any +> : ^^^ +} + +export class Bar4 { +>Bar4 : Bar4 +> : ^^^^ + + constructor(private x: Array) {} +>x : any +> : ^^^ +} + +export function test1(x?: Array | undefined): void {} +>test1 : (x?: Array | undefined) => void +> : ^ ^^^ ^^^^^ +>x : any +> : ^^^ + +export function test2(x?: Unresolved | undefined): void {} +>test2 : (x?: Unresolved | undefined) => void +> : ^ ^^^ ^^^^^ +>x : any +> : ^^^ + +export function test3(x?: Unresolved): void {} +>test3 : (x?: Unresolved) => void +> : ^ ^^^ ^^^^^ +>x : any +> : ^^^ + diff --git a/tests/baselines/reference/iteratorExtraParameters.errors.txt b/tests/baselines/reference/iteratorExtraParameters.errors.txt new file mode 100644 index 0000000000000..fec3eb9882bda --- /dev/null +++ b/tests/baselines/reference/iteratorExtraParameters.errors.txt @@ -0,0 +1,50 @@ +iteratorExtraParameters.ts(11,21): error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +iteratorExtraParameters.ts(13,12): error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +iteratorExtraParameters.ts(15,9): error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +iteratorExtraParameters.ts(17,10): error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. + + +==== iteratorExtraParameters.ts (4 errors) ==== + // https://github.com/microsoft/TypeScript/issues/57130 + const iter = { + *[Symbol.iterator](_: number) { + yield 0; + } + }; + + declare function g(...args: any): any; + + function* f() { + for (const _ of iter); + ~~~~ +!!! error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! related TS2322 iteratorExtraParameters.ts:11:21: Type '{ [Symbol.iterator](_: number): Generator; }' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '(_: number) => Generator' is not assignable to type '() => Iterator'. + Target signature provides too few arguments. Expected 1 or more, but got 0. + + yield* iter; + ~~~~ +!!! error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! related TS2322 iteratorExtraParameters.ts:13:12: Type '{ [Symbol.iterator](_: number): Generator; }' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '(_: number) => Generator' is not assignable to type '() => Iterator'. + Target signature provides too few arguments. Expected 1 or more, but got 0. + + [...iter] + ~~~~ +!!! error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! related TS2322 iteratorExtraParameters.ts:15:9: Type '{ [Symbol.iterator](_: number): Generator; }' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '(_: number) => Generator' is not assignable to type '() => Iterator'. + Target signature provides too few arguments. Expected 1 or more, but got 0. + + g(...iter); + ~~~~ +!!! error TS2488: Type '{ [Symbol.iterator](_: number): Generator; }' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! related TS2322 iteratorExtraParameters.ts:17:10: Type '{ [Symbol.iterator](_: number): Generator; }' is not assignable to type 'Iterable'. + Types of property '[Symbol.iterator]' are incompatible. + Type '(_: number) => Generator' is not assignable to type '() => Iterator'. + Target signature provides too few arguments. Expected 1 or more, but got 0. + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryAndJsxFragmentFactory.types b/tests/baselines/reference/jsxFactoryAndJsxFragmentFactory.types index 9aa6630bb9171..5ac6ac7b6fc47 100644 --- a/tests/baselines/reference/jsxFactoryAndJsxFragmentFactory.types +++ b/tests/baselines/reference/jsxFactoryAndJsxFragmentFactory.types @@ -8,16 +8,16 @@ declare var Frag: any; >Frag : any <>; -><> : error +><> : any <>1<>2.12.2; -><>1<>2.12.2 : error +><>1<>2.12.2 : any >1 : error >span : any > : ^^^ >span : any > : ^^^ -><>2.12.2 : error +><>2.12.2 : any >2.1 : error >span : any > : ^^^ diff --git a/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.errors.txt b/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.errors.txt deleted file mode 100644 index df7d2e819b46c..0000000000000 --- a/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -jsxFactoryAndJsxFragmentFactoryNull.tsx(3,1): error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. - - -==== jsxFactoryAndJsxFragmentFactoryNull.tsx (1 errors) ==== - declare var h: any; - - <>; - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'null' to be in scope, but it could not be found. - <>1<>2.12.2; \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.types b/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.types index 5c9d13f33a5ab..eee38e2d3fc43 100644 --- a/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.types +++ b/tests/baselines/reference/jsxFactoryAndJsxFragmentFactoryNull.types @@ -3,31 +3,24 @@ === jsxFactoryAndJsxFragmentFactoryNull.tsx === declare var h: any; >h : any -> : ^^^ <>; ><> : any -> : ^^^ <>1<>2.12.2; ><>1<>2.12.2 : any -> : ^^^ ->1 : any -> : ^^^ +>1 : error >span : any > : ^^^ >span : any > : ^^^ ><>2.12.2 : any -> : ^^^ ->2.1 : any -> : ^^^ +>2.1 : error >span : any > : ^^^ >span : any > : ^^^ ->2.2 : any -> : ^^^ +>2.2 : error >span : any > : ^^^ >span : any diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js index 23844cf6bab19..2d0c7b4607ea5 100644 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js @@ -30,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); const p = __importStar(require("pkg")); p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js index 23844cf6bab19..2d0c7b4607ea5 100644 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js @@ -30,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); const p = __importStar(require("pkg")); p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js index 23844cf6bab19..2d0c7b4607ea5 100644 --- a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js @@ -30,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); const p = __importStar(require("pkg")); p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).js b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).js index 23844cf6bab19..2d0c7b4607ea5 100644 --- a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).js +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).js @@ -30,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); const p = __importStar(require("pkg")); p.thing(); diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js index aeafa06e28154..1498e98d79602 100644 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const self = __importStar(require("package")); diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).js b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).js index aeafa06e28154..1498e98d79602 100644 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).js +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const self = __importStar(require("package")); diff --git a/tests/baselines/reference/nodeModules1(module=node16).js b/tests/baselines/reference/nodeModules1(module=node16).js index 5b6840498ef10..bfebc4d12e830 100644 --- a/tests/baselines/reference/nodeModules1(module=node16).js +++ b/tests/baselines/reference/nodeModules1(module=node16).js @@ -389,13 +389,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; // ESM-format imports below should issue errors diff --git a/tests/baselines/reference/nodeModules1(module=nodenext).js b/tests/baselines/reference/nodeModules1(module=nodenext).js index 5b6840498ef10..bfebc4d12e830 100644 --- a/tests/baselines/reference/nodeModules1(module=nodenext).js +++ b/tests/baselines/reference/nodeModules1(module=nodenext).js @@ -389,13 +389,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; // ESM-format imports below should issue errors diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js index 1376e7c5aea80..4a63449d26383 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js @@ -389,13 +389,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; // ESM-format imports below should issue errors diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).js index 1376e7c5aea80..4a63449d26383 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).js @@ -389,13 +389,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; // ESM-format imports below should issue errors diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js index bd0f2a7780760..89094051db9df 100644 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js @@ -122,22 +122,6 @@ export const cjsSource = true; } } -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; //// [index.mjs] // esm format file import * as cjs from "package/cjs"; @@ -172,13 +156,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); @@ -195,11 +189,27 @@ cjsi.cjsSource; mjsi.cjsSource; typei.implicitCjsSource; ts.cjsSource; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; -//// [index.d.ts] -export {}; //// [index.d.mts] export {}; //// [index.d.cts] export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).js index bd0f2a7780760..89094051db9df 100644 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).js @@ -122,22 +122,6 @@ export const cjsSource = true; } } -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; //// [index.mjs] // esm format file import * as cjs from "package/cjs"; @@ -172,13 +156,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); @@ -195,11 +189,27 @@ cjsi.cjsSource; mjsi.cjsSource; typei.implicitCjsSource; ts.cjsSource; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; -//// [index.d.ts] -export {}; //// [index.d.mts] export {}; //// [index.d.cts] export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js index cce457e2d41c5..208b7a1a36fde 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js @@ -88,20 +88,6 @@ export { type }; } } -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; //// [index.mjs] // esm format file import * as cjs from "package/cjs"; @@ -134,13 +120,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); @@ -155,11 +151,25 @@ const typei = __importStar(require("inner")); cjsi; mjsi; typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; -//// [index.d.ts] -export {}; //// [index.d.mts] export {}; //// [index.d.cts] export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).js index cce457e2d41c5..208b7a1a36fde 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).js @@ -88,20 +88,6 @@ export { type }; } } -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; //// [index.mjs] // esm format file import * as cjs from "package/cjs"; @@ -134,13 +120,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); @@ -155,11 +151,25 @@ const typei = __importStar(require("inner")); cjsi; mjsi; typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; -//// [index.d.ts] -export {}; //// [index.d.mts] export {}; //// [index.d.cts] export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js index 634e532de497a..510e6b7128c79 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js @@ -37,14 +37,6 @@ type; } } -//// [index.js] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; //// [index.mjs] // esm format file import * as cjs from "#cjs"; @@ -71,13 +63,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const cjs = __importStar(require("#cjs")); @@ -86,11 +88,19 @@ const type = __importStar(require("#type")); cjs; mjs; type; +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; -//// [index.d.ts] -export {}; //// [index.d.mts] export {}; //// [index.d.cts] export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).js index 634e532de497a..510e6b7128c79 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).js @@ -37,14 +37,6 @@ type; } } -//// [index.js] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; //// [index.mjs] // esm format file import * as cjs from "#cjs"; @@ -71,13 +63,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const cjs = __importStar(require("#cjs")); @@ -86,11 +88,19 @@ const type = __importStar(require("#type")); cjs; mjs; type; +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; -//// [index.d.ts] -export {}; //// [index.d.mts] export {}; //// [index.d.cts] export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js index db1bb37d36aac..79669dc7d4da8 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index")); diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).js index db1bb37d36aac..79669dc7d4da8 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index")); diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node16).js index 7ede2700377a9..3ba5fbbce0406 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node16).js @@ -102,13 +102,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/exclude/index")); diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=nodenext).js index 7ede2700377a9..3ba5fbbce0406 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=nodenext).js @@ -102,13 +102,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/exclude/index")); diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js index e10a987a39924..b23d73a88c0e9 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index.cjs")); diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).js index e10a987a39924..b23d73a88c0e9 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index.cjs")); diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js index a67f7fdfdd48d..8bf4f316a59ff 100644 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js @@ -156,13 +156,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).js b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).js index a67f7fdfdd48d..8bf4f316a59ff 100644 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).js @@ -156,13 +156,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js index 7500542fd8d1b..58d736d2641fe 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js @@ -123,13 +123,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.f = exports.e = exports.d = exports.c = exports.b = exports.a = void 0; // cjs format file diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).js b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).js index 7500542fd8d1b..58d736d2641fe 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).js @@ -123,13 +123,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.f = exports.e = exports.d = exports.c = exports.b = exports.a = void 0; // cjs format file diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js index d9c0ba1a429a3..a60b20a63d224 100644 --- a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js @@ -41,13 +41,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const type = __importStar(require("#type")); diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).js b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).js index d9c0ba1a429a3..a60b20a63d224 100644 --- a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).js @@ -41,13 +41,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const type = __importStar(require("#type")); diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js index a5ed511f6f5f7..fa6401e1a49a4 100644 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js @@ -49,13 +49,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const type = __importStar(require("#type")); diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).js b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).js index a5ed511f6f5f7..fa6401e1a49a4 100644 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).js @@ -49,13 +49,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const type = __importStar(require("#type")); diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesPackageExports(module=node16).js index d974207d7b4ee..7d1a5738c7346 100644 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node16).js @@ -120,13 +120,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).js b/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).js index d974207d7b4ee..7d1a5738c7346 100644 --- a/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).js @@ -120,13 +120,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjs = __importStar(require("package/cjs")); diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node16).js b/tests/baselines/reference/nodeModulesPackageImports(module=node16).js index fb612b6c2fd66..c25d1005e93d5 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node16).js +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node16).js @@ -63,13 +63,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const cjs = __importStar(require("#cjs")); diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node16).trace.json b/tests/baselines/reference/nodeModulesPackageImports(module=node16).trace.json index bf539475a7a7f..1fc306a0c6b64 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node16).trace.json +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node16).trace.json @@ -7,7 +7,6 @@ "Using 'imports' subpath '#cjs' with target './index.cjs'.", "File name '/.src/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/index.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.cts', result '/.src/index.cts'.", "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", "======== Resolving module '#mjs' from '/.src/index.ts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -16,7 +15,6 @@ "Using 'imports' subpath '#mjs' with target './index.mjs'.", "File name '/.src/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/index.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.mts', result '/.src/index.mts'.", "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", "======== Resolving module '#type' from '/.src/index.ts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -25,7 +23,6 @@ "Using 'imports' subpath '#type' with target './index.js'.", "File name '/.src/index.js' has a '.js' extension - stripping it.", "File '/.src/index.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.ts', result '/.src/index.ts'.", "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", "======== Resolving module '#cjs' from '/.src/index.cts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -34,7 +31,6 @@ "Using 'imports' subpath '#cjs' with target './index.cjs'.", "File name '/.src/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/index.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.cts', result '/.src/index.cts'.", "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", "======== Resolving module '#mjs' from '/.src/index.cts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -43,7 +39,6 @@ "Using 'imports' subpath '#mjs' with target './index.mjs'.", "File name '/.src/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/index.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.mts', result '/.src/index.mts'.", "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", "======== Resolving module '#type' from '/.src/index.cts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -52,7 +47,6 @@ "Using 'imports' subpath '#type' with target './index.js'.", "File name '/.src/index.js' has a '.js' extension - stripping it.", "File '/.src/index.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.ts', result '/.src/index.ts'.", "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", "======== Resolving module '#cjs' from '/.src/index.mts'. ========", "Resolution for module '#cjs' was found in cache from location '/.src'.", @@ -63,24 +57,6 @@ "======== Resolving module '#type' from '/.src/index.mts'. ========", "Resolution for module '#type' was found in cache from location '/.src'.", "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", - "======== Resolving module '#cjs' from '/.src/index.mts'. ========", - "Resolution for module '#cjs' was found in cache from location '/.src'.", - "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", - "======== Resolving module '#mjs' from '/.src/index.mts'. ========", - "Resolution for module '#mjs' was found in cache from location '/.src'.", - "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", - "======== Resolving module '#type' from '/.src/index.mts'. ========", - "Resolution for module '#type' was found in cache from location '/.src'.", - "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", - "======== Resolving module '#cjs' from '/.src/index.cts'. ========", - "Resolution for module '#cjs' was found in cache from location '/.src'.", - "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", - "======== Resolving module '#mjs' from '/.src/index.cts'. ========", - "Resolution for module '#mjs' was found in cache from location '/.src'.", - "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", - "======== Resolving module '#type' from '/.src/index.cts'. ========", - "Resolution for module '#type' was found in cache from location '/.src'.", - "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", "File '/.ts/package.json' does not exist.", "File '/package.json' does not exist.", "======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========", diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).js b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).js index fb612b6c2fd66..c25d1005e93d5 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).js @@ -63,13 +63,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const cjs = __importStar(require("#cjs")); diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json index 8d3d19610e929..a8fe93ee30144 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).trace.json @@ -7,7 +7,6 @@ "Using 'imports' subpath '#cjs' with target './index.cjs'.", "File name '/.src/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/index.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.cts', result '/.src/index.cts'.", "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", "======== Resolving module '#mjs' from '/.src/index.ts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -16,7 +15,6 @@ "Using 'imports' subpath '#mjs' with target './index.mjs'.", "File name '/.src/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/index.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.mts', result '/.src/index.mts'.", "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", "======== Resolving module '#type' from '/.src/index.ts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -25,7 +23,6 @@ "Using 'imports' subpath '#type' with target './index.js'.", "File name '/.src/index.js' has a '.js' extension - stripping it.", "File '/.src/index.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.ts', result '/.src/index.ts'.", "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", "======== Resolving module '#cjs' from '/.src/index.cts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -34,7 +31,6 @@ "Using 'imports' subpath '#cjs' with target './index.cjs'.", "File name '/.src/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/index.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.cts', result '/.src/index.cts'.", "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", "======== Resolving module '#mjs' from '/.src/index.cts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -43,7 +39,6 @@ "Using 'imports' subpath '#mjs' with target './index.mjs'.", "File name '/.src/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/index.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.mts', result '/.src/index.mts'.", "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", "======== Resolving module '#type' from '/.src/index.cts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -52,7 +47,6 @@ "Using 'imports' subpath '#type' with target './index.js'.", "File name '/.src/index.js' has a '.js' extension - stripping it.", "File '/.src/index.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/index.ts', result '/.src/index.ts'.", "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", "======== Resolving module '#cjs' from '/.src/index.mts'. ========", "Resolution for module '#cjs' was found in cache from location '/.src'.", @@ -63,24 +57,6 @@ "======== Resolving module '#type' from '/.src/index.mts'. ========", "Resolution for module '#type' was found in cache from location '/.src'.", "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", - "======== Resolving module '#cjs' from '/.src/index.mts'. ========", - "Resolution for module '#cjs' was found in cache from location '/.src'.", - "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", - "======== Resolving module '#mjs' from '/.src/index.mts'. ========", - "Resolution for module '#mjs' was found in cache from location '/.src'.", - "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", - "======== Resolving module '#type' from '/.src/index.mts'. ========", - "Resolution for module '#type' was found in cache from location '/.src'.", - "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", - "======== Resolving module '#cjs' from '/.src/index.cts'. ========", - "Resolution for module '#cjs' was found in cache from location '/.src'.", - "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", - "======== Resolving module '#mjs' from '/.src/index.cts'. ========", - "Resolution for module '#mjs' was found in cache from location '/.src'.", - "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", - "======== Resolving module '#type' from '/.src/index.cts'. ========", - "Resolution for module '#type' was found in cache from location '/.src'.", - "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", "File '/.ts/package.json' does not exist.", "File '/package.json' does not exist.", "======== Resolving module '@typescript/lib-esnext' from '/.src/__lib_node_modules_lookup_lib.esnext.d.ts__.ts'. ========", diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js index cef593a42469a..f710ad1fe43f2 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index")); diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).js b/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).js index cef593a42469a..f710ad1fe43f2 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index")); diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node16).js b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node16).js index 5c3a1fea21903..5fe735dbc37b1 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node16).js +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node16).js @@ -156,13 +156,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/exclude/index")); diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=nodenext).js b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=nodenext).js index 5c3a1fea21903..5fe735dbc37b1 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=nodenext).js @@ -156,13 +156,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/exclude/index")); diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js index 62c5b11569855..18a9e37f040a1 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index.cjs")); diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json index 6ea0756249395..4d02f9365e312 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json @@ -48,7 +48,6 @@ "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/node_modules/inner/index.cts' does not exist.", "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -58,7 +57,6 @@ "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/node_modules/inner/index.mts' does not exist.", "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -69,7 +67,6 @@ "File '/.src/node_modules/inner/index.ts' does not exist.", "File '/.src/node_modules/inner/index.tsx' does not exist.", "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -79,7 +76,6 @@ "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/node_modules/inner/index.cts' does not exist.", "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -89,7 +85,6 @@ "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/node_modules/inner/index.mts' does not exist.", "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", "Module resolution kind is not specified, using 'Node16'.", @@ -100,7 +95,6 @@ "File '/.src/node_modules/inner/index.ts' does not exist.", "File '/.src/node_modules/inner/index.tsx' does not exist.", "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ========", @@ -170,22 +164,22 @@ "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ========", "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", - "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ========", "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", - "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", - "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", - "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", - "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", - "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", "File '/.ts/package.json' does not exist.", diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).js b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).js index 62c5b11569855..18a9e37f040a1 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).js @@ -99,13 +99,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const cjsi = __importStar(require("inner/cjs/index.cjs")); diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json index 120ddd2efeb1d..b39696da67c6c 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json @@ -48,7 +48,6 @@ "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/node_modules/inner/index.cts' does not exist.", "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -58,7 +57,6 @@ "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/node_modules/inner/index.mts' does not exist.", "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -69,7 +67,6 @@ "File '/.src/node_modules/inner/index.ts' does not exist.", "File '/.src/node_modules/inner/index.tsx' does not exist.", "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -79,7 +76,6 @@ "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", "File '/.src/node_modules/inner/index.cts' does not exist.", "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -89,7 +85,6 @@ "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", "File '/.src/node_modules/inner/index.mts' does not exist.", "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", @@ -100,7 +95,6 @@ "File '/.src/node_modules/inner/index.ts' does not exist.", "File '/.src/node_modules/inner/index.tsx' does not exist.", "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", - "Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ========", @@ -170,22 +164,22 @@ "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ========", "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", - "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ========", "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", - "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", - "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", - "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", - "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", - "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", "File '/.ts/package.json' does not exist.", diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js index 1d93a589402d8..09afe3776dcb2 100644 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js @@ -57,13 +57,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).js b/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).js index 1d93a589402d8..09afe3776dcb2 100644 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).js @@ -57,13 +57,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js index 1553828a6ae5e..fe34ab0566b01 100644 --- a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js @@ -77,13 +77,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const mod = __importStar(require("inner")); diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).js b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).js index 1553828a6ae5e..fe34ab0566b01 100644 --- a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).js @@ -77,13 +77,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const mod = __importStar(require("inner")); diff --git a/tests/baselines/reference/nodePackageSelfName(module=node16).js b/tests/baselines/reference/nodePackageSelfName(module=node16).js index 7061f58c6bb04..dc65d690cf617 100644 --- a/tests/baselines/reference/nodePackageSelfName(module=node16).js +++ b/tests/baselines/reference/nodePackageSelfName(module=node16).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const self = __importStar(require("package")); diff --git a/tests/baselines/reference/nodePackageSelfName(module=nodenext).js b/tests/baselines/reference/nodePackageSelfName(module=nodenext).js index 7061f58c6bb04..dc65d690cf617 100644 --- a/tests/baselines/reference/nodePackageSelfName(module=nodenext).js +++ b/tests/baselines/reference/nodePackageSelfName(module=nodenext).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // esm format file const self = __importStar(require("package")); diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js index 8738c8041a9b6..f9d633df6fc03 100644 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const self = __importStar(require("@scope/package")); diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).js b/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).js index 8738c8041a9b6..f9d633df6fc03 100644 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).js +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).js @@ -46,13 +46,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); // cjs format file const self = __importStar(require("@scope/package")); diff --git a/tests/baselines/reference/parameterDecoratorsEmitCrash.errors.txt b/tests/baselines/reference/parameterDecoratorsEmitCrash.errors.txt new file mode 100644 index 0000000000000..1e54b05e16c1f --- /dev/null +++ b/tests/baselines/reference/parameterDecoratorsEmitCrash.errors.txt @@ -0,0 +1,14 @@ +parameterDecoratorsEmitCrash.ts(6,17): error TS1206: Decorators are not valid here. + + +==== parameterDecoratorsEmitCrash.ts (1 errors) ==== + // https://github.com/microsoft/TypeScript/issues/58269 + declare var dec: any; + + export class C { + @dec x: any; + constructor(@dec x: any) {} + ~ +!!! error TS1206: Decorators are not valid here. + } + \ No newline at end of file diff --git a/tests/baselines/reference/parameterDecoratorsEmitCrash.js b/tests/baselines/reference/parameterDecoratorsEmitCrash.js new file mode 100644 index 0000000000000..057607b0b9da9 --- /dev/null +++ b/tests/baselines/reference/parameterDecoratorsEmitCrash.js @@ -0,0 +1,71 @@ +//// [tests/cases/compiler/parameterDecoratorsEmitCrash.ts] //// + +//// [parameterDecoratorsEmitCrash.ts] +// https://github.com/microsoft/TypeScript/issues/58269 +declare var dec: any; + +export class C { + @dec x: any; + constructor(@dec x: any) {} +} + + +//// [parameterDecoratorsEmitCrash.js] +"use strict"; +var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; +var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.C = void 0; +var C = function () { + var _a; + var _x_decorators; + var _x_initializers = []; + var _x_extraInitializers = []; + return _a = /** @class */ (function () { + function C(x) { + this.x = __runInitializers(this, _x_initializers, void 0); + __runInitializers(this, _x_extraInitializers); + } + return C; + }()), + (function () { + var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0; + _x_decorators = [dec]; + __esDecorate(null, null, _x_decorators, { kind: "field", name: "x", static: false, private: false, access: { has: function (obj) { return "x" in obj; }, get: function (obj) { return obj.x; }, set: function (obj, value) { obj.x = value; } }, metadata: _metadata }, _x_initializers, _x_extraInitializers); + if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata }); + })(), + _a; +}(); +exports.C = C; diff --git a/tests/baselines/reference/printerApi/printsNodeCorrectly.template string.js b/tests/baselines/reference/printerApi/printsNodeCorrectly.template string.js new file mode 100644 index 0000000000000..7acaf247a15a0 --- /dev/null +++ b/tests/baselines/reference/printerApi/printsNodeCorrectly.template string.js @@ -0,0 +1,2 @@ +` +` \ No newline at end of file diff --git a/tests/baselines/reference/returnStatementNoAsiAfterTransform(target=es5).js b/tests/baselines/reference/returnStatementNoAsiAfterTransform(target=es5).js new file mode 100644 index 0000000000000..0485eb813e407 --- /dev/null +++ b/tests/baselines/reference/returnStatementNoAsiAfterTransform(target=es5).js @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/statements/returnStatements/returnStatementNoAsiAfterTransform.ts] //// + +//// [returnStatementNoAsiAfterTransform.ts] +declare var a: any; + +function t1() { + return ( + // comment + a as any + ); +} +function t2() { + return ( + // comment + a as any + ) + 1; +} +function t3() { + return ( + // comment + a as any + ) ? 0 : 1; +} +function t4() { + return ( + // comment + a as any + ).b; +} +function t5() { + return ( + // comment + a as any + )[a]; +} +function t6() { + return ( + // comment + a as any + )(); +} +function t7() { + return ( + // comment + a as any + )``; +} +function t8() { + return ( + // comment + a as any + ) as any; +} +function t9() { + return ( + // comment + a as any + ) satisfies any; +} +function t10() { + return ( + // comment + a as any + )!; +} + + +//// [returnStatementNoAsiAfterTransform.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +function t1() { + return ( + // comment + a); +} +function t2() { + return ( + // comment + a) + 1; +} +function t3() { + return ( + // comment + a) ? 0 : 1; +} +function t4() { + return ( + // comment + a).b; +} +function t5() { + return ( + // comment + a)[a]; +} +function t6() { + return ( + // comment + a)(); +} +function t7() { + return ( + // comment + a)(__makeTemplateObject([""], [""])); +} +function t8() { + return ( + // comment + a); +} +function t9() { + return ( + // comment + a); +} +function t10() { + return ( + // comment + a); +} diff --git a/tests/baselines/reference/returnStatementNoAsiAfterTransform(target=esnext).js b/tests/baselines/reference/returnStatementNoAsiAfterTransform(target=esnext).js new file mode 100644 index 0000000000000..65e3b7057f673 --- /dev/null +++ b/tests/baselines/reference/returnStatementNoAsiAfterTransform(target=esnext).js @@ -0,0 +1,118 @@ +//// [tests/cases/conformance/statements/returnStatements/returnStatementNoAsiAfterTransform.ts] //// + +//// [returnStatementNoAsiAfterTransform.ts] +declare var a: any; + +function t1() { + return ( + // comment + a as any + ); +} +function t2() { + return ( + // comment + a as any + ) + 1; +} +function t3() { + return ( + // comment + a as any + ) ? 0 : 1; +} +function t4() { + return ( + // comment + a as any + ).b; +} +function t5() { + return ( + // comment + a as any + )[a]; +} +function t6() { + return ( + // comment + a as any + )(); +} +function t7() { + return ( + // comment + a as any + )``; +} +function t8() { + return ( + // comment + a as any + ) as any; +} +function t9() { + return ( + // comment + a as any + ) satisfies any; +} +function t10() { + return ( + // comment + a as any + )!; +} + + +//// [returnStatementNoAsiAfterTransform.js] +function t1() { + return ( + // comment + a); +} +function t2() { + return ( + // comment + a) + 1; +} +function t3() { + return ( + // comment + a) ? 0 : 1; +} +function t4() { + return ( + // comment + a).b; +} +function t5() { + return ( + // comment + a)[a]; +} +function t6() { + return ( + // comment + a)(); +} +function t7() { + return ( + // comment + a) ``; +} +function t8() { + return ( + // comment + a); +} +function t9() { + return ( + // comment + a); +} +function t10() { + return ( + // comment + a); +} diff --git a/tests/baselines/reference/selfNameAndImportsEmitInclusion.js b/tests/baselines/reference/selfNameAndImportsEmitInclusion.js new file mode 100644 index 0000000000000..e8e1e014ab482 --- /dev/null +++ b/tests/baselines/reference/selfNameAndImportsEmitInclusion.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/selfNameAndImportsEmitInclusion.ts] //// + +//// [package.json] +{ + "name": "pkg", + "type": "module", + "imports": { + "#indirect1": "./src/indirect1.ts" + }, + "exports": { + "./*": "./dist/*" + } +} + +//// [indirect1.ts] +export const indirect1 = 0; + +//// [indirect2.ts] +export const indirect2 = 0; + +//// [main.ts] +import { indirect1 } from "#indirect1"; +import { indirect2 } from "pkg/indirect2.js"; +console.log(indirect1, indirect2); + + +//// [indirect1.js] +export const indirect1 = 0; +//// [indirect2.js] +export const indirect2 = 0; +//// [main.js] +import { indirect1 } from "#indirect1"; +import { indirect2 } from "pkg/indirect2.js"; +console.log(indirect1, indirect2); diff --git a/tests/baselines/reference/selfNameModuleAugmentation.trace.json b/tests/baselines/reference/selfNameModuleAugmentation.trace.json index c02409bd73411..bdb1889706548 100644 --- a/tests/baselines/reference/selfNameModuleAugmentation.trace.json +++ b/tests/baselines/reference/selfNameModuleAugmentation.trace.json @@ -23,7 +23,6 @@ "'package.json' does not have a 'peerDependencies' field.", "Resolved under condition 'default'.", "Exiting conditional exports.", - "Resolving real path for '/node_modules/acorn-walk/dist/walk.d.ts', result '/node_modules/acorn-walk/dist/walk.d.ts'.", "======== Module name 'acorn-walk' was successfully resolved to '/node_modules/acorn-walk/dist/walk.d.ts' with Package ID 'acorn-walk/dist/walk.d.ts@8.2.0'. ========", "======== Resolving module 'acorn-walk' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'Bundler'.", diff --git a/tests/baselines/reference/signatureOverloadsWithComments.js b/tests/baselines/reference/signatureOverloadsWithComments.js new file mode 100644 index 0000000000000..a66e4a1cadc8d --- /dev/null +++ b/tests/baselines/reference/signatureOverloadsWithComments.js @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/signatureOverloadsWithComments.ts] //// + +//// [signatureOverloadsWithComments.ts] +/** + * Docs + */ +function Foo() { + return class Bar { + /** + * comment 1 + */ + foo(bar: string): void; + /** + * @deprecated This signature is deprecated + * + * comment 2 + */ + foo(): string; + foo(bar?: string): string | void { + return 'hi' + } + } +} + + + + +//// [signatureOverloadsWithComments.d.ts] +/** + * Docs + */ +declare function Foo(): { + new (): { + /** + * comment 1 + */ + foo(bar: string): void; + /** + * @deprecated This signature is deprecated + * + * comment 2 + */ + foo(): string; + }; +}; diff --git a/tests/baselines/reference/signatureOverloadsWithComments.symbols b/tests/baselines/reference/signatureOverloadsWithComments.symbols new file mode 100644 index 0000000000000..3d04d7bb43cc2 --- /dev/null +++ b/tests/baselines/reference/signatureOverloadsWithComments.symbols @@ -0,0 +1,36 @@ +//// [tests/cases/compiler/signatureOverloadsWithComments.ts] //// + +=== signatureOverloadsWithComments.ts === +/** + * Docs + */ +function Foo() { +>Foo : Symbol(Foo, Decl(signatureOverloadsWithComments.ts, 0, 0)) + + return class Bar { +>Bar : Symbol(Bar, Decl(signatureOverloadsWithComments.ts, 4, 10)) + + /** + * comment 1 + */ + foo(bar: string): void; +>foo : Symbol(Bar.foo, Decl(signatureOverloadsWithComments.ts, 4, 22), Decl(signatureOverloadsWithComments.ts, 8, 31), Decl(signatureOverloadsWithComments.ts, 14, 22)) +>bar : Symbol(bar, Decl(signatureOverloadsWithComments.ts, 8, 12)) + + /** + * @deprecated This signature is deprecated + * + * comment 2 + */ + foo(): string; +>foo : Symbol(Bar.foo, Decl(signatureOverloadsWithComments.ts, 4, 22), Decl(signatureOverloadsWithComments.ts, 8, 31), Decl(signatureOverloadsWithComments.ts, 14, 22)) + + foo(bar?: string): string | void { +>foo : Symbol(Bar.foo, Decl(signatureOverloadsWithComments.ts, 4, 22), Decl(signatureOverloadsWithComments.ts, 8, 31), Decl(signatureOverloadsWithComments.ts, 14, 22)) +>bar : Symbol(bar, Decl(signatureOverloadsWithComments.ts, 15, 12)) + + return 'hi' + } + } +} + diff --git a/tests/baselines/reference/signatureOverloadsWithComments.types b/tests/baselines/reference/signatureOverloadsWithComments.types new file mode 100644 index 0000000000000..6742e001f3481 --- /dev/null +++ b/tests/baselines/reference/signatureOverloadsWithComments.types @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/signatureOverloadsWithComments.ts] //// + +=== signatureOverloadsWithComments.ts === +/** + * Docs + */ +function Foo() { +>Foo : () => typeof Bar +> : ^^^^^^^^^^^^^^^^ + + return class Bar { +>class Bar { /** * comment 1 */ foo(bar: string): void; /** * @deprecated This signature is deprecated * * comment 2 */ foo(): string; foo(bar?: string): string | void { return 'hi' } } : typeof Bar +> : ^^^^^^^^^^ +>Bar : typeof Bar +> : ^^^^^^^^^^ + + /** + * comment 1 + */ + foo(bar: string): void; +>foo : { (bar: string): void; (): string; } +> : ^^^ ^^ ^^^ ^^^^^^ ^^^ +>bar : string +> : ^^^^^^ + + /** + * @deprecated This signature is deprecated + * + * comment 2 + */ + foo(): string; +>foo : { (bar: string): void; (): string; } +> : ^^^ ^^ ^^^ ^^^^^^ ^^^ + + foo(bar?: string): string | void { +>foo : { (bar: string): void; (): string; } +> : ^^^ ^^ ^^^ ^^^^^^ ^^^ +>bar : string +> : ^^^^^^ + + return 'hi' +>'hi' : "hi" +> : ^^^^ + } + } +} + diff --git a/tests/baselines/reference/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.js b/tests/baselines/reference/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.js index 3b1693123f427..551c470855230 100644 --- a/tests/baselines/reference/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.js +++ b/tests/baselines/reference/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.js @@ -57,13 +57,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; const pkg = __importStar(require("package-b")); diff --git a/tests/baselines/reference/transpile/declarationFunctionDeclarations.d.ts b/tests/baselines/reference/transpile/declarationFunctionDeclarations.d.ts index 660699a4426c3..7814e7759fa75 100644 --- a/tests/baselines/reference/transpile/declarationFunctionDeclarations.d.ts +++ b/tests/baselines/reference/transpile/declarationFunctionDeclarations.d.ts @@ -125,15 +125,15 @@ export {}; //// [Diagnostics reported] -fnDecl.ts(12,27): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(16,36): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(20,26): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(24,56): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(28,46): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(32,45): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(37,47): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(41,37): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. -fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +fnDecl.ts(12,27): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(16,36): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(20,26): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(24,56): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(28,46): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(32,45): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(37,47): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(41,37): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. +fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. ==== fnDecl.ts (9 errors) ==== @@ -150,42 +150,42 @@ fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires imp export function fnDeclHasUndefined(p: T | undefined = [], rParam: string): void { }; export function fnDeclBad(p: T = [], rParam: string): void { }; ~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:12:27: Add a type annotation to the parameter p. export const fnExprOk1 = function (array: number[] = [], rParam: string): void { }; export const fnExprOk2 = function (array: T | undefined = [], rParam: string): void { }; export const fnExprBad = function (array: T = [], rParam: string): void { }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:16:36: Add a type annotation to the parameter array. export const arrowOk1 = (array: number[] = [], rParam: string): void => { }; export const arrowOk2 = (array: T | undefined = [], rParam: string): void => { }; export const arrowBad = (array: T = [], rParam: string): void => { }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:20:26: Add a type annotation to the parameter array. export const inObjectLiteralFnExprOk1 = { o: function (array: number[] = [], rParam: string): void { } }; export const inObjectLiteralFnExprOk2 = { o: function (array: T | undefined = [], rParam: string): void { } }; export const inObjectLiteralFnExprBad = { o: function (array: T = [], rParam: string): void { } }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:24:56: Add a type annotation to the parameter array. export const inObjectLiteralArrowOk1 = { o: (array: number[] = [], rParam: string): void => { } }; export const inObjectLiteralArrowOk2 = { o: (array: T | undefined = [], rParam: string): void => { } }; export const inObjectLiteralArrowBad = { o: (array: T = [], rParam: string): void => { } }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:28:46: Add a type annotation to the parameter array. export const inObjectLiteralMethodOk1 = { o(array: number[] = [], rParam: string): void { } }; export const inObjectLiteralMethodOk2 = { o(array: T | undefined = [], rParam: string): void { } }; export const inObjectLiteralMethodBad = { o(array: T = [], rParam: string): void { } }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:32:45: Add a type annotation to the parameter array. @@ -193,21 +193,21 @@ fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires imp export class InClassFnExprOk2 { o = function (array: T | undefined = [], rParam: string): void { } }; export class InClassFnExprBad { o = function (array: T = [], rParam: string): void { } }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:37:47: Add a type annotation to the parameter array. export class InClassArrowOk1 { o = (array: number[] = [], rParam: string): void => { } }; export class InClassArrowOk2 { o = (array: T | undefined = [], rParam: string): void => { } }; export class InClassArrowBad { o = (array: T = [], rParam: string): void => { } }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:41:37: Add a type annotation to the parameter array. export class InClassMethodOk1 { o(array: number[] = [], rParam: string): void { } }; export class InClassMethodOk2 { o(array: T | undefined = [], rParam: string): void { } }; export class InClassMethodBad { o(array: T = [], rParam: string): void { } }; ~~~~~~~~~~~~~ -!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations. +!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations. !!! related TS9028 fnDecl.ts:45:35: Add a type annotation to the parameter array. diff --git a/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js b/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js index 0a4281d700983..fa310f31caeb5 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js @@ -103,7 +103,6 @@ File '/home/src/workspaces/project/packages/a/index.js' exists - use it as a nam 'package.json' does not have a 'peerDependencies' field. Resolved under condition 'types'. Exiting conditional exports. -Resolving real path for '/home/src/workspaces/project/packages/a/index.js', result '/home/src/workspaces/project/packages/a/index.js'. ======== Module name 'a' was successfully resolved to '/home/src/workspaces/project/packages/a/index.js' with Package ID 'a/index.js@0.0.0'. ======== File '/home/src/tslibs/TS/Lib/package.json' does not exist. File '/home/src/tslibs/TS/package.json' does not exist. @@ -115,6 +114,7 @@ File '/package.json' does not exist. Default library for target 'esnext' packages/a/index.js Matched by default include pattern '**/*' + Imported via 'a' from file 'packages/a/test/index.js' with packageId 'a/index.js@0.0.0' File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" packages/a/test/index.js Matched by default include pattern '**/*' diff --git a/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js b/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js index 7ef24e052163e..f101000471bf2 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js @@ -102,7 +102,6 @@ File '/home/src/workspaces/project/packages/a/index.js' exists - use it as a nam 'package.json' does not have a 'peerDependencies' field. Resolved under condition 'types'. Exiting conditional exports. -Resolving real path for '/home/src/workspaces/project/packages/a/index.js', result '/home/src/workspaces/project/packages/a/index.js'. ======== Module name 'a' was successfully resolved to '/home/src/workspaces/project/packages/a/index.js' with Package ID 'a/index.js@0.0.0'. ======== File '/home/src/tslibs/TS/Lib/package.json' does not exist. File '/home/src/tslibs/TS/package.json' does not exist. @@ -114,6 +113,7 @@ File '/package.json' does not exist. Default library for target 'esnext' packages/a/index.js Matched by default include pattern '**/*' + Imported via 'a' from file 'packages/a/test/index.js' with packageId 'a/index.js@0.0.0' File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" packages/a/test/index.js Matched by default include pattern '**/*' diff --git a/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js index 98741e71013f9..4dbb28719da08 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js @@ -472,13 +472,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.m = void 0; var c = __importStar(require("../core/index")); diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/package-json-is-looked-up-for-file.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/package-json-is-looked-up-for-file.js index beca01c633d3b..71d47a724d728 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/package-json-is-looked-up-for-file.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/package-json-is-looked-up-for-file.js @@ -59,7 +59,6 @@ File '/Users/name/projects/lib-boilerplate/package.json' exists according to ear Using 'exports' subpath '.' with target './src/index.ts'. File '/Users/name/projects/lib-boilerplate/src/index.ts' exists - use it as a name resolution result. 'package.json' does not have a 'peerDependencies' field. -Resolving real path for '/Users/name/projects/lib-boilerplate/src/index.ts', result '/Users/name/projects/lib-boilerplate/src/index.ts'. ======== Module name 'lib-boilerplate' was successfully resolved to '/Users/name/projects/lib-boilerplate/src/index.ts' with Package ID 'lib-boilerplate/src/index.ts@0.0.2'. ======== File '/home/src/tslibs/TS/Lib/package.json' does not exist. File '/home/src/tslibs/TS/package.json' does not exist. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/self-name-package-reference.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/self-name-package-reference.js index 0105455c35d95..b8270ff4a2216 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/self-name-package-reference.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/self-name-package-reference.js @@ -55,7 +55,6 @@ Resolving in ESM mode with conditions 'import', 'types', 'node'. File '/Users/name/projects/web/package.json' exists according to earlier cached lookups. Using 'exports' subpath '.' with target './dist/index.js'. File '/Users/name/projects/web/index.ts' exists - use it as a name resolution result. -Resolving real path for '/Users/name/projects/web/index.ts', result '/Users/name/projects/web/index.ts'. ======== Module name '@this/package' was successfully resolved to '/Users/name/projects/web/index.ts'. ======== File '/home/src/tslibs/TS/Lib/package.json' does not exist. File '/home/src/tslibs/TS/package.json' does not exist. diff --git a/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js b/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js index 75b26665bb616..ba1110fbcc661 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js @@ -64,7 +64,6 @@ Using 'exports' subpath '.' with target './dist/index.js'. File '/user/username/projects/myproject/index.ts' exists - use it as a name resolution result. Resolved under condition 'default'. Exiting conditional exports. -Resolving real path for '/user/username/projects/myproject/index.ts', result '/user/username/projects/myproject/index.ts'. ======== Module name '@this/package' was successfully resolved to '/user/username/projects/myproject/index.ts'. ======== File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. File '/home/src/tslibs/TS/Lib/package.json' does not exist. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js index 80357339f2fc5..515748a97f6ad 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js @@ -216,7 +216,7 @@ export declare function multiply(a: number, b: number): number; } //// [/user/username/projects/sample1/logic/index.js.map] -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAEC;AAHD,+CAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,yDAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAEC;AAHD,+CAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,yDAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/user/username/projects/sample1/logic/index.js] "use strict"; @@ -236,13 +236,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.m = void 0; exports.getSecondsInDay = getSecondsInDay; @@ -361,13 +371,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.m = void 0; var c = __importStar(require("../core/index")); @@ -675,7 +695,7 @@ export const m = mod; function foo() { } //// [/user/username/projects/sample1/logic/index.js.map] -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAEC;AAHD,+CAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,yDAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,SAAS,GAAG,KAAK,CAAC"} +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAEC;AAHD,+CAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,yDAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,SAAS,GAAG,KAAK,CAAC"} //// [/user/username/projects/sample1/logic/index.js] "use strict"; @@ -695,13 +715,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.m = void 0; exports.getSecondsInDay = getSecondsInDay; @@ -814,7 +844,7 @@ export const m = mod; function foo() { }export function gfoo() { } //// [/user/username/projects/sample1/logic/index.js.map] -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAEC;AAGiB,oBAA0B;AAN5C,+CAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,yDAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,SAAS,GAAG,KAAK,CAAC;AAAA,SAAgB,IAAI,KAAK,CAAC"} +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAEC;AAGiB,oBAA0B;AAN5C,+CAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,yDAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,SAAS,GAAG,KAAK,CAAC;AAAA,SAAgB,IAAI,KAAK,CAAC"} //// [/user/username/projects/sample1/logic/index.js] "use strict"; @@ -834,13 +864,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.m = void 0; exports.getSecondsInDay = getSecondsInDay; @@ -1204,13 +1244,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.m = void 0; exports.getSecondsInDay = getSecondsInDay; diff --git a/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap1.js b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap1.js new file mode 100644 index 0000000000000..20790f3d8c3cf --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap1.js @@ -0,0 +1,483 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "type": "module", + "imports": { + "#is-browser": { + "browser": "./dist/env/browser.js", + "default": "./dist/env/node.js" + } + } +} + +//// [/home/src/workspaces/project/src/a.ts] +import {} from ""; + +//// [/home/src/workspaces/project/src/env/browser.ts] +export const isBrowser = true; + +//// [/home/src/workspaces/project/src/env/node.ts] +export const isBrowser = false; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/a.ts", + "/home/src/workspaces/project/src/env/browser.ts", + "/home/src/workspaces/project/src/env/node.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/browser.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/node.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + /home/src/workspaces/project/src/a.ts Text-1 "import {} from \"\";" + /home/src/workspaces/project/src/env/browser.ts Text-1 "export const isBrowser = true;" + /home/src/workspaces/project/src/env/node.ts Text-1 "export const isBrowser = false;" + + + src/a.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + src/env/browser.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + src/env/node.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/browser.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/node.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/env/browser.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/env/node.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/env/browser.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/env/node.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/env/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.ts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/env/browser.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/env/node.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 17 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#is-browser", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap2.js b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap2.js new file mode 100644 index 0000000000000..46de407066c78 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap2.js @@ -0,0 +1,524 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "type": "module", + "imports": { + "#internal/*": "./dist/internal/*" + } +} + +//// [/home/src/workspaces/project/src/a.ts] +import {} from ""; +import {} from "#internal/"; + +//// [/home/src/workspaces/project/src/internal/foo.ts] +export function something(name: string) {} + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/a.ts", + "/home/src/workspaces/project/src/internal/foo.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/internal/foo.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/internal/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/a.ts Text-1 "import {} from \"\";\nimport {} from \"#internal/\";" + /home/src/workspaces/project/src/internal/foo.ts Text-1 "export function something(name: string) {}" + + + src/a.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + src/internal/foo.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/internal/foo.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/internal/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project/src: *new* + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/internal/foo.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/internal/foo.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/internal/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.ts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} +/home/src/workspaces/project/src: + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/internal/foo.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 17 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#internal", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 4, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 4, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 5, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 2, + "offset": 27 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 5, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "foo.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap3.js b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap3.js new file mode 100644 index 0000000000000..108703f1404c6 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap3.js @@ -0,0 +1,524 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "type": "module", + "imports": { + "#internal/": "./dist/internal/" + } +} + +//// [/home/src/workspaces/project/src/a.ts] +import {} from ""; +import {} from "#internal/"; + +//// [/home/src/workspaces/project/src/internal/foo.ts] +export function something(name: string) {} + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/a.ts", + "/home/src/workspaces/project/src/internal/foo.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/internal/foo.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/internal/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/a.ts Text-1 "import {} from \"\";\nimport {} from \"#internal/\";" + /home/src/workspaces/project/src/internal/foo.ts Text-1 "export function something(name: string) {}" + + + src/a.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + src/internal/foo.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/internal/foo.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/internal/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project/src: *new* + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/internal/foo.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/internal/foo.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/internal/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.ts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} +/home/src/workspaces/project/src: + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/internal/foo.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 17 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#internal", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 4, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 4, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 5, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 2, + "offset": 27 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 5, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "foo.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap4.js b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap4.js new file mode 100644 index 0000000000000..63feb5500973e --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap4.js @@ -0,0 +1,462 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "type": "module", + "imports": { + "#is-browser": { + "types": "./dist/env/browser.d.ts", + "default": "./dist/env/browser.js" + } + } +} + +//// [/home/src/workspaces/project/src/a.ts] +import {} from ""; + +//// [/home/src/workspaces/project/src/env/browser.ts] +export const isBrowser = true; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/a.ts", + "/home/src/workspaces/project/src/env/browser.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/browser.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/a.ts Text-1 "import {} from \"\";" + /home/src/workspaces/project/src/env/browser.ts Text-1 "export const isBrowser = true;" + + + src/a.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + src/env/browser.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/browser.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/env/browser.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/env/browser.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/env/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.ts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/env/browser.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 17 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#is-browser", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap5.js b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap5.js new file mode 100644 index 0000000000000..8c218da0a58d9 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/importCompletions_importsMap5.js @@ -0,0 +1,478 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "type": "module", + "imports": { + "#is-browser": { + "types": "./types/env/browser.d.ts", + "default": "./not-dist-on-purpose/env/browser.js" + } + } +} + +//// [/home/src/workspaces/project/src/a.ts] +import {} from ""; + +//// [/home/src/workspaces/project/src/env/browser.ts] +export const isBrowser = true; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist", + "declarationDir": "types", + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/a.ts", + "/home/src/workspaces/project/src/env/browser.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "declarationDir": "/home/src/workspaces/project/types", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/browser.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/env/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/a.ts Text-1 "import {} from \"\";" + /home/src/workspaces/project/src/env/browser.ts Text-1 "export const isBrowser = true;" + + + src/a.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + src/env/browser.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "start": { + "line": 6, + "offset": 5 + }, + "end": { + "line": 6, + "offset": 21 + }, + "text": "Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'.", + "code": 5069, + "category": "error", + "fileName": "/home/src/workspaces/project/tsconfig.json" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\",\n \"declarationDir\": \"types\",\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/browser.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/env/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/env/browser.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/env/browser.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/env/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.ts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/a.ts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/env/browser.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 17 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#is-browser", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_blankTargetFile.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_blankTargetFile.js index b896f39cefe33..376d47e901a34 100644 --- a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_blankTargetFile.js +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_blankTargetFile.js @@ -22,11 +22,11 @@ console.log(abc); console.log("abc"); -//// [/home/src/workspaces/project/c.ts] +//// [/home/src/workspaces/project/folder/c.ts] //// [/home/src/workspaces/project/tsconfig.json] -{ "files": ["c.ts", "a.ts", "b.ts"] } +{ "files": ["folder/c.ts", "a.ts", "b.ts"] } Info seq [hh:mm:ss:mss] request: @@ -34,16 +34,16 @@ Info seq [hh:mm:ss:mss] request: "seq": 0, "type": "request", "arguments": { - "file": "/home/src/workspaces/project/c.ts" + "file": "/home/src/workspaces/project/folder/c.ts" }, "command": "open" } -Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { "rootNames": [ - "/home/src/workspaces/project/c.ts", + "/home/src/workspaces/project/folder/c.ts", "/home/src/workspaces/project/a.ts", "/home/src/workspaces/project/b.ts" ], @@ -58,7 +58,7 @@ Info seq [hh:mm:ss:mss] event: "event": "projectLoadingStart", "body": { "projectName": "/home/src/workspaces/project/tsconfig.json", - "reason": "Creating possible configured project for /home/src/workspaces/project/c.ts to open" + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open" } } Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info @@ -81,7 +81,7 @@ Info seq [hh:mm:ss:mss] Files (6) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text - /home/src/workspaces/project/c.ts SVC-1-0 "" + /home/src/workspaces/project/folder/c.ts SVC-1-0 "" /home/src/workspaces/project/a.ts Text-1 "export const abc = 10;" /home/src/workspaces/project/b.ts Text-1 "import { abc } from \"./a\";\n\nconsole.log(abc);\n\n\nconsole.log(\"abc\");" @@ -92,7 +92,7 @@ Info seq [hh:mm:ss:mss] Files (6) Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' - c.ts + folder/c.ts Part of 'files' list in tsconfig.json a.ts Part of 'files' list in tsconfig.json @@ -116,7 +116,7 @@ Info seq [hh:mm:ss:mss] event: "type": "event", "event": "configFileDiag", "body": { - "triggerFile": "/home/src/workspaces/project/c.ts", + "triggerFile": "/home/src/workspaces/project/folder/c.ts", "configFile": "/home/src/workspaces/project/tsconfig.json", "diagnostics": [] } @@ -126,7 +126,7 @@ Info seq [hh:mm:ss:mss] Files (6) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: -Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/c.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json Info seq [hh:mm:ss:mss] response: { @@ -191,7 +191,7 @@ ScriptInfos:: version: Text-1 containingProjects: 1 /home/src/workspaces/project/tsconfig.json -/home/src/workspaces/project/c.ts (Open) *new* +/home/src/workspaces/project/folder/c.ts (Open) *new* version: SVC-1-0 containingProjects: 1 /home/src/workspaces/project/tsconfig.json *default* @@ -242,7 +242,7 @@ Info seq [hh:mm:ss:mss] request: "seq": 2, "type": "request", "arguments": { - "file": "/home/src/workspaces/project/c.ts", + "file": "/home/src/workspaces/project/folder/c.ts", "pastedText": [ "console.log(abc);" ], @@ -283,7 +283,7 @@ Info seq [hh:mm:ss:mss] Files (6) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text - /home/src/workspaces/project/c.ts SVC-1-1 "console.log(abc);" + /home/src/workspaces/project/folder/c.ts SVC-1-1 "console.log(abc);" /home/src/workspaces/project/a.ts Text-1 "export const abc = 10;" /home/src/workspaces/project/b.ts Text-1 "import { abc } from \"./a\";\n\nconsole.log(abc);\n\n\nconsole.log(\"abc\");" @@ -303,7 +303,7 @@ Info seq [hh:mm:ss:mss] response: "body": { "edits": [ { - "fileName": "/home/src/workspaces/project/c.ts", + "fileName": "/home/src/workspaces/project/folder/c.ts", "textChanges": [ { "start": { @@ -314,7 +314,7 @@ Info seq [hh:mm:ss:mss] response: "line": 1, "offset": 1 }, - "newText": "import { abc } from \"./a\";\n\n" + "newText": "import { abc } from \"../a\";\n\n" }, { "start": { @@ -362,7 +362,7 @@ ScriptInfos:: version: Text-1 containingProjects: 1 /home/src/workspaces/project/tsconfig.json -/home/src/workspaces/project/c.ts (Open) *changed* +/home/src/workspaces/project/folder/c.ts (Open) *changed* version: SVC-1-2 *changed* containingProjects: 1 /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultExport1.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultExport1.js new file mode 100644 index 0000000000000..96d4f54a4ab44 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultExport1.js @@ -0,0 +1,366 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +export default function foo(name: string): void { + console.log(name); +} + +//// [/home/src/workspaces/project/b.ts] +import foo from "./a"; +const b = foo("bar"); + +//// [/home/src/workspaces/project/folder/c.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["folder/c.ts", "a.ts", "b.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/folder/c.ts", + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/b.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/b.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.ts SVC-1-0 "" + /home/src/workspaces/project/a.ts Text-1 "export default function foo(name: string): void {\n console.log(name);\n}" + /home/src/workspaces/project/b.ts Text-1 "import foo from \"./a\";\nconst b = foo(\"bar\");" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + folder/c.ts + Part of 'files' list in tsconfig.json + a.ts + Part of 'files' list in tsconfig.json + Imported via "./a" from file 'b.ts' + b.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/c.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/b.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/b.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.ts", + "pastedText": [ + "const b = foo(\"bar\");" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/b.ts", + "spans": [ + { + "start": { + "line": 2, + "offset": 1 + }, + "end": { + "line": 2, + "offset": 22 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.ts SVC-1-1 "const b = foo(\"bar\");" + /home/src/workspaces/project/a.ts Text-1 "export default function foo(name: string): void {\n console.log(name);\n}" + /home/src/workspaces/project/b.ts Text-1 "import foo from \"./a\";\nconst b = foo(\"bar\");" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] getExportInfoMap: cache miss or empty; calculating new results +Info seq [hh:mm:ss:mss] getExportInfoMap: done in * ms +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/folder/c.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import foo from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "const b = foo(\"bar\");" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/b.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultExport2.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultExport2.js new file mode 100644 index 0000000000000..6a5eaf2e4d5c6 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultExport2.js @@ -0,0 +1,344 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +const b = foo("bar"); + export default function foo(name: string): void { + console.log(name); + } + +//// [/home/src/workspaces/project/folder/c.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["folder/c.ts", "a.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/folder/c.ts", + "/home/src/workspaces/project/a.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.ts SVC-1-0 "" + /home/src/workspaces/project/a.ts Text-1 "const b = foo(\"bar\");\n export default function foo(name: string): void {\n console.log(name);\n }" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + folder/c.ts + Part of 'files' list in tsconfig.json + a.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/c.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.ts", + "pastedText": [ + "const b = foo(\"bar\");" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 22 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.ts SVC-1-1 "const b = foo(\"bar\");" + /home/src/workspaces/project/a.ts Text-1 "const b = foo(\"bar\");\n export default function foo(name: string): void {\n console.log(name);\n }" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/folder/c.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import foo from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "const b = foo(\"bar\");" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultImport.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultImport.js new file mode 100644 index 0000000000000..a3d38c09021da --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_defaultImport.js @@ -0,0 +1,387 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/folder/a.ts] +const abc = 10; +const def = 20; +export interface testInterface { + abc: number; + def: number; +} + +//// [/home/src/workspaces/project/folder/b.mts] +import test from "./a.js"; + +function foo(abc: test.testInterface, def: test.testInterface) { + console.log(abc); + console.log(def); +} + + +//// [/home/src/workspaces/project/folder/folder/c.ts] + + +//// [/home/src/workspaces/project/folder/tsconfig.json] +{ "compilerOptions": { "module": "nodenext" }, "files": ["folder/c.ts", "a.ts", "b.mts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/folder/c.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/folder/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/folder/tsconfig.json, currentDirectory: /home/src/workspaces/project/folder +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/folder/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/folder/folder/c.ts", + "/home/src/workspaces/project/folder/a.ts", + "/home/src/workspaces/project/folder/b.mts" + ], + "options": { + "module": 199, + "configFilePath": "/home/src/workspaces/project/folder/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/folder/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/folder/c.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/b.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/folder/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/folder/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + /home/src/workspaces/project/folder/folder/c.ts SVC-1-0 "" + /home/src/workspaces/project/folder/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}" + /home/src/workspaces/project/folder/b.mts Text-1 "import test from \"./a.js\";\n\nfunction foo(abc: test.testInterface, def: test.testInterface) {\n console.log(abc);\n console.log(def);\n}\n" + + + folder/c.ts + Part of 'files' list in tsconfig.json + File is CommonJS module because 'package.json' was not found + a.ts + Part of 'files' list in tsconfig.json + Imported via "./a.js" from file 'b.mts' + File is CommonJS module because 'package.json' was not found + b.mts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/folder/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/folder/c.ts", + "configFile": "/home/src/workspaces/project/folder/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/folder/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/folder/c.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/folder/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/folder/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/folder/b.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/folder/folder/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/folder/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/folder/tsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/folder/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/folder/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/workspaces/project/folder/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/folder/tsconfig.json +/home/src/workspaces/project/folder/b.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/folder/tsconfig.json +/home/src/workspaces/project/folder/folder/c.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/folder/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/folder/c.ts", + "pastedText": [ + "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/folder/b.mts", + "spans": [ + { + "start": { + "line": 3, + "offset": 1 + }, + "end": { + "line": 6, + "offset": 2 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/folder/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + /home/src/workspaces/project/folder/folder/c.ts SVC-1-1 "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}" + /home/src/workspaces/project/folder/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}" + /home/src/workspaces/project/folder/b.mts Text-1 "import test from \"./a.js\";\n\nfunction foo(abc: test.testInterface, def: test.testInterface) {\n console.log(abc);\n console.log(def);\n}\n" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/folder/folder/c.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import test from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/folder/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/workspaces/project/folder/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/folder/tsconfig.json +/home/src/workspaces/project/folder/b.mts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/folder/tsconfig.json +/home/src/workspaces/project/folder/folder/c.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/folder/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_namespaceImport.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_namespaceImport.js new file mode 100644 index 0000000000000..7cde663d43d2a --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_namespaceImport.js @@ -0,0 +1,372 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +const abc = 10; +const def = 20; +export interface testInterface { + abc: number; + def: number; +} + +//// [/home/src/workspaces/project/b.ts] +import * as test from "./a"; + +function foo(abc: test.abc, def: test.def) { + console.log(abc); + console.log(def); +} + + +//// [/home/src/workspaces/project/folder/c.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["folder/c.ts", "a.ts", "b.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/folder/c.ts", + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/b.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/b.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.ts SVC-1-0 "" + /home/src/workspaces/project/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}" + /home/src/workspaces/project/b.ts Text-1 "import * as test from \"./a\";\n\nfunction foo(abc: test.abc, def: test.def) {\n console.log(abc);\n console.log(def);\n}\n" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + folder/c.ts + Part of 'files' list in tsconfig.json + a.ts + Part of 'files' list in tsconfig.json + Imported via "./a" from file 'b.ts' + b.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/c.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/b.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/b.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.ts", + "pastedText": [ + "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/b.ts", + "spans": [ + { + "start": { + "line": 3, + "offset": 1 + }, + "end": { + "line": 6, + "offset": 2 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.ts SVC-1-1 "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}" + /home/src/workspaces/project/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}" + /home/src/workspaces/project/b.ts Text-1 "import * as test from \"./a\";\n\nfunction foo(abc: test.abc, def: test.def) {\n console.log(abc);\n console.log(def);\n}\n" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/folder/c.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import * as test from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/b.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection0.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection0.js new file mode 100644 index 0000000000000..4a14f70dca8c4 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection0.js @@ -0,0 +1,317 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } +const x = foo() + +foo() +x + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\nfoo()\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\nfoo()\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection1.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection1.js new file mode 100644 index 0000000000000..40e467f44ba61 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection1.js @@ -0,0 +1,361 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } +const x = foo() + +foo() +x + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\nfoo()\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo()" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 4, + "offset": 1 + }, + "end": { + "line": 4, + "offset": 6 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\nfoo()\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo()" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo()" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection2.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection2.js new file mode 100644 index 0000000000000..f2fb7a3ef0bff --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection2.js @@ -0,0 +1,360 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } + +// comment +foo() + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n// comment\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo()" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 4, + "offset": 1 + }, + "end": { + "line": 4, + "offset": 6 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n// comment\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo()" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo()" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection3.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection3.js new file mode 100644 index 0000000000000..654d91f5b0f40 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection3.js @@ -0,0 +1,360 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } + +/* comment */ +foo() + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n/* comment */\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo()" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 4, + "offset": 1 + }, + "end": { + "line": 4, + "offset": 6 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n/* comment */\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo()" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo()" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection4.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection4.js new file mode 100644 index 0000000000000..486c454f23563 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection4.js @@ -0,0 +1,363 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } + +/* + comment + more comment +*/ +foo() + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n/*\n comment\n more comment\n*/\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + " comment\n more comment\n*/\nfoo()" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 4, + "offset": 1 + }, + "end": { + "line": 7, + "offset": 6 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n/*\n comment\n more comment\n*/\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-1 " comment\n more comment\n*/\nfoo()" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\"\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": " comment\n more comment\n*/\nfoo()" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection5.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection5.js new file mode 100644 index 0000000000000..0973168714713 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection5.js @@ -0,0 +1,360 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } + +// comment +foo() + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n// comment\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "// comment\nfoo()" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 3, + "offset": 1 + }, + "end": { + "line": 4, + "offset": 6 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n// comment\nfoo()" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "// comment\nfoo()" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "// comment\nfoo()" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection6.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection6.js new file mode 100644 index 0000000000000..c7ef87ebe9484 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection6.js @@ -0,0 +1,374 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } +const x = foo() + +// comment +foo() +/* another comment */ +x + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\n// comment\nfoo()\n/* another comment */\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo()\n/* another comment */\nx" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 5, + "offset": 1 + }, + "end": { + "line": 7, + "offset": 2 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\n// comment\nfoo()\n/* another comment */\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo()\n/* another comment */\nx" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + }, + { + "start": { + "line": 2, + "offset": 1 + }, + "end": { + "line": 2, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo, x } from \"../a\"\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo()\n/* another comment */\nx" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection7.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection7.js new file mode 100644 index 0000000000000..0cbcb672121d1 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection7.js @@ -0,0 +1,363 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } +const x = foo() + +// comment +foo +/* another comment */ +x + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\n// comment\nfoo\n/* another comment */\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo\n/* another comment */" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 5, + "offset": 1 + }, + "end": { + "line": 6, + "offset": 22 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst x = foo()\n\n// comment\nfoo\n/* another comment */\nx" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo\n/* another comment */" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo\n/* another comment */" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection8.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection8.js new file mode 100644 index 0000000000000..78726e80feb76 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection8.js @@ -0,0 +1,363 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } +const aaaa = foo() + +// comment +foo +/* another comment */ +aaaa + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst aaaa = foo()\n\n// comment\nfoo\n/* another comment */\naaaa" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo\n/* another comment */\na" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 5, + "offset": 1 + }, + "end": { + "line": 7, + "offset": 2 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\nconst aaaa = foo()\n\n// comment\nfoo\n/* another comment */\naaaa" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo\n/* another comment */\na" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\"\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo\n/* another comment */\na" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection9.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection9.js new file mode 100644 index 0000000000000..bc48dcb20e8e8 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection9.js @@ -0,0 +1,361 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/a.ts] +function foo() { } + +// comment +foo +/* another comment */ + +//// [/home/src/workspaces/project/folder/target.ts] + + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["a.ts", "folder/target.ts"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/a.ts", + "/home/src/workspaces/project/folder/target.ts" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/target.ts to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n// comment\nfoo\n/* another comment */" + /home/src/workspaces/project/folder/target.ts SVC-1-0 "" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + a.ts + Part of 'files' list in tsconfig.json + folder/target.ts + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/target.ts", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/target.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/target.ts", + "pastedText": [ + "foo" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/a.ts", + "spans": [ + { + "start": { + "line": 4, + "offset": 1 + }, + "end": { + "line": 4, + "offset": 4 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/a.ts Text-1 "function foo() { }\n\n// comment\nfoo\n/* another comment */" + /home/src/workspaces/project/folder/target.ts SVC-1-1 "foo" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/a.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "export " + } + ] + }, + { + "fileName": "/home/src/workspaces/project/folder/target.ts", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "import { foo } from \"../a\";\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "foo" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/a.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/target.ts (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_requireImportJsx.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_requireImportJsx.js new file mode 100644 index 0000000000000..7ca17ad0ab4ef --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_requireImportJsx.js @@ -0,0 +1,377 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/b.jsx] +import React = require("./react"); + +class MyComponent extends React.Component { + render() { + return
; + } +} + +//// [/home/src/workspaces/project/folder/c.jsx] + + +//// [/home/src/workspaces/project/react.d.ts] +export = React; +export as namespace React; +declare namespace React { + class Component {} +} + +//// [/home/src/workspaces/project/tsconfig.json] +{ "files": ["folder/c.jsx", "react.d.ts", "b.jsx"] } + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.jsx" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.jsx ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/folder/c.jsx", + "/home/src/workspaces/project/react.d.ts", + "/home/src/workspaces/project/b.jsx" + ], + "options": { + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.jsx to open" + } + } +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/react.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/b.jsx 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.jsx SVC-1-0 "" + /home/src/workspaces/project/react.d.ts Text-1 "export = React;\nexport as namespace React;\ndeclare namespace React {\n class Component {}\n}" + /home/src/workspaces/project/b.jsx Text-1 "import React = require(\"./react\");\n\nclass MyComponent extends React.Component {\n render() {\n return
;\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + folder/c.jsx + Part of 'files' list in tsconfig.json + react.d.ts + Part of 'files' list in tsconfig.json + Imported via "./react" from file 'b.jsx' + b.jsx + Part of 'files' list in tsconfig.json + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/folder/c.jsx", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.jsx ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/b.jsx: *new* + {"pollingInterval":500} +/home/src/workspaces/project/react.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectories:: +/home/src/workspaces/project: *new* + {} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/b.jsx *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.jsx (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/react.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "formatOptions": { + "indentSize": 4, + "tabSize": 4, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "indentStyle": 2, + "insertSpaceAfterConstructor": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, + "insertSpaceBeforeFunctionParenthesis": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false, + "semicolons": "ignore", + "trimTrailingWhitespace": true, + "indentSwitchCase": true + } + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] Format host information updated +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 1, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/folder/c.jsx", + "pastedText": [ + "class MyComponent extends React.Component {\n render() {\n return
;\n }\n}" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + } + } + ], + "copiedFrom": { + "file": "/home/src/workspaces/project/b.jsx", + "spans": [ + { + "start": { + "line": 3, + "offset": 1 + }, + "end": { + "line": 7, + "offset": 2 + } + } + ] + } + }, + "command": "getPasteEdits" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/folder/c.jsx SVC-1-1 "class MyComponent extends React.Component {\n render() {\n return
;\n }\n}" + /home/src/workspaces/project/react.d.ts Text-1 "export = React;\nexport as namespace React;\ndeclare namespace React {\n class Component {}\n}" + /home/src/workspaces/project/b.jsx Text-1 "import React = require(\"./react\");\n\nclass MyComponent extends React.Component {\n render() {\n return
;\n }\n}" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "getPasteEdits", + "request_seq": 2, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "edits": [ + { + "fileName": "/home/src/workspaces/project/folder/c.jsx", + "textChanges": [ + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "const React = require(\"../react\");\n\n" + }, + { + "start": { + "line": 1, + "offset": 1 + }, + "end": { + "line": 1, + "offset": 1 + }, + "newText": "class MyComponent extends React.Component {\n render() {\n return
;\n }\n}" + } + ] + } + ], + "fixId": "providePostPasteEdits" + } + } +After Request +Projects:: +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 1 + dirty: true *changed* + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/b.jsx + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/folder/c.jsx (Open) *changed* + version: SVC-1-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/react.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard1.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard1.js new file mode 100644 index 0000000000000..afab97fce62d7 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard1.js @@ -0,0 +1,524 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "foo", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "imports": { + "#*": { + "types": "./dist/*.d.ts", + "import": "./dist/*.mjs", + "default": "./dist/*.js" + }, + "#arguments": { + "types": "./dist/arguments/index.d.ts", + "import": "./dist/arguments/index.mjs", + "default": "./dist/arguments/index.js" + } + } +} + +//// [/home/src/workspaces/project/src/arguments/index.ts] +export const arguments = 0; + +//// [/home/src/workspaces/project/src/blah.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/index.ts] +export const index = 0; + +//// [/home/src/workspaces/project/src/m.mts] +import { } from ""; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/blah.ts", + "/home/src/workspaces/project/src/index.ts", + "/home/src/workspaces/project/src/m.mts", + "/home/src/workspaces/project/src/arguments/index.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/m.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/arguments/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/arguments/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/m.mts Text-1 "import { } from \"\";" + /home/src/workspaces/project/src/arguments/index.ts Text-1 "export const arguments = 0;" + + + src/blah.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/m.mts + Matched by default include pattern '**/*' + src/arguments/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/arguments/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/arguments/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/blah.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/m.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/arguments/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/blah.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/m.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/m.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/m.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/m.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/m.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/arguments/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/arguments/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/m.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/arguments/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/m.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/m.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#index", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#arguments", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard2.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard2.js new file mode 100644 index 0000000000000..90fe6d8133481 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard2.js @@ -0,0 +1,2182 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "salesforce-pageobjects", + "version": "1.0.0", + "imports": { + "#*": { + "types": "./dist/*.d.ts", + "import": "./dist/*.mjs", + "default": "./dist/*.js" + } + } +} + +//// [/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts] +export const actionRenderer = 0; + +//// [/home/src/workspaces/project/src/index.mts] +import { } from ""; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/index.mts", + "/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/action/pageObjects/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/action/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/index.mts Text-1 "import { } from \"\";" + /home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts Text-1 "export const actionRenderer = 0;" + + + src/index.mts + Matched by default include pattern '**/*' + src/action/pageObjects/actionRenderer.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/action/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/action/pageObjects/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/index.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/action/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/action/pageObjects/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/index.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#action", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 4, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18, + "endLine": 1, + "endOffset": 18, + "insertString": "" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 4, + "success": true + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 2 *changed* + projectProgramVersion: 1 + dirty: true *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-1 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 5, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18, + "endLine": 1, + "endOffset": 18, + "insertString": "#" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 5, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 6, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 19, + "key": "#" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 6, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 7, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 19, + "endLine": 1, + "endOffset": 19, + "insertString": "a" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 7, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-3 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 8, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 20, + "key": "a" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 8, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 9, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 20, + "endLine": 1, + "endOffset": 20, + "insertString": "c" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 9, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-4 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 10, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 21, + "key": "c" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 10, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 11, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 21, + "endLine": 1, + "endOffset": 21, + "insertString": "t" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 11, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-5 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 12, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 22, + "key": "t" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 12, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 13, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 22, + "endLine": 1, + "endOffset": 22, + "insertString": "i" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 13, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-6 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 14, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 23, + "key": "i" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 14, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 15, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 23, + "endLine": 1, + "endOffset": 23, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 15, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-7 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 16, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 24, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 16, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 17, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 24, + "endLine": 1, + "endOffset": 24, + "insertString": "n" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 17, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-8 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 18, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 25, + "key": "n" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 18, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 19, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 25, + "endLine": 1, + "endOffset": 25, + "insertString": "/" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 19, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-9 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 20, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 26, + "key": "/" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 20, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 21, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 21, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 22, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 26 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/dist 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/dist 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/index.mts SVC-2-9 "import { } from \"#action/\";" + /home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts Text-1 "export const actionRenderer = 0;" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 22, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "pageObjects", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/action/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/action/pageObjects/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} + {} *new* +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/dist: *new* + {} +/home/src/workspaces/project/node_modules: + {} + {} *new* +/home/src/workspaces/project/node_modules/@types: + {} + {} +/home/src/workspaces/project/src: *new* + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 2 + projectProgramVersion: 2 *changed* + dirty: false *changed* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 23, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 26, + "endLine": 1, + "endOffset": 26, + "insertString": "" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 23, + "success": true + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 2 + dirty: true *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-10 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 24, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 26, + "endLine": 1, + "endOffset": 26, + "insertString": "p" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 24, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-11 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 25, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 27, + "key": "p" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 25, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 26, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 27, + "endLine": 1, + "endOffset": 27, + "insertString": "a" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 26, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-12 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 27, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 28, + "key": "a" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 27, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 28, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 28, + "endLine": 1, + "endOffset": 28, + "insertString": "g" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 28, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-13 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 29, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 29, + "key": "g" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 29, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 30, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 29, + "endLine": 1, + "endOffset": 29, + "insertString": "e" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 30, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-14 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 31, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 30, + "key": "e" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 31, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 32, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 30, + "endLine": 1, + "endOffset": 30, + "insertString": "O" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 32, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-15 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 33, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 31, + "key": "O" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 33, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 34, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 31, + "endLine": 1, + "endOffset": 31, + "insertString": "b" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 34, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-16 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 35, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 32, + "key": "b" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 35, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 36, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 32, + "endLine": 1, + "endOffset": 32, + "insertString": "j" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 36, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-17 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 37, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 33, + "key": "j" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 37, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 38, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 33, + "endLine": 1, + "endOffset": 33, + "insertString": "e" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 38, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-18 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 39, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 34, + "key": "e" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 39, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 40, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 34, + "endLine": 1, + "endOffset": 34, + "insertString": "c" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 40, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-19 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 41, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 35, + "key": "c" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 41, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 42, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 35, + "endLine": 1, + "endOffset": 35, + "insertString": "t" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 42, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-20 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 43, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 36, + "key": "t" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 43, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 44, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 36, + "endLine": 1, + "endOffset": 36, + "insertString": "s" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 44, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-21 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 45, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 37, + "key": "s" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 45, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 46, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 37, + "endLine": 1, + "endOffset": 37, + "insertString": "/" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 46, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + version: SVC-2-22 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 47, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 38, + "key": "/" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 47, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 48, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 48, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 49, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 38 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 3 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/index.mts SVC-2-22 "import { } from \"#action/pageObjects/\";" + /home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts Text-1 "export const actionRenderer = 0;" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 49, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "actionRenderer", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 + projectProgramVersion: 3 *changed* + dirty: false *changed* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard3.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard3.js new file mode 100644 index 0000000000000..1a110a97b2ad2 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard3.js @@ -0,0 +1,2484 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/nope.ts] +export const nope = 0; + +//// [/home/src/workspaces/project/package.json] +{ + "types": "index.d.ts", + "imports": { + "#component-*": { + "types@>=4.3.5": "types/components/*.d.ts" + } + } +} + +//// [/home/src/workspaces/project/src/a.ts] +import { } from ""; + +//// [/home/src/workspaces/project/src/components/blah.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/components/index.ts] +export const index = 0; + +//// [/home/src/workspaces/project/src/components/subfolder/one.ts] +export const one = 0; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist", + "declarationDir": "types" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/nope.ts", + "/home/src/workspaces/project/src/a.ts", + "/home/src/workspaces/project/src/components/blah.ts", + "/home/src/workspaces/project/src/components/index.ts", + "/home/src/workspaces/project/src/components/subfolder/one.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "declarationDir": "/home/src/workspaces/project/types", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/nope.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/components/blah.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/components/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/components/subfolder/one.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/components/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/components/subfolder/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/workspaces/project/nope.ts Text-1 "export const nope = 0;" + /home/src/workspaces/project/src/a.ts Text-1 "import { } from \"\";" + /home/src/workspaces/project/src/components/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/components/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/components/subfolder/one.ts Text-1 "export const one = 0;" + + + nope.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/a.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/components/blah.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/components/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/components/subfolder/one.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "File '/home/src/workspaces/project/nope.ts' is not under 'rootDir' '/home/src/workspaces/project/src'. 'rootDir' is expected to contain all source files.\n The file is in the program because:\n Matched by default include pattern '**/*'\n File is CommonJS module because '/home/src/workspaces/project/package.json' does not have field \"type\"", + "code": 6059, + "category": "error" + }, + { + "start": { + "line": 6, + "offset": 5 + }, + "end": { + "line": 6, + "offset": 21 + }, + "text": "Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'.", + "code": 5069, + "category": "error", + "fileName": "/home/src/workspaces/project/tsconfig.json" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\",\n \"declarationDir\": \"types\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/nope.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/components/blah.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/components/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/components/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/components/subfolder/one.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/components/subfolder/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/blah.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.ts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/nope.ts: + {"pollingInterval":500} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/components/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/components/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/components/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/components/subfolder/one.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/components/subfolder/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.ts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#component-blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#component-index", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#component-subfolder", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 4, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 18, + "endLine": 1, + "endOffset": 18, + "insertString": "" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 4, + "success": true + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 2 *changed* + projectProgramVersion: 1 + dirty: true *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-1 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 5, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 18, + "endLine": 1, + "endOffset": 18, + "insertString": "#" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 5, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 6, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 19, + "key": "#" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 6, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 7, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 19, + "endLine": 1, + "endOffset": 19, + "insertString": "c" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 7, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-3 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 8, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 20, + "key": "c" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 8, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 9, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 20, + "endLine": 1, + "endOffset": 20, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 9, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-4 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 10, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 21, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 10, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 11, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 21, + "endLine": 1, + "endOffset": 21, + "insertString": "m" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 11, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-5 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 12, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 22, + "key": "m" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 12, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 13, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 22, + "endLine": 1, + "endOffset": 22, + "insertString": "p" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 13, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-6 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 14, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 23, + "key": "p" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 14, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 15, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 23, + "endLine": 1, + "endOffset": 23, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 15, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-7 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 16, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 24, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 16, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 17, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 24, + "endLine": 1, + "endOffset": 24, + "insertString": "n" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 17, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-8 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 18, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 25, + "key": "n" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 18, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 19, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 25, + "endLine": 1, + "endOffset": 25, + "insertString": "e" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 19, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-9 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 20, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 26, + "key": "e" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 20, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 21, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 26, + "endLine": 1, + "endOffset": 26, + "insertString": "n" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 21, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-10 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 22, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 27, + "key": "n" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 22, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 23, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 27, + "endLine": 1, + "endOffset": 27, + "insertString": "t" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 23, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-11 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 24, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 28, + "key": "t" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 24, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 25, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 28, + "endLine": 1, + "endOffset": 28, + "insertString": "-" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 25, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-12 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 26, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 29, + "key": "-" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 26, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 27, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 29, + "endLine": 1, + "endOffset": 29, + "insertString": "s" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 27, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-13 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 28, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 30, + "key": "s" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 28, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 29, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 30, + "endLine": 1, + "endOffset": 30, + "insertString": "u" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 29, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-14 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 30, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 31, + "key": "u" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 30, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 31, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 31, + "endLine": 1, + "endOffset": 31, + "insertString": "b" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 31, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-15 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 32, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 32, + "key": "b" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 32, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 33, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 32, + "endLine": 1, + "endOffset": 32, + "insertString": "f" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 33, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-16 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 34, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 33, + "key": "f" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 34, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 35, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 33, + "endLine": 1, + "endOffset": 33, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 35, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-17 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 36, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 34, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 36, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 37, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 34, + "endLine": 1, + "endOffset": 34, + "insertString": "l" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 37, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-18 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 38, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 35, + "key": "l" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 38, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 39, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 35, + "endLine": 1, + "endOffset": 35, + "insertString": "d" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 39, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-19 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 40, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 36, + "key": "d" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 40, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 41, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 36, + "endLine": 1, + "endOffset": 36, + "insertString": "e" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 41, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-20 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 42, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 37, + "key": "e" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 42, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 43, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 37, + "endLine": 1, + "endOffset": 37, + "insertString": "r" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 43, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-21 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 44, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 38, + "key": "r" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 44, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 45, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 38, + "endLine": 1, + "endOffset": 38, + "insertString": "/" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 45, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.ts (Open) *changed* + version: SVC-2-22 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/components/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/components/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 46, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 39, + "key": "/" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 46, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 47, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 47, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 48, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.ts", + "line": 1, + "offset": 39 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/workspaces/project/nope.ts Text-1 "export const nope = 0;" + /home/src/workspaces/project/src/a.ts SVC-2-22 "import { } from \"#component-subfolder/\";" + /home/src/workspaces/project/src/components/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/components/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/components/subfolder/one.ts Text-1 "export const one = 0;" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 48, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "one", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/nope.ts: + {"pollingInterval":500} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/components/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/components/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/components/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/components/subfolder/one.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/components/subfolder/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} + {} *new* +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} + {} *new* +/home/src/workspaces/project/node_modules/@types: + {} + {} +/home/src/workspaces/project/src: *new* + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 2 + projectProgramVersion: 2 *changed* + dirty: false *changed* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard4.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard4.js new file mode 100644 index 0000000000000..63b86885267c4 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard4.js @@ -0,0 +1,1747 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/nope.ts] +export const nope = 0; + +//// [/home/src/workspaces/project/package.json] +{ + "types": "index.d.ts", + "imports": { + "#*": "dist/*", + "#foo/*": "dist/*", + "#bar/*": "dist/*", + "#exact-match": "dist/index.d.ts" + } +} + +//// [/home/src/workspaces/project/src/a.mts] +import { } from ""; + +//// [/home/src/workspaces/project/src/blah.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/foo/onlyInFooFolder.ts] +export const foo = 0; + +//// [/home/src/workspaces/project/src/index.ts] +export const index = 0; + +//// [/home/src/workspaces/project/src/subfolder/one.ts] +export const one = 0; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/nope.ts", + "/home/src/workspaces/project/src/a.mts", + "/home/src/workspaces/project/src/blah.ts", + "/home/src/workspaces/project/src/index.ts", + "/home/src/workspaces/project/src/foo/onlyInFooFolder.ts", + "/home/src/workspaces/project/src/subfolder/one.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/nope.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/a.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/foo/onlyInFooFolder.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/subfolder/one.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/foo/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/subfolder/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/workspaces/project/nope.ts Text-1 "export const nope = 0;" + /home/src/workspaces/project/src/a.mts Text-1 "import { } from \"\";" + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/foo/onlyInFooFolder.ts Text-1 "export const foo = 0;" + /home/src/workspaces/project/src/subfolder/one.ts Text-1 "export const one = 0;" + + + nope.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/a.mts + Matched by default include pattern '**/*' + src/blah.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/foo/onlyInFooFolder.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/subfolder/one.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "File '/home/src/workspaces/project/nope.ts' is not under 'rootDir' '/home/src/workspaces/project/src'. 'rootDir' is expected to contain all source files.\n The file is in the program because:\n Matched by default include pattern '**/*'\n File is CommonJS module because '/home/src/workspaces/project/package.json' does not have field \"type\"", + "code": 6059, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/nope.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/a.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/blah.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/foo/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/subfolder/one.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/subfolder/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/blah.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/a.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/a.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/a.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/nope.ts: + {"pollingInterval":500} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/foo/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/subfolder/one.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/subfolder/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/a.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#a.mjs", + "kind": "script", + "kindModifiers": ".mjs", + "sortText": "11" + }, + { + "name": "#blah.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + }, + { + "name": "#index.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + }, + { + "name": "#foo", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#subfolder", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#bar", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#exact-match", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 4, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 18, + "endLine": 1, + "endOffset": 18, + "insertString": "" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 4, + "success": true + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 2 *changed* + projectProgramVersion: 1 + dirty: true *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-1 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 5, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 18, + "endLine": 1, + "endOffset": 18, + "insertString": "#" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 5, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-2 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 6, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 19, + "key": "#" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 6, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 7, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 19, + "endLine": 1, + "endOffset": 19, + "insertString": "f" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 7, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-3 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 8, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 20, + "key": "f" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 8, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 9, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 20, + "endLine": 1, + "endOffset": 20, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 9, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-4 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 10, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 21, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 10, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 11, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 21, + "endLine": 1, + "endOffset": 21, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 11, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-5 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 12, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 22, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 12, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 13, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 22, + "endLine": 1, + "endOffset": 22, + "insertString": "/" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 13, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-6 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 14, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 23, + "key": "/" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 14, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 15, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 15, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 16, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 23 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/workspaces/project/nope.ts Text-1 "export const nope = 0;" + /home/src/workspaces/project/src/a.mts SVC-2-6 "import { } from \"#foo/\";" + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/foo/onlyInFooFolder.ts Text-1 "export const foo = 0;" + /home/src/workspaces/project/src/subfolder/one.ts Text-1 "export const one = 0;" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 16, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "a.mjs", + "kind": "script", + "kindModifiers": ".mjs", + "sortText": "11" + }, + { + "name": "blah.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + }, + { + "name": "index.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + }, + { + "name": "foo", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "subfolder", + "kind": "directory", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/nope.ts: + {"pollingInterval":500} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/foo/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/subfolder/one.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/subfolder/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} + {} *new* +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} + {} *new* +/home/src/workspaces/project/node_modules/@types: + {} + {} +/home/src/workspaces/project/src: *new* + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 2 + projectProgramVersion: 2 *changed* + dirty: false *changed* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 17, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 23, + "endLine": 1, + "endOffset": 23, + "insertString": "" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 17, + "success": true + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 *changed* + projectProgramVersion: 2 + dirty: true *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-7 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 18, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 23, + "endLine": 1, + "endOffset": 23, + "insertString": "f" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 18, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-8 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 19, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 24, + "key": "f" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 19, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 20, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 24, + "endLine": 1, + "endOffset": 24, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 20, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-9 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 21, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 25, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 21, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 22, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 25, + "endLine": 1, + "endOffset": 25, + "insertString": "o" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 22, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-10 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 23, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 26, + "key": "o" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 23, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 24, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 26, + "endLine": 1, + "endOffset": 26, + "insertString": "/" + }, + "command": "change" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "change", + "request_seq": 24, + "success": true + } +After Request +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/nope.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/a.mts (Open) *changed* + version: SVC-2-11 *changed* + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/foo/onlyInFooFolder.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/subfolder/one.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 25, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 27, + "key": "/" + }, + "command": "formatonkey" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "formatonkey", + "request_seq": 25, + "success": true, + "body": [] + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 26, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 26, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 27, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/a.mts", + "line": 1, + "offset": 27 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 3 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (6) + /home/src/workspaces/project/nope.ts Text-1 "export const nope = 0;" + /home/src/workspaces/project/src/a.mts SVC-2-11 "import { } from \"#foo/foo/\";" + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/foo/onlyInFooFolder.ts Text-1 "export const foo = 0;" + /home/src/workspaces/project/src/subfolder/one.ts Text-1 "export const one = 0;" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 27, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + }, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "onlyInFooFolder.js", + "kind": "script", + "kindModifiers": ".js", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } +After Request +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 3 + projectProgramVersion: 3 *changed* + dirty: false *changed* diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard5.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard5.js new file mode 100644 index 0000000000000..27f4085657a32 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard5.js @@ -0,0 +1,560 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "foo", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "imports": { + "#*": { + "import": { + "types": "./dist/types/*.d.mts", + "default": "./dist/esm/*.mjs" + }, + "default": { + "types": "./dist/types/*.d.ts", + "default": "./dist/cjs/*.js" + } + }, + "#only-in-cjs": { + "require": { + "types": "./dist/types/only-in-cjs/index.d.ts", + "default": "./dist/cjs/only-in-cjs/index.js" + } + } + } +} + +//// [/home/src/workspaces/project/src/blah.mts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/blah.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/index.mts] +import { } from ""; + +//// [/home/src/workspaces/project/src/index.ts] +export const index = 0; + +//// [/home/src/workspaces/project/src/only-in-cjs/index.ts] +export const onlyInCjs = 0; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist/esm", + "declarationDir": "dist/types" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/blah.mts", + "/home/src/workspaces/project/src/blah.ts", + "/home/src/workspaces/project/src/index.mts", + "/home/src/workspaces/project/src/index.ts", + "/home/src/workspaces/project/src/only-in-cjs/index.ts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist/esm", + "declarationDir": "/home/src/workspaces/project/dist/types", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/only-in-cjs/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/only-in-cjs/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + /home/src/workspaces/project/src/blah.mts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.mts Text-1 "import { } from \"\";" + /home/src/workspaces/project/src/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/only-in-cjs/index.ts Text-1 "export const onlyInCjs = 0;" + + + src/blah.mts + Matched by default include pattern '**/*' + src/blah.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.mts + Matched by default include pattern '**/*' + src/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/only-in-cjs/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "start": { + "line": 6, + "offset": 5 + }, + "end": { + "line": 6, + "offset": 21 + }, + "text": "Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'.", + "code": 5069, + "category": "error", + "fileName": "/home/src/workspaces/project/tsconfig.json" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist/esm\",\n \"declarationDir\": \"dist/types\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/blah.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/only-in-cjs/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/only-in-cjs/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/blah.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/only-in-cjs/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (5) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.mts: + {"pollingInterval":500} +/home/src/workspaces/project/src/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/only-in-cjs/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/only-in-cjs/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/index.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.mts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/only-in-cjs/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + }, + { + "name": "#index", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard6.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard6.js new file mode 100644 index 0000000000000..fb284dcc7a04b --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard6.js @@ -0,0 +1,477 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "foo", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "imports": { + "#*": "./dist/*?.d.ts" + } +} + +//// [/home/src/workspaces/project/src/blah?.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/index.ts] +export const index = 0; + +//// [/home/src/workspaces/project/src/m.mts] +import { } from ""; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/blah?.ts", + "/home/src/workspaces/project/src/index.ts", + "/home/src/workspaces/project/src/m.mts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah?.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/m.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + /home/src/workspaces/project/src/blah?.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.ts Text-1 "export const index = 0;" + /home/src/workspaces/project/src/m.mts Text-1 "import { } from \"\";" + + + src/blah?.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/m.mts + Matched by default include pattern '**/*' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah?.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/m.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah?.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/m.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/m.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/m.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/m.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (3) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/m.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah?.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/index.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/m.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah?.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/m.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/m.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard7.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard7.js new file mode 100644 index 0000000000000..e8b921a29c1b2 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard7.js @@ -0,0 +1,453 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "foo", + "imports": { + "#*": "./dist/*.js" + } +} + +//// [/home/src/workspaces/project/src/blah.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/index.mts] +import { } from ""; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/blah.ts", + "/home/src/workspaces/project/src/index.mts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.mts Text-1 "import { } from \"\";" + + + src/blah.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.mts + Matched by default include pattern '**/*' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/index.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard8.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard8.js new file mode 100644 index 0000000000000..e8b921a29c1b2 --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard8.js @@ -0,0 +1,453 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "foo", + "imports": { + "#*": "./dist/*.js" + } +} + +//// [/home/src/workspaces/project/src/blah.ts] +export const blah = 0; + +//// [/home/src/workspaces/project/src/index.mts] +import { } from ""; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist" + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/blah.ts", + "/home/src/workspaces/project/src/index.mts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/blah.ts Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.mts Text-1 "import { } from \"\";" + + + src/blah.ts + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.mts + Matched by default include pattern '**/*' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\"\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.ts: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/index.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard9.js b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard9.js new file mode 100644 index 0000000000000..a3e4748da892b --- /dev/null +++ b/tests/baselines/reference/tsserver/fourslashServer/pathCompletionsPackageJsonImportsSrcNoDistWildcard9.js @@ -0,0 +1,455 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +lib.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts] +lib.decorators.d.ts-Text + +//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts] +lib.decorators.legacy.d.ts-Text + +//// [/home/src/workspaces/project/package.json] +{ + "name": "foo", + "imports": { + "#*": "./dist/*.js" + } +} + +//// [/home/src/workspaces/project/src/blah.js] +export const blah = 0; + +//// [/home/src/workspaces/project/src/index.mts] +import { } from ""; + +//// [/home/src/workspaces/project/tsconfig.json] +{ + "compilerOptions": { + "module": "nodenext", + "rootDir": "src", + "outDir": "dist", + "allowJs": true + } +} + + +Info seq [hh:mm:ss:mss] request: + { + "seq": 0, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/tsconfig.json" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file +Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : { + "rootNames": [ + "/home/src/workspaces/project/src/blah.js", + "/home/src/workspaces/project/src/index.mts" + ], + "options": { + "module": 199, + "rootDir": "/home/src/workspaces/project/src", + "outDir": "/home/src/workspaces/project/dist", + "allowJs": true, + "configFilePath": "/home/src/workspaces/project/tsconfig.json" + } +} +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingStart", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json", + "reason": "Creating possible configured project for /home/src/workspaces/project/tsconfig.json to open" + } + } +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 1 undefined Config: /home/src/workspaces/project/tsconfig.json WatchType: Wild card directory +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/blah.js 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/src/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Missing file +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/workspaces/project/src/blah.js Text-1 "export const blah = 0;" + /home/src/workspaces/project/src/index.mts Text-1 "import { } from \"\";" + + + src/blah.js + Matched by default include pattern '**/*' + File is CommonJS module because 'package.json' does not have field "type" + src/index.mts + Matched by default include pattern '**/*' + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "projectLoadingFinish", + "body": { + "projectName": "/home/src/workspaces/project/tsconfig.json" + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "configFileDiag", + "body": { + "triggerFile": "/home/src/workspaces/project/tsconfig.json", + "configFile": "/home/src/workspaces/project/tsconfig.json", + "diagnostics": [ + { + "text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'", + "code": 6053, + "category": "error" + }, + { + "text": "Cannot find global type 'Array'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Boolean'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Function'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'IArguments'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Number'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'Object'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'RegExp'.", + "code": 2318, + "category": "error" + }, + { + "text": "Cannot find global type 'String'.", + "code": 2318, + "category": "error" + } + ] + } + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/workspaces/project +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text + /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text + /home/src/workspaces/project/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"rootDir\": \"src\",\n \"outDir\": \"dist\",\n \"allowJs\": true\n }\n}" + + + ../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ../../tslibs/TS/Lib/lib.decorators.d.ts + Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts' + ../../tslibs/TS/Lib/lib.decorators.legacy.d.ts + Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts' + tsconfig.json + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 250 undefined WatchType: package.json file +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 0, + "success": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new* + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: *new* + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.js: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/index.mts: *new* + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: *new* + {"pollingInterval":2000} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: *new* + {} +/home/src/workspaces/node_modules/@types: *new* + {} + {} +/home/src/workspaces/project: *new* + {} +/home/src/workspaces/project/node_modules: *new* + {} +/home/src/workspaces/project/node_modules/@types: *new* + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: true + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.js *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/tsconfig.json (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 1, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts" + }, + "command": "open" + } +Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /home/src/workspaces/project/src/index.mts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (4) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/tsconfig.json ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/src/index.mts ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "open", + "request_seq": 1, + "success": true + } +After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/src/blah.js: + {"pollingInterval":500} +/home/src/workspaces/project/src/package.json: + {"pollingInterval":2000} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedFiles *deleted*:: +/home/src/workspaces/project/src/index.mts: + {"pollingInterval":500} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} +/home/src/workspaces/node_modules/@types: + {} + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false +/home/src/workspaces/project/tsconfig.json (Configured) *changed* + projectStateVersion: 1 + projectProgramVersion: 1 + noOpenRef: false *changed* + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +/home/src/workspaces/project/src/blah.js + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json +/home/src/workspaces/project/src/index.mts (Open) *changed* + open: true *changed* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/tsconfig.json *default* +/home/src/workspaces/project/tsconfig.json (Open) + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Info seq [hh:mm:ss:mss] request: + { + "seq": 2, + "type": "request", + "arguments": { + "preferences": {} + }, + "command": "configure" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "configure", + "request_seq": 2, + "success": true + } +Info seq [hh:mm:ss:mss] request: + { + "seq": 3, + "type": "request", + "arguments": { + "file": "/home/src/workspaces/project/src/index.mts", + "line": 1, + "offset": 18 + }, + "command": "completionInfo" + } +Info seq [hh:mm:ss:mss] response: + { + "seq": 0, + "type": "response", + "command": "completionInfo", + "request_seq": 3, + "success": true, + "body": { + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": true, + "entries": [ + { + "name": "#blah", + "kind": "script", + "kindModifiers": "", + "sortText": "11" + } + ], + "defaultCommitCharacters": [] + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/pasteEdits/should-not-error.js b/tests/baselines/reference/tsserver/pasteEdits/should-not-error.js new file mode 100644 index 0000000000000..926e5a51c35e4 --- /dev/null +++ b/tests/baselines/reference/tsserver/pasteEdits/should-not-error.js @@ -0,0 +1,248 @@ +Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false +Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib +Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript +Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist +Before request +//// [/home/src/projects/project/file1.ts] +export const r = 1; +console.log(r); + +//// [/home/src/projects/project/tsconfig.json] +{} + +//// [/home/src/tslibs/TS/Lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Info seq [hh:mm:ss:mss] request: + { + "command": "updateOpen", + "arguments": { + "changedFiles": [], + "closedFiles": [], + "openFiles": [ + { + "file": "^/untitled/ts-nul-authority/Untitled-1", + "fileContent": "function foo(){}\r\n \r\n", + "scriptKindName": "TS" + } + ] + }, + "seq": 1, + "type": "request" + } +Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: ^/untitled/ts-nul-authority/Untitled-1 ProjectRootPath: undefined:: Result: undefined +Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/Vscode/Projects/bin +Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/bin/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/bin/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots +Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (2) + /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };" + ^/untitled/ts-nul-authority/Untitled-1 SVC-1-0 "function foo(){}\r\n \r\n" + + + ../../../tslibs/TS/Lib/lib.d.ts + Default library for target 'es5' + ^/untitled/ts-nul-authority/Untitled-1 + Root file specified for compilation + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) +Info seq [hh:mm:ss:mss] Files (2) + +Info seq [hh:mm:ss:mss] ----------------------------------------------- +Info seq [hh:mm:ss:mss] Open files: +Info seq [hh:mm:ss:mss] FileName: ^/untitled/ts-nul-authority/Untitled-1 ProjectRootPath: undefined +Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] response: + { + "response": true, + "responseRequired": true, + "performanceData": { + "updateGraphDurationMs": * + } + } +After request + +PolledWatches:: +/home/src/Vscode/Projects/bin/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/Vscode/Projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/Vscode/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/home/src/tslibs/TS/Lib/lib.d.ts: *new* + {} + +Projects:: +/dev/null/inferredProject1* (Inferred) *new* + projectStateVersion: 1 + projectProgramVersion: 1 + autoImportProviderHost: false + +ScriptInfos:: +/home/src/tslibs/TS/Lib/lib.d.ts *new* + version: Text-1 + containingProjects: 1 + /dev/null/inferredProject1* +^/untitled/ts-nul-authority/Untitled-1 (Dynamic) (Open) *new* + version: SVC-1-0 + containingProjects: 1 + /dev/null/inferredProject1* *default* + +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "getPasteEdits", + "arguments": { + "file": "^/untitled/ts-nul-authority/Untitled-1", + "pastedText": [ + "console.log(r);" + ], + "pasteLocations": [ + { + "start": { + "line": 1, + "offset": 0 + }, + "end": { + "line": 1, + "offset": 0 + } + } + ], + "copiedFrom": { + "file": "/home/src/projects/project/file1.ts", + "spans": [ + { + "start": { + "line": 2, + "offset": 0 + }, + "end": { + "line": 2, + "offset": 13 + } + } + ] + } + }, + "seq": 2, + "type": "request" + } +Info seq [hh:mm:ss:mss] response: + { + "responseRequired": true + } +After request + +Before request + +Info seq [hh:mm:ss:mss] request: + { + "command": "geterr", + "arguments": { + "delay": 0, + "files": [ + "^/untitled/ts-nul-authority/Untitled-1" + ] + }, + "seq": 3, + "type": "request" + } +After request + +Timeout callback:: count: 1 +1: checkOne *new* + +Before running Timeout callback:: count: 1 +1: checkOne + +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "syntaxDiag", + "body": { + "file": "^/untitled/ts-nul-authority/Untitled-1", + "diagnostics": [] + } + } +After running Timeout callback:: count: 0 + +Immedidate callback:: count: 1 +1: semanticCheck *new* + +Before running Immedidate callback:: count: 1 +1: semanticCheck + +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "semanticDiag", + "body": { + "file": "^/untitled/ts-nul-authority/Untitled-1", + "diagnostics": [] + } + } +After running Immedidate callback:: count: 1 + +Immedidate callback:: count: 1 +2: suggestionCheck *new* + +Before running Immedidate callback:: count: 1 +2: suggestionCheck + +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "suggestionDiag", + "body": { + "file": "^/untitled/ts-nul-authority/Untitled-1", + "diagnostics": [] + } + } +Info seq [hh:mm:ss:mss] event: + { + "seq": 0, + "type": "event", + "event": "requestCompleted", + "body": { + "request_seq": 3, + "performanceData": { + "diagnosticsDuration": [ + { + "syntaxDiag": *, + "semanticDiag": *, + "suggestionDiag": *, + "file": "^/untitled/ts-nul-authority/Untitled-1" + } + ] + } + } + } +After running Immedidate callback:: count: 0 diff --git a/tests/baselines/reference/typeAliasDeclarationEmit3.errors.txt b/tests/baselines/reference/typeAliasDeclarationEmit3.errors.txt new file mode 100644 index 0000000000000..516b4494910a0 --- /dev/null +++ b/tests/baselines/reference/typeAliasDeclarationEmit3.errors.txt @@ -0,0 +1,30 @@ +typeAliasDeclarationEmit3.ts(3,14): error TS1156: 'type' declarations can only be declared inside a block. +typeAliasDeclarationEmit3.ts(9,14): error TS1156: 'type' declarations can only be declared inside a block. +typeAliasDeclarationEmit3.ts(15,14): error TS1156: 'type' declarations can only be declared inside a block. + + +==== typeAliasDeclarationEmit3.ts (3 errors) ==== + function f1(): void { + for (let i = 0; i < 1; i++) + type foo = []; + ~~~ +!!! error TS1156: 'type' declarations can only be declared inside a block. + console.log('f1'); + } + + function f2(): void { + while (true) + type foo = []; + ~~~ +!!! error TS1156: 'type' declarations can only be declared inside a block. + console.log('f2'); + } + + function f3(): void { + if (true) + type foo = []; + ~~~ +!!! error TS1156: 'type' declarations can only be declared inside a block. + console.log('f3'); + } + \ No newline at end of file diff --git a/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.errors.txt b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.errors.txt new file mode 100644 index 0000000000000..eca38cd12fd43 --- /dev/null +++ b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.errors.txt @@ -0,0 +1,46 @@ +typeInterfaceDeclarationsInBlockStatements1.ts(4,18): error TS1156: 'type' declarations can only be declared inside a block. +typeInterfaceDeclarationsInBlockStatements1.ts(12,21): error TS2304: Cannot find name 's'. +typeInterfaceDeclarationsInBlockStatements1.ts(17,15): error TS1156: 'interface' declarations can only be declared inside a block. +typeInterfaceDeclarationsInBlockStatements1.ts(29,21): error TS2304: Cannot find name 's'. + + +==== typeInterfaceDeclarationsInBlockStatements1.ts (4 errors) ==== + // https://github.com/microsoft/TypeScript/issues/60175 + + function f1() { + if (true) type s = string; + ~ +!!! error TS1156: 'type' declarations can only be declared inside a block. + console.log("" as s); + } + + function f2() { + if (true) { + type s = string; + } + console.log("" as s); + ~ +!!! error TS2304: Cannot find name 's'. + } + + function f3() { + if (true) + interface s { + ~ +!!! error TS1156: 'interface' declarations can only be declared inside a block. + length: number; + } + console.log("" as s); + } + + function f4() { + if (true) { + interface s { + length: number; + } + } + console.log("" as s); + ~ +!!! error TS2304: Cannot find name 's'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.js b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.js new file mode 100644 index 0000000000000..f636aafa95cce --- /dev/null +++ b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.js @@ -0,0 +1,65 @@ +//// [tests/cases/compiler/typeInterfaceDeclarationsInBlockStatements1.ts] //// + +//// [typeInterfaceDeclarationsInBlockStatements1.ts] +// https://github.com/microsoft/TypeScript/issues/60175 + +function f1() { + if (true) type s = string; + console.log("" as s); +} + +function f2() { + if (true) { + type s = string; + } + console.log("" as s); +} + +function f3() { + if (true) + interface s { + length: number; + } + console.log("" as s); +} + +function f4() { + if (true) { + interface s { + length: number; + } + } + console.log("" as s); +} + + +//// [typeInterfaceDeclarationsInBlockStatements1.js] +"use strict"; +// https://github.com/microsoft/TypeScript/issues/60175 +function f1() { + if (true) + ; + console.log(""); +} +function f2() { + if (true) { + } + console.log(""); +} +function f3() { + if (true) + ; + console.log(""); +} +function f4() { + if (true) { + } + console.log(""); +} + + +//// [typeInterfaceDeclarationsInBlockStatements1.d.ts] +declare function f1(): void; +declare function f2(): void; +declare function f3(): void; +declare function f4(): void; diff --git a/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.symbols b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.symbols new file mode 100644 index 0000000000000..7c3ee3a47ae40 --- /dev/null +++ b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.symbols @@ -0,0 +1,67 @@ +//// [tests/cases/compiler/typeInterfaceDeclarationsInBlockStatements1.ts] //// + +=== typeInterfaceDeclarationsInBlockStatements1.ts === +// https://github.com/microsoft/TypeScript/issues/60175 + +function f1() { +>f1 : Symbol(f1, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 0, 0)) + + if (true) type s = string; +>s : Symbol(s, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 3, 11)) + + console.log("" as s); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>s : Symbol(s, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 3, 11)) +} + +function f2() { +>f2 : Symbol(f2, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 5, 1)) + + if (true) { + type s = string; +>s : Symbol(s, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 8, 13)) + } + console.log("" as s); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>s : Symbol(s) +} + +function f3() { +>f3 : Symbol(f3, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 12, 1)) + + if (true) + interface s { +>s : Symbol(s, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 15, 11)) + + length: number; +>length : Symbol(s.length, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 16, 17)) + } + console.log("" as s); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>s : Symbol(s, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 15, 11)) +} + +function f4() { +>f4 : Symbol(f4, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 20, 1)) + + if (true) { + interface s { +>s : Symbol(s, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 23, 13)) + + length: number; +>length : Symbol(s.length, Decl(typeInterfaceDeclarationsInBlockStatements1.ts, 24, 17)) + } + } + console.log("" as s); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>s : Symbol(s) +} + diff --git a/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.types b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.types new file mode 100644 index 0000000000000..1a9b2cadab318 --- /dev/null +++ b/tests/baselines/reference/typeInterfaceDeclarationsInBlockStatements1.types @@ -0,0 +1,114 @@ +//// [tests/cases/compiler/typeInterfaceDeclarationsInBlockStatements1.ts] //// + +=== typeInterfaceDeclarationsInBlockStatements1.ts === +// https://github.com/microsoft/TypeScript/issues/60175 + +function f1() { +>f1 : () => void +> : ^^^^^^^^^^ + + if (true) type s = string; +>true : true +> : ^^^^ +>s : string +> : ^^^^^^ + + console.log("" as s); +>console.log("" as s) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>"" as s : string +> : ^^^^^^ +>"" : "" +> : ^^ +} + +function f2() { +>f2 : () => void +> : ^^^^^^^^^^ + + if (true) { +>true : true +> : ^^^^ + + type s = string; +>s : string +> : ^^^^^^ + } + console.log("" as s); +>console.log("" as s) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>"" as s : s +> : ^ +>"" : "" +> : ^^ +} + +function f3() { +>f3 : () => void +> : ^^^^^^^^^^ + + if (true) +>true : true +> : ^^^^ + + interface s { + length: number; +>length : number +> : ^^^^^^ + } + console.log("" as s); +>console.log("" as s) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>"" as s : s +> : ^ +>"" : "" +> : ^^ +} + +function f4() { +>f4 : () => void +> : ^^^^^^^^^^ + + if (true) { +>true : true +> : ^^^^ + + interface s { + length: number; +>length : number +> : ^^^^^^ + } + } + console.log("" as s); +>console.log("" as s) : void +> : ^^^^ +>console.log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>console : Console +> : ^^^^^^^ +>log : (...data: any[]) => void +> : ^^^^ ^^ ^^^^^ +>"" as s : s +> : ^ +>"" : "" +> : ^^ +} + diff --git a/tests/baselines/reference/verbatimModuleSyntaxRestrictionsCJS.js b/tests/baselines/reference/verbatimModuleSyntaxRestrictionsCJS.js index 92d72e603984a..b3e3508feb16b 100644 --- a/tests/baselines/reference/verbatimModuleSyntaxRestrictionsCJS.js +++ b/tests/baselines/reference/verbatimModuleSyntaxRestrictionsCJS.js @@ -74,13 +74,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; diff --git a/tests/baselines/reference/yieldStatementNoAsiAfterTransform(target=es5).js b/tests/baselines/reference/yieldStatementNoAsiAfterTransform(target=es5).js new file mode 100644 index 0000000000000..b34722da6afe5 --- /dev/null +++ b/tests/baselines/reference/yieldStatementNoAsiAfterTransform(target=es5).js @@ -0,0 +1,219 @@ +//// [tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts] //// + +//// [yieldStatementNoAsiAfterTransform.ts] +declare var a: any; + +function *t1() { + yield ( + // comment + a as any + ); +} +function *t2() { + yield ( + // comment + a as any + ) + 1; +} +function *t3() { + yield ( + // comment + a as any + ) ? 0 : 1; +} +function *t4() { + yield ( + // comment + a as any + ).b; +} +function *t5() { + yield ( + // comment + a as any + )[a]; +} +function *t6() { + yield ( + // comment + a as any + )(); +} +function *t7() { + yield ( + // comment + a as any + )``; +} +function *t8() { + yield ( + // comment + a as any + ) as any; +} +function *t9() { + yield ( + // comment + a as any + ) satisfies any; +} +function *t10() { + yield ( + // comment + a as any + )!; +} + + +//// [yieldStatementNoAsiAfterTransform.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +function t1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t2() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a + 1]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t3() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a ? 0 : 1]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t4() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a.b]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t5() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a[a]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t6() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a()]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t7() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a(__makeTemplateObject([""], [""]))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t8() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t9() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} +function t10() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, + // comment + a]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); +} diff --git a/tests/baselines/reference/yieldStatementNoAsiAfterTransform(target=esnext).js b/tests/baselines/reference/yieldStatementNoAsiAfterTransform(target=esnext).js new file mode 100644 index 0000000000000..71167e5407143 --- /dev/null +++ b/tests/baselines/reference/yieldStatementNoAsiAfterTransform(target=esnext).js @@ -0,0 +1,118 @@ +//// [tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts] //// + +//// [yieldStatementNoAsiAfterTransform.ts] +declare var a: any; + +function *t1() { + yield ( + // comment + a as any + ); +} +function *t2() { + yield ( + // comment + a as any + ) + 1; +} +function *t3() { + yield ( + // comment + a as any + ) ? 0 : 1; +} +function *t4() { + yield ( + // comment + a as any + ).b; +} +function *t5() { + yield ( + // comment + a as any + )[a]; +} +function *t6() { + yield ( + // comment + a as any + )(); +} +function *t7() { + yield ( + // comment + a as any + )``; +} +function *t8() { + yield ( + // comment + a as any + ) as any; +} +function *t9() { + yield ( + // comment + a as any + ) satisfies any; +} +function *t10() { + yield ( + // comment + a as any + )!; +} + + +//// [yieldStatementNoAsiAfterTransform.js] +function* t1() { + yield ( + // comment + a); +} +function* t2() { + yield ( + // comment + a) + 1; +} +function* t3() { + yield ( + // comment + a) ? 0 : 1; +} +function* t4() { + yield ( + // comment + a).b; +} +function* t5() { + yield ( + // comment + a)[a]; +} +function* t6() { + yield ( + // comment + a)(); +} +function* t7() { + yield ( + // comment + a) ``; +} +function* t8() { + yield ( + // comment + a); +} +function* t9() { + yield ( + // comment + a); +} +function* t10() { + yield ( + // comment + a); +} diff --git a/tests/cases/compiler/asyncIteratorExtraParameters.ts b/tests/cases/compiler/asyncIteratorExtraParameters.ts new file mode 100644 index 0000000000000..e25a0429dc8d7 --- /dev/null +++ b/tests/cases/compiler/asyncIteratorExtraParameters.ts @@ -0,0 +1,18 @@ +// @target: esnext +// @noEmit: true +// @noTypesAndSymbols: true + +// https://github.com/microsoft/TypeScript/issues/57130 +const iter = { + async *[Symbol.asyncIterator](_: number) { + yield 0; + } +}; + +declare function g(...args: any): any; + +async function* f() { + for await (const _ of iter); + + yield* iter; +} diff --git a/tests/cases/compiler/classAccessorInitializationInferenceWithElementAccess1.ts b/tests/cases/compiler/classAccessorInitializationInferenceWithElementAccess1.ts new file mode 100644 index 0000000000000..8f8b891532d7d --- /dev/null +++ b/tests/cases/compiler/classAccessorInitializationInferenceWithElementAccess1.ts @@ -0,0 +1,19 @@ +// @strict: true +// @target: esnext +// @declaration: true + +export class Cls { + accessor x; + accessor y; + accessor z; + + accessor 0; + + constructor(seed: number) { + this['x'] = [seed]; + this['y'] = { seed }; + this['z'] = `${seed}`; + + this[0] = [seed]; + } +} diff --git a/tests/cases/compiler/classAttributeInferenceTemplate.ts b/tests/cases/compiler/classAttributeInferenceTemplate.ts index d7a7be3bcb63a..c876482a39c8a 100644 --- a/tests/cases/compiler/classAttributeInferenceTemplate.ts +++ b/tests/cases/compiler/classAttributeInferenceTemplate.ts @@ -1,4 +1,5 @@ // @strict: true +// @target: esnext class MyClass { property; property2; @@ -11,4 +12,18 @@ class MyClass { const localProperty = `foo-${variable}`; // Correctly inferred as `string` } -} \ No newline at end of file +} + +class MyClass2 { + accessor property; + accessor property2; + + constructor() { + const variable = 'something' + + this.property = `foo`; // Correctly inferred as `string` + this.property2 = `foo-${variable}`; // Causes an error + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` + } +} diff --git a/tests/cases/compiler/classAttributeInferenceTemplateJS.ts b/tests/cases/compiler/classAttributeInferenceTemplateJS.ts index 4a1ea9f3cba82..a35fd951d5480 100644 --- a/tests/cases/compiler/classAttributeInferenceTemplateJS.ts +++ b/tests/cases/compiler/classAttributeInferenceTemplateJS.ts @@ -1,4 +1,5 @@ // @noEmit: true +// @target: esnext // @checkJs: true // @strict: true // @filename: index.js @@ -14,4 +15,18 @@ class MyClass { const localProperty = `foo-${variable}`; // Correctly inferred as `string` } -} \ No newline at end of file +} + +class MyClass2 { + accessor property; + accessor property2; + + constructor() { + const variable = 'something' + + this.property = `foo`; // Correctly inferred as `string` + this.property2 = `foo-${variable}`; // Causes an error + + const localProperty = `foo-${variable}`; // Correctly inferred as `string` + } +} diff --git a/tests/cases/compiler/computedPropertiesWithSetterAssignment.ts b/tests/cases/compiler/computedPropertiesWithSetterAssignment.ts new file mode 100644 index 0000000000000..c1fd1623a2bfa --- /dev/null +++ b/tests/cases/compiler/computedPropertiesWithSetterAssignment.ts @@ -0,0 +1,24 @@ +// @target: esnext +// @strict: true +// @filename: /a.ts + +const k = Symbol(); + +const enum Props { + k = 'k', +} + +interface Foo { + get k(): Set; + set k(v: Iterable); + + get [k](): Set; + set [k](v: Iterable); +} + +declare const foo: Foo; + +foo.k = ['foo']; +foo['k'] = ['foo']; +foo[Props.k] = ['foo']; +foo[k] = ['foo']; diff --git a/tests/cases/compiler/controlFlowAutoAccessor1.ts b/tests/cases/compiler/controlFlowAutoAccessor1.ts new file mode 100644 index 0000000000000..1b27e7e67a384 --- /dev/null +++ b/tests/cases/compiler/controlFlowAutoAccessor1.ts @@ -0,0 +1,61 @@ +// @strict: true +// @target: esnext +// @declaration: true + +class Example { + accessor test; + + constructor(test: number) { + this.test = test; + } + + getTest() { + return this.test; + } +} + +class Example2 { + accessor test; + + constructor(test: number | undefined) { + this.test = test; + } + + getTest() { + if (this.test) { + return this.test; + } + return 0; + } +} + +// https://github.com/microsoft/TypeScript/issues/59728 + +class Example3 { + accessor value; + + constructor(n: number) { + this.value = n; + + if (n < 0) { + this.value = null; + } + } +} + +declare var n: number; +class Example4 { + static accessor value; + static { + this.value = n; + if (n < 0) { + this.value = null; + } + } +} + +class Example5 { + static accessor value; // error +} +Example5.value = 123; +Example5.value++; diff --git a/tests/cases/compiler/isolatedDeclarationErrorTypes1.ts b/tests/cases/compiler/isolatedDeclarationErrorTypes1.ts new file mode 100644 index 0000000000000..a94ea0d47b242 --- /dev/null +++ b/tests/cases/compiler/isolatedDeclarationErrorTypes1.ts @@ -0,0 +1,13 @@ +// @isolatedDeclarations: true +// @strict: true +// @declaration: true +// @moduleResolution: nodenext +// @module: nodenext + +// https://github.com/microsoft/TypeScript/issues/60192 + +import { Unresolved } from "foo"; + +export const foo1 = (type?: Unresolved): void => {}; +export const foo2 = (type?: Unresolved | undefined): void => {}; +export const foo3 = (type: Unresolved): void => {}; diff --git a/tests/cases/compiler/isolatedDeclarationsAddUndefined2.ts b/tests/cases/compiler/isolatedDeclarationsAddUndefined2.ts new file mode 100644 index 0000000000000..ef28b2c542e25 --- /dev/null +++ b/tests/cases/compiler/isolatedDeclarationsAddUndefined2.ts @@ -0,0 +1,27 @@ +// @isolatedDeclarations: true +// @declaration: true +// @strict: true + +// https://github.com/microsoft/TypeScript/issues/60123 + +export class Bar { + constructor(private x?: Array | undefined) {} +} + +export class Bar2 { + constructor(private x?: Array) {} +} + +export class Bar3 { + constructor(private x: Array | undefined) {} +} + +export class Bar4 { + constructor(private x: Array) {} +} + +export function test1(x?: Array | undefined): void {} + +export function test2(x?: Unresolved | undefined): void {} + +export function test3(x?: Unresolved): void {} diff --git a/tests/cases/compiler/iteratorExtraParameters.ts b/tests/cases/compiler/iteratorExtraParameters.ts new file mode 100644 index 0000000000000..86d563871675f --- /dev/null +++ b/tests/cases/compiler/iteratorExtraParameters.ts @@ -0,0 +1,22 @@ +// @target: esnext +// @noEmit: true +// @noTypesAndSymbols: true + +// https://github.com/microsoft/TypeScript/issues/57130 +const iter = { + *[Symbol.iterator](_: number) { + yield 0; + } +}; + +declare function g(...args: any): any; + +function* f() { + for (const _ of iter); + + yield* iter; + + [...iter] + + g(...iter); +} diff --git a/tests/cases/compiler/parameterDecoratorsEmitCrash.ts b/tests/cases/compiler/parameterDecoratorsEmitCrash.ts new file mode 100644 index 0000000000000..50572aaa82aec --- /dev/null +++ b/tests/cases/compiler/parameterDecoratorsEmitCrash.ts @@ -0,0 +1,9 @@ +// @noTypesAndSymbols: true + +// https://github.com/microsoft/TypeScript/issues/58269 +declare var dec: any; + +export class C { + @dec x: any; + constructor(@dec x: any) {} +} diff --git a/tests/cases/compiler/selfNameAndImportsEmitInclusion.ts b/tests/cases/compiler/selfNameAndImportsEmitInclusion.ts new file mode 100644 index 0000000000000..40cf548adeafe --- /dev/null +++ b/tests/cases/compiler/selfNameAndImportsEmitInclusion.ts @@ -0,0 +1,34 @@ +// @noTypesAndSymbols: true + +// @Filename: /tsconfig.json +{ + "compilerOptions": { + "module": "nodenext", + "outDir": "dist", + "rootDir": "src", + }, + "files": ["src/main.ts"] +} + +// @Filename: /package.json +{ + "name": "pkg", + "type": "module", + "imports": { + "#indirect1": "./src/indirect1.ts" + }, + "exports": { + "./*": "./dist/*" + } +} + +// @Filename: /src/indirect1.ts +export const indirect1 = 0; + +// @Filename: /src/indirect2.ts +export const indirect2 = 0; + +// @Filename: /src/main.ts +import { indirect1 } from "#indirect1"; +import { indirect2 } from "pkg/indirect2.js"; +console.log(indirect1, indirect2); diff --git a/tests/cases/compiler/signatureOverloadsWithComments.ts b/tests/cases/compiler/signatureOverloadsWithComments.ts new file mode 100644 index 0000000000000..61101f1b046d7 --- /dev/null +++ b/tests/cases/compiler/signatureOverloadsWithComments.ts @@ -0,0 +1,23 @@ +// @declaration: true +// @emitDeclarationOnly: true + +/** + * Docs + */ +function Foo() { + return class Bar { + /** + * comment 1 + */ + foo(bar: string): void; + /** + * @deprecated This signature is deprecated + * + * comment 2 + */ + foo(): string; + foo(bar?: string): string | void { + return 'hi' + } + } +} diff --git a/tests/cases/compiler/typeInterfaceDeclarationsInBlockStatements1.ts b/tests/cases/compiler/typeInterfaceDeclarationsInBlockStatements1.ts new file mode 100644 index 0000000000000..27d698a4835b7 --- /dev/null +++ b/tests/cases/compiler/typeInterfaceDeclarationsInBlockStatements1.ts @@ -0,0 +1,33 @@ +// @strict: true +// @declaration: true + +// https://github.com/microsoft/TypeScript/issues/60175 + +function f1() { + if (true) type s = string; + console.log("" as s); +} + +function f2() { + if (true) { + type s = string; + } + console.log("" as s); +} + +function f3() { + if (true) + interface s { + length: number; + } + console.log("" as s); +} + +function f4() { + if (true) { + interface s { + length: number; + } + } + console.log("" as s); +} diff --git a/tests/cases/compiler/typedArrayConstructorOverloads.ts b/tests/cases/compiler/typedArrayConstructorOverloads.ts new file mode 100644 index 0000000000000..0a656f7eaeb2f --- /dev/null +++ b/tests/cases/compiler/typedArrayConstructorOverloads.ts @@ -0,0 +1,13 @@ +// @target: esnext +// @noEmit: true +// @noTypesAndSymbols: true + +// https://github.com/microsoft/TypeScript/issues/60367 + +type TypedArrayConstructor = + | Float64ArrayConstructor + | BigInt64ArrayConstructor + +export function makeTypedArray(buffer: ArrayBuffer, ctr: TypedArrayConstructor) { + return new ctr(buffer); +} diff --git a/tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef4.ts b/tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef4.ts new file mode 100644 index 0000000000000..7589c07a4f62d --- /dev/null +++ b/tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef4.ts @@ -0,0 +1,15 @@ +// @strict: true +// @target: esnext +// @declaration: true + +class C { + static accessor x; + static { + this.x = 1; + } + static accessor y = this.x; + static accessor z; + static { + this.z = this.y; + } +} diff --git a/tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef5.ts b/tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef5.ts new file mode 100644 index 0000000000000..04761883a43f6 --- /dev/null +++ b/tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef5.ts @@ -0,0 +1,10 @@ +// @strict: true +// @target: esnext +// @declaration: true + +class C { + static { + this.x = 1; + } + static accessor x; +} diff --git a/tests/cases/conformance/classes/propertyMemberDeclarations/canFollowGetSetKeyword.ts b/tests/cases/conformance/classes/propertyMemberDeclarations/canFollowGetSetKeyword.ts new file mode 100644 index 0000000000000..6039dedfe306d --- /dev/null +++ b/tests/cases/conformance/classes/propertyMemberDeclarations/canFollowGetSetKeyword.ts @@ -0,0 +1,17 @@ +// @noTypesAndSymbols: true +class A { + get + *x() {} +} +class B { + set + *x() {} +} +const c = { + get + *x() {} +}; +const d = { + set + *x() {} +}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts new file mode 100644 index 0000000000000..997341c7cb1a6 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration10.ts @@ -0,0 +1,30 @@ +// @strict: true, false +// @noEmit: true + +export function prepareConfig({ + additionalFiles: { + json = [] + } = {} +}: { + additionalFiles?: Partial>; +} = {}) { + json // string[] +} + +export function prepareConfigWithoutAnnotation({ + additionalFiles: { + json = [] + } = {} +} = {}) { + json +} + +export const prepareConfigWithContextualSignature: (param:{ + additionalFiles?: Partial>; +}) => void = ({ + additionalFiles: { + json = [] + } = {} +} = {}) => { + json // string[] +} diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts new file mode 100644 index 0000000000000..d033af2b0891e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts @@ -0,0 +1,51 @@ +// @strict: true, false +// @noEmit: true +// @allowJs: true +// @checkJs: true + +// https://github.com/microsoft/TypeScript/issues/59936 + +// @filename: index.js + +/** + * @param {Object} [config] + * @param {Partial>} [config.additionalFiles] + */ +export function prepareConfig({ + additionalFiles: { + json = [] + } = {} +} = {}) { + json // string[] +} + +export function prepareConfigWithoutAnnotation({ + additionalFiles: { + json = [] + } = {} +} = {}) { + json +} + +/** @type {(param: { + additionalFiles?: Partial>; +}) => void} */ +export const prepareConfigWithContextualSignature = ({ + additionalFiles: { + json = [] + } = {} +} = {})=> { + json // string[] +} + +// Additional repros from https://github.com/microsoft/TypeScript/issues/59936 + +/** + * @param {{ a?: { json?: string[] }}} [config] + */ +function f1({ a: { json = [] } = {} } = {}) { return json } + +/** + * @param {[[string[]?]?]} [x] + */ +function f2([[json = []] = []] = []) { return json } diff --git a/tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts b/tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts new file mode 100644 index 0000000000000..818159c7197e6 --- /dev/null +++ b/tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts @@ -0,0 +1,65 @@ +// @target: es5,esnext +// @lib: esnext +// @noTypesAndSymbols: true +declare var a: any; + +function *t1() { + yield ( + // comment + a as any + ); +} +function *t2() { + yield ( + // comment + a as any + ) + 1; +} +function *t3() { + yield ( + // comment + a as any + ) ? 0 : 1; +} +function *t4() { + yield ( + // comment + a as any + ).b; +} +function *t5() { + yield ( + // comment + a as any + )[a]; +} +function *t6() { + yield ( + // comment + a as any + )(); +} +function *t7() { + yield ( + // comment + a as any + )``; +} +function *t8() { + yield ( + // comment + a as any + ) as any; +} +function *t9() { + yield ( + // comment + a as any + ) satisfies any; +} +function *t10() { + yield ( + // comment + a as any + )!; +} diff --git a/tests/cases/conformance/statements/returnStatements/returnStatementNoAsiAfterTransform.ts b/tests/cases/conformance/statements/returnStatements/returnStatementNoAsiAfterTransform.ts new file mode 100644 index 0000000000000..ba76ca6f50156 --- /dev/null +++ b/tests/cases/conformance/statements/returnStatements/returnStatementNoAsiAfterTransform.ts @@ -0,0 +1,64 @@ +// @target: es5,esnext +// @noTypesAndSymbols: true +declare var a: any; + +function t1() { + return ( + // comment + a as any + ); +} +function t2() { + return ( + // comment + a as any + ) + 1; +} +function t3() { + return ( + // comment + a as any + ) ? 0 : 1; +} +function t4() { + return ( + // comment + a as any + ).b; +} +function t5() { + return ( + // comment + a as any + )[a]; +} +function t6() { + return ( + // comment + a as any + )(); +} +function t7() { + return ( + // comment + a as any + )``; +} +function t8() { + return ( + // comment + a as any + ) as any; +} +function t9() { + return ( + // comment + a as any + ) satisfies any; +} +function t10() { + return ( + // comment + a as any + )!; +} diff --git a/tests/cases/conformance/types/conditional/inferTypesWithExtendsDependingOnTypeVariables.ts b/tests/cases/conformance/types/conditional/inferTypesWithExtendsDependingOnTypeVariables.ts new file mode 100644 index 0000000000000..9deb9e41f1cc3 --- /dev/null +++ b/tests/cases/conformance/types/conditional/inferTypesWithExtendsDependingOnTypeVariables.ts @@ -0,0 +1,7 @@ +// @strict: true +// @noEmit: true + +// repro from https://github.com/microsoft/TypeScript/issues/54197 + +type Bar = T extends readonly [any, ...infer X extends readonly K[]] ? X : never; +type Res1 = Bar<"a" | "b", ["a", "b", "b"]> diff --git a/tests/cases/fourslash/autoImportCompletionAmbientMergedModule1.ts b/tests/cases/fourslash/autoImportCompletionAmbientMergedModule1.ts new file mode 100644 index 0000000000000..48257107b51d5 --- /dev/null +++ b/tests/cases/fourslash/autoImportCompletionAmbientMergedModule1.ts @@ -0,0 +1,67 @@ +/// + +// @strict: true +// @module: commonjs + +// @filename: /node_modules/@types/vscode/index.d.ts +//// declare module "vscode" { +//// export class Position { +//// readonly line: number; +//// readonly character: number; +//// } +//// } + +// @filename: src/motion.ts +//// import { Position } from "vscode"; +//// +//// export abstract class MoveQuoteMatch { +//// public override async execActionWithCount( +//// position: Position, +//// ): Promise {} +//// } +//// +//// declare module "vscode" { +//// interface Position { +//// toString(): string; +//// } +//// } + +// @filename: src/smartQuotes.ts +//// import { MoveQuoteMatch } from "./motion"; +//// +//// export class MoveInsideNextQuote extends MoveQuoteMatch {/*1*/ +//// keys = ["i", "n", "q"]; +//// } + +const preferences = { + includeCompletionsWithInsertText: true, + includeCompletionsWithClassMemberSnippets: true, +}; + +verify.completions({ + marker: "1", + includes: [ + { + name: "execActionWithCount", + insertText: "public execActionWithCount(position: Position): Promise {\n}", + filterText: "execActionWithCount", + hasAction: true, + source: "ClassMemberSnippet/", + }, + ], + preferences, + isNewIdentifierLocation: true, +}); + +verify.applyCodeActionFromCompletion("1", { + name: "execActionWithCount", + source: "ClassMemberSnippet/", + description: `Includes imports of types referenced by 'execActionWithCount'`, + newFileContent: `import { Position } from "vscode"; +import { MoveQuoteMatch } from "./motion"; + +export class MoveInsideNextQuote extends MoveQuoteMatch { + keys = ["i", "n", "q"]; +}`, + preferences, +}); diff --git a/tests/cases/fourslash/autoImportCompletionExportEqualsWithDefault1.ts b/tests/cases/fourslash/autoImportCompletionExportEqualsWithDefault1.ts new file mode 100644 index 0000000000000..6e5f3c6614a2b --- /dev/null +++ b/tests/cases/fourslash/autoImportCompletionExportEqualsWithDefault1.ts @@ -0,0 +1,91 @@ +/// + +// @strict: true +// @module: commonjs + +// @filename: node.ts +//// import Container from "./container.js"; +//// import Document from "./document.js"; +//// +//// declare namespace Node { +//// class Node extends Node_ {} +//// +//// export { Node as default }; +//// } +//// +//// declare abstract class Node_ { +//// parent: Container | Document | undefined; +//// } +//// +//// declare class Node extends Node_ {} +//// +//// export = Node; + +// @filename: document.ts +//// import Container from "./container.js"; +//// +//// declare namespace Document { +//// export { Document_ as default }; +//// } +//// +//// declare class Document_ extends Container {} +//// +//// declare class Document extends Document_ {} +//// +//// export = Document; + +// @filename: container.ts +//// import Node from "./node.js"; +//// +//// declare namespace Container { +//// export { Container_ as default }; +//// } +//// +//// declare abstract class Container_ extends Node { +//// p/*1*/ +//// } +//// +//// declare class Container extends Container_ {} +//// +//// export = Container; + +const preferences = { + includeCompletionsWithInsertText: true, + includeCompletionsWithClassMemberSnippets: true, +}; + +verify.completions({ + marker: "1", + includes: [ + { + name: "parent", + insertText: "parent: Container_ | Document_ | undefined;", + filterText: "parent", + hasAction: true, + source: "ClassMemberSnippet/", + }, + ], + preferences, + isNewIdentifierLocation: true, +}); + +verify.applyCodeActionFromCompletion("1", { + name: "parent", + source: "ClassMemberSnippet/", + description: `Includes imports of types referenced by 'parent'`, + newFileContent: `import Document_ from "./document.js"; +import Node from "./node.js"; + +declare namespace Container { + export { Container_ as default }; +} + +declare abstract class Container_ extends Node { + p +} + +declare class Container extends Container_ {} + +export = Container;`, + preferences, +}); diff --git a/tests/cases/fourslash/autoImportPathsConfigDir.ts b/tests/cases/fourslash/autoImportPathsConfigDir.ts new file mode 100644 index 0000000000000..0b451767b325b --- /dev/null +++ b/tests/cases/fourslash/autoImportPathsConfigDir.ts @@ -0,0 +1,18 @@ +/// + +// @Filename: tsconfig.json +//// { +//// "compilerOptions": { +//// "paths": { +//// "@root/*": ["${configDir}/src/*"] +//// } +//// } +//// } + +// @Filename: src/one.ts +//// export const one = 1; + +// @Filename: src/foo/two.ts +//// one/**/ + +verify.importFixModuleSpecifiers("", ["@root/one"]); diff --git a/tests/cases/fourslash/autoImportPathsNodeModules.ts b/tests/cases/fourslash/autoImportPathsNodeModules.ts new file mode 100644 index 0000000000000..18df371fb1d05 --- /dev/null +++ b/tests/cases/fourslash/autoImportPathsNodeModules.ts @@ -0,0 +1,26 @@ +/// + +// @Filename: tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "amd", +//// "moduleResolution": "node", +//// "rootDir": "ts", +//// "baseUrl": ".", +//// "paths": { +//// "*": ["node_modules/@woltlab/wcf/ts/*"] +//// } +//// }, +//// "include": [ +//// "ts", +//// "node_modules/@woltlab/wcf/ts", +//// ] +//// } + +// @Filename: node_modules/@woltlab/wcf/ts/WoltLabSuite/Core/Component/Dialog.ts +//// export class Dialog {} + +// @Filename: ts/main.ts +//// Dialog/**/ + +verify.importFixModuleSpecifiers("", ["WoltLabSuite/Core/Component/Dialog"]); diff --git a/tests/cases/fourslash/codeFixAddMissingProperties30.ts b/tests/cases/fourslash/codeFixAddMissingProperties30.ts index 3475c38db7642..720038818209b 100644 --- a/tests/cases/fourslash/codeFixAddMissingProperties30.ts +++ b/tests/cases/fourslash/codeFixAddMissingProperties30.ts @@ -9,7 +9,6 @@ ////} ////[|f([{}])|] -debugger; verify.codeFix({ index: 0, description: ts.Diagnostics.Add_missing_properties.message, diff --git a/tests/cases/fourslash/codeFixAddMissingProperties31.ts b/tests/cases/fourslash/codeFixAddMissingProperties31.ts index c05e87d68d468..efc15962fb828 100644 --- a/tests/cases/fourslash/codeFixAddMissingProperties31.ts +++ b/tests/cases/fourslash/codeFixAddMissingProperties31.ts @@ -9,7 +9,6 @@ ////} ////[|const b: B[] = [{c: [{}]}]|] -debugger; verify.codeFix({ index: 0, description: ts.Diagnostics.Add_missing_properties.message, diff --git a/tests/cases/fourslash/codeFixAddMissingProperties32.ts b/tests/cases/fourslash/codeFixAddMissingProperties32.ts new file mode 100644 index 0000000000000..7777c9332c3b5 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingProperties32.ts @@ -0,0 +1,24 @@ +/// + +// @filename: E.ts +////export enum E { +//// A, +//// B, +////} + +// @filename: foo.ts +////import { E } from "./E" +////type T = { +//// e: E, +////} +////[|const t: T = { }|] + +goTo.file('foo.ts'); +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Add_missing_properties.message, + newRangeContent: +`const t: T = { + e: E.A +}`, +}); diff --git a/tests/cases/fourslash/codeFixAddMissingProperties45.ts b/tests/cases/fourslash/codeFixAddMissingProperties45.ts new file mode 100644 index 0000000000000..4a2f30f73ad36 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingProperties45.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// type U = { u?: { v: string } }; +//// const u: U = { [|u: {}|] }; + +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Add_missing_properties.message, + newRangeContent: +`u: { + v: "" +}`, +}); diff --git a/tests/cases/fourslash/codeFixAddMissingProperties46.ts b/tests/cases/fourslash/codeFixAddMissingProperties46.ts new file mode 100644 index 0000000000000..3d0e64257fe1f --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingProperties46.ts @@ -0,0 +1,16 @@ +/// + +// @strict: true + +//// type T = { t: string }; +//// declare function f(arg?: T): void; +//// f([|{}|]); + +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Add_missing_properties.message, + newRangeContent: +`{ + t: "" +}`, +}); diff --git a/tests/cases/fourslash/codeFixAddMissingProperties47.ts b/tests/cases/fourslash/codeFixAddMissingProperties47.ts new file mode 100644 index 0000000000000..8d26466aaf671 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingProperties47.ts @@ -0,0 +1,22 @@ +/// + +// @strict: true + +//// interface A { +//// a: number; +//// b: string; +//// } +//// function f(_obj: (A | undefined)[]): string { +//// return ""; +//// } +//// [|f([{}]);|] + +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Add_missing_properties.message, + newRangeContent: +`f([{ + a: 0, + b: "" +}]);`, +}); diff --git a/tests/cases/fourslash/codeFixAddMissingProperties48.ts b/tests/cases/fourslash/codeFixAddMissingProperties48.ts new file mode 100644 index 0000000000000..69993cd821b0a --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingProperties48.ts @@ -0,0 +1,22 @@ +/// + +// @strict: true + +//// interface A { +//// a: number; +//// b: string; +//// } +//// interface B { +//// c: (A | undefined)[]; +//// } +//// [|const b: B[] = [{ c: [{}] }];|] + +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Add_missing_properties.message, + newRangeContent: +`const b: B[] = [{ c: [{ + a: 0, + b: "" +}] }];`, +}); diff --git a/tests/cases/fourslash/completionsImportDefaultExportCrash.ts b/tests/cases/fourslash/completionsImportDefaultExportCrash1.ts similarity index 89% rename from tests/cases/fourslash/completionsImportDefaultExportCrash.ts rename to tests/cases/fourslash/completionsImportDefaultExportCrash1.ts index b6780b1578d1e..776a9fd8c4d4b 100644 --- a/tests/cases/fourslash/completionsImportDefaultExportCrash.ts +++ b/tests/cases/fourslash/completionsImportDefaultExportCrash1.ts @@ -35,8 +35,8 @@ verify.completions({ marker: "1", - // some kind of a check should be added here + includes: [{ name: "$" }], preferences: { - includeCompletionsForModuleExports: true, + includeCompletionsForModuleExports: true, } }); diff --git a/tests/cases/fourslash/completionsImportDefaultExportCrash2.ts b/tests/cases/fourslash/completionsImportDefaultExportCrash2.ts new file mode 100644 index 0000000000000..2e4d28e5a6930 --- /dev/null +++ b/tests/cases/fourslash/completionsImportDefaultExportCrash2.ts @@ -0,0 +1,51 @@ +/// + +// @module: nodenext +// @allowJs: true + +// @Filename: /node_modules/dom7/index.d.ts +//// export interface Dom7Array { +//// length: number; +//// prop(propName: string): any; +//// } +//// +//// export interface Dom7 { +//// (): Dom7Array; +//// fn: any; +//// } +//// +//// declare const Dom7: Dom7; +//// +//// export { +//// Dom7 as $, +//// }; + +// @Filename: /dom7.js +//// import * as methods from 'dom7'; +//// Object.keys(methods).forEach((methodName) => { +//// if (methodName === '$') return; +//// methods.$.fn[methodName] = methods[methodName]; +//// }); +//// +//// export default methods.$; + +// @Filename: /swipe-back.js +//// /*1*/ + +verify.completions({ + marker: "1", + includes: [{ + name: "$", + hasAction: true, + source: 'dom7', + sortText: completion.SortText.AutoImportSuggestions, + }, { + name: "Dom7", + hasAction: true, + source: './dom7', + sortText: completion.SortText.AutoImportSuggestions, + }], + preferences: { + includeCompletionsForModuleExports: true, + } +}); diff --git a/tests/cases/fourslash/completionsImport_umdDefaultNoCrash1.ts b/tests/cases/fourslash/completionsImport_umdDefaultNoCrash1.ts new file mode 100644 index 0000000000000..af2fe79e050f7 --- /dev/null +++ b/tests/cases/fourslash/completionsImport_umdDefaultNoCrash1.ts @@ -0,0 +1,49 @@ +/// + +// @moduleResolution: node +// @allowJs: true +// @checkJs: true + +// @Filename: /node_modules/dottie/package.json +//// { +//// "name": "dottie", +//// "main": "dottie.js" +//// } + +// @Filename: /node_modules/dottie/dottie.js +//// (function (undefined) { +//// var root = this; +//// +//// var Dottie = function () {}; +//// +//// Dottie["default"] = function (object, path, value) {}; +//// +//// if (typeof module !== "undefined" && module.exports) { +//// exports = module.exports = Dottie; +//// } else { +//// root["Dottie"] = Dottie; +//// root["Dot"] = Dottie; +//// +//// if (typeof define === "function") { +//// define([], function () { +//// return Dottie; +//// }); +//// } +//// } +//// })(); + +// @Filename: /src/index.js +//// /**/ + +verify.completions({ + marker: "", + includes: [ + { + name: "Dottie", + hasAction: true, + source: "/node_modules/dottie/dottie", + sortText: completion.SortText.AutoImportSuggestions, + }, + ], + preferences: { includeCompletionsForModuleExports: true }, +}); diff --git a/tests/cases/fourslash/completionsImport_umdDefaultNoCrash2.ts b/tests/cases/fourslash/completionsImport_umdDefaultNoCrash2.ts new file mode 100644 index 0000000000000..fbd4fce743ba1 --- /dev/null +++ b/tests/cases/fourslash/completionsImport_umdDefaultNoCrash2.ts @@ -0,0 +1,43 @@ +/// + +// @moduleResolution: node +// @allowJs: true +// @checkJs: true + +// @Filename: /node_modules/dottie/package.json +//// { +//// "name": "dottie", +//// "main": "dottie.js" +//// } + +// @Filename: /node_modules/dottie/dottie.js +//// (function (undefined) { +//// var root = this; +//// +//// var Dottie = function () {}; +//// +//// Dottie["default"] = function (object, path, value) {}; +//// +//// if (typeof module !== "undefined" && module.exports) { +//// exports = module.exports = Dottie; +//// } else { +//// root["Dottie"] = Dottie; +//// root["Dot"] = Dottie; +//// +//// if (typeof define === "function") { +//// define([], function () { +//// return Dottie; +//// }); +//// } +//// } +//// })(); + +// @Filename: /src/index.js +//// import Dottie from 'dottie'; +//// /**/ + +verify.completions({ + marker: "", + includes: [{ name: "Dottie" }], + preferences: { includeCompletionsForModuleExports: true }, +}); diff --git a/tests/cases/fourslash/completionsJSDocNoCrash3.ts b/tests/cases/fourslash/completionsJSDocNoCrash3.ts new file mode 100644 index 0000000000000..f952b30422468 --- /dev/null +++ b/tests/cases/fourslash/completionsJSDocNoCrash3.ts @@ -0,0 +1,25 @@ +/// + +// @strict: true + +// @filename: index.ts +//// class MssqlClient { +//// /** +//// * +//// * @param {Object} - args +//// * @param {String} - args.parentTable +//// * @returns {Promise<{upStatement/**/, downStatement}>} +//// */ +//// async relationCreate(args) {} +//// } +//// +//// export default MssqlClient; + +verify.completions({ + marker: "", + exact: [{ + name: "readonly", + sortText: completion.SortText.GlobalsOrKeywords, + }], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/completionsPaths_pathMapping_nonTrailingWildcard1.ts b/tests/cases/fourslash/completionsPaths_pathMapping_nonTrailingWildcard1.ts new file mode 100644 index 0000000000000..65f8c7e59b5d7 --- /dev/null +++ b/tests/cases/fourslash/completionsPaths_pathMapping_nonTrailingWildcard1.ts @@ -0,0 +1,58 @@ +/// + +// @Filename: /src/b.ts +////export const x = 0; + +// @Filename: /src/dir/x.ts +/////export const x = 0; + +// @Filename: /src/a.ts +////import {} from "foo//*0*/"; +////import {} from "foo/dir//*1*/"; // invalid +////import {} from "foo/_/*2*/"; +////import {} from "foo/_dir//*3*/"; + +// @Filename: /tsconfig.json +////{ +//// "compilerOptions": { +//// "baseUrl": ".", +//// "paths": { +//// "foo/_*/suffix": ["src/*.ts"] +//// } +//// } +////} + +verify.completions( + { + marker: "0", + exact: [ + { name: "foo/_a/suffix", kind: "script" }, + { name: "foo/_b/suffix", kind: "script" }, + { name: "foo/_dir/suffix", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "1", + exact: [ + { name: "foo/_a/suffix", kind: "script" }, + { name: "foo/_b/suffix", kind: "script" }, + { name: "foo/_dir/suffix", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "2", + exact: [ + { name: "a", kind: "script" }, + { name: "b", kind: "script" }, + { name: "dir", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "3", + exact: { name: "x", kind: "script" }, + isNewIdentifierLocation: true, + }, +); diff --git a/tests/cases/fourslash/formatRemoveSemicolons1.ts b/tests/cases/fourslash/formatRemoveSemicolons1.ts index b80ecee7edb2d..39735fe0a8d93 100644 --- a/tests/cases/fourslash/formatRemoveSemicolons1.ts +++ b/tests/cases/fourslash/formatRemoveSemicolons1.ts @@ -51,7 +51,7 @@ class C { ["p"] zero: void ["one"] = {}; - ["two"]; + ["two"] ; } a; @@ -59,7 +59,7 @@ a; b; (3) 4; -/ regex /; +/ regex / ; []; /** blah */[0] diff --git a/tests/cases/fourslash/formatRemoveSemicolons4.ts b/tests/cases/fourslash/formatRemoveSemicolons4.ts new file mode 100644 index 0000000000000..299efa837a74c --- /dev/null +++ b/tests/cases/fourslash/formatRemoveSemicolons4.ts @@ -0,0 +1,48 @@ +/// + +////declare const opt: number | undefined; +//// +////const a = 1; +////const b = 2; +////;[1, 2, 3] +//// +////const c = opt ? 1 : 2; +////const d = opt ? 1 : 2; +////;[1, 2, 3] +//// +////const e = opt ?? 1; +////const f = opt ?? 1; +////;[1, 2, 3] +//// +////type a = 1; +////type b = 2; +////;[1, 2, 3] +//// +////type c = typeof opt extends 1 ? 1 : 2; +////type d = typeof opt extends 1 ? 1 : 2; +////;[1, 2, 3] + +format.setFormatOptions({ ...format.copyFormatOptions(), semicolons: ts.SemicolonPreference.Remove }); +format.document(); +verify.currentFileContentIs( +`declare const opt: number | undefined + +const a = 1 +const b = 2 +;[1, 2, 3] + +const c = opt ? 1 : 2 +const d = opt ? 1 : 2 +;[1, 2, 3] + +const e = opt ?? 1 +const f = opt ?? 1 +;[1, 2, 3] + +type a = 1 +type b = 2 +;[1, 2, 3] + +type c = typeof opt extends 1 ? 1 : 2 +type d = typeof opt extends 1 ? 1 : 2 +;[1, 2, 3]`); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonExportsSpecifierEndsInTs.ts b/tests/cases/fourslash/importCompletionsPackageJsonExportsSpecifierEndsInTs.ts new file mode 100644 index 0000000000000..0549081b7ddeb --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonExportsSpecifierEndsInTs.ts @@ -0,0 +1,31 @@ +/// + +// @module: nodenext + +// @Filename: /node_modules/pkg/package.json +//// { +//// "name": "pkg", +//// "version": "1.0.0", +//// "exports": { +//// "./something.ts": "./a.js" +//// } +//// } + +// @Filename: /node_modules/pkg/a.d.ts +//// export function foo(): void; + +// @Filename: /package.json +//// { +//// "dependencies": { +//// "pkg": "*" +//// } +//// } + +// @Filename: /index.ts +//// import {} from "pkg//*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["something.ts"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonExportsTrailingSlash1.ts b/tests/cases/fourslash/importCompletionsPackageJsonExportsTrailingSlash1.ts new file mode 100644 index 0000000000000..e381945b5d926 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonExportsTrailingSlash1.ts @@ -0,0 +1,38 @@ +/// + +// @module: nodenext +// @moduleResolution: nodenext + +// @Filename: /node_modules/pkg/package.json +//// { +//// "name": "pkg", +//// "version": "1.0.0", +//// "exports": { +//// "./test/": "./" +//// } +//// } + +// @Filename: /node_modules/pkg/foo.d.ts +//// export function foo(): void; + +// @Filename: /package.json +//// { +//// "dependencies": { +//// "pkg": "*" +//// } +//// } + +// @Filename: /index.ts +//// import {} from "pkg//*1*/"; +//// import {} from "pkg/test//*2*/"; + +verify.completions({ + marker: ["1"], + exact: ["test"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["2"], + exact: ["foo.js"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsConditions1.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsConditions1.ts new file mode 100644 index 0000000000000..9bac2d834dd42 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsConditions1.ts @@ -0,0 +1,25 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#thing": { +//// "types": { "import": "./types-esm/thing.d.mts", "require": "./types/thing.d.ts" }, +//// "default": { "import": "./esm/thing.mjs", "require": "./dist/thing.js" } +//// } +//// } +//// } + +// @Filename: /types/thing.d.ts +//// export function something(name: string): any; + +// @Filename: /src/foo.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#thing"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsLength1.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsLength1.ts new file mode 100644 index 0000000000000..36380677a29de --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsLength1.ts @@ -0,0 +1,46 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*": "./src/*.ts" +//// } +//// } + +// @Filename: /src/a/b/c/something.ts +//// export function something(name: string): any; + +// @Filename: /src/a/b/c/d.ts +//// import {} from "/*1*/"; +//// import {} from "#a//*2*/"; +//// import {} from "#a/b//*3*/"; +//// import {} from "#a/b/c//*4*/"; +//// import {} from "#a/b/c/something//*5*/"; + +verify.completions({ + marker: ["1"], + exact: ["#a"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["2"], + exact: ["b"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["3"], + exact: ["c"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["4"], + exact: ["d", "something"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["5"], + exact: [], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsLength2.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsLength2.ts new file mode 100644 index 0000000000000..8dd812c00ef2c --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsLength2.ts @@ -0,0 +1,47 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*": "./src/*.ts" +//// } +//// } + +// @Filename: /src/a/b/c/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; +//// import {} from "#a//*2*/"; +//// import {} from "#a/b//*3*/"; +//// import {} from "#a/b/c//*4*/"; +//// import {} from "#a/b/c/something//*5*/"; + +verify.completions({ + marker: ["1"], + exact: ["#a"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["2"], + exact: ["b"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["3"], + exact: ["c"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["4"], + exact: ["something"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["5"], + exact: [], + isNewIdentifierLocation: true, +}); + diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern.ts new file mode 100644 index 0000000000000..89b84c7b5bf47 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*": "./src/*" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something.js"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern2.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern2.ts new file mode 100644 index 0000000000000..2cbea78b63351 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern2.ts @@ -0,0 +1,23 @@ +/// + +// @module: nodenext +// @allowImportingTsExtensions: true + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*": "./src/*" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something.ts"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_capsInPath1.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_capsInPath1.ts new file mode 100644 index 0000000000000..f75079c117361 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_capsInPath1.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /Dev/package.json +//// { +//// "imports": { +//// "#thing": "./src/something.js" +//// } +//// } + +// @Filename: /Dev/src/something.ts +//// export function something(name: string): any; + +// @Filename: /Dev/a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#thing"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_capsInPath2.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_capsInPath2.ts new file mode 100644 index 0000000000000..fcb66e518d0f4 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_capsInPath2.ts @@ -0,0 +1,27 @@ +/// + +// @module: nodenext + +// @Filename: /Dev/package.json +//// { +//// "imports": { +//// "#thing/*": "./src/*.js" +//// } +//// } + +// @Filename: /Dev/src/something.ts +//// export function something(name: string): any; + +// @Filename: /Dev/a.ts +//// import {} from "#thing//*2*/"; + +// verify.completions({ +// marker: ["1"], +// exact: ["#thing"], +// isNewIdentifierLocation: true, +// }); +verify.completions({ + marker: ["2"], + exact: ["something"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_js.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_js.ts new file mode 100644 index 0000000000000..62c47e19cfb12 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_js.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*": "./src/*.js" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_js_ts.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_js_ts.ts new file mode 100644 index 0000000000000..0b79cad7fbc52 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_js_ts.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*.js": "./src/*.ts" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something.js"], + isNewIdentifierLocation: true, +}); \ No newline at end of file diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts.ts new file mode 100644 index 0000000000000..ef3ef47db4367 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*": "./src/*.ts" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts_js.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts_js.ts new file mode 100644 index 0000000000000..595d3b0a7194d --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts_js.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*.ts": "./src/*.js" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something.ts"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts_ts.ts b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts_ts.ts new file mode 100644 index 0000000000000..e6dafdb1a3dc7 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImportsPattern_ts_ts.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#*.ts": "./src/*.ts" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#something.ts"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImports_js.ts b/tests/cases/fourslash/importCompletionsPackageJsonImports_js.ts new file mode 100644 index 0000000000000..b650f213eaa89 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImports_js.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#thing": "./src/something.js" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#thing"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/importCompletionsPackageJsonImports_ts.ts b/tests/cases/fourslash/importCompletionsPackageJsonImports_ts.ts new file mode 100644 index 0000000000000..0c8563e8665b3 --- /dev/null +++ b/tests/cases/fourslash/importCompletionsPackageJsonImports_ts.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#thing": "./src/something.ts" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#thing"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/inlayHintsOverloadCall.ts b/tests/cases/fourslash/inlayHintsOverloadCall1.ts similarity index 100% rename from tests/cases/fourslash/inlayHintsOverloadCall.ts rename to tests/cases/fourslash/inlayHintsOverloadCall1.ts diff --git a/tests/cases/fourslash/inlayHintsOverloadCall2.ts b/tests/cases/fourslash/inlayHintsOverloadCall2.ts new file mode 100644 index 0000000000000..2a9a0a91e7587 --- /dev/null +++ b/tests/cases/fourslash/inlayHintsOverloadCall2.ts @@ -0,0 +1,23 @@ +/// + +////type HasID = { +//// id: number; +////} +//// +////type Numbers = { +//// n: number[]; +////} +//// +////declare function func(bad1: number, bad2: HasID): void; +////declare function func(ok_1: Numbers, ok_2: HasID): void; +//// +////func( +//// { n: [1, 2, 3] }, +//// { +//// id: 1, +//// }, +////); + +verify.baselineInlayHints(undefined, { + includeInlayParameterNameHints: "all", +}); diff --git a/tests/cases/fourslash/inlayHintsPropertyDeclarations2.ts b/tests/cases/fourslash/inlayHintsPropertyDeclarations2.ts new file mode 100644 index 0000000000000..71730770a4807 --- /dev/null +++ b/tests/cases/fourslash/inlayHintsPropertyDeclarations2.ts @@ -0,0 +1,21 @@ +/// + +// @strict: true +// @target: esnext +//// class C { +//// accessor a = 1 +//// accessor b: number = 2 +//// accessor c; +//// accessor d; +//// +//// constructor(value: number) { +//// this.d = value; +//// if (value <= 0) { +//// this.d = null; +//// } +//// } +//// } + +verify.baselineInlayHints(undefined, { + includeInlayPropertyDeclarationTypeHints: true, +}); diff --git a/tests/cases/fourslash/moveToFile_namespaceImport.ts b/tests/cases/fourslash/moveToFile_namespaceImport.ts new file mode 100644 index 0000000000000..443cf161535f9 --- /dev/null +++ b/tests/cases/fourslash/moveToFile_namespaceImport.ts @@ -0,0 +1,33 @@ +/// + +// @Filename: /a.ts +//// export type ExecutionPoint = string; +//// + +// @Filename: /b.ts +//// import * as A from "./a"; +//// +//// [|async function fn1(point: A.ExecutionPoint) {}|] +//// +//// async function fn2(point: A.ExecutionPoint) {} +//// + +// @Filename: /point.ts +//// + +verify.moveToFile({ + newFileContents: { + "/b.ts": +`import * as A from "./a"; + +async function fn2(point: A.ExecutionPoint) {} +`, + "/point.ts": +`import * as A from "./a"; + + +async function fn1(point: A.ExecutionPoint) { } +`, + }, + interactiveRefactorArguments: { targetFile: "/point.ts" }, +}); \ No newline at end of file diff --git a/tests/cases/fourslash/moveToNewFile_aliasDefaultExportNamedImport.ts b/tests/cases/fourslash/moveToNewFile_aliasDefaultExportNamedImport.ts new file mode 100644 index 0000000000000..2db768ae54e4c --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_aliasDefaultExportNamedImport.ts @@ -0,0 +1,35 @@ +/// + +// @Filename: /node_modules/use-react/index.d.ts +///// export { default as useLatest } from './useLatest'; + +// @Filename: /node_modules/use-react/index.d.ts +//// declare const useLatest: (value: T) => { +//// readonly current: T; +//// }; +//// export default useLatest; +//// + +// @Filename: /test.ts +//// import { useLatest } from 'react-use'; +//// +//// [|export function useUseLatest(data: string) { +//// return useLatest(data); +//// }|] + +verify.moveToNewFile({ + newFileContents: { + "/test.ts": +` +`, + + "/useUseLatest.ts": +`import { useLatest } from 'react-use'; + + +export function useUseLatest(data: string) { + return useLatest(data); +} +`, + }, +}); \ No newline at end of file diff --git a/tests/cases/fourslash/moveToNewFile_inferQuoteStyle.ts b/tests/cases/fourslash/moveToNewFile_inferQuoteStyle1.ts similarity index 100% rename from tests/cases/fourslash/moveToNewFile_inferQuoteStyle.ts rename to tests/cases/fourslash/moveToNewFile_inferQuoteStyle1.ts diff --git a/tests/cases/fourslash/moveToNewFile_inferQuoteStyle2.ts b/tests/cases/fourslash/moveToNewFile_inferQuoteStyle2.ts new file mode 100644 index 0000000000000..191baee3ebc99 --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_inferQuoteStyle2.ts @@ -0,0 +1,24 @@ +/// + +// @Filename: /a.ts +////export const x = 0; +////x; + +// @Filename: /b.ts +////import { x } from './a' +//// +////[|x|]; + + +verify.moveToNewFile({ + newFileContents: { + "/newFile.ts": // module specifier should have the same quotes as import in the original file +`import { x } from './a'; + +x; +`, + "/b.ts": +` +` + }, +}); diff --git a/tests/cases/fourslash/moveToNewFile_moveNamedImport.ts b/tests/cases/fourslash/moveToNewFile_moveNamedImport1.ts similarity index 100% rename from tests/cases/fourslash/moveToNewFile_moveNamedImport.ts rename to tests/cases/fourslash/moveToNewFile_moveNamedImport1.ts diff --git a/tests/cases/fourslash/moveToNewFile_moveNamedImport2.ts b/tests/cases/fourslash/moveToNewFile_moveNamedImport2.ts new file mode 100644 index 0000000000000..f289d16f7ff0c --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_moveNamedImport2.ts @@ -0,0 +1,22 @@ +/// + +// @Filename: /other.ts +//// export function foo() { return 1 }; + +// @Filename: /a.ts +////import { foo as oFoo } from './other'; +////[|export const x = oFoo();|] +////export const a = 0; + +verify.moveToNewFile({ + newFileContents: { +"/a.ts": +`export const a = 0;`, + +"/x.ts": +`import { foo as oFoo } from './other'; + +export const x = oFoo(); +` + }, +}); diff --git a/tests/cases/fourslash/moveToNewFile_namespaceExport.ts b/tests/cases/fourslash/moveToNewFile_namespaceExport.ts new file mode 100644 index 0000000000000..eaa26394b482d --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_namespaceExport.ts @@ -0,0 +1,25 @@ +/// + +// @module: esnext + +// @filename: /a.ts +////export interface A {} + +// @filename: /b.ts +////export * as A from "./a"; +////export type B = string + +// @filename: /c.ts +////import { A } from "./b" +////[|type B = A.B|] + +verify.moveToNewFile({ + newFileContents: { + "/c.ts": '', + "/B.1.ts": +`import { A } from "./a"; + +type B = A.B; +`, + }, +}); \ No newline at end of file diff --git a/tests/cases/fourslash/moveToNewFile_namespaceTypeImport.ts b/tests/cases/fourslash/moveToNewFile_namespaceTypeImport.ts new file mode 100644 index 0000000000000..e5c48b342373e --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_namespaceTypeImport.ts @@ -0,0 +1,39 @@ +// @filename: /src/test.ts +//// import type * as ambient from "ambient"; +//// +//// [|export class Yadda { +//// foo(): ambient.Thing { +//// throw new Error("not implemented"); +//// } +//// +//// bar(): ambient.DoesNotExist { +//// throw new Error("not implemented"); +//// } +//// }|] + +// @filename: /src/globals.ts +//// declare module "ambient" { +//// export interface Thing {} +//// } + +verify.moveToNewFile({ + newFileContents: { + "/src/test.ts": +` +`, + "/src/Yadda.ts": +`import type * as ambient from "ambient"; + + +export class Yadda { + foo(): ambient.Thing { + throw new Error("not implemented"); + } + + bar(): ambient.DoesNotExist { + throw new Error("not implemented"); + } +} +` + } +}); diff --git a/tests/cases/fourslash/moveToNewFile_reactDefaultImport.ts b/tests/cases/fourslash/moveToNewFile_reactDefaultImport.ts new file mode 100644 index 0000000000000..49ad5794ad6dd --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_reactDefaultImport.ts @@ -0,0 +1,41 @@ +/// + +// @jsx: react +// @module: esnext +// @target: es2020 +// @moduleResolution: bundler + +// @Filename: /node_modules/react/index.d.ts +//// export = React; +//// export as namespace React; +//// declare namespace React { +//// class Component {} +//// } + +// @Filename: /src/main.tsx +//// import React from "react"; +//// +//// [|class MyComponent extends React.Component { +//// render() { +//// return
; +//// } +//// }|] + + +// this test only crashes with bundler and non-preserve +verify.moveToNewFile({ + newFileContents: { + "/src/main.tsx": +` +`, + "/src/MyComponent.tsx": +`import React from "react"; + +class MyComponent extends React.Component { + render() { + return
; + } +} +` + } +}); diff --git a/tests/cases/fourslash/moveToNewFile_reactNamespaceImport.ts b/tests/cases/fourslash/moveToNewFile_reactNamespaceImport.ts new file mode 100644 index 0000000000000..2dff4b1014877 --- /dev/null +++ b/tests/cases/fourslash/moveToNewFile_reactNamespaceImport.ts @@ -0,0 +1,44 @@ +/// + +// @jsx: preserve + +// @Filename: /node_modules/react/index.d.ts +////export = React; +////export as namespace React; +////declare namespace React { +//// class Component {} +////} + +// @Filename: /src/main.tsx +//// import * as React from 'react'; +//// +//// export const main = () => {}; +//// +//// [|interface SProps { +//// children: string; +//// } +//// +//// function SidebarSection({children}: SProps) { +//// return
{children}
; +//// }|] + + +verify.moveToNewFile({ + newFileContents: { + "/src/main.tsx": +` +export const main = () => {}; + +`, + "/src/SProps.tsx": +`import * as React from 'react'; + +interface SProps { + children: string; +} +function SidebarSection({ children }: SProps) { + return
{children}
; +} +` + } +}); diff --git a/tests/cases/fourslash/navigationBarItemsClass6.ts b/tests/cases/fourslash/navigationBarItemsClass6.ts new file mode 100644 index 0000000000000..7dc7290356d18 --- /dev/null +++ b/tests/cases/fourslash/navigationBarItemsClass6.ts @@ -0,0 +1,31 @@ +/// + +////function Z() { } +//// +////Z.foo = 42 +//// +////class Z { } + +verify.navigationTree({ + text: "", + kind: "script", + childItems: [ + { + text: "Z", + kind: "class", + childItems: [ + { + text: "constructor", + kind: "constructor" + }, + { + text: "foo" + } + ] + }, + { + text: "Z", + kind: "class" + } + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonExportsWildcard12.ts b/tests/cases/fourslash/pathCompletionsPackageJsonExportsWildcard12.ts new file mode 100644 index 0000000000000..9b6dcd8ce31a7 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonExportsWildcard12.ts @@ -0,0 +1,55 @@ +/// + +// @module: nodenext + +// @Filename: /node_modules/foo/package.json +//// { +//// "name": "foo", +//// "exports": { +//// "./bar/_*/suffix": "./dist/*.js" +//// } +//// } + +// @Filename: /node_modules/foo/dist/b.d.ts +////export const x = 0; + +// @Filename: /node_modules/foo/dist/dir/x.d.ts +/////export const x = 0; + +// @Filename: /a.mts +////import {} from "foo/bar//*0*/"; +////import {} from "foo/bar/dir//*1*/"; // invalid +////import {} from "foo/bar/_/*2*/"; +////import {} from "foo/bar/_dir//*3*/"; + +verify.completions( + { + marker: "0", + exact: [ + { name: "bar/_b/suffix", kind: "script" }, + { name: "bar/_dir/suffix", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "1", + exact: [ + { name: "bar/_b/suffix", kind: "script" }, + { name: "bar/_dir/suffix", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "2", + exact: [ + { name: "b", kind: "script" }, + { name: "dir", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "3", + exact: { name: "x", kind: "script" }, + isNewIdentifierLocation: true, + }, +); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsBundlerNoNodeCondition.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsBundlerNoNodeCondition.ts new file mode 100644 index 0000000000000..324c51f0a696b --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsBundlerNoNodeCondition.ts @@ -0,0 +1,31 @@ +/// + +// @moduleResolution: bundler + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#only-for-node": { +//// "node": "./something.js" +//// }, +//// "#for-everywhere": "./other.js", +//// } +//// } + +// @Filename: /something.d.ts +//// export const index = 0; + +// @Filename: /other.d.ts +//// export const index = 0; + +// @Filename: /index.ts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#for-everywhere", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsCustomConditions.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsCustomConditions.ts new file mode 100644 index 0000000000000..81a4da924773e --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsCustomConditions.ts @@ -0,0 +1,28 @@ +/// + +// @module: nodenext +// @customConditions: custom-condition + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#only-with-custom-conditions": { +//// "custom-condition": "./something.js" +//// }, +//// } +//// } + +// @Filename: /something.d.ts +//// export const index = 0; + +// @Filename: /index.ts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#only-with-custom-conditions", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsIgnoreMatchingNodeModule1.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsIgnoreMatchingNodeModule1.ts new file mode 100644 index 0000000000000..c38db992d9a1f --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsIgnoreMatchingNodeModule1.ts @@ -0,0 +1,22 @@ +/// + +// @module: nodenext + +// @Filename: /src/node_modules/#internal/package.json +//// { +//// "imports": { +//// "#thing": "./dist/something.js" +//// } +//// } + +// @Filename: /src/node_modules/#internal/dist/something.d.ts +//// export function something(name: string): any; + +// @Filename: /src/a.ts +//// import {} from "#internal//*1*/"; + +verify.completions({ + marker: ["1"], + exact: [], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsIgnoreMatchingNodeModule2.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsIgnoreMatchingNodeModule2.ts new file mode 100644 index 0000000000000..81616077fb03f --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsIgnoreMatchingNodeModule2.ts @@ -0,0 +1,25 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#internal/*": "./src/*.ts" +//// } +//// } + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /src/node_modules/#internal/package.json +//// {} + +// @Filename: /src/a.ts +//// import {} from "#internal//*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["a", "something"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsOnlyFromClosestScope1.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsOnlyFromClosestScope1.ts new file mode 100644 index 0000000000000..0c5e569b2a000 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsOnlyFromClosestScope1.ts @@ -0,0 +1,34 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "imports": { +//// "#thing": "./src/something.ts" +//// } +//// } + +// @Filename: /src/package.json +//// {} + +// @Filename: /src/something.ts +//// export function something(name: string): any; + +// @Filename: /src/a.ts +//// import {} from "/*1*/"; + +// @Filename: /a.ts +//// import {} from "/*2*/"; + +verify.completions({ + marker: ["1"], + exact: [], + isNewIdentifierLocation: true, +}); + +verify.completions({ + marker: ["2"], + exact: ["#thing"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard1.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard1.ts new file mode 100644 index 0000000000000..274412a2fe8d5 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard1.ts @@ -0,0 +1,45 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "main": "dist/index.js", +//// "module": "dist/index.mjs", +//// "types": "dist/index.d.ts", +//// "imports": { +//// "#*": { +//// "types": "./dist/*.d.ts", +//// "import": "./dist/*.mjs", +//// "default": "./dist/*.js" +//// }, +//// "#arguments": { +//// "types": "./dist/arguments/index.d.ts", +//// "import": "./dist/arguments/index.mjs", +//// "default": "./dist/arguments/index.js" +//// } +//// } +//// } + +// @Filename: /dist/index.d.ts +//// export const index = 0; + +// @Filename: /dist/blah.d.ts +//// export const blah = 0; + +// @Filename: /dist/arguments/index.d.ts +//// export const arguments = 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + { name: "#index", kind: "script", kindModifiers: "" }, + { name: "#arguments", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard10.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard10.ts new file mode 100644 index 0000000000000..129e291e4c2ae --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard10.ts @@ -0,0 +1,28 @@ +/// + +// @module: preserve +// @moduleResolution: bundler +// @allowImportingTsExtensions: true +// @jsx: react + +// @Filename: /package.json +//// { +//// "name": "repo", +//// "imports": { +//// "#*": "./src/*" +//// } +//// } + +// @Filename: /src/card.tsx +//// export {}; + +// @Filename: /main.ts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#card.tsx", kind: "script", kindModifiers: ".tsx" }, + ], +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard11.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard11.ts new file mode 100644 index 0000000000000..a355b245eb908 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard11.ts @@ -0,0 +1,27 @@ +/// + +// @module: preserve +// @moduleResolution: bundler +// @jsx: react + +// @Filename: /package.json +//// { +//// "name": "repo", +//// "imports": { +//// "#*": "./src/*" +//// } +//// } + +// @Filename: /src/card.tsx +//// export {}; + +// @Filename: /main.ts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#card.js", kind: "script", kindModifiers: ".js" }, + ], +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard12.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard12.ts new file mode 100644 index 0000000000000..d0fdfedbc1fa6 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard12.ts @@ -0,0 +1,58 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "repo", +//// "imports": { +//// "#foo/_*/suffix": "./src/*.ts" +//// } +//// } + +// @Filename: /src/b.ts +////export const x = 0; + +// @Filename: /src/dir/x.ts +/////export const x = 0; + +// @Filename: /src/a.ts +////import {} from "#foo//*0*/"; +////import {} from "#foo/dir//*1*/"; // invalid +////import {} from "#foo/_/*2*/"; +////import {} from "#foo/_dir//*3*/"; + +verify.completions( + { + marker: "0", + exact: [ + { name: "#foo/_a/suffix", kind: "script" }, + { name: "#foo/_b/suffix", kind: "script" }, + { name: "#foo/_dir/suffix", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "1", + exact: [ + { name: "#foo/_a/suffix", kind: "script" }, + { name: "#foo/_b/suffix", kind: "script" }, + { name: "#foo/_dir/suffix", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "2", + exact: [ + { name: "a", kind: "script" }, + { name: "b", kind: "script" }, + { name: "dir", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "3", + exact: { name: "x", kind: "script" }, + isNewIdentifierLocation: true, + }, +); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard2.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard2.ts new file mode 100644 index 0000000000000..0e53d02ecc378 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard2.ts @@ -0,0 +1,42 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "salesforce-pageobjects", +//// "version": "1.0.0", +//// "imports": { +//// "#*": { +//// "types": "./dist/*.d.ts", +//// "import": "./dist/*.mjs", +//// "default": "./dist/*.js" +//// } +//// } +//// } + +// @Filename: /dist/action/pageObjects/actionRenderer.d.ts +//// export const actionRenderer = 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [{ name: "#action", kind: "directory" }] +}); + +edit.insert("#action/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "pageObjects", kind: "directory" }], +}); + +edit.insert("pageObjects/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "actionRenderer", kind: "script" }], +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard3.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard3.ts new file mode 100644 index 0000000000000..e5ca68e643938 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard3.ts @@ -0,0 +1,45 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "types": "index.d.ts", +//// "imports": { +//// "#component-*": { +//// "types@>=4.3.5": "types/components/*.d.ts" +//// } +//// } +//// } + +// @Filename: /nope.d.ts +//// export const nope = 0; + +// @Filename: /types/components/index.d.ts +//// export const index = 0; + +// @Filename: /types/components/blah.d.ts +//// export const blah = 0; + +// @Filename: /types/components/subfolder/one.d.ts +//// export const one = 0; + +// @Filename: /a.ts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#component-blah", kind: "script" }, + { name: "#component-index", kind: "script" }, + { name: "#component-subfolder", kind: "directory" }, + ], +}); + +edit.insert("#component-subfolder/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "one", kind: "script" }], +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard4.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard4.ts new file mode 100644 index 0000000000000..06ead3662e97b --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard4.ts @@ -0,0 +1,64 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "types": "index.d.ts", +//// "imports": { +//// "#*": "dist/*", +//// "#foo/*": "dist/*", +//// "#bar/*": "dist/*", +//// "#exact-match": "dist/index.d.ts" +//// } +//// } + +// @Filename: /nope.d.ts +//// export const nope = 0; + +// @Filename: /dist/index.d.ts +//// export const index = 0; + +// @Filename: /dist/blah.d.ts +//// export const blah = 0; + +// @Filename: /dist/foo/onlyInFooFolder.d.ts +//// export const foo = 0; + +// @Filename: /dist/subfolder/one.d.ts +//// export const one = 0; + +// @Filename: /a.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah.js", kind: "script", kindModifiers: ".js" }, + { name: "#index.js", kind: "script", kindModifiers: ".js" }, + { name: "#foo", kind: "directory" }, + { name: "#subfolder", kind: "directory" }, + { name: "#bar", kind: "directory" }, + { name: "#exact-match", kind: "script" }, + ], +}); + +edit.insert("#foo/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [ + { name: "blah.js", kind: "script", kindModifiers: ".js" }, + { name: "index.js", kind: "script", kindModifiers: ".js" }, + { name: "foo", kind: "directory" }, + { name: "subfolder", kind: "directory" }, + ], +}); + +edit.insert("foo/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "onlyInFooFolder.js", kind: "script", kindModifiers: ".js" }], +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard5.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard5.ts new file mode 100644 index 0000000000000..4217ece6826c9 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard5.ts @@ -0,0 +1,56 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "main": "dist/index.js", +//// "module": "dist/index.mjs", +//// "types": "dist/index.d.ts", +//// "imports": { +//// "#*": { +//// "import": { +//// "types": "./dist/types/*.d.mts", +//// "default": "./dist/esm/*.mjs" +//// }, +//// "default": { +//// "types": "./dist/types/*.d.ts", +//// "default": "./dist/cjs/*.js" +//// } +//// }, +//// "#only-in-cjs": { +//// "require": { +//// "types": "./dist/types/only-in-cjs/index.d.ts", +//// "default": "./dist/cjs/only-in-cjs/index.js" +//// } +//// } +//// } +//// } + +// @Filename: /dist/types/index.d.mts +//// export const index = 0; + +// @Filename: /dist/types/index.d.ts +//// export const index = 0; + +// @Filename: /dist/types/blah.d.mts +//// export const blah = 0; + +// @Filename: /dist/types/blah.d.ts +//// export const blah = 0; + +// @Filename: /dist/types/only-in-cjs/index.d.ts +//// export const onlyInCjs = 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + { name: "#index", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard6.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard6.ts new file mode 100644 index 0000000000000..265fbe322404e --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard6.ts @@ -0,0 +1,31 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "main": "dist/index.js", +//// "module": "dist/index.mjs", +//// "types": "dist/index.d.ts", +//// "imports": { +//// "#*": "./dist/*?.d.ts" +//// } +//// } + +// @Filename: /dist/index.d.ts +//// export const index = 0; + +// @Filename: /dist/blah?.d.ts +//// export const blah = 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard7.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard7.ts new file mode 100644 index 0000000000000..42446088f6586 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard7.ts @@ -0,0 +1,25 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#*": "./dist/*.js" +//// } +//// } + +// @Filename: /dist/blah.d.ts +//// export const blah = 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard8.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard8.ts new file mode 100644 index 0000000000000..b66761c43257d --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard8.ts @@ -0,0 +1,28 @@ +/// + +// @module: nodenext + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#*": "./dist/*.js" +//// } +//// } + +// @Filename: /dist/blah.js +//// export const blah = 0; + +// @Filename: /dist/blah.d.ts +//// export declare const blah: 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard9.ts b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard9.ts new file mode 100644 index 0000000000000..5e3ba519e23c3 --- /dev/null +++ b/tests/cases/fourslash/pathCompletionsPackageJsonImportsWildcard9.ts @@ -0,0 +1,26 @@ +/// + +// @module: nodenext +// @allowJs: true + +// @Filename: /package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#*": "./dist/*.js" +//// } +//// } + +// @Filename: /dist/blah.js +//// export const blah = 0; + +// @Filename: /index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/server/importCompletions_importsMap1.ts b/tests/cases/fourslash/server/importCompletions_importsMap1.ts new file mode 100644 index 0000000000000..530704bfb5d74 --- /dev/null +++ b/tests/cases/fourslash/server/importCompletions_importsMap1.ts @@ -0,0 +1,36 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "type": "module", +//// "imports": { +//// "#is-browser": { +//// "browser": "./dist/env/browser.js", +//// "default": "./dist/env/node.js" +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/env/browser.ts +//// export const isBrowser = true; + +// @Filename: /home/src/workspaces/project/src/env/node.ts +//// export const isBrowser = false; + +// @Filename: /home/src/workspaces/project/src/a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#is-browser"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/server/importCompletions_importsMap2.ts b/tests/cases/fourslash/server/importCompletions_importsMap2.ts new file mode 100644 index 0000000000000..10ea87f0aca2d --- /dev/null +++ b/tests/cases/fourslash/server/importCompletions_importsMap2.ts @@ -0,0 +1,36 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "type": "module", +//// "imports": { +//// "#internal/*": "./dist/internal/*" +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/internal/foo.ts +//// export function something(name: string) {} + +// @Filename: /home/src/workspaces/project/src/a.ts +//// import {} from "/*1*/"; +//// import {} from "#internal//*2*/"; + +verify.completions({ + marker: ["1"], + exact: ["#internal"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["2"], + exact: ["foo.js"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/server/importCompletions_importsMap3.ts b/tests/cases/fourslash/server/importCompletions_importsMap3.ts new file mode 100644 index 0000000000000..01776d771a3db --- /dev/null +++ b/tests/cases/fourslash/server/importCompletions_importsMap3.ts @@ -0,0 +1,36 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "type": "module", +//// "imports": { +//// "#internal/": "./dist/internal/" +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/internal/foo.ts +//// export function something(name: string) {} + +// @Filename: /home/src/workspaces/project/src/a.ts +//// import {} from "/*1*/"; +//// import {} from "#internal//*2*/"; + +verify.completions({ + marker: ["1"], + exact: ["#internal"], + isNewIdentifierLocation: true, +}); +verify.completions({ + marker: ["2"], + exact: ["foo.js"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/server/importCompletions_importsMap4.ts b/tests/cases/fourslash/server/importCompletions_importsMap4.ts new file mode 100644 index 0000000000000..3e15b253f4710 --- /dev/null +++ b/tests/cases/fourslash/server/importCompletions_importsMap4.ts @@ -0,0 +1,33 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "type": "module", +//// "imports": { +//// "#is-browser": { +//// "types": "./dist/env/browser.d.ts", +//// "default": "./dist/env/browser.js" +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/env/browser.ts +//// export const isBrowser = true; + +// @Filename: /home/src/workspaces/project/src/a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#is-browser"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/server/importCompletions_importsMap5.ts b/tests/cases/fourslash/server/importCompletions_importsMap5.ts new file mode 100644 index 0000000000000..0b240075a1e66 --- /dev/null +++ b/tests/cases/fourslash/server/importCompletions_importsMap5.ts @@ -0,0 +1,34 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist", +//// "declarationDir": "types", +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "type": "module", +//// "imports": { +//// "#is-browser": { +//// "types": "./types/env/browser.d.ts", +//// "default": "./not-dist-on-purpose/env/browser.js" +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/env/browser.ts +//// export const isBrowser = true; + +// @Filename: /home/src/workspaces/project/src/a.ts +//// import {} from "/*1*/"; + +verify.completions({ + marker: ["1"], + exact: ["#is-browser"], + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/server/pasteEdits_blankTargetFile.ts b/tests/cases/fourslash/server/pasteEdits_blankTargetFile.ts index 97cd869cd74a7..711f50eaed1b8 100644 --- a/tests/cases/fourslash/server/pasteEdits_blankTargetFile.ts +++ b/tests/cases/fourslash/server/pasteEdits_blankTargetFile.ts @@ -1,6 +1,6 @@ /// -// @Filename: /home/src/workspaces/project/c.ts +// @Filename: /home/src/workspaces/project/folder/c.ts ////[||] // @Filename: /home/src/workspaces/project/a.ts @@ -15,7 +15,7 @@ //// console.log("abc"); // @Filename: /home/src/workspaces/project/tsconfig.json -////{ "files": ["c.ts", "a.ts", "b.ts"] } +////{ "files": ["folder/c.ts", "a.ts", "b.ts"] } const ranges = test.ranges(); verify.pasteEdits({ @@ -25,8 +25,8 @@ verify.pasteEdits({ copiedFrom: { file: "/home/src/workspaces/project/b.ts", range: [ranges[1]] }, }, newFileContents: { - "/home/src/workspaces/project/c.ts": -`import { abc } from "./a"; + "/home/src/workspaces/project/folder/c.ts": +`import { abc } from "../a"; console.log(abc);` } diff --git a/tests/cases/fourslash/server/pasteEdits_defaultExport1.ts b/tests/cases/fourslash/server/pasteEdits_defaultExport1.ts new file mode 100644 index 0000000000000..c04342ef37ab4 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_defaultExport1.ts @@ -0,0 +1,31 @@ +/// + +// @Filename: /home/src/workspaces/project/folder/c.ts +////[||] + +// @Filename: /home/src/workspaces/project/b.ts +////import foo from "./a"; +////[|const b = foo("bar");|] + +// @Filename: /home/src/workspaces/project/a.ts +//// export default function foo(name: string): void { +//// console.log(name); +//// } + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["folder/c.ts", "a.ts", "b.ts"] } + +const range = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`const b = foo("bar");`], + pasteLocations: [range[0]], + copiedFrom: { file: "/home/src/workspaces/project/b.ts", range: [range[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/c.ts": +`import foo from "../a"; + +const b = foo("bar");` + } +}); \ No newline at end of file diff --git a/tests/cases/fourslash/server/pasteEdits_defaultExport2.ts b/tests/cases/fourslash/server/pasteEdits_defaultExport2.ts new file mode 100644 index 0000000000000..bb8adbc78a522 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_defaultExport2.ts @@ -0,0 +1,28 @@ +/// + +// @Filename: /home/src/workspaces/project/folder/c.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +////[|const b = foo("bar");|] +//// export default function foo(name: string): void { +//// console.log(name); +//// } + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["folder/c.ts", "a.ts"] } + +const range = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`const b = foo("bar");`], + pasteLocations: [range[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [range[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/c.ts": +`import foo from "../a"; + +const b = foo("bar");` + } +}); \ No newline at end of file diff --git a/tests/cases/fourslash/server/pasteEdits_defaultImport.ts b/tests/cases/fourslash/server/pasteEdits_defaultImport.ts new file mode 100644 index 0000000000000..d2eafb4291c45 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_defaultImport.ts @@ -0,0 +1,45 @@ +/// + +// @Filename: /home/src/workspaces/project/folder/folder/c.ts +//// [||] + +// @Filename: /home/src/workspaces/project/folder/b.mts +//// import test from "./a.js"; +//// +//// [|function foo(abc: test.testInterface, def: test.testInterface) { +//// console.log(abc); +//// console.log(def); +//// }|] +//// + +// @Filename: /home/src/workspaces/project/folder/a.ts +//// const abc = 10; +//// const def = 20; +//// export interface testInterface { +//// abc: number; +//// def: number; +//// } + +// @Filename: /home/src/workspaces/project/folder/tsconfig.json +////{ "compilerOptions": { "module": "nodenext" }, "files": ["folder/c.ts", "a.ts", "b.mts"] } + +const range = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`function foo(abc: test.abc, def: test.def) { +console.log(abc); +console.log(def); +}`], + pasteLocations: [range[0]], + copiedFrom: { file: "/home/src/workspaces/project/folder/b.mts", range: [range[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/folder/c.ts": +`import test from "../a"; + +function foo(abc: test.abc, def: test.def) { +console.log(abc); +console.log(def); +}` + } +}); \ No newline at end of file diff --git a/tests/cases/fourslash/server/pasteEdits_namespaceImport.ts b/tests/cases/fourslash/server/pasteEdits_namespaceImport.ts new file mode 100644 index 0000000000000..ded500926fa96 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_namespaceImport.ts @@ -0,0 +1,46 @@ +/// + +// @Filename: /home/src/workspaces/project/folder/c.ts +//// [||] + + +// @Filename: /home/src/workspaces/project/a.ts +//// const abc = 10; +//// const def = 20; +//// export interface testInterface { +//// abc: number; +//// def: number; +//// } + +// @Filename: /home/src/workspaces/project/b.ts +//// import * as test from "./a"; +//// +//// [|function foo(abc: test.abc, def: test.def) { +//// console.log(abc); +//// console.log(def); +//// }|] +//// + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["folder/c.ts", "a.ts", "b.ts"] } + +const range = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`function foo(abc: test.abc, def: test.def) { +console.log(abc); +console.log(def); +}`], + pasteLocations: [range[0]], + copiedFrom: { file: "/home/src/workspaces/project/b.ts", range: [range[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/c.ts": +`import * as test from "../a"; + +function foo(abc: test.abc, def: test.def) { +console.log(abc); +console.log(def); +}` + } +}); \ No newline at end of file diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection0.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection0.ts new file mode 100644 index 0000000000000..5ab90a9b480d2 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection0.ts @@ -0,0 +1,23 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// [||]function foo() { } +//// const x = foo() +//// +//// foo() +//// x + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [``], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: {} +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection1.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection1.ts new file mode 100644 index 0000000000000..f9276c236dadb --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection1.ts @@ -0,0 +1,34 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// const x = foo() +//// +//// [|foo()|] +//// x + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo()`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a"; + +foo()`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } +const x = foo() + +foo() +x`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection2.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection2.ts new file mode 100644 index 0000000000000..4f6992b1f1868 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection2.ts @@ -0,0 +1,32 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// +//// // comment +//// [|foo()|] + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo()`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a"; + +foo()`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } + +// comment +foo()`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection3.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection3.ts new file mode 100644 index 0000000000000..d9cd323acdab1 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection3.ts @@ -0,0 +1,32 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// +//// /* comment */ +//// [|foo()|] + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo()`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a"; + +foo()`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } + +/* comment */ +foo()`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection4.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection4.ts new file mode 100644 index 0000000000000..56c6d6ce60c0c --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection4.ts @@ -0,0 +1,44 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// +//// /* +//// [| comment +//// more comment +//// */ +//// foo()|] + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [` comment + more comment +*/ +foo()`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a" + + comment + more comment +*/ +foo()`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } + +/* + comment + more comment +*/ +foo()`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection5.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection5.ts new file mode 100644 index 0000000000000..df881e68744c8 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection5.ts @@ -0,0 +1,34 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// +//// [|// comment +//// foo()|] + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`// comment +foo()`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a"; + +// comment +foo()`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } + +// comment +foo()`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection6.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection6.ts new file mode 100644 index 0000000000000..607e98f052ff6 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection6.ts @@ -0,0 +1,42 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// const x = foo() +//// +//// // comment +//// [|foo() +//// /* another comment */ +//// x|] + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo() +/* another comment */ +x`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo, x } from "../a" + +foo() +/* another comment */ +x`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } +export const x = foo() + +// comment +foo() +/* another comment */ +x`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection7.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection7.ts new file mode 100644 index 0000000000000..cf8deea6bcc22 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection7.ts @@ -0,0 +1,40 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// const x = foo() +//// +//// // comment +//// [|foo +//// /* another comment */|] +//// x + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo +/* another comment */`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a"; + +foo +/* another comment */`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } +const x = foo() + +// comment +foo +/* another comment */ +x`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection8.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection8.ts new file mode 100644 index 0000000000000..13a54c2f854f7 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection8.ts @@ -0,0 +1,42 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// const aaaa = foo() +//// +//// // comment +//// [|foo +//// /* another comment */ +//// a|]aaa + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo +/* another comment */ +a`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a" + +foo +/* another comment */ +a`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } +const aaaa = foo() + +// comment +foo +/* another comment */ +aaaa`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_rangeSelection9.ts b/tests/cases/fourslash/server/pasteEdits_rangeSelection9.ts new file mode 100644 index 0000000000000..872746f4ba141 --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_rangeSelection9.ts @@ -0,0 +1,34 @@ +/// +// @Filename: /home/src/workspaces/project/folder/target.ts +////[||] + +// @Filename: /home/src/workspaces/project/a.ts +//// function foo() { } +//// +//// // comment +//// [|foo|] +//// /* another comment */ + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["a.ts", "folder/target.ts"] } + +const ranges = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: [`foo`], + pasteLocations: [ranges[0]], + copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [ranges[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/target.ts": +`import { foo } from "../a"; + +foo`, + "/home/src/workspaces/project/a.ts": +`export function foo() { } + +// comment +foo +/* another comment */`, + } +}); diff --git a/tests/cases/fourslash/server/pasteEdits_requireImportJsx.ts b/tests/cases/fourslash/server/pasteEdits_requireImportJsx.ts new file mode 100644 index 0000000000000..f7be3b8f61c4a --- /dev/null +++ b/tests/cases/fourslash/server/pasteEdits_requireImportJsx.ts @@ -0,0 +1,47 @@ +/// + +// @Filename: /home/src/workspaces/project/folder/c.jsx +//// [||] + +// @Filename: /home/src/workspaces/project/b.jsx +//// import React = require("./react"); +//// +//// [|class MyComponent extends React.Component { +//// render() { +//// return
; +//// } +//// }|] + +// @Filename: /home/src/workspaces/project/react.d.ts +////export = React; +////export as namespace React; +////declare namespace React { +//// class Component {} +////} + +// @Filename: /home/src/workspaces/project/tsconfig.json +////{ "files": ["folder/c.jsx", "react.d.ts", "b.jsx"] } + +const range = test.ranges(); +verify.pasteEdits({ + args: { + pastedText: +[`class MyComponent extends React.Component { + render() { + return
; + } +}`], + pasteLocations: [range[0]], + copiedFrom: { file: "/home/src/workspaces/project/b.jsx", range: [range[1]] }, + }, + newFileContents: { + "/home/src/workspaces/project/folder/c.jsx": +`const React = require("../react"); + +class MyComponent extends React.Component { + render() { + return
; + } +}` + } +}); \ No newline at end of file diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard1.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard1.ts new file mode 100644 index 0000000000000..0bc1ad2dbdacc --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard1.ts @@ -0,0 +1,52 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "foo", +//// "main": "dist/index.js", +//// "module": "dist/index.mjs", +//// "types": "dist/index.d.ts", +//// "imports": { +//// "#*": { +//// "types": "./dist/*.d.ts", +//// "import": "./dist/*.mjs", +//// "default": "./dist/*.js" +//// }, +//// "#arguments": { +//// "types": "./dist/arguments/index.d.ts", +//// "import": "./dist/arguments/index.mjs", +//// "default": "./dist/arguments/index.js" +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/index.ts +//// export const index = 0; + +// @Filename: /home/src/workspaces/project/src/blah.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/arguments/index.ts +//// export const arguments = 0; + +// @Filename: /home/src/workspaces/project/src/m.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + { name: "#index", kind: "script", kindModifiers: "" }, + { name: "#arguments", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard2.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard2.ts new file mode 100644 index 0000000000000..5dbbeba52d78c --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard2.ts @@ -0,0 +1,49 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "salesforce-pageobjects", +//// "version": "1.0.0", +//// "imports": { +//// "#*": { +//// "types": "./dist/*.d.ts", +//// "import": "./dist/*.mjs", +//// "default": "./dist/*.js" +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/action/pageObjects/actionRenderer.ts +//// export const actionRenderer = 0; + +// @Filename: /home/src/workspaces/project/src/index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [{ name: "#action", kind: "directory" }] +}); + +edit.insert("#action/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "pageObjects", kind: "directory" }], +}); + +edit.insert("pageObjects/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "actionRenderer", kind: "script" }], +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard3.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard3.ts new file mode 100644 index 0000000000000..443382bdf4811 --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard3.ts @@ -0,0 +1,53 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist", +//// "declarationDir": "types" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "types": "index.d.ts", +//// "imports": { +//// "#component-*": { +//// "types@>=4.3.5": "types/components/*.d.ts" +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/nope.ts +//// export const nope = 0; + +// @Filename: /home/src/workspaces/project/src/components/index.ts +//// export const index = 0; + +// @Filename: /home/src/workspaces/project/src/components/blah.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/components/subfolder/one.ts +//// export const one = 0; + +// @Filename: /home/src/workspaces/project/src/a.ts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#component-blah", kind: "script" }, + { name: "#component-index", kind: "script" }, + { name: "#component-subfolder", kind: "directory" }, + ], +}); + +edit.insert("#component-subfolder/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "one", kind: "script" }], +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard4.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard4.ts new file mode 100644 index 0000000000000..ae393be7ce4d6 --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard4.ts @@ -0,0 +1,73 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "types": "index.d.ts", +//// "imports": { +//// "#*": "dist/*", +//// "#foo/*": "dist/*", +//// "#bar/*": "dist/*", +//// "#exact-match": "dist/index.d.ts" +//// } +//// } + +// @Filename: /home/src/workspaces/project/nope.ts +//// export const nope = 0; + +// @Filename: /home/src/workspaces/project/src/index.ts +//// export const index = 0; + +// @Filename: /home/src/workspaces/project/src/blah.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/foo/onlyInFooFolder.ts +//// export const foo = 0; + +// @Filename: /home/src/workspaces/project/src/subfolder/one.ts +//// export const one = 0; + +// @Filename: /home/src/workspaces/project/src/a.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#a.mjs", kind: "script", kindModifiers: ".mjs" }, + { name: "#blah.js", kind: "script", kindModifiers: ".js" }, + { name: "#index.js", kind: "script", kindModifiers: ".js" }, + { name: "#foo", kind: "directory" }, + { name: "#subfolder", kind: "directory" }, + { name: "#bar", kind: "directory" }, + { name: "#exact-match", kind: "script" }, + ], +}); + +edit.insert("#foo/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [ + { name: "a.mjs", kind: "script", kindModifiers: ".mjs" }, + { name: "blah.js", kind: "script", kindModifiers: ".js" }, + { name: "index.js", kind: "script", kindModifiers: ".js" }, + { name: "foo", kind: "directory" }, + { name: "subfolder", kind: "directory" }, + ], +}); + +edit.insert("foo/"); + +verify.completions({ + isNewIdentifierLocation: true, + exact: [{ name: "onlyInFooFolder.js", kind: "script", kindModifiers: ".js" }], +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard5.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard5.ts new file mode 100644 index 0000000000000..d63f313c1773e --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard5.ts @@ -0,0 +1,64 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist/esm", +//// "declarationDir": "dist/types" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "foo", +//// "main": "dist/index.js", +//// "module": "dist/index.mjs", +//// "types": "dist/index.d.ts", +//// "imports": { +//// "#*": { +//// "import": { +//// "types": "./dist/types/*.d.mts", +//// "default": "./dist/esm/*.mjs" +//// }, +//// "default": { +//// "types": "./dist/types/*.d.ts", +//// "default": "./dist/cjs/*.js" +//// } +//// }, +//// "#only-in-cjs": { +//// "require": { +//// "types": "./dist/types/only-in-cjs/index.d.ts", +//// "default": "./dist/cjs/only-in-cjs/index.js" +//// } +//// } +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/index.mts +//// export const index = 0; + +// @Filename: /home/src/workspaces/project/src/index.ts +//// export const index = 0; + +// @Filename: /home/src/workspaces/project/src/blah.mts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/blah.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/only-in-cjs/index.ts +//// export const onlyInCjs = 0; + +// @Filename: /home/src/workspaces/project/src/index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + { name: "#index", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard6.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard6.ts new file mode 100644 index 0000000000000..79026a3f7c2b3 --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard6.ts @@ -0,0 +1,38 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "foo", +//// "main": "dist/index.js", +//// "module": "dist/index.mjs", +//// "types": "dist/index.d.ts", +//// "imports": { +//// "#*": "./dist/*?.d.ts" +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/index.ts +//// export const index = 0; + +// @Filename: /home/src/workspaces/project/src/blah?.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/m.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard7.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard7.ts new file mode 100644 index 0000000000000..c26da613c1304 --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard7.ts @@ -0,0 +1,32 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#*": "./dist/*.js" +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/blah.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard8.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard8.ts new file mode 100644 index 0000000000000..c26da613c1304 --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard8.ts @@ -0,0 +1,32 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist" +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#*": "./dist/*.js" +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/blah.ts +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +}); diff --git a/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard9.ts b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard9.ts new file mode 100644 index 0000000000000..fdbe7436f4d96 --- /dev/null +++ b/tests/cases/fourslash/server/pathCompletionsPackageJsonImportsSrcNoDistWildcard9.ts @@ -0,0 +1,33 @@ +/// + +// @Filename: /home/src/workspaces/project/tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "nodenext", +//// "rootDir": "src", +//// "outDir": "dist", +//// "allowJs": true +//// } +//// } + +// @Filename: /home/src/workspaces/project/package.json +//// { +//// "name": "foo", +//// "imports": { +//// "#*": "./dist/*.js" +//// } +//// } + +// @Filename: /home/src/workspaces/project/src/blah.js +//// export const blah = 0; + +// @Filename: /home/src/workspaces/project/src/index.mts +//// import { } from "/**/"; + +verify.completions({ + marker: "", + isNewIdentifierLocation: true, + exact: [ + { name: "#blah", kind: "script", kindModifiers: "" }, + ] +});