Skip to content

Instantly share code, notes, and snippets.

View sidwebworks's full-sized avatar
💫
Trying my best

Sid sidwebworks

💫
Trying my best
View GitHub Profile
@sidwebworks
sidwebworks / Autocomplete.js
Created June 20, 2022 17:54 — forked from mwrouse/Autocomplete.js
Autocompletion for an object in the monaco editor
function ShowAutocompletion(obj) {
// Disable default autocompletion for javascript
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ noLib: true });
// Helper function to return the monaco completion item type of a thing
function getType(thing, isMember) {
isMember = (isMember == undefined) ? (typeof isMember == "boolean") ? isMember : false : false; // Give isMember a default value of false
switch ((typeof thing).toLowerCase()) {
case "object":