private static void writeRefJson(Node ref, Binding binding, JsonGenerator json) throws IOException {
        if (binding.file != null) {
            String path = binding.qname.replace("%20", ".");

            if (binding.start >= 0 && ref.start >= 0) {
                json.writeStartObject();
                json.writeStringField("sym", path);
                json.writeStringField("symFile", binding.node.file);
                json.writeStringField("file", ref.file);
                json.writeNumberField("start", ref.start);
                json.writeNumberField("end", ref.end);
                json.writeBooleanField("builtin", false);
                json.writeEndObject();
            }
        }
    }