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

214
Views
how to fold by line number in a VS Code Extension?

I am trying to create simple extension for vs code that need to collapse specific cells

I found this option

vscode.commands.executeCommand('editor.fold', fold={levels: 1, selectionLines: lines});

but I cant figure out how to set it to collapse one line (the start of the cell) how to create the selectionLines argument? (Or a better solution) [there is some extensions that uses editor.foldLevels, editor.foldAll and I can't find the docs for it]

The api: https://code.visualstudio.com/api/references/commands

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

0

Solved it!

you need to do:

vscode.commands.executeCommand('editor.fold', {selectionLines: [lineNumber]});
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!