I would like to limit the amount of suggestions Monaco gives me on default with plain Javascript. Things like autocompleting array object's properties such as length are welcome but anything related to DOM or CSS elements is not needed.
There's a Github issue reply that describes how this can be achieved in theory, but there's an issue ran into with the approach described in the link. The custom definitions for JS such as lib.es5.d.ts are so long that if I try to convert the whole definition to Javascript string and feed to Monaco through monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri); function, Javascript crashes to RangeError: Maximum call stack size exceeded because the string containing the definitions is too long to process.
Is there a way to configure Monaco so that only lib.es5.d.ts definitions are being used with autocomplete, or perhaps some way around the too long string issue?
This was solved by using a webpack raw-loader to import the definitions as a js handle and then passing that handle to monaco.languages.typescript.javascriptDefaults.setExtraLibs(...) function appropriately. Many different definitions can be included this way.