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

540
Views
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 answers
Answer question

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 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!