Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda