/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{parser as e}from"../../../@lezer/json/dist/index.js";import{LanguageSupport as t,LRLanguage as n,indentNodeProp as r,continuedIndent as s,foldNodeProp as a,foldInside as o}from"../../language/dist/index.js";const c=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;const n=function(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}(t,e.state.doc);return[{from:n,message:t.message,severity:"error",to:n}]}return[]};const i=/* @__PURE__ */n.define({name:"json",parser:/* @__PURE__ */e.configure({props:[
/* @__PURE__ */r.add({Object:/* @__PURE__ */s({except:/^\s*\}/}),Array:/* @__PURE__ */s({except:/^\s*\]/})}),
/* @__PURE__ */a.add({"Object Array":o})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function m(){return new t(i)}export{m as json,i as jsonLanguage,c as jsonParseLinter};