-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning/build option on missing output dir
- Loading branch information
1 parent
136b5ab
commit 83e7f2b
Showing
7 changed files
with
105 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.showError = function (conn) { return function (s) { return function () { return conn.window.showErrorMessage(s); }; }; }; | ||
exports.showErrorWithActionsImpl = function (conn) { return function (s) { return function (actions) { return function () { | ||
return (_a = conn.window).showErrorMessage.apply(_a, [s].concat(actions)); | ||
var _a; | ||
}; }; }; }; | ||
exports.showWarning = function (conn) { return function (s) { return function () { return conn.window.showWarningMessage(s); }; }; }; | ||
exports.showWarningWithActionsImpl = function (conn) { return function (s) { return function (actions) { return function () { | ||
return (_a = conn.window).showWarningMessage.apply(_a, [s].concat(actions)); | ||
var _a; | ||
}; }; }; }; | ||
exports.showInformation = function (conn) { return function (s) { return function () { return conn.window.showInformationMessage(s); }; }; }; | ||
exports.showInformationWithActionsImpl = function (conn) { return function (s) { return function (actions) { return function () { | ||
return (_a = conn.window).showInformationMessage.apply(_a, [s].concat(actions)); | ||
var _a; | ||
}; }; }; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module LanguageServer.Window (showError, showErrorWithActions, showWarning, showWarningWithActions, showInformation, showInformationWithActions) where | ||
|
||
import Prelude | ||
|
||
import Control.Monad.Aff (Aff) | ||
import Control.Monad.Eff (Eff) | ||
import Control.Promise (Promise) | ||
import Control.Promise as Promise | ||
import Data.Maybe (Maybe) | ||
import Data.Nullable (Nullable, toMaybe) | ||
import LanguageServer.Types (CONN, Connection) | ||
|
||
type MessageAction = { title :: String } | ||
|
||
foreign import showError :: forall eff. Connection -> String -> Eff (conn :: CONN | eff) Unit | ||
foreign import showErrorWithActionsImpl :: forall eff. Connection -> String -> Array MessageAction-> Eff (conn :: CONN | eff) (Promise (Nullable MessageAction)) | ||
|
||
convertMessageAction :: Nullable MessageAction -> Maybe String | ||
convertMessageAction act = _.title <$> toMaybe act | ||
|
||
showErrorWithActions :: forall eff. Connection -> String -> Array String -> Aff (conn :: CONN | eff) (Maybe String) | ||
showErrorWithActions conn msg acts = | ||
convertMessageAction <$> (Promise.toAffE $ showErrorWithActionsImpl conn msg (map (\title -> { title }) acts)) | ||
|
||
foreign import showWarning :: forall eff. Connection -> String -> Eff (conn :: CONN | eff) Unit | ||
foreign import showWarningWithActionsImpl :: forall eff. Connection -> String -> Array MessageAction-> Eff (conn :: CONN | eff) (Promise (Nullable MessageAction)) | ||
|
||
showWarningWithActions :: forall eff. Connection -> String -> Array String -> Aff (conn :: CONN | eff) (Maybe String) | ||
showWarningWithActions conn msg acts = | ||
convertMessageAction <$> (Promise.toAffE $ showWarningWithActionsImpl conn msg (map (\title -> { title }) acts)) | ||
|
||
|
||
foreign import showInformation :: forall eff. Connection -> String -> Eff (conn :: CONN | eff) Unit | ||
foreign import showInformationWithActionsImpl :: forall eff. Connection -> String -> Array MessageAction-> Eff (conn :: CONN | eff) (Promise (Nullable MessageAction)) | ||
|
||
showInformationWithActions :: forall eff. Connection -> String -> Array String -> Aff (conn :: CONN | eff) (Maybe String) | ||
showInformationWithActions conn msg acts = | ||
convertMessageAction <$> (Promise.toAffE $ showInformationWithActionsImpl conn msg (map (\title -> { title }) acts)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { IConnection, MessageActionItem } from "vscode-languageserver/lib/main"; | ||
|
||
export const showError = (conn: IConnection) => (s: string) => () => conn.window.showErrorMessage(s); | ||
export const showErrorWithActionsImpl = (conn: IConnection) => (s: string) => <T extends MessageActionItem>(actions: T[]) => () => conn.window.showErrorMessage(s, ...actions); | ||
|
||
export const showWarning = (conn: IConnection) => (s: string) => () => conn.window.showWarningMessage(s); | ||
export const showWarningWithActionsImpl = (conn: IConnection) => (s: string) => <T extends MessageActionItem>(actions: T[]) => () => conn.window.showWarningMessage(s, ...actions); | ||
|
||
export const showInformation = (conn: IConnection) => (s: string) => () => conn.window.showInformationMessage(s); | ||
export const showInformationWithActionsImpl = (conn: IConnection) => (s: string) => <T extends MessageActionItem>(actions: T[]) => () => conn.window.showInformationMessage(s, ...actions); | ||
|