Skip to content

Theme color & few other things #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 27, 2017
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
46 changes: 37 additions & 9 deletions Fable.Import.VSCode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module vscode =


and [<Import("EventEmitter", "vscode")>] EventEmitter<'T>() =

member __.addListener(``event``: string, listener: Function): NodeJS.EventEmitter = failwith "JS only"
member __.on(``event``: string, listener: Function): NodeJS.EventEmitter = failwith "JS only"
member __.once(``event``: string, listener: Function): NodeJS.EventEmitter = failwith "JS only"
Expand Down Expand Up @@ -88,9 +87,20 @@ module vscode =
member __.active with get(): Position = failwith "JS only" and set(v: Position): unit = failwith "JS only"
member __.isReversed with get(): bool = failwith "JS only" and set(v: bool): unit = failwith "JS only"

/// Represents sources that can cause selection change events.
and TextEditorSelectionChangeKind =
/// Selection changed due to typing in the editor.
| Keyboard = 1
/// Selection change due to clicking in the editor.
| Mouse = 2
/// Selection changed because a command ran.
| Command = 3

and TextEditorSelectionChangeEvent =
abstract textEditor: TextEditor with get, set
abstract selections: ResizeArray<Selection> with get, set
/// The change kind which has triggered this event.
abstract kind: TextEditorSelectionChangeKind option with get, set

and TextEditorOptionsChangeEvent =
abstract textEditor: TextEditor with get, set
Expand All @@ -115,25 +125,41 @@ module vscode =
| Right = 4
| Full = 7

and DecorationRangeBehavior =
/// The decoration's range will widen when edits occur at the start or end.
| OpenOpen = 0
/// The decoration's range will not widen when edits occur at the start of end.
| ClosedClosed = 1
/// The decoration's range will widen when edits occur at the start, but not at the end.
| OpenClosed = 2
/// The decoration's range will widen when edits occur at the end, but not at the start.
| ClosedOpen = 3

and [<Import("ThemeColor","vscode")>] ThemeColor(id: string) =
class end

and ThemableDecorationRenderOptions =
abstract backgroundColor: string option with get, set
abstract outlineColor: string option with get, set
abstract backgroundColor: U2<string, ThemeColor> option with get, set
abstract outlineColor: U2<string, ThemeColor> option with get, set
abstract outlineStyle: string option with get, set
abstract outlineWidth: string option with get, set
abstract borderColor: string option with get, set
abstract borderColor: U2<string, ThemeColor> option with get, set
abstract borderRadius: string option with get, set
abstract borderSpacing: string option with get, set
abstract borderStyle: string option with get, set
abstract borderWidth: string option with get, set
abstract textDecoration: string option with get, set
abstract cursor: string option with get, set
abstract color: string option with get, set
abstract color: U2<string, ThemeColor> option with get, set
abstract gutterIconPath: string option with get, set
abstract overviewRulerColor: string option with get, set
abstract overviewRulerColor: U2<string, ThemeColor> option with get, set

and DecorationRenderOptions =
inherit ThemableDecorationRenderOptions
abstract isWholeLine: bool option with get, set
/// Customize the growing behavior of the decoration when edits occur at the edges of the decoration's range.
/// Defaults to `DecorationRangeBehavior.OpenOpen`.
abstract rangeBehavior: DecorationRangeBehavior option with get, set
abstract overviewRulerLane: OverviewRulerLane option with get, set
abstract light: ThemableDecorationRenderOptions option with get, set
abstract dark: ThemableDecorationRenderOptions option with get, set
Expand All @@ -147,13 +173,13 @@ module vscode =
/// CSS styling property that will be applied to the decoration attachment.
abstract border: string option with get, set
/// CSS styling property that will be applied to text enclosed by a decoration.
abstract borderColor: string option with get, set
abstract borderColor: U2<string, ThemeColor> option with get, set
/// CSS styling property that will be applied to the decoration attachment.
abstract textDecoration: string option with get, set
/// CSS styling property that will be applied to the decoration attachment.
abstract color: string option with get, set
abstract color: U2<string, ThemeColor> option with get, set
/// CSS styling property that will be applied to the decoration attachment.
abstract backgroundColor: string option with get, set
abstract backgroundColor: U2<string, ThemeColor> option with get, set
/// CSS styling property that will be applied to the decoration attachment.
abstract margin: string option with get, set
/// CSS styling property that will be applied to the decoration attachment.
Expand Down Expand Up @@ -535,8 +561,10 @@ module vscode =
abstract globalState: Memento with get, set
abstract extensionPath: string with get, set
abstract asAbsolutePath: relativePath: string -> string
abstract storagePath: string option with get, set

and Memento =
abstract get<'T> : key: string -> 'T option
abstract get: key: string * ?defaultValue: 'T -> 'T
abstract update: key: string * value: obj -> Promise<unit>

Expand Down
2 changes: 1 addition & 1 deletion Helpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module Promise =
let onFail (a : obj -> unit) (pr : Promise<'T>) : Promise<'T> =
pr.catch (unbox<Func<obj, U2<'T, PromiseLike<'T>>>> (fun reason -> a reason |> ignore; reject reason))

let all (prs : Promise<'T> seq) =
let all (prs : Promise<'T> seq): JS.Promise<ResizeArray<'T>> =
Promise.all (unbox prs)

let empty<'T> = lift (unbox<'T>null)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"homepage": "https://github.com/ionide/ionide-vscode-helpers#readme",
"dependencies": {
"axios": "^0.13.1",
"fable-core": "*"
"fable-core": "0.6.x"
},
"scripts": {
"build": "fable ./Ionide.VSCode.Helpers.fsproj -s -o ./release/ -m commonjs --verbose"
},
"devDependencies": {
"fable-compiler": "*"
"fable-compiler": "0.6.x"
}
}