IDE Configuration - themaplelab/swan GitHub Wiki
You can configure IntelliJ to recognize SIL and SWIRL files and highlight keywords within them.
Go to Preferences -> Editor -> File Types and press +
under Recognized File Types.
Name | SWIRL |
Line comment | // |
Block comment start | /* |
Block comment end | */ |
Support paired braces | yes |
Support paired parens | yes |
Support paired brackets | yes |
Support string escapes | yes |
Keywords 1 | apply assign binary_op builtin_ref cond_fail dynamic_ref field_read field_write function_ref literal new pointer_read pointer_write singleton_read singleton_write switch_enum_assign switch_value_assign unary_op |
Keywords 2 | br br_if cond_br return switch switch_enum throw try_apply unreachable unwind yield |
Keywords 3 | func |
Keywords 4 | [coroutine] [linked] [model] [model_override] [stub] [entry] |
Next, press +
under File Name Patterns and add *.swirl
.
Repeat the same process for SIL, but with these values and for *.sil
file name pattern.
Name | SIL |
Line comment | // |
Block comment start | None |
Block comment end | None |
Support paired braces | yes |
Support paired parens | yes |
Support paired brackets | yes |
Support string escapes | yes |
Keywords 1 | alloc_stack alloc_ref alloc_ref_dynamic alloc_box alloc_value_buffer alloc_global dealloc_stack dealloc_box project_box dealloc_ref dealloc_partial_ref dealloc_value_buffer project_value_buffer debug_value debug_value_addr load store load_borrow store_borrow begin_borrow end_borrow end_lifetime copy_addr destroy_addr index_addr tail_addr index_raw_pointer bind_memory begin_access end_access begin_unpaired_access end_unpaired_access strong_retain strong_release set_deallocating copy_unowned_value strong_copy_unowned_value strong_retain_unowned unowned_retain unowned_release load_weak store_weak load_unowned store_unowned fix_lifetime mark_dependence is_unique is_escaping_closure copy_block copy_block_without_escaping function_ref dynamic_function_ref prev_dynamic_function_ref global_addr global_value integer_literal float_literal string_literal class_method objc_method super_method objc_super_method witness_method apply begin_apply abort_apply end_apply partial_apply builtin metatype value_metatype existential_metatype objc_protocol retain_value retain_value_addr unmanaged_retain_value copy_value strong_copy_unmanaged_value release_value release_value_addr unmanaged_release_value destroy_value autorelease_value unmanaged_autorelease_value tuple tuple_extract tuple_element_addr destructure_tuple struct struct_extract struct_element_addr destructure_struct object ref_element_addr ref_tail_addr enum unchecked_enum_data init_enum_data_addr inject_enum_addr unchecked_take_enum_data_addr select_enum select_enum_addr init_existential_addr init_existential_value deinit_existential_addr deinit_existential_value open_existential_addr open_existential_value init_existential_ref open_existential_ref init_existential_metatype open_existential_metatype alloc_existential_box project_existential_box open_existential_box open_existential_box_value dealloc_existential_box project_block_storage init_block_storage_header upcast address_to_pointer pointer_to_address unchecked_ref_cast unchecked_ref_cast_addr unchecked_addr_cast unchecked_trivial_bit_cast unchecked_bitwise_cast unchecked_ownership_conversion ref_to_raw_pointer raw_pointer_to_ref ref_to_unowned unowned_to_ref ref_to_unmanaged unmanaged_to_ref convert_function convert_escape_to_noescape thin_function_to_pointer pointer_to_thin_function classify_bridge_object value_to_bridge_object ref_to_bridge_object bridge_object_to_ref bridge_object_to_word thin_to_thick_function thick_to_objc_metatype objc_to_thick_metatype objc_metatype_to_object objc_existential_metatype_to_object unconditional_checked_cast unconditional_checked_cast_addr unconditional_checked_cast_value keypath cond_fail |
Keywords 2 | unreachable return throw yield unwind br cond_br switch_value select_value switch_enum switch_enum_addr dynamic_method_br checked_cast_br checked_cast_value_br checked_cast_addr_br try_apply |
Keywords 3 | import sil sil_default_witness_table sil_global sil_scope sil_vtable sil_witness_table |