Skip to content

Commit

Permalink
Add CompletionItem with snippet support to the example
Browse files Browse the repository at this point in the history
Many users are asking about snippet support in Monaco. Enhancing the
example on in the playground with a snippet CompletionItem will help
users learn about the feature more easily without having to dig through
Stack Overflow and GitHub issues.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
  • Loading branch information
rcjsuen committed Dec 13, 2019
1 parent 5b7c0c4 commit 3a3d010
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Expand Up @@ -57,6 +57,13 @@
kind: monaco.languages.CompletionItemKind.Function,
documentation: "Recursively mkdir, like <code>mkdir -p</code>",
insertText: '"mkdirp": "*"'
},
{
label: '"my-third-party-library"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: "Describe your library here",
insertText: '"${1:my-third-party-library}": "${2:1.2.3}"',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
}
];
}
Expand Down
Expand Up @@ -19,6 +19,13 @@ function createDependencyProposals() {
kind: monaco.languages.CompletionItemKind.Function,
documentation: "Recursively mkdir, like <code>mkdir -p</code>",
insertText: '"mkdirp": "*"'
},
{
label: '"my-third-party-library"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: "Describe your library here",
insertText: '"${1:my-third-party-library}": "${2:1.2.3}"',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
}
];
}
Expand Down

0 comments on commit 3a3d010

Please sign in to comment.