import{C as r}from"./codemirror-CVZ5hDL3.js";import"./show-hint-CnJAUBuc.js";import{a as m}from"./index-Cq7z4i0o.js";import{P as d}from"./Range-CZNrBk8u.js";import"./codemirror-DpyRu-EA.js";r.registerHelper("hint","graphql",(n,c)=>{const{schema:i,externalFragments:p,autocompleteOptions:u}=c;if(!i)return;const s=n.getCursor(),e=n.getTokenAt(s),a=e.type!==null&&/"|\w/.test(e.string[0])?e.start:e.end,g=new d(s.line,a),t={list:m(i,n.getValue(),g,e,p,u).map(o=>{var l;return{text:(l=o?.rawInsert)!==null&&l!==void 0?l:o.label,type:o.type,description:o.documentation,isDeprecated:o.isDeprecated,deprecationReason:o.deprecationReason}}),from:{line:s.line,ch:a},to:{line:s.line,ch:e.end}};return t?.list&&t.list.length>0&&(t.from=r.Pos(t.from.line,t.from.ch),t.to=r.Pos(t.to.line,t.to.ch),r.signal(n,"hasCompletion",n,t,e)),t});
//# sourceMappingURL=hint-C2Xx8CF7.js.map
