monaco-intellisense
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -1,3 +0,3 @@ | ||
"use strict";var c=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var o in e)c(t,o,{get:e[o],enumerable:!0})},R=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of M(e))!S.call(t,n)&&n!==o&&c(t,n,{get:()=>e[n],enumerable:!(r=D(e,n))||r.enumerable});return t};var A=t=>R(c({},"__esModule",{value:!0}),t);var U={};y(U,{object:()=>G});module.exports=A(U);var C=[".","['"],f="javascript",I={templateExpressionDelimiters:[],maxDepth:1/0,excludePrototype:!0};var x=t=>{let{model:e,position:o}=t;return e.getValueInRange({startLineNumber:o.lineNumber,startColumn:1,endLineNumber:o.lineNumber,endColumn:o.column})};var L=(t,e=!1,o)=>{switch(typeof t){case"object":return t===null?o.languages.CompletionItemKind.Value:o.languages.CompletionItemKind.Class;case"function":return e?o.languages.CompletionItemKind.Method:o.languages.CompletionItemKind.Function;default:return o.languages.CompletionItemKind.Variable}},b=(t,e)=>{let o=t.split(" ").pop()||"";if(e.some(n=>o.includes(n))){let n=-1,s=0;e.forEach(i=>{let p=o.lastIndexOf(i);p>n&&(n=p,s=i.length)}),n>=0&&(o=o.substring(n+s))}return o},O=(t,e,o)=>{if(!o)return t;let r=P(e),n=t[r[0]];if(r.length===0)return{};for(let s=1;s<r.length;s++)if(Object.hasOwn(n,r[s]))n=n[r[s]];else return{};return n},P=t=>{let e=(o,r,n)=>o.split(r).join(".").split(n).join(".").split(".").filter(Boolean);return t.includes("['")?e(t,"['","']"):t.slice(0,-1).split(".").filter(Boolean)},N=t=>t.split(".").length,T=(t,e,o,r)=>{let{monaco:n}=r,s="";try{s=e.__proto__.constructor.name}catch{s=typeof e}let i={label:t,kind:L(e,o,n),detail:s,insertText:t,insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet};return s.toLowerCase()==="function"&&(i.insertText+=`($1) { | ||
"use strict";var u=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var t in o)u(e,t,{get:o[t],enumerable:!0})},R=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of S(o))!_.call(e,n)&&n!==t&&u(e,n,{get:()=>o[n],enumerable:!(s=D(o,n))||s.enumerable});return e};var P=e=>R(u({},"__esModule",{value:!0}),e);var U={};y(U,{object:()=>G});module.exports=P(U);var C=[".","['"],f="javascript",I={templateExpressionDelimiters:[],maxDepth:1/0,excludePrototype:!0};var x=e=>{let{model:o,position:t}=e;return o.getLineContent(t.lineNumber).substring(0,t.column-1)};var A=(e,o=!1,t)=>e===null?t.languages.CompletionItemKind.Value:typeof e=="object"?t.languages.CompletionItemKind.Class:typeof e=="function"?o?t.languages.CompletionItemKind.Method:t.languages.CompletionItemKind.Function:t.languages.CompletionItemKind.Variable,O=(e,o)=>{let t=e.split(" ").pop()||"",s=Math.max(...o.map(n=>t.lastIndexOf(n)));return s>=0?t.substring(s+1):t},b=(e,o,t)=>t?L(o).reduce((n,r)=>n&&Object.hasOwn(n,r)?n[r]:{},e):e,L=e=>{let o=[],t="",s=!1;for(let n=0;n<e.length-1;n++){let r=e[n];r==="["&&e[n+1]==="'"?(t&&(o.push(t),t=""),s=!0,n++):s&&r==="'"&&e[n+1]==="]"?(o.push(t),t="",s=!1,n++):!s&&r==="."?t&&(o.push(t),t=""):t+=r}return t&&o.push(t),o},N=e=>(e.match(/\./g)||[]).length,T=(e,o,t,s)=>{let{monaco:n}=s,r=o?.constructor?.name||typeof o,i={label:e,kind:A(o,t,n),detail:r,insertText:e,insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet};return r.toLowerCase()==="function"&&(i.insertText+=`($1) { | ||
$0 | ||
}`,i.documentation=e.toString().split("{")[0]),i};var E=(t,e={})=>{let{maxDepth:o,excludePrototype:r,templateExpressionDelimiters:n}={...I,...e};return s=>{let i=x(s),p=b(i,n),a=C.some(l=>p.includes(l)),g=O(t,p,a),h=N(p);if(Object.keys(g).length===0)return{suggestions:[]};let d=[];function j(l,_=0){if(!(_>o))for(let m in l)(r&&Object.hasOwn(l,m)||!r&&!m.startsWith("__"))&&d.push(T(m,l[m],a,s))}return j(g,h),{suggestions:d}}};var u=(t,e)=>(o,r)=>{let n=E(o,r);return t.languages.registerCompletionItemProvider(e,{triggerCharacters:[".","'"],provideCompletionItems:(s,i)=>n({monaco:t,model:s,position:i})})};var G=(t,e)=>({nested:u(t,e||f)});0&&(module.exports={object}); | ||
}`,i.documentation=o.toString().split("{")[0]),i};var h=(e,o={})=>{let{maxDepth:t,excludePrototype:s,templateExpressionDelimiters:n}={...I,...o};return r=>{let i=x(r),m=O(i,n),c=C.some(p=>m.includes(p)),l=b(e,m,c),E=N(m);if(!l||Object.keys(l).length===0)return{suggestions:[]};let d=[];return((p,j=0)=>{j>t||Object.entries(p).forEach(([a,M])=>{(s&&Object.prototype.hasOwnProperty.call(p,a)||!s&&!a.startsWith("__"))&&d.push(T(a,M,c,r))})})(l,E),{suggestions:d}}};var g=(e,o)=>{let t=(s,n)=>{let r=h(s,n);return(i,m)=>r({monaco:e,model:i,position:m})};return(s,n)=>{let r=t(s,n);return e.languages.registerCompletionItemProvider(o,{triggerCharacters:[".","'"],provideCompletionItems:r})}};var G=(e,o)=>({nested:g(e,o||f)});0&&(module.exports={object}); |
{ | ||
"name": "monaco-intellisense", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Your own Intellisense in Monaco Editor", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10725
71