From 9eb689e066cf86eddbd60ba7a2459de80d5d5439 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 30 Aug 2021 14:05:16 -0700 Subject: [PATCH 1/3] Cherry-pick PR #45642 into release-4.4 (#45644) Component commits: 58e56ed5d6 Close package json watches in watch mode on close Co-authored-by: Wesley Wigham --- src/compiler/watchPublic.ts | 4 ++++ .../incremental/editing-module-augmentation-watch.js | 5 ++--- .../importHelpers-backing-types-removed-watch.js | 5 ++--- .../jsxImportSource-backing-types-removed-watch.js | 10 ++++------ .../jsxImportSource-option-changed-watch.js | 4 ---- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index bfcdc4c8a1d2a..1cc21a0bc9400 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -404,6 +404,10 @@ namespace ts { }); parsedConfigs = undefined; } + if (packageJsonMap) { + clearMap(packageJsonMap, closeFileWatcher); + packageJsonMap = undefined!; + } } function getCurrentBuilderProgram() { diff --git a/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-watch.js b/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-watch.js index 381d2d4f0f640..14d6f7c11844c 100644 --- a/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-watch.js @@ -203,9 +203,6 @@ Shape signatures in builder refreshed for:: /users/username/projects/project/src/index.ts (computed .d.ts) WatchedFiles:: -/users/username/projects/project/node_modules/classnames/package.json: - {"fileName":"/users/username/projects/project/node_modules/classnames/package.json","pollingInterval":250} - {"fileName":"/users/username/projects/project/node_modules/classnames/package.json","pollingInterval":250} /users/username/projects/project/tsconfig.json: {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} /users/username/projects/project/src/index.ts: @@ -216,6 +213,8 @@ WatchedFiles:: {"fileName":"/users/username/projects/project/src/types/classnames.d.ts","pollingInterval":250} /a/lib/lib.d.ts: {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/users/username/projects/project/node_modules/classnames/package.json: + {"fileName":"/users/username/projects/project/node_modules/classnames/package.json","pollingInterval":250} FsWatches:: diff --git a/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-watch.js b/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-watch.js index 49041b04874bf..54acbbd1a410d 100644 --- a/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-watch.js @@ -122,15 +122,14 @@ Shape signatures in builder refreshed for:: /users/username/projects/project/index.tsx (used version) WatchedFiles:: -/users/username/projects/project/node_modules/tslib/package.json: - {"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250} - {"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250} /users/username/projects/project/tsconfig.json: {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} /users/username/projects/project/index.tsx: {"fileName":"/users/username/projects/project/index.tsx","pollingInterval":250} /a/lib/lib.d.ts: {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/users/username/projects/project/node_modules/tslib/package.json: + {"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250} FsWatches:: diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-watch.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-watch.js index 9f5e8e47e58e1..641134714d966 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-watch.js @@ -190,18 +190,16 @@ Shape signatures in builder refreshed for:: /users/username/projects/project/index.tsx (computed .d.ts) WatchedFiles:: -/users/username/projects/project/node_modules/react/jsx-runtime/package.json: - {"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250} - {"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250} -/users/username/projects/project/node_modules/react/package.json: - {"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250} - {"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250} /users/username/projects/project/tsconfig.json: {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} /users/username/projects/project/index.tsx: {"fileName":"/users/username/projects/project/index.tsx","pollingInterval":250} /a/lib/lib.d.ts: {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/users/username/projects/project/node_modules/react/jsx-runtime/package.json: + {"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250} +/users/username/projects/project/node_modules/react/package.json: + {"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250} FsWatches:: diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js index cd4b2d10192ef..0d39109590ffe 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js @@ -225,10 +225,6 @@ Shape signatures in builder refreshed for:: /users/username/projects/project/index.tsx (computed .d.ts) WatchedFiles:: -/users/username/projects/project/node_modules/react/jsx-runtime/package.json: - {"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250} -/users/username/projects/project/node_modules/react/package.json: - {"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250} /users/username/projects/project/tsconfig.json: {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} /users/username/projects/project/index.tsx: From 782c09d783e006a697b4ba6d1e7ec2f718ce8393 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 30 Aug 2021 14:18:11 -0700 Subject: [PATCH 2/3] Cherry-pick PR #45484 into release-4.4 (#45564) Component commits: 33829fa4a4 Fix and updated tests 2249d6c83e Added test e1a2b9ed19 Revert "Fix and updated tests" This reverts commit 33829fa4a4a4cc0b54d3793ced9a31fa42930e3a. 51881c4ea2 Filter out empty access expression 2253da6ae9 PR feedback Co-authored-by: Armando Aguirre --- src/services/completions.ts | 11 +++++++---- tests/cases/fourslash/getJavaScriptCompletions22.ts | 12 ++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/getJavaScriptCompletions22.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 285095e727a0c..ef16b782c2971 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1338,13 +1338,16 @@ namespace ts.Completions { case SyntaxKind.PropertyAccessExpression: propertyAccessToConvert = parent as PropertyAccessExpression; node = propertyAccessToConvert.expression; - if ((isCallExpression(node) || isFunctionLike(node)) && - node.end === contextToken.pos && - node.getChildCount(sourceFile) && - last(node.getChildren(sourceFile)).kind !== SyntaxKind.CloseParenToken) { + const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert); + if (nodeIsMissing(leftmostAccessExpression) || + ((isCallExpression(node) || isFunctionLike(node)) && + node.end === contextToken.pos && + node.getChildCount(sourceFile) && + last(node.getChildren(sourceFile)).kind !== SyntaxKind.CloseParenToken)) { // This is likely dot from incorrectly parsed expression and user is starting to write spread // eg: Math.min(./**/) // const x = function (./**/) {} + // ({./**/}) return undefined; } break; diff --git a/tests/cases/fourslash/getJavaScriptCompletions22.ts b/tests/cases/fourslash/getJavaScriptCompletions22.ts new file mode 100644 index 0000000000000..86f82a346eeb5 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions22.ts @@ -0,0 +1,12 @@ +/// + +// Regresion test for GH#45436 + +// @allowNonTsExtensions: true +// @Filename: file.js +//// const abc = {}; +//// ({./*1*/}); + +goTo.marker('1'); +edit.insert('.'); +verify.completions({ exact: undefined }); From bbb31bb109d8c2366dd24725a34ea9bf2a35f3b1 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 10 Sep 2021 20:36:51 +0000 Subject: [PATCH 3/3] Bump version to 4.4.3 and LKG --- lib/tsc.js | 6 +++++- lib/tsserver.js | 17 ++++++++++++----- lib/tsserverlibrary.js | 17 ++++++++++++----- lib/typescript.js | 17 ++++++++++++----- lib/typescriptServices.js | 17 ++++++++++++----- lib/typingsInstaller.js | 6 +++++- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 8 files changed, 60 insertions(+), 24 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index d425ad1b55369..e81c6d87ee334 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { var ts; (function (ts) { ts.versionMajorMinor = "4.4"; - ts.version = "4.4.2"; + ts.version = "4.4.3"; var NativeCollections; (function (NativeCollections) { function tryGetNativeMap() { @@ -97526,6 +97526,10 @@ var ts; }); parsedConfigs = undefined; } + if (packageJsonMap) { + ts.clearMap(packageJsonMap, ts.closeFileWatcher); + packageJsonMap = undefined; + } } function getCurrentBuilderProgram() { return builderProgram; diff --git a/lib/tsserver.js b/lib/tsserver.js index 6e4ee30b7be1d..fe6210be028d9 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -100,7 +100,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.4.2"; + ts.version = "4.4.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -118027,6 +118027,10 @@ var ts; }); parsedConfigs = undefined; } + if (packageJsonMap) { + ts.clearMap(packageJsonMap, ts.closeFileWatcher); + packageJsonMap = undefined; + } } function getCurrentBuilderProgram() { return builderProgram; @@ -126702,13 +126706,16 @@ var ts; case 204 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; - if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && - node.end === contextToken.pos && - node.getChildCount(sourceFile) && - ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */) { + var leftmostAccessExpression = ts.getLeftmostAccessExpression(propertyAccessToConvert); + if (ts.nodeIsMissing(leftmostAccessExpression) || + ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && + node.end === contextToken.pos && + node.getChildCount(sourceFile) && + ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */)) { // This is likely dot from incorrectly parsed expression and user is starting to write spread // eg: Math.min(./**/) // const x = function (./**/) {} + // ({./**/}) return undefined; } break; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 5fa1cd290e10a..d7f4aeafca012 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.4.2"; + ts.version = "4.4.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -118221,6 +118221,10 @@ var ts; }); parsedConfigs = undefined; } + if (packageJsonMap) { + ts.clearMap(packageJsonMap, ts.closeFileWatcher); + packageJsonMap = undefined; + } } function getCurrentBuilderProgram() { return builderProgram; @@ -127284,13 +127288,16 @@ var ts; case 204 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; - if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && - node.end === contextToken.pos && - node.getChildCount(sourceFile) && - ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */) { + var leftmostAccessExpression = ts.getLeftmostAccessExpression(propertyAccessToConvert); + if (ts.nodeIsMissing(leftmostAccessExpression) || + ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && + node.end === contextToken.pos && + node.getChildCount(sourceFile) && + ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */)) { // This is likely dot from incorrectly parsed expression and user is starting to write spread // eg: Math.min(./**/) // const x = function (./**/) {} + // ({./**/}) return undefined; } break; diff --git a/lib/typescript.js b/lib/typescript.js index 44462973f29fb..ebd4c15a2a6a7 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.4.2"; + ts.version = "4.4.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -118221,6 +118221,10 @@ var ts; }); parsedConfigs = undefined; } + if (packageJsonMap) { + ts.clearMap(packageJsonMap, ts.closeFileWatcher); + packageJsonMap = undefined; + } } function getCurrentBuilderProgram() { return builderProgram; @@ -127284,13 +127288,16 @@ var ts; case 204 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; - if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && - node.end === contextToken.pos && - node.getChildCount(sourceFile) && - ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */) { + var leftmostAccessExpression = ts.getLeftmostAccessExpression(propertyAccessToConvert); + if (ts.nodeIsMissing(leftmostAccessExpression) || + ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && + node.end === contextToken.pos && + node.getChildCount(sourceFile) && + ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */)) { // This is likely dot from incorrectly parsed expression and user is starting to write spread // eg: Math.min(./**/) // const x = function (./**/) {} + // ({./**/}) return undefined; } break; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 20a6fc52e509b..9fb67067ec13c 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.4.2"; + ts.version = "4.4.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -118221,6 +118221,10 @@ var ts; }); parsedConfigs = undefined; } + if (packageJsonMap) { + ts.clearMap(packageJsonMap, ts.closeFileWatcher); + packageJsonMap = undefined; + } } function getCurrentBuilderProgram() { return builderProgram; @@ -127284,13 +127288,16 @@ var ts; case 204 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; - if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && - node.end === contextToken.pos && - node.getChildCount(sourceFile) && - ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */) { + var leftmostAccessExpression = ts.getLeftmostAccessExpression(propertyAccessToConvert); + if (ts.nodeIsMissing(leftmostAccessExpression) || + ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && + node.end === contextToken.pos && + node.getChildCount(sourceFile) && + ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */)) { // This is likely dot from incorrectly parsed expression and user is starting to write spread // eg: Math.min(./**/) // const x = function (./**/) {} + // ({./**/}) return undefined; } break; diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index a0e7177a10ceb..ba475a0e8e99f 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -89,7 +89,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.4.2"; + ts.version = "4.4.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -118016,6 +118016,10 @@ var ts; }); parsedConfigs = undefined; } + if (packageJsonMap) { + ts.clearMap(packageJsonMap, ts.closeFileWatcher); + packageJsonMap = undefined; + } } function getCurrentBuilderProgram() { return builderProgram; diff --git a/package.json b/package.json index d62bcb0c5f439..a7b638357953d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.4.2", + "version": "4.4.3", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index f82b32beb3570..2d7cc75a278f3 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -5,7 +5,7 @@ namespace ts { // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - export const version = "4.4.2" as string; + export const version = "4.4.3" as string; /** * Type of objects whose values are all of the same type. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy