use serde_json::{
Value,
json,
};
pub fn uri() -> Value {
json!({ "type": "string", "format": "uri" })
}
pub fn text_document_identifier() -> Value {
json!({
"type": "object",
"properties": { "uri": uri() },
"required": ["uri"]
})
}
pub fn position() -> Value {
json!({
"type": "object",
"properties": {
"line": { "type": "integer", "minimum": 0 },
"character": { "type": "integer", "minimum": 0 }
},
"required": ["line", "character"]
})
}
pub fn range() -> Value {
json!({
"type": "object",
"properties": { "start": position(), "end": position() },
"required": ["start", "end"]
})
}
pub fn text_document_position() -> Value {
json!({
"type": "object",
"properties": {
"textDocument": text_document_identifier(),
"position": position()
},
"required": ["textDocument", "position"]
})
}
pub fn hierarchy_item() -> Value {
json!({
"type": "object",
"properties": {
"name": { "type": "string" },
"kind": { "type": "integer" },
"uri": uri(),
"range": range(),
"selectionRange": range(),
"tags": { "type": "array", "items": { "type": "integer" } },
"detail": { "type": "string" },
"data": {}
},
"required": ["name", "kind", "uri", "range", "selectionRange"]
})
}