Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

546
Vistas
How Can I Make VS Code Split Long Strings *Properly* When I Break Them Up?

In other editors if I have a line of Javascript like:

const longString = 'abc abc abc abc abc abc abc abc abc';

and my cursor is in the middle of that string:

const longString = 'abc abc abc abc abc |abc abc abc abc';

and I hit ENTER, my editor will be smart enough to break that string into two valid strings, joined by a +:

const longString = 'abc abc abc abc abc ' +
                   'abc abc abc abc';

... but not VS Code. The most advanced editor I've ever used can't do this one (seemingly) basic thing, and it's driving me crazy.

Now there is a plug-in called Split Lines, that promises to do just this ... but it's been broken for awhile.

My question is, is there any way, in 2021 (ideally with just VS Code, but if not, with extensions) to make VS Code smarter when I break up strings?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could replace the single quotes with back ticks and it will still be recognized as a single string.

console.log(`string text line 1
string text line 2`);
// "string text line 1
// string text line 2"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#multi-line_strings

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda