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

133
Visualizações
VSCode extension throws regex indices error only when other extension is enabled

Background

I am working on an extension (vscode-color-blocks) that uses RegExp match indices (new in ES2022). This means I am using a regex string with the d flag to get indices (relational positions) of each capture group in my regex (source):

export const colorBlockRegex = new RegExp(regexString, 'd');

This means that a successful regex match object will have a .indices attribute that I can then use (source):

const match = colorBlockRegex.exec(comment.content);
if (!match) continue;
console.log(match.indices);

Problem

All of this works fine when I am using the extension on it's own and even together with some other extensions. But VSCode behaves like this new regex feature is not available once I install an extension named Todo Tree. At that point my extension crashes and I get the following error:

stack trace: SyntaxError: Invalid flags: d
    at _ (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:114:74341)
    at Array.<anonymous> (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:114:3580)
    at Object.parse (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:114:71938)
    at Object.parse (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:1:12529)
    at Object.parse (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:114:415)
    at i (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:52:165)
    at Array.get [as indices] (...\.vscode\extensions\gruntfuggly.todo-tree-0.0.215\dist\extension.js:52:2895)
    at DecorationRangeHandler.addNewDecorationRanges (...\vscode-color-blocks\dist\extension.js:1735:95)

The stack trace is a little confusing as it steps from gruntfuggly.todo-tree-0.0.215 into my extension vscode-color-blocks.

Otherwise there must be something wrong with how these two extensions are running on different versions on Javascript?

about 4 years ago · Juan Pablo Isaza
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