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

Your own Intellisense in Monaco Editor

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by175%
Maintainers
0
Weekly downloads
 
Created
Source

Monaco Intellisense

Monaco Intellisense is a library that provides custom IntelliSense (code completion) for the Monaco Editor, enabling rich code completion experiences within the Monaco Editor.

Installation

npm install monaco-intellisense

object

The object module provides methods to register custom IntelliSense for objects within the Monaco Editor.

object.nested

https://github.com/user-attachments/assets/a1e41f97-aacc-44bb-94a4-c17ed85ad062

The object.nested method registers a completion item provider for nested object properties.

Parameters
  • items (ObjectNestedCompletionItems): The items to be used for completion suggestions.
  • options (NestedOptions, optional): Additional options for the completion provider.
Example
import * as monaco from 'monaco-editor';
import {object} from 'monaco-intellisense';

const editor = monaco.editor.create(document.getElementById('editor'), {
  value: '',
  language: 'javascript',
});

const objectIntellisense = object(monaco).nested(
  {
    user: {
      name: 'John Doe',
      age: 30,
      address: {
        street: '123 Main St',
        city: 'Anytown',
        zip: '12345',
      },
    },
    settings: {
      theme: 'dark',
      notifications: true,
    },
  },
  {
    templateExpressionDelimiters: ['{{', '}}'],
  },
);

editor.onDidDispose(() => {
  objectIntellisense.dispose();
});

Options

The object.nested method accepts an optional options parameter to configure the nested completion provider. The available options are:

  • templateExpressionDelimiters (string[]): Delimiters used to trigger completion suggestions within template expressions.
    • Example: ["{{", "}}"]
    • This will allow to show completions even when the cursor is inside the {{}}.
  • maxDepth (number): Maximum depth to traverse when generating completion suggestions.
    • Default: Infinity
  • excludePrototype (boolean): Whether to exclude prototype properties from completion suggestions.
    • Default: true

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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