In his streams Per updates the ion compiler while writing ion. To have a similar workflow in Clion:
ion directory as a project - this will create CMakeLists.txt.
Change CMakeLists.txt with the following content
cmake_minimum_required(VERSION 3.13) project(ion C) set(CMAKE_C_STANDARD 11) include_directories(.) add_executable(ion main.c)
This allows to build and run the ion compiler.
To enable breakpoints in the ion files, add the
pattern to C/C++ file types (Settings > Editor > File Types).
Let's say we want to debug the test1 package. Add the executable to CMakeLists.txt:
Create a new run configuration called 'test1' (Run > Edit configurations...> + > Application)
test1 in its Target and Executable fields.
Create a run configuration 'compile test1' with Target and Executable
ion, program arguments
-o <path/to/test1/out.c> test1 and environment variables:
Add the 'compile test1' configuration to the 'Before launch' list of 'test1' after the 'Build'.
Now you can debug 'test1' configuration and it stops in ion breakpoints.
For some reason sometimes debugger doesn't show all local variables. You can evaluate them by name and add to watches.