Skip to content

Commit d29187d

Browse files
committed
logic is fun but hard
1 parent 91eef72 commit d29187d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

server/src/server.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -743,15 +743,18 @@ function format(msg: p.RequestMessage): Array<p.Message> {
743743

744744
if (
745745
bscBinaryPath == null &&
746-
!extensionConfiguration.allowBuiltInFormatter &&
747-
!hasPromptedAboutBuiltInFormatter
746+
!extensionConfiguration.allowBuiltInFormatter
748747
) {
749748
// Let's only prompt the user once about this, or things might become annoying.
749+
if (hasPromptedAboutBuiltInFormatter) {
750+
return [fakeSuccessResponse];
751+
}
750752
hasPromptedAboutBuiltInFormatter = true;
753+
751754
let params: p.ShowMessageParams = {
752755
type: p.MessageType.Warning,
753756
message: `Formatting not applied! Could not find the ReScript compiler in the current project, and you haven't configured the extension to allow formatting using the built in formatter. To allow formatting files not strictly part of a ReScript project using the built in formatter, [please configure the extension to allow that.](command:workbench.action.openSettings?${encodeURIComponent(
754-
"rescript.settings.allowBuiltInFormatter"
757+
JSON.stringify(["rescript.settings.allowBuiltInFormatter"])
755758
)})`,
756759
};
757760
let response: p.NotificationMessage = {

0 commit comments

Comments
 (0)