How to use setup_new_project command?

I don't know how to use the setup_new_project command. What arguments should I pass into it?

Edited by longtran2904 on Reason: Initial post
You can have a look at 4coder_project_commands.cpp to see what it does and require.

- You need the hot directory to be in the folder where you want to setup the project (for example use the open dialogue to create a directory or open a file in the desired directory).
- Than call the command, it will ask you for:
-- The build target: the source file to compile (e.g. main.c). The build script assume a single translation unit (unity build);
-- The output directory: where to put the resulting executable;
-- The binary output: the name of the resulting executable.

With that the command will create default build scripts (with information from config.4coder), and a project file. You can edit those to better fit your needs.
I tried to pass in:
- build target: LongLib_Windows.c
- output directory: build
- binary output: LongLib_Windows.exe
But it keeps send me this error:
Project errors:
D:/Documents/Projects/LongLib/project.4coder:35:12: expected an r-value; r-value formats:
constants (true, false, integers, hexadecimal integers, strings, characters)
any l-value that is set in the file
compound: '{ compound-element, compound-element, compound-element ...}'
a compound-element is an r-value, and can have a layout specifier
compound-element with layout specifier: .name = r-value, .integer = r-value
D:/Documents/Projects/LongLib/project.4coder:36:1: expected an l-value; l-value formats: 'identifier', 'identifier[#]'
D:/Documents/Projects/LongLib/project.4coder:37:1: expected an l-value; l-value formats: 'identifier', 'identifier[#]'

Edited by longtran2904 on
Sorry I was testing on an older version that was using version 1 of the project system.

I have the same result as you describe, so there is something wrong. After looking at the generated project file, there is an error where semicolon are used instead of comas. There is already an issue on github setup_new_project generates incorrect syntax that also raises other issues, so have a look at that.

Near the end, you can change

1
2
3
4
fkey_command = {
.F1 = "run";
.F2 = "run";
};


to

1
2
3
4
fkey_command = {
.F1 = "build",
.F2 = "run",
};
Yup, it's working now. Thanks! Just another question, is there any way for 4coder to remember the theme and settings (like toggle line) that I'm currently using?
As far as I know there isn't an out of the box way to do that. You can set the theme and settings in config.4coder manually, although there are some weirdness like the theme name must include the theme- which the default value doesn't making it confusing, and use_comment_keywords for which you need to remove the s at the end.

It should be possible to create a custom function to do that, have a look in 4coder_config.cpp.