-
-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Description:
There is a bug in the C++ execution logic where custom arguments defined in the plugin settings are not passed to the Cling interpreter. Additionally, the C++ standard flag is being injected twice into the command call. Furthermore, the argument list grows cumulatively with every execution of the same code block
Steps to Reproduce:
- Go to settings and enter a custom flag (e.g.,
-I/custom/path) in the "Cling arguments for C++" field - Instead of the actual Cling path, set the "Cling path" setting to a simple helper program that prints all command-line arguments it receives. This allows you to see exactly what string the plugin constructs.
- Run the code block.
- Observe that the custom flag is missing, while the standard flag is duplicated.
- Run the code block again.
- Observe a longer args list.
Observed Behavior:
I used a test program to print all arguments passed to the process. The output shows that the custom arguments from the settings are completely ignored. Instead, the output looks like this:
"
Parameter 1: -std=c++2a
Parameter 2: -std=c++2a
Parameter 3:
...
Parameter 7: #include
... (rest of the code block)
"
My guess:
In src/settings/per-lang/makeCppSettings.ts, the UI saves the input to tab.plugin.settings.cppArgs.
However, in src/RunButton.ts, the execution logic for C++ attempts to read s.clingArgs: