@prisma/orm-toolchain 8.0.0-rc.14-dev.31 → 8.0.0-rc.14-dev.32
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.
package/dist/cli.mjs
CHANGED
|
@@ -6730,7 +6730,7 @@ const lspCommand = defineServerCommand({
|
|
|
6730
6730
|
} },
|
|
6731
6731
|
handler: async (args, io) => {
|
|
6732
6732
|
const exitCode = await withoutClientProcessIdInArgv(async () => {
|
|
6733
|
-
const { startServer } = await import("./exports-
|
|
6733
|
+
const { startServer } = await import("./exports-D_DdvSnt.mjs");
|
|
6734
6734
|
return startServer({
|
|
6735
6735
|
stdin: io.stdin,
|
|
6736
6736
|
stdout: io.stdout,
|
|
@@ -1790,6 +1790,9 @@ function resolveSignatureParameters(signature, activeName) {
|
|
|
1790
1790
|
...param
|
|
1791
1791
|
}])];
|
|
1792
1792
|
}
|
|
1793
|
+
function namedParameterText(key, type) {
|
|
1794
|
+
return `${key}${"optional" in type && type.optional === true ? "?" : ""}: ${type.label}`;
|
|
1795
|
+
}
|
|
1793
1796
|
function renderSignatureLabel(name, signature, params) {
|
|
1794
1797
|
let label = `${name}(`;
|
|
1795
1798
|
const parts = params.map((param, index) => {
|
|
@@ -1797,7 +1800,7 @@ function renderSignatureLabel(name, signature, params) {
|
|
|
1797
1800
|
const positional = index < (signature.positional?.length ?? 0);
|
|
1798
1801
|
const optional = "optional" in param.type && param.type.optional === true;
|
|
1799
1802
|
const typeLabel = optional && param.type.label.includes(" | ") ? `(${param.type.label})` : param.type.label;
|
|
1800
|
-
const text = positional ? `${typeLabel}${optional ? "?" : ""}` :
|
|
1803
|
+
const text = positional ? `${typeLabel}${optional ? "?" : ""}` : namedParameterText(param.key, param.type);
|
|
1801
1804
|
const start = label.length;
|
|
1802
1805
|
label += text;
|
|
1803
1806
|
return {
|
|
@@ -1884,13 +1887,28 @@ function narrowHoverResult(resolution) {
|
|
|
1884
1887
|
kind: "contributedType",
|
|
1885
1888
|
symbol: resolution.symbol
|
|
1886
1889
|
};
|
|
1890
|
+
case "parameter": return {
|
|
1891
|
+
kind: "parameter",
|
|
1892
|
+
symbol: resolution.symbol
|
|
1893
|
+
};
|
|
1894
|
+
case "function": return {
|
|
1895
|
+
kind: "function",
|
|
1896
|
+
symbol: resolution.symbol
|
|
1897
|
+
};
|
|
1898
|
+
case "constant": return {
|
|
1899
|
+
kind: "constant",
|
|
1900
|
+
symbol: resolution.symbol
|
|
1901
|
+
};
|
|
1887
1902
|
default: return;
|
|
1888
1903
|
}
|
|
1889
1904
|
}
|
|
1890
1905
|
function renderHoverResult(result) {
|
|
1891
1906
|
if (result.kind === "entity") return renderEntityContent(result.symbol);
|
|
1892
1907
|
if (result.kind === "attribute") return renderAttributeContent(result.symbol);
|
|
1893
|
-
return renderContributedTypeContent(result.symbol);
|
|
1908
|
+
if (result.kind === "contributedType") return renderContributedTypeContent(result.symbol);
|
|
1909
|
+
if (result.kind === "parameter") return renderParameterContent(result.symbol);
|
|
1910
|
+
if (result.kind === "function") return renderFunctionContent(result.symbol);
|
|
1911
|
+
return renderConstantContent(result.symbol);
|
|
1894
1912
|
}
|
|
1895
1913
|
function renderEntityContent(entity) {
|
|
1896
1914
|
return withDocumentation([
|
|
@@ -1916,6 +1934,29 @@ function renderContributedTypeContent(symbol) {
|
|
|
1916
1934
|
"```"
|
|
1917
1935
|
].join("\n"), symbol.descriptor.kind === "typeConstructor" ? symbol.descriptor.documentation : void 0);
|
|
1918
1936
|
}
|
|
1937
|
+
function renderParameterContent(symbol) {
|
|
1938
|
+
return withDocumentation([
|
|
1939
|
+
"```prisma",
|
|
1940
|
+
namedParameterText(symbol.name, symbol.param.type),
|
|
1941
|
+
"```"
|
|
1942
|
+
].join("\n"), symbol.param.documentation);
|
|
1943
|
+
}
|
|
1944
|
+
function renderFunctionContent(symbol) {
|
|
1945
|
+
const params = resolveSignatureParameters(symbol.signature, void 0);
|
|
1946
|
+
const { label } = renderSignatureLabel(symbol.name, symbol.signature, params);
|
|
1947
|
+
return withDocumentation([
|
|
1948
|
+
"```prisma",
|
|
1949
|
+
label,
|
|
1950
|
+
"```"
|
|
1951
|
+
].join("\n"), symbol.signature.documentation);
|
|
1952
|
+
}
|
|
1953
|
+
function renderConstantContent(symbol) {
|
|
1954
|
+
return withDocumentation([
|
|
1955
|
+
"```prisma",
|
|
1956
|
+
symbol.name,
|
|
1957
|
+
"```"
|
|
1958
|
+
].join("\n"), symbol.documentation);
|
|
1959
|
+
}
|
|
1919
1960
|
function withDocumentation(fence, documentation) {
|
|
1920
1961
|
return documentation === void 0 || documentation === "" ? fence : `${fence}\n\n${documentation}`;
|
|
1921
1962
|
}
|
|
@@ -3372,4 +3413,4 @@ function startServer(streams) {
|
|
|
3372
3413
|
//#endregion
|
|
3373
3414
|
export { startServer };
|
|
3374
3415
|
|
|
3375
|
-
//# sourceMappingURL=exports-
|
|
3416
|
+
//# sourceMappingURL=exports-D_DdvSnt.mjs.map
|