codemirror-json-schema
▸ jsonSchema(schema?
): Extension
[]
Full featured cm6 extension for json, including @codemirror/lang-json
Name | Type |
---|---|
schema? |
JSONSchema7 |
Extension
[]
▸ jsonCompletion(opts?
): (ctx
: CompletionContext
) => never
[] | CompletionResult
provides a JSON schema enabled autocomplete extension for codemirror
Name | Type |
---|---|
opts |
JSONCompletionOptions |
fn
▸ (ctx
): never
[] | CompletionResult
Name | Type |
---|---|
ctx |
CompletionContext |
never
[] | CompletionResult
▸ jsonSchemaHover(options?
): (view
: EditorView
, pos
: number
, side
: Side
) => Promise
<null
| Tooltip
>
provides a JSON schema enabled tooltip extension for codemirror
Name | Type |
---|---|
options? |
HoverOptions |
fn
▸ (view
, pos
, side
): Promise
<null
| Tooltip
>
Name | Type |
---|---|
view |
EditorView |
pos |
number |
side |
Side |
Promise
<null
| Tooltip
>
▸ jsonSchemaLinter(options?
): (view
: EditorView
) => Diagnostic
[]
Helper for simpler class instantiaton
Name | Type |
---|---|
options? |
JSONValidationOptions |
fn
▸ (view
): Diagnostic
[]
Name | Type |
---|---|
view |
EditorView |
Diagnostic
[]
▸ getJsonPointers(state
, mode
): JSONPointersMap
retrieve a Map of all the json pointers in a document
Name | Type |
---|---|
state |
EditorState |
mode |
JSONMode |
▸ jsonPointerForPosition(state
, pos
, side?
, mode
): string
retrieve a JSON pointer for a given position in the editor
Name | Type | Default value |
---|---|---|
state |
EditorState |
undefined |
pos |
number |
undefined |
side |
Side |
-1 |
mode |
JSONMode |
undefined |
string
▸ parseJSONDocument(jsonString
): Object
Mimics the behavior of json-source-map
's parseJSONDocument
function using codemirror EditorState
Name | Type |
---|---|
jsonString |
string |
Object
Name | Type |
---|---|
data |
any |
pointers |
JSONPointersMap |
▸ parseJSONDocumentState(state
): Object
Return parsed data and json pointers for a given codemirror EditorState
Name | Type |
---|---|
state |
EditorState |
Object
Name | Type |
---|---|
data |
any |
pointers |
JSONPointersMap |
▸ getJSONSchema(state
): void
| JSONSchema7
Name | Type |
---|---|
state |
EditorState |
void
| JSONSchema7
▸ getJsonPointerAt(docText
, node
, mode
): string
Name | Type |
---|---|
docText |
Text |
node |
SyntaxNode |
mode |
JSONMode |
string
▸ handleRefresh(vu
): boolean
Name | Type |
---|---|
vu |
ViewUpdate |
boolean
▸ resolveTokenName(nodeName
, mode
): string
Name | Type |
---|---|
nodeName |
string |
mode |
JSONMode |
string
▸ stateExtensions(schema?
): Extension
[]
Name | Type |
---|---|
schema? |
JSONSchema7 |
Extension
[]
▸ updateSchema(view
, schema?
): void
Name | Type |
---|---|
view |
EditorView |
schema? |
JSONSchema7 |
void
Ƭ CursorData: Object
Name | Type |
---|---|
pointer |
string |
schema? |
JsonSchema |
Ƭ FoundCursorData: Required
<CursorData
>
Ƭ HoverOptions: Object
Name | Type |
---|---|
formatHover? |
(data : HoverTexts ) => HTMLElement |
getHoverTexts? |
(data : FoundCursorData ) => HoverTexts |
mode? |
JSONMode |
parser? |
(text : string ) => any |
Ƭ JSONPartialPointerData: Object
Name | Type |
---|---|
keyFrom |
number |
keyTo |
number |
Ƭ JSONPointerData: Object
Name | Type |
---|---|
keyFrom |
number |
keyTo |
number |
valueFrom |
number |
valueTo |
number |
Ƭ JSONPointersMap: Map
<string
, JSONPointerData
| JSONPartialPointerData
>
• Const
schemaStateField: StateField
<void
| JSONSchema7
>