mathworks / mathworks/MATLAB-extension-for-vscode

Line continuation using ellipses does not handle indentation correctly

Open
#85 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
435
Forks
40
PR merge metrics
No merged PRs in 30d

Description

On the MATLAB IDE, any line continuation using ellipses (...) automatically indents the next line.

On VS Code, this occurs when the continuation occurs after some operator ('=', '+', etc), or if a function is being defined.
Screenshot 2024-01-12 at 11 59 11 AM 3

However, (as far as I can tell) VS Code does not automatically indent in all other cases.
Screenshot 2024-01-12 at 11 59 11 AM 3 2

Here, lines 55, as well as lines 58-61, should have indented automatically.


When doing multiple line continuations using ellipses, each subsequent line should be indented. Once the line is finished, the indentation should go back to its original position. This occurs on the MATLAB IDE automatically. On VS Code, the indentation does not reset after a line is terminated, and you have to manually tab backwards.

Here, when I don't press 'tab' myself, line 56 is indented when it shouldnt be.
Screenshot 2024-01-12 at 12 07 02 PM 3


Suggestion: Something that would be nice is if VS Code could detect if a line is continuing and automatically add ellipses (when the user presses 'enter' while typing out a line). The MATLAB IDE currently does this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported ellipsis continuation and indentation cases in the MATLAB extension for VS Code, including consecutive continuations and a terminated continuation. Trace the extension's indentation handling from the editor behavior, then verify that continuation lines indent correctly and indentation resets afterward; the suggested automatic insertion of ellipses is a separate enhancement.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.