Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

monaco-intellisense

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monaco-intellisense - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

28

build/index.d.ts

@@ -9,3 +9,3 @@ import * as monaco from 'monaco-editor';

*/
interface CompletionObjectItem {
interface ObjectNestedCompletionItems {
[key: string]: any;

@@ -41,24 +41,8 @@ }

/**
* Register nested object autocompletion with the Monaco editor.
*
* @param {Monaco} monaco - The Monaco editor instance.
* @param {Object} params - The parameters for the nested completion provider.
* @param {string} params.language - The language ID.
* @param {CompletionObjectItem} params.obj - The object to provide completions for.
* @param {NestedOptions} params.options - The options for the nested completion provider.
* @returns {Disposable} The disposable object to remove the provider.
*/
declare const _default: (monaco: Monaco, params: {
obj: CompletionObjectItem;
language: string;
options: NestedOptions;
}) => Disposable;
type ObjectReturn = {
nested: (items: ObjectNestedCompletionItems, options: NestedOptions) => Disposable;
};
declare namespace index {
export {
_default as nested,
};
}
declare const object: (monaco: Monaco, language: string) => ObjectReturn;
export { index as object };
export { object };

@@ -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={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});
"use strict";var a=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},D=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!R.call(e,n)&&n!==o&&a(e,n,{get:()=>t[n],enumerable:!(s=T(t,n))||s.enumerable});return e};var L=e=>D(a({},"__esModule",{value:!0}),e);var S={};P(S,{object:()=>K});module.exports=L(S);var b={triggerCharacters:["."],templateExpressionDelimiters:[],maxDepth:1/0,excludePrototype:!0};var f=e=>{let{model:t,position:o}=e;return t.getValueInRange({startLineNumber:o.lineNumber,startColumn:1,endLineNumber:o.lineNumber,endColumn:o.column})},_=e=>{let t=e.split(`
`);return t[t.length-1].length+1},I=(e,t)=>({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column-1+_(t)});var A=(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}},x=(e,t)=>{let o=e.split(" ").pop()||"";if(t.some(n=>o.includes(n))){let n=-1,r=0;t.forEach(i=>{let m=o.lastIndexOf(i);m>n&&(n=m,r=i.length)}),n>=0&&(o=o.substring(n+r))}return o},O=(e,t)=>{if(!(t.charAt(t.length-1)==="."))return e;let s=t.slice(0,-1).split("."),n=e;for(let r of s)if(Object.prototype.hasOwnProperty.call(n,r))n=n[r];else return{};return n},N=(e,t,o,s)=>{let n="";try{n=t.__proto__.constructor.name}catch{n=typeof t}let r={label:e,kind:A(t,o,s.monaco),detail:n,insertText:e,insertTextRules:s.monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:I(s.position,e)};return n.toLowerCase()==="function"&&(r.insertText+="($0)",r.documentation=t.toString().split("{")[0]),r};var y=(e,t={})=>{let{maxDepth:o,excludePrototype:s,templateExpressionDelimiters:n}={...b,...t};return r=>{let i=f(r),m=x(i,n),h=O(e,m),j=m.charAt(m.length-1)===".",g=[];function d(p,C=0){if(!(C>=o)){for(let l in p)if(Object.prototype.hasOwnProperty.call(p,l)&&!l.startsWith("__")){let c=p[l];if(s&&!Object.prototype.hasOwnProperty.call(p,l))continue;g.push(N(l,c,j,r)),typeof c=="object"&&c!==null&&d(c,C+1)}}}return d(h),{suggestions:g}}};var u=(e,t)=>(o,s)=>{let n=y(o,s);return e.languages.registerCompletionItemProvider(t,{provideCompletionItems:(r,i)=>n({monaco:e,model:r,position:i})})};var K=(e,t)=>({nested:u(e,t)});0&&(module.exports={object});
{
"name": "monaco-intellisense",
"version": "0.0.3",
"version": "0.0.4",
"description": "Your own Intellisense in Monaco Editor",

@@ -14,3 +14,3 @@ "files": [

"dev": "tsup src/index.ts --watch",
"test": "vitest",
"test": "vitest --passWithNoTests",
"type-check": "tsc --noEmit",

@@ -17,0 +17,0 @@ "lint": "eslint . --ext .ts,.tsx --fix",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc