Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- `js-post-build` now passes the correct output file path based on `in-source` configuration: when `in-source: true`, the path next to the source file is passed; when `in-source: false`, the path in the `lib/<module>/` directory is passed. Additionally, stdout and stderr from the post-build command are now logged. https://github.com/rescript-lang/rescript/pull/8190
- `js-post-build` command now runs in the directory containing the `rescript.json` where it is defined, instead of the unpredictable build invocation directory. This provides consistent behavior in monorepos. https://github.com/rescript-lang/rescript/pull/8195
- Remove support for deprecated `bs-dependencies`, `bs-dev-dependencies`, and `bsc-flags` configuration options. Use `dependencies`, `dev-dependencies`, and `compiler-flags` instead. https://github.com/rescript-lang/rescript/pull/8196
- `bsc`: remove legacy `-uncurried` flag. https://github.com/rescript-lang/rescript/pull/8201

#### :eyeglasses: Spec Compliance

Expand Down
9 changes: 3 additions & 6 deletions analysis/src/CompletionBackEnd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1875,17 +1875,14 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens
->
if Debug.verbose () then
print_endline "[complete_typed_value]--> Tfunction #1";
let shouldPrintAsUncurried = false in
let mkFnArgs ~asSnippet =
match args with
| [(Nolabel, argTyp)] when TypeUtils.typeIsUnit argTyp ->
if shouldPrintAsUncurried then "(. )" else "()"
| [(Nolabel, argTyp)] when TypeUtils.typeIsUnit argTyp -> "()"
| [(Nolabel, argTyp)] ->
let varName =
CompletionExpressions.prettyPrintFnTemplateArgName ~env ~full argTyp
in
let argsText = if asSnippet then "${1:" ^ varName ^ "}" else varName in
if shouldPrintAsUncurried then "(. " ^ argsText ^ ")" else argsText
if asSnippet then "${1:" ^ varName ^ "}" else varName
| _ ->
let currentUnlabelledIndex = ref 0 in
let argsText =
Expand All @@ -1908,7 +1905,7 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens
else varName))
|> String.concat ", "
in
"(" ^ if shouldPrintAsUncurried then ". " else "" ^ argsText ^ ")"
"(" ^ argsText ^ ")"
in
let isAsync =
match TypeUtils.extractType ~env ~package:full.package returnType with
Expand Down
8 changes: 0 additions & 8 deletions analysis/src/Packages.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ let newBsPackage ~rootPath =
| Some (String suffix) -> suffix
| _ -> ".js"
in
let uncurried =
let ns = config |> Json.get "uncurried" in
match (rescriptVersion, ns) with
| (major, _), None when major >= 11 -> Some true
| _, ns -> Option.bind ns Json.bool
in
let genericJsxModule =
let jsxConfig = config |> Json.get "jsx" in
match jsxConfig with
Expand Down Expand Up @@ -87,7 +81,6 @@ let newBsPackage ~rootPath =
| _ -> Misc.StringMap.empty)
| None -> Misc.StringMap.empty
in
let uncurried = uncurried = Some true in
match libBs with
| None -> None
| Some libBs ->
Expand Down Expand Up @@ -183,7 +176,6 @@ let newBsPackage ~rootPath =
pathsForModule;
opens;
namespace;
uncurried;
autocomplete;
}))
| None -> None
Expand Down
2 changes: 0 additions & 2 deletions analysis/src/SharedTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ and completionType =
env: QueryEnv.t;
args: typedFnArg list;
typ: Types.type_expr;
uncurried: bool;
returnType: Types.type_expr;
}

Expand Down Expand Up @@ -519,7 +518,6 @@ type package = {
pathsForModule: (file, paths) Hashtbl.t;
namespace: string option;
opens: path list;
uncurried: bool;
rescriptVersion: int * int;
autocomplete: file list Misc.StringMap.t;
}
Expand Down
4 changes: 1 addition & 3 deletions analysis/src/TypeUtils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ let rec extractType ?(printOpeningDebug = true)
| Tarrow _ -> (
match extractFunctionType2 ?typeArgContext t ~env ~package with
| args, tRet, typeArgContext when args <> [] ->
Some
( Tfunction {env; args; typ = t; uncurried = false; returnType = tRet},
typeArgContext )
Some (Tfunction {env; args; typ = t; returnType = tRet}, typeArgContext)
| _args, _tRet, _typeArgContext -> None)
| Tconstr (path, typeArgs, _) -> (
if Debug.verbose () then
Expand Down
1 change: 0 additions & 1 deletion compiler/bsc/rescript_compiler_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array =
clear Clflags.keep_locs,
"*internal* Do not keep locations in .cmi files" );
("-nopervasives", set Clflags.nopervasives, "*internal*");
("-uncurried", unit_call (fun () -> ()), "*internal* deprecated");
( "-v",
unit_call print_version_string,
"Print compiler version and location of standard library and exit" );
Expand Down
3 changes: 1 addition & 2 deletions tests/build_tests/uncurried-always/rescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"sources": {
"dir": "src",
"subdirs": true
},
"uncurried": true
}
}
1 change: 0 additions & 1 deletion tests/gentype_tests/typescript-react-example/rescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"subdirs": true
}
],
"uncurried": true,
"package-specs": {
"module": "esmodule",
"in-source": true
Expand Down
Loading