Editor Module
Types and nested modules
Functions and values
Function or value | Description |
Full Usage:
charsStartWith prefix str
Parameters:
string
str : char list
Returns: bool
|
|
|
|
|
|
|
|
Full Usage:
makeAPMatch startP inMatchP str
Parameters:
char -> bool
inMatchP : char -> bool
str : MatchStream
Returns: (string * MatchStream) option
|
Active pattern helper that matches if a list of chars starts with startP. If it matches the return value is a pair: the first character and the string of characters matching inMatchP the list of chars from the first character that does not match inMatchP. or None if the first character does not match startP. NB - this cannot itself be an active pattern since startP and inMatchP are not literals.
|
Full Usage:
mouseEventHandler evType dispatch ev
Parameters:
string
dispatch : Msg -> unit
ev : MouseEvent
|
|
Full Usage:
reactMemoize functionToMemoize name key props
Parameters:
'Props -> ReactElement
name : string
key : ('Props -> string) option
props : 'Props
Returns: ReactElement
|
|
Full Usage:
renderEditor model dispatch
Parameters:
CodeEditorModel
dispatch : Msg -> unit
Returns: ReactElement
|
Renders the complete code editor with syntax highlighting and error indication. The editor is rendered in a div with a fixed size as specified in the CSS Height and Width props. The height of the editor is rounded to fit an integral number of lines. The editor is scrollable in both X and Y directions. CoceEditorModel is the model for the code editor, and includes info about the lines of code, the cursor position, and any errors.
|
Full Usage:
renderLineNumbers xPosition model
Parameters:
'a
model : CodeEditorModel
Returns: ReactElement
|
|
|
|
|
|
|
Main editor model update function, called from Elmish main update when a CodeEditorMsg Message is received. This allows additional Code Editor messages to be added here in the future without changing the main update function. Note that the message type must still be changed in ModelType.fs since F# does not support forward type references even to an opaque type. NB - There is a way to get forward references - by parametrising the Model type - that is theoretically neat, and possible, but in practice it is too messy to implement because type parameters would then decorate the whole code base.
|
|
Updates the Editor model with the new cursor position based on mouse coordinates. xMouse and yMouse are the mouse coordinates. xMouse specifies the column position in the line at which new chars are inserted xMouse - 1 is the column that is deleted on backspace. Model is the whole Issie Model - of which CodeEditorModel is one field.
|
Full Usage:
updateEditorOnKeyPress keyPress model
Parameters:
KeyPressInfo
model : Model
Returns: Model * Cmd<'a>
|
Active patterns
Active pattern | Description |
Full Usage:
(|CharP|_|) charToMatch str
Parameters:
char
str : MatchStream
Returns: MatchStream option
|
|
Full Usage:
(|IdentifierP|_|) str
Parameters:
MatchStream
Returns: (string * MatchStream) option
|
|
Full Usage:
(|NormalMatch|_|) str
Parameters:
MatchStream
Returns: (string * MatchStream) option
|
Returns as many characters not part of any other active pattern match as possible. This must be adjusted to match the otehr active patterns. Note that doing this without a this pattern, using a default for each character, would be inefficient since it would require a match for each character in the string. In addition it would require another pass to common up sequences of characters. However that would make the code more robust, and perhaps it would be better to do this.
|
|
|
Full Usage:
(|StringLP|_|) prefixL str
Parameters:
string list
str : MatchStream
Returns: (string * MatchStream) option
|
|
Full Usage:
(|StringLiteralStart|_|) str
Parameters:
MatchStream
Returns: (string * MatchStream) option
|