@ttsc/vscode 0.34.2 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
package/lib/extension.js
CHANGED
|
@@ -11274,11 +11274,11 @@ var require_commonjs3 = __commonJS({
|
|
|
11274
11274
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
11275
11275
|
};
|
|
11276
11276
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
11277
|
-
var
|
|
11277
|
+
var path11 = {
|
|
11278
11278
|
win32: { sep: "\\" },
|
|
11279
11279
|
posix: { sep: "/" }
|
|
11280
11280
|
};
|
|
11281
|
-
exports2.sep = defaultPlatform === "win32" ?
|
|
11281
|
+
exports2.sep = defaultPlatform === "win32" ? path11.win32.sep : path11.posix.sep;
|
|
11282
11282
|
exports2.minimatch.sep = exports2.sep;
|
|
11283
11283
|
exports2.GLOBSTAR = Symbol("globstar **");
|
|
11284
11284
|
exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR;
|
|
@@ -14113,13 +14113,13 @@ var require_configuration = __commonJS({
|
|
|
14113
14113
|
});
|
|
14114
14114
|
}
|
|
14115
14115
|
extractSettingsInformation(keys) {
|
|
14116
|
-
function ensurePath(config,
|
|
14116
|
+
function ensurePath(config, path11) {
|
|
14117
14117
|
let current2 = config;
|
|
14118
|
-
for (let i = 0; i <
|
|
14119
|
-
let obj = current2[
|
|
14118
|
+
for (let i = 0; i < path11.length - 1; i++) {
|
|
14119
|
+
let obj = current2[path11[i]];
|
|
14120
14120
|
if (!obj) {
|
|
14121
14121
|
obj = /* @__PURE__ */ Object.create(null);
|
|
14122
|
-
current2[
|
|
14122
|
+
current2[path11[i]] = obj;
|
|
14123
14123
|
}
|
|
14124
14124
|
current2 = obj;
|
|
14125
14125
|
}
|
|
@@ -14137,8 +14137,8 @@ var require_configuration = __commonJS({
|
|
|
14137
14137
|
config = vscode_1.workspace.getConfiguration(void 0, resource).get(key);
|
|
14138
14138
|
}
|
|
14139
14139
|
if (config) {
|
|
14140
|
-
const
|
|
14141
|
-
ensurePath(result,
|
|
14140
|
+
const path11 = keys[i].split(".");
|
|
14141
|
+
ensurePath(result, path11)[path11[path11.length - 1]] = toJSONObject(config);
|
|
14142
14142
|
}
|
|
14143
14143
|
}
|
|
14144
14144
|
return result;
|
|
@@ -18113,13 +18113,13 @@ var require_fileOperations = __commonJS({
|
|
|
18113
18113
|
async filter(event2, prop) {
|
|
18114
18114
|
const fileMatches = await Promise.all(event2.files.map(async (item) => {
|
|
18115
18115
|
const uri = prop(item);
|
|
18116
|
-
const
|
|
18116
|
+
const path11 = uri.fsPath.replace(/\\/g, "/");
|
|
18117
18117
|
for (const filters of this._filters.values()) {
|
|
18118
18118
|
for (const filter of filters) {
|
|
18119
18119
|
if (filter.scheme !== void 0 && filter.scheme !== uri.scheme) {
|
|
18120
18120
|
continue;
|
|
18121
18121
|
}
|
|
18122
|
-
if (filter.matcher.match(
|
|
18122
|
+
if (filter.matcher.match(path11)) {
|
|
18123
18123
|
if (filter.kind === void 0) {
|
|
18124
18124
|
return true;
|
|
18125
18125
|
}
|
|
@@ -18133,7 +18133,7 @@ var require_fileOperations = __commonJS({
|
|
|
18133
18133
|
}
|
|
18134
18134
|
} else if (filter.kind === proto.FileOperationPatternKind.folder) {
|
|
18135
18135
|
const fileType = await _FileOperationFeature.getFileType(uri);
|
|
18136
|
-
if (fileType === code.FileType.Directory && filter.matcher.match(`${
|
|
18136
|
+
if (fileType === code.FileType.Directory && filter.matcher.match(`${path11}/`)) {
|
|
18137
18137
|
return true;
|
|
18138
18138
|
}
|
|
18139
18139
|
}
|
|
@@ -20781,9 +20781,9 @@ var require_main = __commonJS({
|
|
|
20781
20781
|
exports2.createMessageConnection = createMessageConnection;
|
|
20782
20782
|
var ril_1 = __importDefault(require_ril());
|
|
20783
20783
|
ril_1.default.install();
|
|
20784
|
-
var
|
|
20784
|
+
var path11 = __importStar(require("path"));
|
|
20785
20785
|
var os = __importStar(require("os"));
|
|
20786
|
-
var
|
|
20786
|
+
var fs7 = __importStar(require("fs"));
|
|
20787
20787
|
var crypto_1 = require("crypto");
|
|
20788
20788
|
var net_1 = require("net");
|
|
20789
20789
|
var api_1 = require_api();
|
|
@@ -20924,7 +20924,7 @@ var require_main = __commonJS({
|
|
|
20924
20924
|
}
|
|
20925
20925
|
let randomLength = 32;
|
|
20926
20926
|
const fixedLength = "/lsp-.sock".length;
|
|
20927
|
-
const tmpDir =
|
|
20927
|
+
const tmpDir = fs7.realpathSync(XDG_RUNTIME_DIR ?? os.tmpdir());
|
|
20928
20928
|
const limit = safeIpcPathLengths.get(process.platform);
|
|
20929
20929
|
if (limit !== void 0) {
|
|
20930
20930
|
randomLength = Math.min(limit - tmpDir.length - fixedLength, randomLength);
|
|
@@ -20933,7 +20933,7 @@ var require_main = __commonJS({
|
|
|
20933
20933
|
throw new Error(`Unable to generate a random pipe name with ${randomLength} characters.`);
|
|
20934
20934
|
}
|
|
20935
20935
|
const randomSuffix = (0, crypto_1.randomBytes)(Math.floor(randomLength / 2)).toString("hex");
|
|
20936
|
-
return
|
|
20936
|
+
return path11.join(tmpDir, `lsp-${randomSuffix}.sock`);
|
|
20937
20937
|
}
|
|
20938
20938
|
function createClientPipeTransport(pipeName, encoding = "utf-8") {
|
|
20939
20939
|
let connectResolve;
|
|
@@ -22293,8 +22293,8 @@ var require_main3 = __commonJS({
|
|
|
22293
22293
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
22294
22294
|
exports2.SettingMonitor = exports2.LanguageClient = exports2.TransportKind = void 0;
|
|
22295
22295
|
var cp = __importStar(require("child_process"));
|
|
22296
|
-
var
|
|
22297
|
-
var
|
|
22296
|
+
var fs7 = __importStar(require("fs"));
|
|
22297
|
+
var path11 = __importStar(require("path"));
|
|
22298
22298
|
var readline = __importStar(require("readline"));
|
|
22299
22299
|
var vscode_1 = require("vscode");
|
|
22300
22300
|
var Is2 = __importStar(require_is());
|
|
@@ -22739,19 +22739,19 @@ var require_main3 = __commonJS({
|
|
|
22739
22739
|
});
|
|
22740
22740
|
}
|
|
22741
22741
|
_getRuntimePath(runtime, serverWorkingDirectory) {
|
|
22742
|
-
if (
|
|
22742
|
+
if (path11.isAbsolute(runtime)) {
|
|
22743
22743
|
return runtime;
|
|
22744
22744
|
}
|
|
22745
22745
|
const mainRootPath = this._mainGetRootPath();
|
|
22746
22746
|
if (mainRootPath !== void 0) {
|
|
22747
|
-
const result =
|
|
22748
|
-
if (
|
|
22747
|
+
const result = path11.join(mainRootPath, runtime);
|
|
22748
|
+
if (fs7.existsSync(result)) {
|
|
22749
22749
|
return result;
|
|
22750
22750
|
}
|
|
22751
22751
|
}
|
|
22752
22752
|
if (serverWorkingDirectory !== void 0) {
|
|
22753
|
-
const result =
|
|
22754
|
-
if (
|
|
22753
|
+
const result = path11.join(serverWorkingDirectory, runtime);
|
|
22754
|
+
if (fs7.existsSync(result)) {
|
|
22755
22755
|
return result;
|
|
22756
22756
|
}
|
|
22757
22757
|
}
|
|
@@ -22775,7 +22775,7 @@ var require_main3 = __commonJS({
|
|
|
22775
22775
|
}
|
|
22776
22776
|
if (cwd) {
|
|
22777
22777
|
return new Promise((s) => {
|
|
22778
|
-
|
|
22778
|
+
fs7.lstat(cwd, (err, stats) => {
|
|
22779
22779
|
s(!err && stats.isDirectory() ? cwd : void 0);
|
|
22780
22780
|
});
|
|
22781
22781
|
});
|
|
@@ -22836,7 +22836,7 @@ __export(extension_exports, {
|
|
|
22836
22836
|
deactivate: () => deactivate
|
|
22837
22837
|
});
|
|
22838
22838
|
module.exports = __toCommonJS(extension_exports);
|
|
22839
|
-
var
|
|
22839
|
+
var path10 = __toESM(require("node:path"));
|
|
22840
22840
|
var import_vscode = require("vscode");
|
|
22841
22841
|
var import_node = __toESM(require_main3());
|
|
22842
22842
|
|
|
@@ -22962,20 +22962,209 @@ function resolveWithDirectoryMemo(key, memo, resolve2) {
|
|
|
22962
22962
|
|
|
22963
22963
|
// src/serverResolution.ts
|
|
22964
22964
|
var import_node_crypto2 = require("node:crypto");
|
|
22965
|
-
var
|
|
22965
|
+
var import_node_fs6 = __toESM(require("node:fs"));
|
|
22966
|
+
var import_node_module3 = require("node:module");
|
|
22967
|
+
var import_node_path9 = __toESM(require("node:path"));
|
|
22968
|
+
|
|
22969
|
+
// ../ttsc/src/compiler/internal/sharedHost/SidecarEnvironment.ts
|
|
22970
|
+
var SidecarEnvironment;
|
|
22971
|
+
((SidecarEnvironment2) => {
|
|
22972
|
+
function replace(target, snapshot) {
|
|
22973
|
+
const selected = merge(snapshot);
|
|
22974
|
+
for (const key of Object.keys(target)) delete target[key];
|
|
22975
|
+
for (const [key, value] of Object.entries(selected))
|
|
22976
|
+
if (value !== void 0) target[key] = value;
|
|
22977
|
+
}
|
|
22978
|
+
SidecarEnvironment2.replace = replace;
|
|
22979
|
+
function merge(...layers) {
|
|
22980
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
22981
|
+
for (const layer of layers) {
|
|
22982
|
+
if (layer === void 0) continue;
|
|
22983
|
+
if (process.platform !== "win32") {
|
|
22984
|
+
Object.assign(result, layer);
|
|
22985
|
+
continue;
|
|
22986
|
+
}
|
|
22987
|
+
const names = /* @__PURE__ */ new Map();
|
|
22988
|
+
for (const key of Object.keys(layer)) {
|
|
22989
|
+
const identity = key.toUpperCase();
|
|
22990
|
+
const previous = names.get(identity);
|
|
22991
|
+
if (previous === void 0 || key < previous) names.set(identity, key);
|
|
22992
|
+
}
|
|
22993
|
+
for (const [identity, key] of names) result[identity] = layer[key];
|
|
22994
|
+
}
|
|
22995
|
+
return result;
|
|
22996
|
+
}
|
|
22997
|
+
SidecarEnvironment2.merge = merge;
|
|
22998
|
+
function read(env, name) {
|
|
22999
|
+
if (env === void 0) return void 0;
|
|
23000
|
+
if (process.platform !== "win32") return env[name];
|
|
23001
|
+
const identity = name.toUpperCase();
|
|
23002
|
+
let selected;
|
|
23003
|
+
for (const key of Object.keys(env)) {
|
|
23004
|
+
if (key.toUpperCase() === identity && (selected === void 0 || key < selected)) {
|
|
23005
|
+
selected = key;
|
|
23006
|
+
}
|
|
23007
|
+
}
|
|
23008
|
+
return selected === void 0 ? void 0 : env[selected];
|
|
23009
|
+
}
|
|
23010
|
+
SidecarEnvironment2.read = read;
|
|
23011
|
+
function write(env, name, value) {
|
|
23012
|
+
const identity = process.platform === "win32" ? name.toUpperCase() : name;
|
|
23013
|
+
if (process.platform === "win32") {
|
|
23014
|
+
for (const key of Object.keys(env)) {
|
|
23015
|
+
if (key.toUpperCase() === identity) delete env[key];
|
|
23016
|
+
}
|
|
23017
|
+
} else {
|
|
23018
|
+
delete env[name];
|
|
23019
|
+
}
|
|
23020
|
+
if (value !== void 0) env[identity] = value;
|
|
23021
|
+
}
|
|
23022
|
+
SidecarEnvironment2.write = write;
|
|
23023
|
+
})(SidecarEnvironment || (SidecarEnvironment = {}));
|
|
23024
|
+
|
|
23025
|
+
// ../ttsc/src/compiler/internal/resolveTsgo.ts
|
|
23026
|
+
var import_node_fs2 = __toESM(require("node:fs"));
|
|
23027
|
+
var import_node_module2 = require("node:module");
|
|
23028
|
+
var import_node_path2 = __toESM(require("node:path"));
|
|
23029
|
+
|
|
23030
|
+
// ../ttsc/src/compiler/internal/resolveNativeTypeScriptPackage.ts
|
|
23031
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
22966
23032
|
var import_node_module = require("node:module");
|
|
22967
|
-
var
|
|
23033
|
+
var import_node_path = __toESM(require("node:path"));
|
|
23034
|
+
function resolveNativeTypeScriptPackage(from) {
|
|
23035
|
+
const requireFrom = (0, import_node_module.createRequire)(from);
|
|
23036
|
+
const aliases = /* @__PURE__ */ new Set();
|
|
23037
|
+
for (let directory = import_node_path.default.dirname(from); ; directory = import_node_path.default.dirname(directory)) {
|
|
23038
|
+
const project = readManifest(import_node_path.default.join(directory, "package.json"));
|
|
23039
|
+
let declaresTypeScript = false;
|
|
23040
|
+
for (const field of [
|
|
23041
|
+
"dependencies",
|
|
23042
|
+
"devDependencies",
|
|
23043
|
+
"optionalDependencies"
|
|
23044
|
+
]) {
|
|
23045
|
+
const dependencies = project?.[field];
|
|
23046
|
+
if (dependencies === null || typeof dependencies !== "object") continue;
|
|
23047
|
+
declaresTypeScript ||= Object.hasOwn(dependencies, "typescript");
|
|
23048
|
+
for (const [name, specifier] of Object.entries(dependencies))
|
|
23049
|
+
if (name !== "typescript" && typeof specifier === "string" && /^npm:typescript(?:@|$)/.test(specifier))
|
|
23050
|
+
aliases.add(name);
|
|
23051
|
+
}
|
|
23052
|
+
if (declaresTypeScript || aliases.size) break;
|
|
23053
|
+
if (import_node_path.default.dirname(directory) === directory) break;
|
|
23054
|
+
}
|
|
23055
|
+
let selected;
|
|
23056
|
+
for (const name of [...aliases].sort().concat("typescript")) {
|
|
23057
|
+
if (name === "typescript" && selected) return selected;
|
|
23058
|
+
let packageJson;
|
|
23059
|
+
try {
|
|
23060
|
+
packageJson = requireFrom.resolve(`${name}/package.json`);
|
|
23061
|
+
} catch {
|
|
23062
|
+
continue;
|
|
23063
|
+
}
|
|
23064
|
+
const manifest = readManifest(packageJson);
|
|
23065
|
+
if (!manifest) continue;
|
|
23066
|
+
const majorText = typeof manifest.version === "string" ? manifest.version.split(".")[0] : "";
|
|
23067
|
+
const major = /^\d+$/.test(majorText) ? Number(majorText) : NaN;
|
|
23068
|
+
if (major < 7) continue;
|
|
23069
|
+
if (name !== "typescript" && (manifest.name !== "typescript" || !Number.isFinite(major)))
|
|
23070
|
+
continue;
|
|
23071
|
+
const candidate = { packageJson, manifest };
|
|
23072
|
+
if (name === "typescript") return candidate;
|
|
23073
|
+
if (selected && import_node_fs.default.realpathSync(selected.packageJson) !== import_node_fs.default.realpathSync(packageJson))
|
|
23074
|
+
throw new Error(
|
|
23075
|
+
"ttsc: multiple native TypeScript aliases are installed; select one with --binary or TTSC_TSGO_BINARY."
|
|
23076
|
+
);
|
|
23077
|
+
selected = candidate;
|
|
23078
|
+
}
|
|
23079
|
+
return selected;
|
|
23080
|
+
}
|
|
23081
|
+
function readManifest(file) {
|
|
23082
|
+
try {
|
|
23083
|
+
return JSON.parse(import_node_fs.default.readFileSync(file, "utf8"));
|
|
23084
|
+
} catch (error) {
|
|
23085
|
+
if (["ENOENT", "ENOTDIR"].includes(
|
|
23086
|
+
error.code ?? ""
|
|
23087
|
+
))
|
|
23088
|
+
return void 0;
|
|
23089
|
+
throw error;
|
|
23090
|
+
}
|
|
23091
|
+
}
|
|
23092
|
+
|
|
23093
|
+
// ../ttsc/src/compiler/internal/resolveTsgo.ts
|
|
23094
|
+
function resolveTsgo(opts = {}) {
|
|
23095
|
+
const env = opts.env ?? process.env;
|
|
23096
|
+
const explicit = opts.binary ?? SidecarEnvironment.read(env, "TTSC_TSGO_BINARY");
|
|
23097
|
+
if (explicit) {
|
|
23098
|
+
if (!import_node_path2.default.isAbsolute(explicit) || !import_node_fs2.default.existsSync(explicit)) {
|
|
23099
|
+
throw new Error(
|
|
23100
|
+
`ttsc: explicit tsgo binary must be an existing absolute path: ${explicit}`
|
|
23101
|
+
);
|
|
23102
|
+
}
|
|
23103
|
+
return {
|
|
23104
|
+
binary: explicit,
|
|
23105
|
+
packageJson: "",
|
|
23106
|
+
packageRoot: import_node_path2.default.dirname(explicit),
|
|
23107
|
+
version: "custom"
|
|
23108
|
+
};
|
|
23109
|
+
}
|
|
23110
|
+
const cwd = import_node_path2.default.resolve(opts.cwd ?? process.cwd());
|
|
23111
|
+
const selected = resolveNativeTypeScriptPackage(import_node_path2.default.join(cwd, "package.json")) ?? (opts.resolveFrom ? resolveNativeTypeScriptPackage(opts.resolveFrom) : void 0);
|
|
23112
|
+
if (!selected) {
|
|
23113
|
+
throw new Error(
|
|
23114
|
+
[
|
|
23115
|
+
"ttsc: native TypeScript 7 or newer is required.",
|
|
23116
|
+
"Install the native TypeScript compiler in the consuming project:",
|
|
23117
|
+
" npm i -D typescript",
|
|
23118
|
+
"For legacy tooling, declare an npm:typescript@^7 alias in package.json."
|
|
23119
|
+
].join("\n")
|
|
23120
|
+
);
|
|
23121
|
+
}
|
|
23122
|
+
const { packageJson, manifest } = selected;
|
|
23123
|
+
const packageRoot = import_node_path2.default.dirname(packageJson);
|
|
23124
|
+
const platformPackage = `@typescript/typescript-${process.platform}-${process.arch}`;
|
|
23125
|
+
const platformResolver = (0, import_node_module2.createRequire)(packageJson);
|
|
23126
|
+
let platformPackageJson;
|
|
23127
|
+
try {
|
|
23128
|
+
platformPackageJson = platformResolver.resolve(
|
|
23129
|
+
`${platformPackage}/package.json`
|
|
23130
|
+
);
|
|
23131
|
+
} catch {
|
|
23132
|
+
throw new Error(
|
|
23133
|
+
[
|
|
23134
|
+
`ttsc: platform-specific TypeScript binary not found (${platformPackage}).`,
|
|
23135
|
+
"Reinstall the selected native TypeScript package with optional dependencies enabled."
|
|
23136
|
+
].join("\n")
|
|
23137
|
+
);
|
|
23138
|
+
}
|
|
23139
|
+
const platformRoot = import_node_path2.default.dirname(platformPackageJson);
|
|
23140
|
+
const binary = import_node_path2.default.join(
|
|
23141
|
+
platformRoot,
|
|
23142
|
+
"lib",
|
|
23143
|
+
process.platform === "win32" ? "tsc.exe" : "tsc"
|
|
23144
|
+
);
|
|
23145
|
+
if (!import_node_fs2.default.existsSync(binary)) {
|
|
23146
|
+
throw new Error(`ttsc: TypeScript executable not found: ${binary}`);
|
|
23147
|
+
}
|
|
23148
|
+
return {
|
|
23149
|
+
binary,
|
|
23150
|
+
gitHead: typeof manifest.gitHead === "string" ? manifest.gitHead : void 0,
|
|
23151
|
+
packageJson,
|
|
23152
|
+
packageRoot,
|
|
23153
|
+
platformPackageJson,
|
|
23154
|
+
version: typeof manifest.version === "string" ? manifest.version : "unknown"
|
|
23155
|
+
};
|
|
23156
|
+
}
|
|
22968
23157
|
|
|
22969
23158
|
// ../ttsc/src/internal/pathIdentity/createCaseSensitivityObservations.ts
|
|
22970
23159
|
var import_node_child_process = __toESM(require("node:child_process"));
|
|
22971
|
-
var
|
|
22972
|
-
var
|
|
23160
|
+
var import_node_fs4 = __toESM(require("node:fs"));
|
|
23161
|
+
var import_node_path5 = __toESM(require("node:path"));
|
|
22973
23162
|
|
|
22974
23163
|
// ../ttsc/src/internal/E2ETrace.ts
|
|
22975
23164
|
var import_node_crypto = __toESM(require("node:crypto"));
|
|
22976
23165
|
var import_node_events = require("node:events");
|
|
22977
|
-
var
|
|
22978
|
-
var
|
|
23166
|
+
var import_node_fs3 = __toESM(require("node:fs"));
|
|
23167
|
+
var import_node_path3 = __toESM(require("node:path"));
|
|
22979
23168
|
var E2ETrace;
|
|
22980
23169
|
((E2ETrace2) => {
|
|
22981
23170
|
function runtimeCleanup(directory, runtimeCacheDir, origin = "ttsx-runtime-cleanup") {
|
|
@@ -23235,27 +23424,27 @@ var failed = false;
|
|
|
23235
23424
|
function admit(selected) {
|
|
23236
23425
|
if (failed) return false;
|
|
23237
23426
|
if (root !== void 0) return true;
|
|
23238
|
-
if (!
|
|
23427
|
+
if (!import_node_path3.default.isAbsolute(selected)) return false;
|
|
23239
23428
|
instance = import_node_crypto.default.randomBytes(16).toString("hex");
|
|
23240
23429
|
root = selected;
|
|
23241
23430
|
return true;
|
|
23242
23431
|
}
|
|
23243
23432
|
function append(value) {
|
|
23244
|
-
const fd =
|
|
23245
|
-
|
|
23433
|
+
const fd = import_node_fs3.default.openSync(
|
|
23434
|
+
import_node_path3.default.join(root, `${process.pid}-${instance}.jsonl`),
|
|
23246
23435
|
"a",
|
|
23247
23436
|
384
|
|
23248
23437
|
);
|
|
23249
23438
|
try {
|
|
23250
23439
|
let offset = 0;
|
|
23251
23440
|
while (offset < value.length) {
|
|
23252
|
-
const written =
|
|
23441
|
+
const written = import_node_fs3.default.writeSync(fd, value, offset, value.length - offset);
|
|
23253
23442
|
if (written <= 0) throw new Error("trace short write");
|
|
23254
23443
|
offset += written;
|
|
23255
23444
|
bytes += written;
|
|
23256
23445
|
}
|
|
23257
23446
|
} finally {
|
|
23258
|
-
|
|
23447
|
+
import_node_fs3.default.closeSync(fd);
|
|
23259
23448
|
}
|
|
23260
23449
|
}
|
|
23261
23450
|
function event(token, kind, pid, data, upper) {
|
|
@@ -23302,7 +23491,7 @@ function payload(token, label, value) {
|
|
|
23302
23491
|
}
|
|
23303
23492
|
const filename = `${process.pid}-${instance}-${token.invocation}-${label}.bin`;
|
|
23304
23493
|
try {
|
|
23305
|
-
|
|
23494
|
+
import_node_fs3.default.writeFileSync(import_node_path3.default.join(root, filename), content, {
|
|
23306
23495
|
flag: "wx",
|
|
23307
23496
|
mode: 384
|
|
23308
23497
|
});
|
|
@@ -23410,9 +23599,9 @@ function parseWindowsDirectoryCaseSensitivity(directoryOutput, volumeOutput, vol
|
|
|
23410
23599
|
}
|
|
23411
23600
|
|
|
23412
23601
|
// ../ttsc/src/internal/pathIdentity/resolveFilesystemPath.ts
|
|
23413
|
-
var
|
|
23602
|
+
var import_node_path4 = __toESM(require("node:path"));
|
|
23414
23603
|
function resolveFilesystemPath(location, platform = process.platform) {
|
|
23415
|
-
const pathApi = platform === "win32" ?
|
|
23604
|
+
const pathApi = platform === "win32" ? import_node_path4.default.win32 : import_node_path4.default.posix;
|
|
23416
23605
|
if (platform !== "win32") {
|
|
23417
23606
|
return pathApi.resolve(location);
|
|
23418
23607
|
}
|
|
@@ -23430,8 +23619,8 @@ function resolveFilesystemPath(location, platform = process.platform) {
|
|
|
23430
23619
|
function createCaseSensitivityObservations(operations = {}) {
|
|
23431
23620
|
const platform = operations.platform ?? process.platform;
|
|
23432
23621
|
const probes = {
|
|
23433
|
-
lstat: operations.lstat ??
|
|
23434
|
-
readdir: operations.readdir ??
|
|
23622
|
+
lstat: operations.lstat ?? import_node_fs4.default.lstatSync,
|
|
23623
|
+
readdir: operations.readdir ?? import_node_fs4.default.readdirSync,
|
|
23435
23624
|
realpath: operations.realpath ?? physicalRealpath
|
|
23436
23625
|
};
|
|
23437
23626
|
const answers = /* @__PURE__ */ new Map();
|
|
@@ -23449,10 +23638,10 @@ function createCaseSensitivityObservations(operations = {}) {
|
|
|
23449
23638
|
};
|
|
23450
23639
|
}
|
|
23451
23640
|
function physicalRealpath(location) {
|
|
23452
|
-
return
|
|
23641
|
+
return import_node_fs4.default.realpathSync.native?.(location) ?? import_node_fs4.default.realpathSync(location);
|
|
23453
23642
|
}
|
|
23454
23643
|
function filesystemDirectoryIsCaseSensitive(directory, platform, operations) {
|
|
23455
|
-
const pathApi = platform === "win32" ?
|
|
23644
|
+
const pathApi = platform === "win32" ? import_node_path5.default.win32 : import_node_path5.default.posix;
|
|
23456
23645
|
let entries;
|
|
23457
23646
|
try {
|
|
23458
23647
|
entries = operations.readdir(directory);
|
|
@@ -23534,7 +23723,7 @@ function filesystemDirectoryIsCaseSensitive(directory, platform, operations) {
|
|
|
23534
23723
|
function queryWindowsDirectoryCaseSensitivity(directory) {
|
|
23535
23724
|
const result = queryWindowsDirectoryCaseSensitivityBytes(directory);
|
|
23536
23725
|
if (result === void 0) return void 0;
|
|
23537
|
-
const volumeRoot =
|
|
23726
|
+
const volumeRoot = import_node_path5.default.win32.parse(directory).root;
|
|
23538
23727
|
const direct = parseWindowsDirectoryCaseSensitivity(
|
|
23539
23728
|
result,
|
|
23540
23729
|
void 0,
|
|
@@ -23571,14 +23760,14 @@ function isMissingFilesystemEntry(error) {
|
|
|
23571
23760
|
}
|
|
23572
23761
|
|
|
23573
23762
|
// ../ttsc/src/internal/pathIdentity/createFilesystemPathIdentityContext.ts
|
|
23574
|
-
var
|
|
23575
|
-
var
|
|
23763
|
+
var import_node_fs5 = __toESM(require("node:fs"));
|
|
23764
|
+
var import_node_path7 = __toESM(require("node:path"));
|
|
23576
23765
|
|
|
23577
23766
|
// ../ttsc/src/internal/pathIdentity/isFilesystemPathIdentityWithin.ts
|
|
23578
|
-
var
|
|
23767
|
+
var import_node_path6 = __toESM(require("node:path"));
|
|
23579
23768
|
function isFilesystemPathIdentityWithin(root2, candidate, platform = process.platform) {
|
|
23580
23769
|
if (candidate === root2) return true;
|
|
23581
|
-
const separator = platform === "win32" ?
|
|
23770
|
+
const separator = platform === "win32" ? import_node_path6.default.win32.sep : import_node_path6.default.posix.sep;
|
|
23582
23771
|
return candidate.startsWith(
|
|
23583
23772
|
root2.endsWith(separator) ? root2 : `${root2}${separator}`
|
|
23584
23773
|
);
|
|
@@ -23590,11 +23779,11 @@ function createFilesystemPathIdentityContext(operations = {}) {
|
|
|
23590
23779
|
const realpaths = /* @__PURE__ */ new Map();
|
|
23591
23780
|
const sensitivities = /* @__PURE__ */ new Map();
|
|
23592
23781
|
const platform = operations.platform ?? process.platform;
|
|
23593
|
-
const pathApi = platform === "win32" ?
|
|
23782
|
+
const pathApi = platform === "win32" ? import_node_path7.default.win32 : import_node_path7.default.posix;
|
|
23594
23783
|
const throwOnRealpathError = operations.throwOnRealpathError ?? true;
|
|
23595
23784
|
const realpath = operations.realpath ?? physicalRealpath2;
|
|
23596
|
-
const lstat = operations.lstat ??
|
|
23597
|
-
const readdir = operations.readdir ??
|
|
23785
|
+
const lstat = operations.lstat ?? import_node_fs5.default.lstatSync;
|
|
23786
|
+
const readdir = operations.readdir ?? import_node_fs5.default.readdirSync;
|
|
23598
23787
|
const caseSensitive = operations.caseSensitive ?? createCaseSensitivityObservations({ lstat, platform, readdir, realpath });
|
|
23599
23788
|
const resolve2 = (location) => {
|
|
23600
23789
|
const normalized = resolveFilesystemPath(location, platform);
|
|
@@ -23732,11 +23921,11 @@ function cachedCaseSensitivity(cache, caseSensitive, directory) {
|
|
|
23732
23921
|
return sensitive;
|
|
23733
23922
|
}
|
|
23734
23923
|
function physicalRealpath2(location) {
|
|
23735
|
-
return
|
|
23924
|
+
return import_node_fs5.default.realpathSync.native?.(location) ?? import_node_fs5.default.realpathSync(location);
|
|
23736
23925
|
}
|
|
23737
23926
|
function filesystemPathIdentityKey(location, platform) {
|
|
23738
23927
|
if (platform !== "win32") return location;
|
|
23739
|
-
const root2 =
|
|
23928
|
+
const root2 = import_node_path7.default.win32.parse(location).root;
|
|
23740
23929
|
return `${root2.toLowerCase()}${location.slice(root2.length)}`;
|
|
23741
23930
|
}
|
|
23742
23931
|
function foldAsciiCase2(value) {
|
|
@@ -23747,7 +23936,7 @@ function isMissingFilesystemEntry2(error) {
|
|
|
23747
23936
|
}
|
|
23748
23937
|
|
|
23749
23938
|
// src/clientRootPlanning.ts
|
|
23750
|
-
var
|
|
23939
|
+
var import_node_path8 = __toESM(require("node:path"));
|
|
23751
23940
|
function filterCandidatesByPhysicalRoots(candidates, identities, platform) {
|
|
23752
23941
|
const sorted = candidates.map((candidate) => ({
|
|
23753
23942
|
candidate,
|
|
@@ -23797,7 +23986,7 @@ function planRootsByPhysicalIdentity(roots, preferredRoot, identities, platform)
|
|
|
23797
23986
|
return selected;
|
|
23798
23987
|
}
|
|
23799
23988
|
function pathDepth(value, platform) {
|
|
23800
|
-
const pathApi = platform === "win32" ?
|
|
23989
|
+
const pathApi = platform === "win32" ? import_node_path8.default.win32 : import_node_path8.default.posix;
|
|
23801
23990
|
return pathApi.resolve(value).split(pathApi.sep).filter(Boolean).length;
|
|
23802
23991
|
}
|
|
23803
23992
|
|
|
@@ -23813,22 +24002,22 @@ var PROJECT_CONFIG_PATTERN = /^(?:tsconfig|jsconfig)(?:\..*)?\.json$/;
|
|
|
23813
24002
|
var WRAPPED_COMMAND_IDS = ["ttsc.lint.fixAll", "ttsc.format.document"];
|
|
23814
24003
|
function resolveTtscServerLauncher(resolveFrom) {
|
|
23815
24004
|
try {
|
|
23816
|
-
const requireFromBase = (0,
|
|
23817
|
-
|
|
24005
|
+
const requireFromBase = (0, import_node_module3.createRequire)(
|
|
24006
|
+
import_node_path9.default.join(resolveFrom, "__ttsc_vscode_resolve__.cjs")
|
|
23818
24007
|
);
|
|
23819
24008
|
const packageJson = requireFromBase.resolve("ttsc/package.json");
|
|
23820
|
-
const packageRoot =
|
|
23821
|
-
const manifest = JSON.parse(
|
|
23822
|
-
const bin = typeof manifest.bin?.ttscserver === "string" ? manifest.bin.ttscserver :
|
|
23823
|
-
const launcher =
|
|
23824
|
-
return
|
|
24009
|
+
const packageRoot = import_node_path9.default.dirname(packageJson);
|
|
24010
|
+
const manifest = JSON.parse(import_node_fs6.default.readFileSync(packageJson, "utf8"));
|
|
24011
|
+
const bin = typeof manifest.bin?.ttscserver === "string" ? manifest.bin.ttscserver : import_node_path9.default.join("lib", "launcher", "ttscserver.js");
|
|
24012
|
+
const launcher = import_node_path9.default.resolve(packageRoot, bin);
|
|
24013
|
+
return import_node_fs6.default.existsSync(launcher) ? launcher : void 0;
|
|
23825
24014
|
} catch {
|
|
23826
24015
|
return void 0;
|
|
23827
24016
|
}
|
|
23828
24017
|
}
|
|
23829
24018
|
function findProjectConfig(start, stopAt) {
|
|
23830
|
-
let dir =
|
|
23831
|
-
const boundary = stopAt ?
|
|
24019
|
+
let dir = import_node_path9.default.resolve(start);
|
|
24020
|
+
const boundary = stopAt ? import_node_path9.default.resolve(stopAt) : void 0;
|
|
23832
24021
|
const identities = boundary ? createServerRootPathIdentityContext() : void 0;
|
|
23833
24022
|
for (; ; ) {
|
|
23834
24023
|
if (boundary && !identities.isWithin(boundary, dir)) {
|
|
@@ -23841,7 +24030,7 @@ function findProjectConfig(start, stopAt) {
|
|
|
23841
24030
|
if (boundary && identities.resolve(dir).key === identities.resolve(boundary).key) {
|
|
23842
24031
|
return void 0;
|
|
23843
24032
|
}
|
|
23844
|
-
const parent =
|
|
24033
|
+
const parent = import_node_path9.default.dirname(dir);
|
|
23845
24034
|
if (parent === dir) {
|
|
23846
24035
|
return void 0;
|
|
23847
24036
|
}
|
|
@@ -23858,10 +24047,10 @@ function createResolutionCandidates(input) {
|
|
|
23858
24047
|
candidates.push(candidate);
|
|
23859
24048
|
};
|
|
23860
24049
|
if (input.activeFile) {
|
|
23861
|
-
const resolveFrom =
|
|
24050
|
+
const resolveFrom = import_node_path9.default.dirname(input.activeFile);
|
|
23862
24051
|
const tsconfig = findProjectConfig(resolveFrom, input.activeWorkspaceRoot);
|
|
23863
24052
|
push({
|
|
23864
|
-
cwd: tsconfig ?
|
|
24053
|
+
cwd: tsconfig ? import_node_path9.default.dirname(tsconfig) : input.activeWorkspaceRoot ?? resolveFrom,
|
|
23865
24054
|
resolveFrom,
|
|
23866
24055
|
tsconfig
|
|
23867
24056
|
});
|
|
@@ -23869,7 +24058,7 @@ function createResolutionCandidates(input) {
|
|
|
23869
24058
|
for (const root2 of input.workspaceRoots ?? []) {
|
|
23870
24059
|
const tsconfig = findProjectConfig(root2, root2);
|
|
23871
24060
|
push({
|
|
23872
|
-
cwd: tsconfig ?
|
|
24061
|
+
cwd: tsconfig ? import_node_path9.default.dirname(tsconfig) : root2,
|
|
23873
24062
|
resolveFrom: root2,
|
|
23874
24063
|
tsconfig
|
|
23875
24064
|
});
|
|
@@ -23991,11 +24180,11 @@ function rootKey(root2, platform = process.platform, identities = createServerRo
|
|
|
23991
24180
|
}
|
|
23992
24181
|
function projectConfigIn(dir) {
|
|
23993
24182
|
try {
|
|
23994
|
-
const matches =
|
|
24183
|
+
const matches = import_node_fs6.default.readdirSync(dir).filter((name) => PROJECT_CONFIG_PATTERN.test(name)).sort(compareProjectConfigNames);
|
|
23995
24184
|
for (const name of matches) {
|
|
23996
|
-
const candidate =
|
|
24185
|
+
const candidate = import_node_path9.default.join(dir, name);
|
|
23997
24186
|
try {
|
|
23998
|
-
if (
|
|
24187
|
+
if (import_node_fs6.default.statSync(candidate).isFile()) {
|
|
23999
24188
|
return candidate;
|
|
24000
24189
|
}
|
|
24001
24190
|
} catch {
|
|
@@ -24016,10 +24205,10 @@ function compareProjectConfigNames(left, right) {
|
|
|
24016
24205
|
return priority(left) - priority(right) || left.localeCompare(right);
|
|
24017
24206
|
}
|
|
24018
24207
|
function isJavaScriptLauncher(launcher) {
|
|
24019
|
-
return [".js", ".cjs", ".mjs"].includes(
|
|
24208
|
+
return [".js", ".cjs", ".mjs"].includes(import_node_path9.default.extname(launcher));
|
|
24020
24209
|
}
|
|
24021
24210
|
function isWindowsCommandLauncher(launcher) {
|
|
24022
|
-
return [".cmd", ".bat"].includes(
|
|
24211
|
+
return [".cmd", ".bat"].includes(import_node_path9.default.extname(launcher).toLowerCase());
|
|
24023
24212
|
}
|
|
24024
24213
|
function createWindowsCommandShim(args) {
|
|
24025
24214
|
const prefix = "TTSC_VSCODE_COMMAND_SHIM_ARG_";
|
|
@@ -24039,24 +24228,7 @@ function quoteWindowsArg(arg) {
|
|
|
24039
24228
|
}
|
|
24040
24229
|
function resolveTsgoBinary(base) {
|
|
24041
24230
|
try {
|
|
24042
|
-
|
|
24043
|
-
import_node_path7.default.join(base, "__ttsc_vscode_resolve__.cjs")
|
|
24044
|
-
);
|
|
24045
|
-
const packageJson = requireFromBase.resolve("typescript/package.json");
|
|
24046
|
-
const packageRoot = import_node_path7.default.dirname(packageJson);
|
|
24047
|
-
const requireFromTsgo = (0, import_node_module.createRequire)(
|
|
24048
|
-
import_node_path7.default.join(packageRoot, "__ttsc_vscode_resolve__.cjs")
|
|
24049
|
-
);
|
|
24050
|
-
const platformPackage = `@typescript/typescript-${process.platform}-${process.arch}`;
|
|
24051
|
-
const platformPackageJson = requireFromTsgo.resolve(
|
|
24052
|
-
`${platformPackage}/package.json`
|
|
24053
|
-
);
|
|
24054
|
-
const binary = import_node_path7.default.join(
|
|
24055
|
-
import_node_path7.default.dirname(platformPackageJson),
|
|
24056
|
-
"lib",
|
|
24057
|
-
process.platform === "win32" ? "tsc.exe" : "tsc"
|
|
24058
|
-
);
|
|
24059
|
-
return import_node_fs4.default.existsSync(binary) ? binary : void 0;
|
|
24231
|
+
return resolveTsgo({ cwd: base, env: {} }).binary;
|
|
24060
24232
|
} catch {
|
|
24061
24233
|
return void 0;
|
|
24062
24234
|
}
|
|
@@ -24126,7 +24298,7 @@ function createServerLaunchSpecs(candidates) {
|
|
|
24126
24298
|
cwd: candidate.cwd,
|
|
24127
24299
|
id: key,
|
|
24128
24300
|
launcher,
|
|
24129
|
-
name: `ttsc (${
|
|
24301
|
+
name: `ttsc (${path10.basename(candidate.cwd)})`,
|
|
24130
24302
|
workspaceFolder: workspaceFolderFor(candidate.cwd, specs.length)
|
|
24131
24303
|
});
|
|
24132
24304
|
}
|
|
@@ -24136,7 +24308,7 @@ function resolveConfiguredServerPath(configuredPath, cwd) {
|
|
|
24136
24308
|
if (!configuredPath) {
|
|
24137
24309
|
return void 0;
|
|
24138
24310
|
}
|
|
24139
|
-
if (
|
|
24311
|
+
if (path10.isAbsolute(configuredPath)) {
|
|
24140
24312
|
return configuredPath;
|
|
24141
24313
|
}
|
|
24142
24314
|
const key = `${rootKey(cwd)}\0${configuredPath}`;
|
|
@@ -24152,7 +24324,7 @@ function resolveServerLaunchSpecForUri(uri, memo = /* @__PURE__ */ new Map()) {
|
|
|
24152
24324
|
if (uri.scheme !== "file") return void 0;
|
|
24153
24325
|
const folder = import_vscode.workspace.getWorkspaceFolder(uri);
|
|
24154
24326
|
const activeWorkspaceRoot = folder?.uri.scheme === "file" ? folder.uri.fsPath : void 0;
|
|
24155
|
-
const memoKey = `${
|
|
24327
|
+
const memoKey = `${path10.dirname(uri.fsPath)}\0${activeWorkspaceRoot ?? ""}`;
|
|
24156
24328
|
return resolveWithDirectoryMemo(
|
|
24157
24329
|
memoKey,
|
|
24158
24330
|
memo,
|
|
@@ -24169,14 +24341,14 @@ function createServerOptions(launcher, candidate) {
|
|
|
24169
24341
|
}
|
|
24170
24342
|
function workspaceFolderFor(root2, index) {
|
|
24171
24343
|
const folder = import_vscode.workspace.workspaceFolders?.find(
|
|
24172
|
-
(candidate) => candidate.uri.scheme === "file" &&
|
|
24344
|
+
(candidate) => candidate.uri.scheme === "file" && path10.resolve(candidate.uri.fsPath) === path10.resolve(root2)
|
|
24173
24345
|
);
|
|
24174
24346
|
if (folder) {
|
|
24175
24347
|
return folder;
|
|
24176
24348
|
}
|
|
24177
24349
|
return {
|
|
24178
24350
|
index,
|
|
24179
|
-
name:
|
|
24351
|
+
name: path10.basename(root2),
|
|
24180
24352
|
uri: import_vscode.Uri.file(root2)
|
|
24181
24353
|
};
|
|
24182
24354
|
}
|
|
@@ -24355,7 +24527,7 @@ function resolveCommandTarget(uriArg) {
|
|
|
24355
24527
|
return uriArg;
|
|
24356
24528
|
}
|
|
24357
24529
|
if (typeof uriArg === "string") {
|
|
24358
|
-
return
|
|
24530
|
+
return path10.isAbsolute(uriArg) ? import_vscode.Uri.file(uriArg) : import_vscode.Uri.parse(uriArg);
|
|
24359
24531
|
}
|
|
24360
24532
|
return import_vscode.window.activeTextEditor?.document.uri;
|
|
24361
24533
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ttsc/vscode",
|
|
3
3
|
"displayName": "ttsc",
|
|
4
4
|
"description": "TypeScript-Go and ttsc plugin diagnostics, completions, lint actions, and formatting for VS Code.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.35.0",
|
|
6
6
|
"publisher": "samchon",
|
|
7
7
|
"icon": "images/icon.png",
|
|
8
8
|
"license": "MIT",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"rimraf": "^6.1.2",
|
|
107
107
|
"typescript": "^7.0.2",
|
|
108
108
|
"vscode-languageclient": "^10.1.0",
|
|
109
|
-
"ttsc": "0.
|
|
109
|
+
"ttsc": "0.35.0"
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"build": "tsc --noEmit && rimraf lib dist && node build/build.cjs",
|