Home

Awesome

JSONiq & XQuery Package for Atom

Build Status Code Climate

This package provides syntax highlighting for JSONiq and XQuery files. The syntax highlighting and error reporting is provided by XQLint.

Installation

Linter package must be installed in order to use this plugin. If Linter is not installed, please follow the instructions here.

$apm install linter language-jsoniq

Syntax Highlighting, Warnings, and Errors

example

Code Snippets

snippets

TriggerNameBody
forforfor $${1:item} in ${2:expr}${3}
returnreturnreturn ${1:expr}${2}
importimportimport module namespace ${1:ns} = "${2:http://www.example.com/}";\n${3}
somesomesome $${1:varname} in ${2:expr} satisfies ${3:expr}${4}
everyeveryevery $${1:varname} in ${2:expr} satisfies ${3:expr}${4}
ififif(${1:true}) then\n ${2:expr}\nelse\n ${3:true}${4}
switchswitchswitch(${1:"foo"})\ncase ${2:"foo"}\nreturn ${3:true}\ndefault return ${4:false}${5}
trytrytry {\n ${1:expr}\n} catch ${2:*} {\n ${3:expr}\n}${4}
tumblingtumblingfor tumbling window $${1:varname} in ${2:expr}\nstart at $${3:start} when ${4:expr}\nend at $${5:end} when ${6:expr}\nreturn ${7:expr}${8}
slidingslidingfor sliding window $${1:varname} in ${2:expr}\nstart at $${3:start} when ${4:expr}\nend at $${5:end} when ${6:expr}\nreturn ${7:expr}${8}
letletlet $${1:varname} := ${2:expr}${3}
groupgroupgroup by $${1:varname} := ${2:expr}${3}
orderorderorder by $${1:expr} := ${2:descending}${3}
stablestablestable order by $${1:expr}${2}
countcountcount $${1:varname}${2}
orderedorderedordered { ${1:expr} }${2}
unorderedunorderedunordered { ${1:expr} }${2}
treattreattreat as ${1:expr}${2}
castablecastablecastable as ${1:atomicType}${2}
castcastcast as ${1:atomicType}${2}
typeswitchtypeswitchtypeswitch(${1:expr})\ncase ${2:type} return ${3:expr}\ndefault return ${4:expr}${5}
varvardeclare variable $${1:varname} := ${2:expr};${3}
fnfndeclare function ${1:ns}:${2:name}(){\n ${3:expr}\n};\n\n${4}
modulemodulemodule namespace ${1:ns} = "${2:http://www.example.com}";\n\n${3}