typescript
Advanced tools
Comparing version 5.7.0-dev.20241105 to 5.8.0-dev.20241106
@@ -286,9 +286,3 @@ /*! ***************************************************************************** | ||
} | ||
let cancellationToken; | ||
try { | ||
const factory = require("./cancellationToken.js"); | ||
cancellationToken = factory(sys4.args); | ||
} catch { | ||
cancellationToken = typescript_exports.server.nullCancellationToken; | ||
} | ||
const cancellationToken = createCancellationToken(sys4.args); | ||
const localeStr = typescript_exports.server.findArgument("--locale"); | ||
@@ -581,2 +575,44 @@ if (localeStr) { | ||
} | ||
function pipeExists(name) { | ||
return import_fs.default.existsSync(name); | ||
} | ||
function createCancellationToken(args) { | ||
let cancellationPipeName; | ||
for (let i = 0; i < args.length - 1; i++) { | ||
if (args[i] === "--cancellationPipeName") { | ||
cancellationPipeName = args[i + 1]; | ||
break; | ||
} | ||
} | ||
if (!cancellationPipeName) { | ||
return typescript_exports.server.nullCancellationToken; | ||
} | ||
if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") { | ||
const namePrefix = cancellationPipeName.slice(0, -1); | ||
if (namePrefix.length === 0 || namePrefix.includes("*")) { | ||
throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'."); | ||
} | ||
let perRequestPipeName; | ||
let currentRequestId; | ||
return { | ||
isCancellationRequested: () => perRequestPipeName !== void 0 && pipeExists(perRequestPipeName), | ||
setRequest(requestId) { | ||
currentRequestId = requestId; | ||
perRequestPipeName = namePrefix + requestId; | ||
}, | ||
resetRequest(requestId) { | ||
if (currentRequestId !== requestId) { | ||
throw new Error(`Mismatched request id, expected ${currentRequestId}, actual ${requestId}`); | ||
} | ||
perRequestPipeName = void 0; | ||
} | ||
}; | ||
} else { | ||
return { | ||
isCancellationRequested: () => pipeExists(cancellationPipeName), | ||
setRequest: (_requestId) => void 0, | ||
resetRequest: (_requestId) => void 0 | ||
}; | ||
} | ||
} | ||
@@ -583,0 +619,0 @@ // src/tsserver/server.ts |
@@ -26,1 +26,2 @@ /*! ***************************************************************************** | ||
/// <reference lib="esnext.iterator" /> | ||
/// <reference lib="esnext.promise" /> |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://www.typescriptlang.org/", | ||
"version": "5.7.0-dev.20241105", | ||
"version": "5.8.0-dev.20241106", | ||
"license": "Apache-2.0", | ||
@@ -120,3 +120,3 @@ "description": "TypeScript is a language for application scale JavaScript development", | ||
}, | ||
"gitHead": "c09e2ab4ff1abb69d2b4a9b361dbbde43b0d5667" | ||
"gitHead": "30979c2651e5b0aa8ab583bbd8161cac3d0ea317" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22773576
19
92367