New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

motoko

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motoko - npm Package Compare versions

Comparing version 3.0.2 to 3.1.0

contrib/snippets.json

31

contrib/monaco.js
'use strict';
const { keywords, typeKeywords } = require('../lib/keywords');
const snippetConfig = require('./snippets.json');
/// Monaco editor configuration
exports.configure = (monaco) => {
exports.configure = (monaco, { snippets } = {}) => {
monaco.languages.register({ id: 'motoko' });

@@ -124,2 +125,30 @@ monaco.languages.setLanguageConfiguration('motoko', {

});
if (snippets) {
monaco.languages.registerCompletionItemProvider('motoko', {
provideCompletionItems() {
return {
suggestions: Object.entries(snippetConfig).map(
([name, snippet]) => {
return {
label:
typeof snippet.prefix === 'string'
? snippet.prefix
: snippet.prefix[0],
detail: name,
insertText:
typeof snippet.body === 'string'
? snippet.body
: snippet.body.join('\n'),
// insert as snippet (https://microsoft.github.io/monaco-editor/api/enums/monaco.languages.CompletionItemInsertTextRule.html)
insertTextRules: 4,
// snippet completion (https://microsoft.github.io/monaco-editor/api/enums/monaco.languages.CompletionItemKind.html)
kind: 27,
};
},
),
};
},
});
}
};

4

package.json
{
"name": "motoko",
"version": "3.0.2",
"version": "3.1.0",
"description": "Compile and run Motoko smart contracts in Node.js or the browser.",

@@ -25,3 +25,3 @@ "author": "Ryan Vandersmith (https://github.com/rvanasa)",

"isomorphic-parse-github-url": "1.0.2",
"sanitize-filename": "^1.6.3"
"sanitize-filename": "1.6.3"
},

@@ -28,0 +28,0 @@ "devDependencies": {

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