monaco-intellisense
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -17,2 +17,7 @@ import * as monaco from 'monaco-editor'; | ||
/** | ||
* Characters that trigger completion suggestions. | ||
* @default ['.'] | ||
*/ | ||
triggerCharacters?: string[]; | ||
/** | ||
* Delimiters used to trigger completion suggestions within template expressions. | ||
@@ -41,3 +46,3 @@ * @example | ||
* @param {Object} params - The parameters for the nested completion provider. | ||
* @param {string} params.languageId - The language ID. | ||
* @param {string} params.language - The language ID. | ||
* @param {CompletionObjectItem} params.obj - The object to provide completions for. | ||
@@ -49,3 +54,3 @@ * @param {NestedOptions} params.options - The options for the nested completion provider. | ||
obj: CompletionObjectItem; | ||
languageId: string; | ||
language: string; | ||
options: NestedOptions; | ||
@@ -52,0 +57,0 @@ }) => Disposable; |
@@ -1,2 +0,2 @@ | ||
"use strict";var a=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},L=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of R(t))!D.call(e,n)&&n!==o&&a(e,n,{get:()=>t[n],enumerable:!(i=P(t,n))||i.enumerable});return e};var _=e=>L(a({},"__esModule",{value:!0}),e);var S={};f(S,{object:()=>u});module.exports=_(S);var u={};f(u,{nested:()=>N});var I={templateExpressionDelimiters:[],maxDepth:1/0,excludePrototype:!0};var x=e=>{let{model:t,position:o}=e;return t.getValueInRange({startLineNumber:o.lineNumber,startColumn:1,endLineNumber:o.lineNumber,endColumn:o.column})},A=e=>{let t=e.split(` | ||
`);return t[t.length-1].length+1},O=(e,t)=>({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column-1+A(t)});var K=(e,t=!1,o)=>{switch(typeof e){case"object":return e===null?o.languages.CompletionItemKind.Value:o.languages.CompletionItemKind.Class;case"function":return t?o.languages.CompletionItemKind.Method:o.languages.CompletionItemKind.Function;default:return o.languages.CompletionItemKind.Variable}},y=(e,t)=>{let o=e.split(" ").pop()||"";if(t.some(n=>o.includes(n))){let n=-1,r=0;t.forEach(m=>{let s=o.lastIndexOf(m);s>n&&(n=s,r=m.length)}),n>=0&&(o=o.substring(n+r))}return o},T=(e,t)=>{if(!(t.charAt(t.length-1)==="."))return e;let i=t.slice(0,-1).split("."),n=e;for(let r of i)if(Object.prototype.hasOwnProperty.call(n,r))n=n[r];else return{};return n},h=(e,t,o,i)=>{let n="";try{n=t.__proto__.constructor.name}catch{n=typeof t}let r={label:e,kind:K(t,o,i.monaco),detail:n,insertText:e,insertTextRules:i.monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:O(i.position,e)};return n.toLowerCase()==="function"&&(r.insertText+="($0)",r.documentation=t.toString().split("{")[0]),r};var j=(e,t={})=>{let{maxDepth:o,excludePrototype:i,templateExpressionDelimiters:n}={...I,...t};return r=>{let m=x(r),s=y(m,n),g=T(e,s),M=s.charAt(s.length-1)===".",C=[];function d(p,b=0){if(!(b>=o)){for(let l in p)if(Object.prototype.hasOwnProperty.call(p,l)&&!l.startsWith("__")){let c=p[l];if(i&&!Object.prototype.hasOwnProperty.call(p,l))continue;C.push(h(l,c,M,r)),typeof c=="object"&&c!==null&&d(c,b+1)}}}return d(g),{suggestions:C}}};var N=(e,t)=>{let{obj:o,languageId:i,options:n}=t,r=j(o,n);return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:(m,s)=>r({monaco:e,model:m,position:s})})};0&&(module.exports={object}); | ||
"use strict";var a=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},L=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of R(t))!D.call(e,n)&&n!==o&&a(e,n,{get:()=>t[n],enumerable:!(i=P(t,n))||i.enumerable});return e};var _=e=>L(a({},"__esModule",{value:!0}),e);var S={};f(S,{object:()=>u});module.exports=_(S);var u={};f(u,{nested:()=>N});var I={triggerCharacters:["."],templateExpressionDelimiters:[],maxDepth:1/0,excludePrototype:!0};var x=e=>{let{model:t,position:o}=e;return t.getValueInRange({startLineNumber:o.lineNumber,startColumn:1,endLineNumber:o.lineNumber,endColumn:o.column})},A=e=>{let t=e.split(` | ||
`);return t[t.length-1].length+1},O=(e,t)=>({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column-1+A(t)});var K=(e,t=!1,o)=>{switch(typeof e){case"object":return e===null?o.languages.CompletionItemKind.Value:o.languages.CompletionItemKind.Class;case"function":return t?o.languages.CompletionItemKind.Method:o.languages.CompletionItemKind.Function;default:return o.languages.CompletionItemKind.Variable}},y=(e,t)=>{let o=e.split(" ").pop()||"";if(t.some(n=>o.includes(n))){let n=-1,r=0;t.forEach(m=>{let s=o.lastIndexOf(m);s>n&&(n=s,r=m.length)}),n>=0&&(o=o.substring(n+r))}return o},h=(e,t)=>{if(!(t.charAt(t.length-1)==="."))return e;let i=t.slice(0,-1).split("."),n=e;for(let r of i)if(Object.prototype.hasOwnProperty.call(n,r))n=n[r];else return{};return n},T=(e,t,o,i)=>{let n="";try{n=t.__proto__.constructor.name}catch{n=typeof t}let r={label:e,kind:K(t,o,i.monaco),detail:n,insertText:e,insertTextRules:i.monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:O(i.position,e)};return n.toLowerCase()==="function"&&(r.insertText+="($0)",r.documentation=t.toString().split("{")[0]),r};var j=(e,t={})=>{let{maxDepth:o,excludePrototype:i,templateExpressionDelimiters:n}={...I,...t};return r=>{let m=x(r),s=y(m,n),g=h(e,s),M=s.charAt(s.length-1)===".",C=[];function d(p,b=0){if(!(b>=o)){for(let l in p)if(Object.prototype.hasOwnProperty.call(p,l)&&!l.startsWith("__")){let c=p[l];if(i&&!Object.prototype.hasOwnProperty.call(p,l))continue;C.push(T(l,c,M,r)),typeof c=="object"&&c!==null&&d(c,b+1)}}}return d(g),{suggestions:C}}};var N=(e,t)=>{let{obj:o,language:i,options:n}=t,r=j(o,n);return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:(m,s)=>r({monaco:e,model:m,position:s})})};0&&(module.exports={object}); |
{ | ||
"name": "monaco-intellisense", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8967
76
0