Skip to content

Commit

Permalink
logic is fun but hard
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Aug 30, 2022
1 parent 91eef72 commit d29187d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,15 +743,18 @@ function format(msg: p.RequestMessage): Array<p.Message> {

if (
bscBinaryPath == null &&
!extensionConfiguration.allowBuiltInFormatter &&
!hasPromptedAboutBuiltInFormatter
!extensionConfiguration.allowBuiltInFormatter
) {
// Let's only prompt the user once about this, or things might become annoying.
if (hasPromptedAboutBuiltInFormatter) {
return [fakeSuccessResponse];
}
hasPromptedAboutBuiltInFormatter = true;

let params: p.ShowMessageParams = {
type: p.MessageType.Warning,
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(
"rescript.settings.allowBuiltInFormatter"
JSON.stringify(["rescript.settings.allowBuiltInFormatter"])
)})`,
};
let response: p.NotificationMessage = {
Expand Down

0 comments on commit d29187d

Please sign in to comment.