`--matlabLaunchCommandArgs` does not accept value starting with "-" (Not enough arguments following)

Open
#78 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
node.js, typescript
Domain
cli

Research direction

Build out/index.js and reproduce the two commands from the issue, then inspect the CLI argument parsing for --matlabLaunchCommandArgs. Verify that values beginning with '-' are accepted and passed through like other strings, while the existing command continues to start normally.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
When passing a value starting with - to --matlabLaunchCommandArgs, the server exits with a Not enough arguments following: matlabLaunchCommandArgs error, while other strings work as expected.

To Reproduce
From the repository root (after building out/index.js):

  1. Run:

    node out/index.js --stdio --matlabLaunchCommandArgs "xxx"
    

    The server starts normally.

  2. Then run:

    node out/index.js --stdio --matlabLaunchCommandArgs "-xxx"
    

    The process exits with the following error (or similar):

    Not enough arguments following: matlabLaunchCommandArgs
    

Expected behavior
--matlabLaunchCommandArgs should accept arbitrary strings as its value, including strings that start with - (e.g. "-xxx"), and pass them through to MATLAB in the same way as "xxx".

Useful Information

  • MATLAB-language-server: current main (commit: 6c7e6b4)
  • Node.js: v24.11.1

Additional context
This looks like the value is not being counted as an argument for matlabLaunchCommandArgs, but I am not sure whether this is intended behavior or a bug in how the CLI options are parsed.

If you need additional information or logs, I can provide them.

Dominant language
TypeScript
Stars
125
Forks
21
PR merge metrics
No merged PRs in 30d

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.

More from mathworks/MATLAB-language-server

All issues in mathworks/MATLAB-language-server

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.