Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

261
Views
Adding custom limited Javascript autocomplete set to Monaco editor with addExtraLib

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?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!