├── .github
├── FUNDING.yml
└── workflows
│ └── test.yml
├── docs
├── public
│ └── logo.svg
├── .vitepress
│ └── theme
│ │ ├── components
│ │ └── CenteredArrowDown.vue
│ │ └── index.js
├── package.json
├── diagnostics
│ ├── overview.md
│ ├── uninit.md
│ ├── undef.md
│ └── duplicated-names.md
└── config
│ └── format
│ ├── split-closing-parens.md
│ └── format-comments.md
├── crates
├── parser
│ ├── tests
│ │ └── parse
│ │ │ ├── incomplete-module.wat
│ │ │ ├── token.wat
│ │ │ ├── implicit-module.wat
│ │ │ ├── ident.wat
│ │ │ ├── data-malformed.wat
│ │ │ ├── start.wat
│ │ │ ├── module-malformed.wat
│ │ │ ├── rec-type-malformed.wat
│ │ │ ├── start-malformed.wat
│ │ │ ├── names-malformed.wat
│ │ │ ├── array-malformed.wat
│ │ │ ├── table-malformed.wat
│ │ │ ├── subtyping-malformed.wat
│ │ │ ├── global-malformed.wat
│ │ │ ├── try-table-malformed.wat
│ │ │ ├── type-malformed.wat
│ │ │ ├── binary.wat
│ │ │ ├── tag.wat
│ │ │ ├── struct-malformed.wat
│ │ │ ├── simd.wat
│ │ │ ├── annotations-malformed.wat
│ │ │ ├── address-malformed.wat
│ │ │ ├── elem-malformed.wat
│ │ │ ├── subtyping.wat
│ │ │ ├── memory-malformed.wat
│ │ │ ├── table.wat
│ │ │ ├── incomplete-module.snap
│ │ │ ├── exports-malformed.wat
│ │ │ ├── memory.wat
│ │ │ ├── rec-type.wat
│ │ │ ├── imports-malformed.wat
│ │ │ ├── ref-type-as-immediate.wat
│ │ │ ├── int-literals-malformed.wat
│ │ │ ├── try-table.wat
│ │ │ ├── struct.wat
│ │ │ ├── block-malformed.wat
│ │ │ ├── loop-malformed.wat
│ │ │ ├── bulk.wat
│ │ │ ├── if-malformed.wat
│ │ │ └── array.wat
│ └── src
│ │ └── lib.rs
├── service
│ ├── tests
│ │ ├── formatting
│ │ │ ├── mod.rs
│ │ │ └── snapshots
│ │ │ │ ├── features__formatting__full__format_comments.snap
│ │ │ │ ├── features__formatting__range__fully_covered_node.snap
│ │ │ │ ├── features__formatting__range__format_comments.snap
│ │ │ │ ├── features__formatting__full__tab.snap
│ │ │ │ ├── features__formatting__full__space2.snap
│ │ │ │ ├── features__formatting__full__space4.snap
│ │ │ │ └── features__formatting__range__overlap.snap
│ │ ├── rename
│ │ │ ├── mod.rs
│ │ │ └── snapshots
│ │ │ │ ├── features__rename__prepare_rename__ident.snap
│ │ │ │ └── features__rename__rename__different_kinds.snap
│ │ ├── definition
│ │ │ ├── mod.rs
│ │ │ └── snapshots
│ │ │ │ ├── features__definition__goto_declaration__func_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__block_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__func_as_block.snap
│ │ │ │ ├── features__definition__goto_definition__func_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__table_int_idx.snap
│ │ │ │ ├── features__definition__goto_declaration__func_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__after_func_type.snap
│ │ │ │ ├── features__definition__goto_definition__block_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__func_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__global_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__global_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__local_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__local_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__memory_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__memory_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__param_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__param_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__table_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__type_use_int_idx.snap
│ │ │ │ ├── features__definition__goto_type_definition__global.snap
│ │ │ │ ├── features__definition__goto_definition__exported_global_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__func_in_implicit_module.snap
│ │ │ │ ├── features__definition__goto_definition__imported_func_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_table_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__param_via_type_def.snap
│ │ │ │ ├── features__definition__goto_definition__type_use_ident_idx.snap
│ │ │ │ ├── features__definition__goto_type_definition__global_mut.snap
│ │ │ │ ├── features__definition__goto_type_definition__param_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__exported_global_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_func_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_global_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_global_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_memory_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_memory_int_idx.snap
│ │ │ │ ├── features__definition__goto_definition__imported_table_ident_idx.snap
│ │ │ │ ├── features__definition__goto_definition__param_in_implicit_module.snap
│ │ │ │ ├── features__definition__goto_type_definition__local_ident_idx.snap
│ │ │ │ ├── features__definition__goto_type_definition__func_int_idx_type_use_int_idx.snap
│ │ │ │ ├── features__definition__goto_type_definition__func_ident_idx_type_use_int_idx.snap
│ │ │ │ ├── features__definition__goto_type_definition__func_int_idx_type_use_ident_idx.snap
│ │ │ │ └── features__definition__goto_type_definition__func_ident_idx_type_use_ident_idx.snap
│ │ ├── call_hierarchy
│ │ │ └── snapshots
│ │ │ │ └── features__call_hierarchy__f1_outgoing-2.snap
│ │ ├── completion
│ │ │ ├── snapshots
│ │ │ │ ├── features__completion__local__types_following_ident.snap
│ │ │ │ ├── features__completion__param__types_following_ident.snap
│ │ │ │ ├── features__completion__keyword__module_keyword_in_empty.snap
│ │ │ │ ├── features__completion__local__types_following_incomplete_ident.snap
│ │ │ │ ├── features__completion__param__types_following_incomplete_ident.snap
│ │ │ │ ├── features__completion__keyword__module_field_keyword_without_paren.snap
│ │ │ │ ├── features__completion__data__memory_idx.snap
│ │ │ │ ├── features__completion__elem__table_idx.snap
│ │ │ │ ├── features__completion__param__after_paren.snap
│ │ │ │ ├── features__completion__result__after_paren.snap
│ │ │ │ ├── features__completion__ty_decl__rec_type.snap
│ │ │ │ ├── features__completion__keyword__module_keyword.snap
│ │ │ │ ├── features__completion__table__ref_in_table_type.snap
│ │ │ │ ├── features__completion__ty_decl__field_keyword.snap
│ │ │ │ ├── features__completion__memory__extern_idx_memory.snap
│ │ │ │ ├── features__completion__ty_decl__mut_keyword_then_paren.snap
│ │ │ │ ├── features__completion__import__memory_type_with_paren.snap
│ │ │ │ ├── features__completion__ty_decl__field_keyword_incomplete.snap
│ │ │ │ ├── features__completion__keyword__module_keyword_incomplete.snap
│ │ │ │ ├── features__completion__ty_decl__field_keyword_after_fields.snap
│ │ │ │ ├── features__completion__ty_decl__after_other_type_defs_in_rec_type.snap
│ │ │ │ ├── features__completion__table__export.snap
│ │ │ │ ├── features__completion__memory__pagesize.snap
│ │ │ │ ├── features__completion__table__table_size.snap
│ │ │ │ ├── features__completion__memory__memory_fill.snap
│ │ │ │ ├── features__completion__memory__memory_size.snap
│ │ │ │ ├── features__completion__mem_arg__incomplete.snap
│ │ │ │ ├── features__completion__memory__pagesize_incomplete.snap
│ │ │ │ ├── features__completion__import__global_type_after_paren.snap
│ │ │ │ ├── features__completion__mem_arg__after_instr_name.snap
│ │ │ │ ├── features__completion__mem_arg__after_mem_idx.snap
│ │ │ │ ├── features__completion__ty_decl__array_type_with_paren.snap
│ │ │ │ ├── features__completion__ty_decl__field_type_with_paren.snap
│ │ │ │ ├── features__completion__ty_decl__ref_type_in_field_type.snap
│ │ │ │ ├── features__completion__ty_decl__sub_type_without_paren.snap
│ │ │ │ ├── features__completion__ty_decl__field_type_mut_incomplete.snap
│ │ │ │ ├── features__completion__ty_decl__func_type_in_sub_type.snap
│ │ │ │ ├── features__completion__ty_decl__param_and_result_after_paren.snap
│ │ │ │ ├── features__completion__ty_decl__param_and_result_incomplete.snap
│ │ │ │ ├── features__completion__memory__load_and_store_instr_after_mem_arg.snap
│ │ │ │ ├── features__completion__memory__load_and_store_instr_following_mem_arg.snap
│ │ │ │ ├── features__completion__ty_decl__field_type_mut_in_array_type_incomplete.snap
│ │ │ │ ├── features__completion__func_type__func_types.snap
│ │ │ │ ├── features__completion__tag__extern_type.snap
│ │ │ │ ├── features__completion__import__type_use.snap
│ │ │ │ ├── features__completion__table__after_top_level_paren.snap
│ │ │ │ ├── features__completion__tag__extern_type_incomplete.snap
│ │ │ │ ├── features__completion__table__deprecated.snap
│ │ │ │ ├── features__completion__ty_decl__sub_type_with_paren.snap
│ │ │ │ ├── features__completion__memory__deprecated.snap
│ │ │ │ ├── features__completion__elem__func_idx.snap
│ │ │ │ ├── features__completion__elem__func_idxes.snap
│ │ │ │ ├── features__completion__ty_decl__keywords.snap
│ │ │ │ ├── features__completion__func__call_named.snap
│ │ │ │ ├── features__completion__func_type__sorting.snap
│ │ │ │ ├── features__completion__global__export.snap
│ │ │ │ ├── features__completion__global__globals.snap
│ │ │ │ ├── features__completion__ty_decl__deprecated.snap
│ │ │ │ ├── features__completion__func__extern_idx_func.snap
│ │ │ │ ├── features__completion__memory__load_and_store_instr.snap
│ │ │ │ ├── features__completion__table__elem_without_parens.snap
│ │ │ │ ├── features__completion__global__global_type_mut_keyword.snap
│ │ │ │ ├── features__completion__keyword__module_field_memory_keyword.snap
│ │ │ │ ├── features__completion__memory__pagesize_keyword_incomplete.snap
│ │ │ │ ├── features__completion__local__locals_and_params_in_different_funcs.snap
│ │ │ │ ├── features__completion__tag__catch.snap
│ │ │ │ ├── features__completion__tag__catch_ref.snap
│ │ │ │ ├── features__completion__tag__extern_idx.snap
│ │ │ │ ├── features__completion__tag__catch_before_label.snap
│ │ │ │ ├── features__completion__tag__module_field.snap
│ │ │ │ ├── features__completion__ty_decl__super_type_candidates.snap
│ │ │ │ ├── features__completion__import__desc_keyword.snap
│ │ │ │ ├── features__completion__keyword__extern_idx_keyword.snap
│ │ │ │ ├── features__completion__tag__module_field_incomplete.snap
│ │ │ │ ├── features__completion__keyword__extern_idx_keyword_incomplete.snap
│ │ │ │ ├── features__completion__annotation__after_at.snap
│ │ │ │ ├── features__completion__annotation__incomplete.snap
│ │ │ │ ├── features__completion__table__call_indirect_following_int_idx.snap
│ │ │ │ ├── features__completion__table__call_indirect_following_dollar.snap
│ │ │ │ ├── features__completion__table__call_indirect_incomplete_ident.snap
│ │ │ │ ├── features__completion__table__return_call_indirect_following_int_idx.snap
│ │ │ │ ├── features__completion__memory__extern_idx_memory_incomplete.snap
│ │ │ │ ├── features__completion__memory__extern_idx_memory_following_dollar.snap
│ │ │ │ ├── features__completion__table__return_call_indirect_following_dollar.snap
│ │ │ │ ├── features__completion__table__return_call_indirect_incomplete_ident.snap
│ │ │ │ ├── features__completion__tag__throw.snap
│ │ │ │ ├── features__completion__memory__addr_type_incomplete.snap
│ │ │ │ ├── features__completion__tag__deprecated.snap
│ │ │ │ ├── features__completion__ty_decl__final_keyword.snap
│ │ │ │ ├── features__completion__param__type_def_with_inlined.snap
│ │ │ │ ├── features__completion__instr__more_dots.snap
│ │ │ │ ├── features__completion__block__catch.snap
│ │ │ │ └── features__completion__block__catch_all.snap
│ │ │ └── ref_instr.rs
│ │ ├── inlay_hint
│ │ │ └── snapshots
│ │ │ │ ├── features__inlay_hint__func_end.snap
│ │ │ │ ├── features__inlay_hint__if_end.snap
│ │ │ │ ├── features__inlay_hint__loop_end.snap
│ │ │ │ ├── features__inlay_hint__block_end.snap
│ │ │ │ ├── features__inlay_hint__local.snap
│ │ │ │ ├── features__inlay_hint__param.snap
│ │ │ │ ├── features__inlay_hint__ref_type.snap
│ │ │ │ └── features__inlay_hint__global.snap
│ │ ├── features.rs
│ │ ├── references
│ │ │ └── snapshots
│ │ │ │ ├── features__references__ty__array_def_int_idx-2.snap
│ │ │ │ ├── features__references__local__local_int_idx-2.snap
│ │ │ │ ├── features__references__local__param_int_idx-2.snap
│ │ │ │ ├── features__references__ty__array_access_int_idx-2.snap
│ │ │ │ ├── features__references__ty__struct_access_int_idx-2.snap
│ │ │ │ ├── features__references__ty__struct_def_int_idx-2.snap
│ │ │ │ ├── features__references__func__func_in_implicit_module-2.snap
│ │ │ │ ├── features__references__local__local_access_int_idx-2.snap
│ │ │ │ ├── features__references__local__local_ref_ident_idx-2.snap
│ │ │ │ ├── features__references__local__local_ref_int_idx-2.snap
│ │ │ │ └── features__references__local__param_access_int_idx-2.snap
│ │ ├── signature_help
│ │ │ └── snapshots
│ │ │ │ ├── features__signature_help__no_params_no_results.snap
│ │ │ │ ├── features__signature_help__no_params.snap
│ │ │ │ ├── features__signature_help__return_call_indirect.snap
│ │ │ │ ├── features__signature_help__call_indirect_type_use.snap
│ │ │ │ └── features__signature_help__call_indirect_inline_func_type.snap
│ │ ├── hover
│ │ │ └── snapshots
│ │ │ │ ├── features__hover__field_decl.snap
│ │ │ │ ├── features__hover__global_int_idx.snap
│ │ │ │ ├── features__hover__local_decl.snap
│ │ │ │ ├── features__hover__local_int_idx.snap
│ │ │ │ ├── features__hover__memory_decl.snap
│ │ │ │ ├── features__hover__memory_int_idx.snap
│ │ │ │ ├── features__hover__memory_keyword.snap
│ │ │ │ ├── features__hover__param_decl.snap
│ │ │ │ ├── features__hover__param_int_idx.snap
│ │ │ │ ├── features__hover__ref_type.snap
│ │ │ │ ├── features__hover__field_int_idx.snap
│ │ │ │ ├── features__hover__field_with_mut.snap
│ │ │ │ ├── features__hover__func_as_block.snap
│ │ │ │ ├── features__hover__global_decl.snap
│ │ │ │ ├── features__hover__global_keyword.snap
│ │ │ │ ├── features__hover__local_ident_idx.snap
│ │ │ │ ├── features__hover__local_keyword.snap
│ │ │ │ ├── features__hover__memory_ident_idx.snap
│ │ │ │ ├── features__hover__param_ident_idx.snap
│ │ │ │ ├── features__hover__param_keyword.snap
│ │ │ │ ├── features__hover__param_via_type_def.snap
│ │ │ │ ├── features__hover__select.snap
│ │ │ │ ├── features__hover__type_use_only_func.snap
│ │ │ │ ├── features__hover__array_type_empty.snap
│ │ │ │ ├── features__hover__field_ident_idx.snap
│ │ │ │ ├── features__hover__field_with_ref_type.snap
│ │ │ │ ├── features__hover__if_keyword.snap
│ │ │ │ ├── features__hover__table_decl.snap
│ │ │ │ ├── features__hover__table_int_idx.snap
│ │ │ │ ├── features__hover__type_decl_empty.snap
│ │ │ │ ├── features__hover__global_decl_mut.snap
│ │ │ │ ├── features__hover__global_ident_idx.snap
│ │ │ │ ├── features__hover__instr_name.snap
│ │ │ │ ├── features__hover__loop_keyword.snap
│ │ │ │ ├── features__hover__struct_type_empty.snap
│ │ │ │ ├── features__hover__table_ident_idx.snap
│ │ │ │ ├── features__hover__table_keyword.snap
│ │ │ │ ├── features__hover__block_int_idx.snap
│ │ │ │ ├── features__hover__block_keyword.snap
│ │ │ │ ├── features__hover__select_with_result.snap
│ │ │ │ ├── features__hover__tag_decl.snap
│ │ │ │ ├── features__hover__tag_keyword.snap
│ │ │ │ ├── features__hover__array_type.snap
│ │ │ │ ├── features__hover__num_type.snap
│ │ │ │ ├── features__hover__ref_cast_with_abbr_ref.snap
│ │ │ │ ├── features__hover__ref_cast_with_null_ref.snap
│ │ │ │ ├── features__hover__ref_test_with_abbr_ref.snap
│ │ │ │ ├── features__hover__ref_test_with_null_ref.snap
│ │ │ │ ├── features__hover__tag_int_idx.snap
│ │ │ │ ├── features__hover__ref_cast_with_non_null_ref.snap
│ │ │ │ ├── features__hover__ref_test_with_non_null_ref.snap
│ │ │ │ ├── features__hover__tag_ident_idx.snap
│ │ │ │ ├── features__hover__two_slots_instr_op_code.snap
│ │ │ │ ├── features__hover__block_via_type_use.snap
│ │ │ │ ├── features__hover__func_type_use_with_inlined.snap
│ │ │ │ ├── features__hover__three_slots_instr_op_code.snap
│ │ │ │ ├── features__hover__block_decl.snap
│ │ │ │ ├── features__hover__block_ident_idx.snap
│ │ │ │ ├── features__hover__func_int_idx.snap
│ │ │ │ ├── features__hover__func_decl.snap
│ │ │ │ ├── features__hover__func_keyword.snap
│ │ │ │ ├── features__hover__func_import_int_idx.snap
│ │ │ │ ├── features__hover__struct_type.snap
│ │ │ │ ├── features__hover__type_decl.snap
│ │ │ │ ├── features__hover__type_keyword.snap
│ │ │ │ ├── features__hover__type_use_int_idx.snap
│ │ │ │ ├── features__hover__func_import_ident_idx.snap
│ │ │ │ ├── features__hover__func_type_use_only.snap
│ │ │ │ ├── features__hover__type_use_ident_idx.snap
│ │ │ │ ├── features__hover__vec_type.snap
│ │ │ │ ├── features__hover__doc_comment__after_annotations.snap
│ │ │ │ └── features__hover__doc_comment__before_annotations.snap
│ │ ├── diagnostics
│ │ │ ├── unknown_instr.rs
│ │ │ ├── snapshots
│ │ │ │ ├── features__diagnostics__immediates__ref_type.snap
│ │ │ │ ├── features__diagnostics__subtyping__explicit_final.snap
│ │ │ │ ├── features__diagnostics__subtyping__implicit_final.snap
│ │ │ │ ├── features__diagnostics__start__has_params.snap
│ │ │ │ ├── features__diagnostics__start__has_results.snap
│ │ │ │ ├── features__diagnostics__tag_type__non_func.snap
│ │ │ │ ├── features__diagnostics__block_type__array.snap
│ │ │ │ ├── features__diagnostics__block_type__structs.snap
│ │ │ │ ├── features__diagnostics__subtyping__explicit_final_with_super.snap
│ │ │ │ ├── features__diagnostics__syntax__top_level_error_token.snap
│ │ │ │ ├── features__diagnostics__undef__call_undefined.snap
│ │ │ │ ├── features__diagnostics__undef__field_undefined.snap
│ │ │ │ ├── features__diagnostics__undef__global_undefined.snap
│ │ │ │ ├── features__diagnostics__undef__type_use_undefined.snap
│ │ │ │ ├── features__diagnostics__uninit__block_loop.snap
│ │ │ │ ├── features__diagnostics__uninit__undef.snap
│ │ │ │ ├── features__diagnostics__unread__undef.snap
│ │ │ │ ├── features__diagnostics__start__has_params_and_results.snap
│ │ │ │ ├── features__diagnostics__undef__local_undefined.snap
│ │ │ │ ├── features__diagnostics__uninit__block_block.snap
│ │ │ │ ├── features__diagnostics__uninit__nested_if.snap
│ │ │ │ ├── features__diagnostics__implicit_module__incomplete_module.snap
│ │ │ │ ├── features__diagnostics__mem_type__invalid_page_size.snap
│ │ │ │ ├── features__diagnostics__mem_type__less_than.snap
│ │ │ │ ├── features__diagnostics__mem_type__shared_without_max.snap
│ │ │ │ ├── features__diagnostics__undef__param_via_type_def_by_name.snap
│ │ │ │ ├── features__diagnostics__undef__param_via_type_def_with_inlined.snap
│ │ │ │ └── features__diagnostics__unknown_instr__with_fuzzy.snap
│ │ │ └── typeck
│ │ │ │ └── snapshots
│ │ │ │ ├── features__diagnostics__typeck__drop__incorrect.snap
│ │ │ │ ├── features__diagnostics__typeck__less_operands.snap
│ │ │ │ ├── features__diagnostics__typeck__operand_count_pluralization.snap
│ │ │ │ ├── features__diagnostics__typeck__block__try_table.snap
│ │ │ │ ├── features__diagnostics__typeck__less_operands_on_stack.snap
│ │ │ │ ├── features__diagnostics__typeck__more_operands.snap
│ │ │ │ ├── features__diagnostics__typeck__table__non_null.snap
│ │ │ │ └── features__diagnostics__typeck__block__params_boundary_missing.snap
│ │ ├── semantic_tokens
│ │ │ └── snapshots
│ │ │ │ ├── features__semantic_tokens__range.snap
│ │ │ │ └── features__semantic_tokens__range_not_boundary.snap
│ │ └── code_lens
│ │ │ └── snapshots
│ │ │ └── features__code_lens__zero_references.snap
│ └── src
│ │ ├── uri.rs
│ │ └── refactorings
│ │ └── mod.rs
├── formatter
│ └── tests
│ │ ├── fmt
│ │ ├── mem-arg
│ │ │ ├── trivias.wat
│ │ │ └── trivias.snap
│ │ ├── comments
│ │ │ ├── before-right-paren.wat
│ │ │ ├── before-right-paren.snap
│ │ │ ├── after-left-paren.wat
│ │ │ ├── before-list.wat
│ │ │ ├── after-left-paren.snap
│ │ │ └── before-list.snap
│ │ ├── module
│ │ │ ├── implicit.wat
│ │ │ └── implicit.snap
│ │ ├── struct
│ │ │ ├── multi-line.wat
│ │ │ ├── too-long.wat
│ │ │ ├── multi-line.snap
│ │ │ └── too-long.snap
│ │ ├── rec-type
│ │ │ ├── multi-line.wat
│ │ │ └── multi-line.snap
│ │ ├── ignore
│ │ │ ├── fixture.wat
│ │ │ └── fixture.snap
│ │ ├── format-comments
│ │ │ ├── fixture.wat
│ │ │ ├── config.json
│ │ │ ├── fixture.disabled.snap
│ │ │ └── fixture.enabled.snap
│ │ ├── split-closing-parens
│ │ │ └── config.json
│ │ ├── wrap-before-locals
│ │ │ ├── locals.wat
│ │ │ ├── locals.never.snap
│ │ │ ├── locals.default.snap
│ │ │ ├── locals.overflow.snap
│ │ │ ├── locals.multi-only.snap
│ │ │ ├── locals.always.snap
│ │ │ └── config.json
│ │ └── wrap-before-global-expr
│ │ │ ├── global.wat
│ │ │ ├── global.never.snap
│ │ │ ├── global.overflow.snap
│ │ │ ├── global.multi-only.snap
│ │ │ ├── global.always.snap
│ │ │ ├── global.default.snap
│ │ │ └── config.json
│ │ ├── parser
│ │ ├── incomplete-module.snap
│ │ ├── implicit-module.snap
│ │ ├── data-malformed.snap
│ │ ├── ident.snap
│ │ ├── token.snap
│ │ ├── module-malformed.snap
│ │ ├── names-malformed.snap
│ │ ├── rec-type-malformed.snap
│ │ ├── start.snap
│ │ ├── start-malformed.snap
│ │ ├── array-malformed.snap
│ │ ├── subtyping-malformed.snap
│ │ ├── table-malformed.snap
│ │ ├── type-malformed.snap
│ │ ├── global-malformed.snap
│ │ ├── try-table-malformed.snap
│ │ ├── binary.snap
│ │ ├── tag.snap
│ │ ├── simd.snap
│ │ ├── struct-malformed.snap
│ │ ├── address-malformed.snap
│ │ ├── annotations-malformed.snap
│ │ ├── subtyping.snap
│ │ ├── memory-malformed.snap
│ │ ├── elem-malformed.snap
│ │ ├── exports-malformed.snap
│ │ ├── rec-type.snap
│ │ ├── table.snap
│ │ ├── imports-malformed.snap
│ │ ├── ref-type-as-immediate.snap
│ │ ├── memory.snap
│ │ ├── try-table.snap
│ │ ├── struct.snap
│ │ ├── int-literals-malformed.snap
│ │ └── bulk.snap
│ │ └── inline.rs
└── syntax
│ ├── README.md
│ └── Cargo.toml
├── .gitattributes
├── .gitignore
├── dprint.json
├── .editorconfig
└── Cargo.toml
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: g-plane
2 |
--------------------------------------------------------------------------------
/docs/public/logo.svg:
--------------------------------------------------------------------------------
1 | ../../media/logo.svg
--------------------------------------------------------------------------------
/crates/parser/tests/parse/incomplete-module.wat:
--------------------------------------------------------------------------------
1 | (module
2 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/token.wat:
--------------------------------------------------------------------------------
1 | (module (func br 0drop))
2 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/mod.rs:
--------------------------------------------------------------------------------
1 | mod full;
2 | mod range;
3 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/implicit-module.wat:
--------------------------------------------------------------------------------
1 | (func $f ( param i32 ) )
2 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/ident.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func $')
3 | (func $f'))
4 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | **/*.wat linguist-detectable=false
2 | docs/** linguist-documentation
3 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/data-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (data (memory) "")
3 | )
4 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/start.wat:
--------------------------------------------------------------------------------
1 | (module (start 1))
2 | (module (start $main))
3 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/module-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func)
3 | (f)
4 | (func)
5 | )
6 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/rec-type-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (rec type)
3 | (rec (func))
4 | )
5 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/start-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (start)
3 | (start )
4 | (start $)
5 | )
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/mem-arg/trivias.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func (i32.load align = 9(i32.const 2)))
3 | )
4 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/names-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func $f1
3 | (local.get $)
4 | )
5 | )
6 |
--------------------------------------------------------------------------------
/crates/syntax/README.md:
--------------------------------------------------------------------------------
1 | Syntax tree (CST and AST) related utilities for working with WebAssembly Text Format.
2 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/comments/before-right-paren.wat:
--------------------------------------------------------------------------------
1 | (global $g i32 (;;)
2 | (;;) ;; line comment
3 | )
4 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/module/implicit.wat:
--------------------------------------------------------------------------------
1 | (func)
2 | (global $g (mut i32) (i32.const 0))
3 | (type (func))
4 |
--------------------------------------------------------------------------------
/crates/service/tests/rename/mod.rs:
--------------------------------------------------------------------------------
1 | mod prepare_rename;
2 | #[expect(clippy::module_inception)]
3 | mod rename;
4 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/struct/multi-line.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (struct
3 | (field) (field)
4 | ))
5 | )
6 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/mod.rs:
--------------------------------------------------------------------------------
1 | mod goto_declaration;
2 | mod goto_definition;
3 | mod goto_type_definition;
4 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/rec-type/multi-line.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (rec
3 | (type (struct)) (type (struct))
4 | )
5 | )
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/incomplete-module.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module)
5 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/array-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (arr))
3 | (type (array))
4 | (type (array ()))
5 | )
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/ignore/fixture.wat:
--------------------------------------------------------------------------------
1 | ;; fmt-ignore
2 | ( module )
3 |
4 | (module
5 | ;; fmt-ignore
6 | ( func ))
7 |
--------------------------------------------------------------------------------
/crates/service/src/uri.rs:
--------------------------------------------------------------------------------
1 | #[salsa::interned(no_lifetime, debug)]
2 | pub(crate) struct InternUri {
3 | pub raw: String,
4 | }
5 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/implicit-module.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (func $f (param i32))
5 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/data-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (data (memory) ""))
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func $')
6 | (func $f'))
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/token.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func
6 | br 0drop))
7 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/table-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (table 0)
3 | (table ()
4 | (table funcref ())
5 | (table funcref (elem ())))
6 | )
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .vscode
3 |
4 | node_modules/
5 | docs/.vitepress/cache/
6 | docs/.vitepress/dist/
7 |
8 | # instant PoC
9 | /*.wat
10 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/format-comments/fixture.wat:
--------------------------------------------------------------------------------
1 | (;comment;)
2 | (; comment;)
3 | (;comment ;)
4 | ;;comment
5 |
6 | (; comment ;)
7 | ;; comment
8 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/struct/too-long.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (struct (field) (field) (field) (field) (field) (field) (field) (field) (field)))
3 | )
4 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/module-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func)
6 | (f)
7 | (func))
8 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/names-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func $f1
6 | (local.get $)))
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/rec-type-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (rec type)
6 | (rec (func)))
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/start.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (start 1))
6 | (module
7 | (start $main))
8 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/subtyping-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (su))
3 | (type (sub))
4 | (type (sub ()))
5 | (type (sub 0 final (struct)))
6 | )
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/start-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (start)
6 | (start)
7 | (start $))
8 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/global-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (global ())
3 | (global i32 ())
4 | (global (mut i32) ())
5 | (global)
6 | (global (mut))
7 | )
8 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/try-table-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func (try_table (catch_all)))
3 | (func (try_table (catch $e)))
4 | (func (try_table (catch)))
5 | )
6 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/type-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (func (result i32) (param i32)))
3 | (type (func (result $x i32)))
4 | (type)
5 | (type ())
6 | )
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/comments/before-right-paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (global $g i32 (;;)
5 | (;;) ;; line comment
6 | )
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/mem-arg/trivias.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (func
6 | (i32.load align=9
7 | (i32.const 2))))
8 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/module/implicit.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (func)
5 | (global $g (mut i32)
6 | (i32.const 0))
7 | (type (func))
8 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/rec-type/multi-line.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (rec
6 | (type (struct))
7 | (type (struct))))
8 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/format-comments/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "enabled": {
3 | "format_comments": true
4 | },
5 | "disabled": {
6 | "format_comments": false
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/struct/multi-line.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (type
6 | (struct
7 | (field)
8 | (field))))
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/array-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (type (arr))
6 | (type (array))
7 | (type (array ())))
8 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/components/CenteredArrowDown.vue:
--------------------------------------------------------------------------------
1 |
2 | ↓
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/dprint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "https://dprint.gplane.win/2025-07.json",
3 | "excludes": [
4 | "docs/.vitepress/cache",
5 | "docs/.vitepress/dist",
6 | "*.svg"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/ignore/fixture.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | ;; fmt-ignore
5 | ( module )
6 |
7 | (module
8 | ;; fmt-ignore
9 | ( func ))
10 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/split-closing-parens/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "enabled": {
3 | "split_closing_parens": true
4 | },
5 | "disabled": {
6 | "split_closing_parens": false
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/crates/service/tests/call_hierarchy/snapshots/features__call_hierarchy__f1_outgoing-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/call_hierarchy/mod.rs
3 | expression: outgoing_calls
4 | ---
5 | []
6 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__local__types_following_ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/local.rs
3 | expression: response
4 | ---
5 | null
6 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__param__types_following_ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/param.rs
3 | expression: response
4 | ---
5 | null
6 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__module_keyword_in_empty.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | null
6 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__local__types_following_incomplete_ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/local.rs
3 | expression: response
4 | ---
5 | null
6 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__param__types_following_incomplete_ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/param.rs
3 | expression: response
4 | ---
5 | null
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/comments/after-left-paren.wat:
--------------------------------------------------------------------------------
1 | ( (;;) global (;;) $g (;;)
2 | ((;;) export (;;) "g" (;;)) (;;)
3 | ((;;) import (;;) "spectest" (;;) "global_i32" (;;)) (;;)
4 | i32 (;;)
5 | (;;))
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/locals.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func (param) (local i32 (ref any)))
3 | (func (param) (local i32) (local f64))
4 | (func (param) (param i32) (result i32) (local i32)))
5 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/binary.wat:
--------------------------------------------------------------------------------
1 | (module binary "\00asm\01\00\00\00")
2 | (module binary "\00asm" "\01\00\00\00")
3 | (module $M1 binary "\00asm\01\00\00\00")
4 | (module $M2 binary "\00asm" "\01\00\00\00")
5 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__module_field_keyword_without_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | null
6 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/subtyping-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (type (su))
6 | (type (sub))
7 | (type (sub ()))
8 | (type (sub 0 final (struct))))
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/table-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (table 0)
6 | (table ()
7 | (table funcref ()))
8 | (table funcref (elem ())))
9 | )
10 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/type-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (type (func (result i32) (param i32)))
6 | (type (func (result $x i32)))
7 | (type)
8 | (type ()))
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/format-comments/fixture.disabled.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (;comment;)
5 | (; comment;)
6 | (;comment ;)
7 | ;;comment
8 |
9 | (; comment ;)
10 | ;; comment
11 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/tag.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (tag)
3 | (tag (param i32))
4 | (tag (export "t2") (param i32))
5 | (tag $t3 (param i32 f32))
6 | (export "t3" (tag 3))
7 | (import "test" "t3" (tag $t1 (param i32 f32)))
8 | )
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/format-comments/fixture.enabled.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (; comment ;)
5 | (; comment ;)
6 | (; comment ;)
7 | ;; comment
8 |
9 | (; comment ;)
10 | ;; comment
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/global-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (global ())
6 | (global i32 ())
7 | (global (mut i32) ())
8 | (global)
9 | (global (mut)))
10 |
--------------------------------------------------------------------------------
/crates/parser/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![doc = include_str!("../README.md")]
2 |
3 | mod error;
4 | mod parser2;
5 |
6 | pub use crate::{
7 | error::{Message, SyntaxError},
8 | parser2::{is_id_char, parse, parse_partial},
9 | };
10 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/struct-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (st))
3 | (type (struct ()))
4 | (type (struct field))
5 | (type (struct (field (field)))
6 | (type (struct (field (ref))))
7 | (type (struct (field (mut))))
8 | )
9 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__data__memory_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/data.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$m",
8 | "kind": 6
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/simd.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func
3 | v128.const i8x16 0 1
4 | v128.const i16x8 0 1
5 | v128.const i32x4 0 1
6 | v128.const i64x2 0 1
7 | v128.const f32x4 0.0 1.0
8 | v128.const f64x2 0 1
9 | )
10 | )
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__elem__table_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/elem.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__param__after_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/param.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "ref",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/comments/before-list.wat:
--------------------------------------------------------------------------------
1 | (module
2 | ;; doc comment
3 | (func
4 | ;; comment
5 | (i32.const 0))
6 | )
7 |
8 | (module ;; line trailing comment
9 | (func ;; line trailing comment
10 | (i32.const 0))
11 | )
12 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__result__after_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/result.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "ref",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__rec_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "type",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/try-table-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func
6 | (try_table (catch_all)))
7 | (func
8 | (try_table (catch $e)))
9 | (func
10 | (try_table (catch))))
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__module_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "module",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__ref_in_table_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "ref",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__field_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "field",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 4
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.{yml,md,snap,json,wat,ts,js,css}]
12 | indent_size = 2
13 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/comments/after-left-paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | ((;;) global (;;) $g (;;)
5 | ((;;) export (;;) "g" (;;)) (;;)
6 | ((;;) import (;;) "spectest" (;;) "global_i32" (;;)) (;;)
7 | i32 (;;)
8 | (;;))
9 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__extern_idx_memory.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$memory",
8 | "kind": 6
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__mut_keyword_then_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "ref",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/binary.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module binary "\00asm\01\00\00\00")
5 | (module binary "\00asm" "\01\00\00\00")
6 | (module $M1 binary "\00asm\01\00\00\00")
7 | (module $M2 binary "\00asm" "\01\00\00\00")
8 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/annotations-malformed.wat:
--------------------------------------------------------------------------------
1 | (@a Heiße Würstchen)
2 | (@a )
3 | ( @a)
4 | (@)
5 | (@ )
6 | (@ x)
7 | (@(@a)x)
8 | (@"")
9 | (@ "a")
10 | (@x))
11 | (@x ()))
12 | (@x (y (z))))
13 | (@x (@y )))
14 | ((@a)@b)
15 | (@x "
16 | )
17 | (@x ")
18 | )
19 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__import__memory_type_with_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/import.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "pagesize",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__field_keyword_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "field",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/locals.never.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (func (param) (local i32 (ref any)))
6 | (func (param) (local i32) (local f64))
7 | (func
8 | (param) (param i32) (result i32) (local i32)))
9 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__module_keyword_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "module",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__field_keyword_after_fields.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "field",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/global.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (global i32 i32.const 0)
3 | (global i32 (i32.add (i32.const 0) (i32.const 0)))
4 | (global i32 i32.const 0 i32.const 0 i32.add)
5 | (global (ref null func) ref.func $long-long-long-long-func-name)
6 | )
7 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/locals.default.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (func (param) (local i32 (ref any)))
6 | (func (param) (local i32) (local f64))
7 | (func (param) (param i32) (result i32)
8 | (local i32)))
9 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/locals.overflow.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (func (param) (local i32 (ref any)))
6 | (func (param) (local i32) (local f64))
7 | (func (param) (param i32) (result i32)
8 | (local i32)))
9 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__after_other_type_defs_in_rec_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "type",
8 | "kind": 14
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/address-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func
3 | (i32.load offset )
4 | (i32.load align= )
5 | (i32.load offset2 )
6 | (i32.load align= 2 )
7 | (i32.load align =2 )
8 | (i32.load align = 2 )
9 | (i32.load align(;;)=(;;)2 )
10 | )
11 | )
12 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: test
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | test:
7 | name: test
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v6
11 | - run: cargo clippy --color=always
12 | - run: cargo test --all-features
13 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/elem-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (elem ())
3 | (elem dec)
4 | (elem declare)
5 | (elem declare ())
6 | (elem funcref ())
7 | (elem funcref (item))
8 | (elem func ())
9 | (elem (table))
10 | (elem (table 0) (offset ()))
11 | (elem (offset) ())
12 | )
13 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/subtyping.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type $e0 (sub (array i32)))
3 | (type $e1 (sub $e0 (array i32)))
4 |
5 | (type $e0 (sub (struct)))
6 | (type $e1 (sub $e0 (struct)))
7 | (type $e2 (sub $e1 (struct (field i32))))
8 |
9 | (type $t2 (sub final (func)))
10 | )
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/locals.multi-only.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (func (param) (local i32 (ref any)))
6 | (func (param)
7 | (local i32) (local f64))
8 | (func
9 | (param) (param i32) (result i32) (local i32)))
10 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/tag.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (tag)
6 | (tag (param i32))
7 | (tag (export "t2") (param i32))
8 | (tag $t3 (param i32 f32))
9 | (export "t3" (tag 3))
10 | (import "test" "t3" (tag $t1 (param i32 f32))))
11 |
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "docs",
3 | "private": true,
4 | "type": "module",
5 | "scripts": {
6 | "dev": "vitepress dev",
7 | "build": "vitepress build",
8 | "preview": "vitepress preview"
9 | },
10 | "devDependencies": {
11 | "vitepress": "^1.6.4"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/comments/before-list.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | ;; doc comment
6 | (func
7 | ;; comment
8 | (i32.const 0)))
9 |
10 | (module ;; line trailing comment
11 | (func ;; line trailing comment
12 | (i32.const 0)))
13 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/locals.always.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (func (param)
6 | (local i32 (ref any)))
7 | (func (param)
8 | (local i32) (local f64))
9 | (func (param) (param i32) (result i32)
10 | (local i32)))
11 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/simd.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func
6 | v128.const i8x16 0 1
7 | v128.const i16x8 0 1
8 | v128.const i32x4 0 1
9 | v128.const i64x2 0 1
10 | v128.const f32x4 0.0 1.0
11 | v128.const f64x2 0 1))
12 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/struct-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (type (st))
6 | (type (struct ()))
7 | (type (struct field))
8 | (type (struct (field (field))))
9 | (type (struct (field (ref))))
10 | (type (struct (field (mut)))))
11 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/memory-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (memory)
3 | (memory "")
4 | (memory ())
5 | (memory f32 0)
6 | (memory i32)
7 | (memory 0 (pagesiz 1))
8 | (memory 0 (pagesize))
9 | (memory 0 (pagesize $1))
10 | (memory 0 1 share)
11 | (memory 0 1 share (pagesize 1))
12 | )
13 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/table.wat:
--------------------------------------------------------------------------------
1 | (module (table 0 funcref))
2 | (module (table 1 funcref))
3 | (module (table 0 0 funcref))
4 | (module (table 0 1 funcref))
5 | (module (table 1 256 funcref))
6 | (module (table 0 65536 funcref))
7 | (module (table 0 0xffff_ffff funcref))
8 | (module (table 0 funcref ref.null $a))
9 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__export.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6
9 | },
10 | {
11 | "label": "1",
12 | "kind": 6
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/struct/too-long.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (type
6 | (struct
7 | (field)
8 | (field)
9 | (field)
10 | (field)
11 | (field)
12 | (field)
13 | (field)
14 | (field)
15 | (field))))
16 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/incomplete-module.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/parser/tests/parse.rs
3 | ---
4 | ROOT@0..8
5 | MODULE@0..7
6 | L_PAREN@0..1 "("
7 | KEYWORD@1..7 "module"
8 | WHITESPACE@7..8 "\n"
9 |
10 | error: expected `)`
11 | ┌─ incomplete-module.wat:2:1
12 | │
13 | 2 │
14 | │ ^
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__pagesize.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "1",
8 | "kind": 21
9 | },
10 | {
11 | "label": "65536",
12 | "kind": 21
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__table_size.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6
9 | },
10 | {
11 | "label": "1",
12 | "kind": 6
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/exports-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (export "" (fu))
3 | (export "" (func $))
4 | (export "")
5 | (export "" (func))
6 | (export (func))
7 | (func (export))
8 | (func (export $xx))
9 | (func (export "func
10 | "
11 | ))
12 | (func (import "env" "f1") (export "f3"))
13 | )
14 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__memory_fill.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 6
9 | },
10 | {
11 | "label": "$memory",
12 | "kind": 6
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__memory_size.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 6
9 | },
10 | {
11 | "label": "$memory",
12 | "kind": 6
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__mem_arg__incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/mem_arg.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "offset=",
8 | "kind": 15
9 | },
10 | {
11 | "label": "align=",
12 | "kind": 15
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__pagesize_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "1",
8 | "kind": 21
9 | },
10 | {
11 | "label": "65536",
12 | "kind": 21
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/address-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func
6 | (i32.load offset=)
7 | (i32.load align=)
8 | (i32.load offset=2)
9 | (i32.load align=2)
10 | (i32.load align=2)
11 | (i32.load align=2)
12 | (i32.load align=2)))
13 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__import__global_type_after_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/import.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "ref",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__mem_arg__after_instr_name.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/mem_arg.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "offset=",
8 | "kind": 15
9 | },
10 | {
11 | "label": "align=",
12 | "kind": 15
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__mem_arg__after_mem_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/mem_arg.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "offset=",
8 | "kind": 15
9 | },
10 | {
11 | "label": "align=",
12 | "kind": 15
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__array_type_with_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "ref",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__field_type_with_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "ref",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__ref_type_in_field_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "ref",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__sub_type_without_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 8
9 | },
10 | {
11 | "label": "final",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/rename/snapshots/features__rename__prepare_rename__ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/rename/prepare_rename.rs
3 | expression: response
4 | ---
5 | {
6 | "start": {
7 | "line": 2,
8 | "character": 10
9 | },
10 | "end": {
11 | "line": 2,
12 | "character": 15
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__field_type_mut_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "ref",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__func_type_in_sub_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "param",
8 | "kind": 14
9 | },
10 | {
11 | "label": "result",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/annotations-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (@a Heiße Würstchen)
5 | (@a )
6 | ( @a)
7 | (@)
8 | (@ )
9 | (@ x)
10 | (@(@a)x)
11 | (@"")
12 | (@ "a")
13 | (@x))
14 | (@x ()))
15 | (@x (y (z))))
16 | (@x (@y )))
17 | ((@a)@b)
18 | (@x "
19 | )
20 | (@x ")
21 | )
22 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__param_and_result_after_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "param",
8 | "kind": 14
9 | },
10 | {
11 | "label": "result",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__param_and_result_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "param",
8 | "kind": 14
9 | },
10 | {
11 | "label": "result",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__func_end.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 4,
9 | "character": 5
10 | },
11 | "label": "(func $name)",
12 | "paddingLeft": true
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/docs/diagnostics/overview.md:
--------------------------------------------------------------------------------
1 | # Diagnostics
2 |
3 | WebAssembly Language Tools provides not only some basic validations that [WABT](https://github.com/WebAssembly/wabt) does,
4 | but also some additional lints such as detecting unused items, unreachable code and needless mutable items.
5 |
6 | This documentation introduces most kinds of diagnostics.
7 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__load_and_store_instr_after_mem_arg.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "offset=",
8 | "kind": 15
9 | },
10 | {
11 | "label": "align=",
12 | "kind": 15
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__load_and_store_instr_following_mem_arg.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "offset=",
8 | "kind": 15
9 | },
10 | {
11 | "label": "align=",
12 | "kind": 15
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__field_type_mut_in_array_type_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "ref",
12 | "kind": 14
13 | }
14 | ]
15 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/subtyping.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (type $e0 (sub (array i32)))
6 | (type $e1 (sub $e0 (array i32)))
7 |
8 | (type $e0 (sub (struct)))
9 | (type $e1 (sub $e0 (struct)))
10 | (type $e2 (sub $e1 (struct (field i32))))
11 |
12 | (type $t2 (sub final (func))))
13 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/memory.wat:
--------------------------------------------------------------------------------
1 | (module (memory 0))
2 | (module (memory 0 0))
3 | (module (memory (data)))
4 | (module (memory (data "x")))
5 | (module (memory i32 0))
6 | (module (memory i64 0 1))
7 | (module (memory 0 (pagesize 1)))
8 | (module (memory 0 1 (pagesize 65536)))
9 | (module (memory 0 1 shared) (memory 0 1 unshared (pagesize 1)))
10 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/rec-type.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (rec)
3 | (rec
4 | (type $s0 (struct (field (ref 0))))
5 | (type $s1 (struct (field (ref 0))))
6 | )
7 | (rec (type $r (sub $t (struct (field (ref $r))))))
8 | (rec
9 | (type $t1 (sub (func (param i32 (ref $t3)))))
10 | (type $t2 (sub $t1 (func (param i32 (ref $t2)))))
11 | )
12 | )
13 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/memory-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (memory)
6 | (memory "")
7 | (memory ())
8 | (memory f32 0)
9 | (memory i32)
10 | (memory 0 (pagesiz 1))
11 | (memory 0 (pagesize))
12 | (memory 0 (pagesize $1))
13 | (memory 0 1 share)
14 | (memory 0 1 share (pagesize 1)))
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__func_type__func_types.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/func_type.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 8,
9 | "sortText": "0"
10 | },
11 | {
12 | "label": "$type",
13 | "kind": 8,
14 | "sortText": "0"
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__extern_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "type",
8 | "kind": 14
9 | },
10 | {
11 | "label": "param",
12 | "kind": 14
13 | },
14 | {
15 | "label": "result",
16 | "kind": 14
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/index.js:
--------------------------------------------------------------------------------
1 | import DefaultTheme from 'vitepress/theme'
2 | import CenteredArrowDown from './components/CenteredArrowDown.vue'
3 | import './custom.css'
4 |
5 | /** @type {import('vitepress').Theme} */
6 | export default {
7 | extends: DefaultTheme,
8 | enhanceApp({ app }) {
9 | app.component('CenteredArrowDown', CenteredArrowDown)
10 | },
11 | }
12 |
--------------------------------------------------------------------------------
/docs/config/format/split-closing-parens.md:
--------------------------------------------------------------------------------
1 | # `splitClosingParens`
2 |
3 | > default: `false`
4 |
5 | Control whether closing parentheses should be splitted into different lines.
6 |
7 | ## `false`
8 |
9 | ```wasm
10 | (module
11 | (func
12 | (block)))
13 | ```
14 |
15 | ## `true`
16 |
17 | ```wasm
18 | (module
19 | (func
20 | (block)
21 | )
22 | )
23 | ```
24 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/global.never.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (global i32 i32.const 0)
6 | (global i32 (i32.add
7 | (i32.const 0)
8 | (i32.const 0)))
9 | (global i32 i32.const 0
10 | i32.const 0
11 | i32.add)
12 | (global (ref null func) ref.func $long-long-long-long-func-name))
13 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/elem-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (elem ())
6 | (elem dec)
7 | (elem declare)
8 | (elem declare ())
9 | (elem funcref ())
10 | (elem funcref
11 | (item))
12 | (elem func ())
13 | (elem (table))
14 | (elem (table 0)
15 | (offset ()))
16 | (elem
17 | (offset) ()))
18 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__import__type_use.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/import.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "param",
8 | "kind": 14
9 | },
10 | {
11 | "label": "result",
12 | "kind": 14
13 | },
14 | {
15 | "label": "type",
16 | "kind": 14
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/exports-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (export "" (fu))
6 | (export "" (func $))
7 | (export "")
8 | (export "" (func))
9 | (export (func))
10 | (func (export))
11 | (func (export $xx))
12 | (func (export "func
13 | "))
14 | (func (import "env" "f1")
15 | (export "f3")))
16 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/imports-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (import ())
3 | (import "")
4 | (import "" "")
5 | (import "" ())
6 | (import "" "" ())
7 | (import "" "" (func ))
8 | (import "" "" (table ))
9 | (import "" "" (memory ))
10 | (import "" "" (global ))
11 | (func (import))
12 | (func (import ""))
13 | (func (import "env" "f1") (import "env" "f2"))
14 | )
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__after_top_level_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "import",
8 | "kind": 14
9 | },
10 | {
11 | "label": "export",
12 | "kind": 14
13 | },
14 | {
15 | "label": "elem",
16 | "kind": 14
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__extern_type_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "type",
8 | "kind": 14
9 | },
10 | {
11 | "label": "param",
12 | "kind": 14
13 | },
14 | {
15 | "label": "result",
16 | "kind": 14
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/global.overflow.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (global i32 i32.const 0)
6 | (global i32 (i32.add
7 | (i32.const 0)
8 | (i32.const 0)))
9 | (global i32 i32.const 0
10 | i32.const 0
11 | i32.add)
12 | (global (ref null func)
13 | ref.func $long-long-long-long-func-name))
14 |
--------------------------------------------------------------------------------
/crates/formatter/tests/inline.rs:
--------------------------------------------------------------------------------
1 | use rowan::ast::AstNode;
2 | use wat_formatter::format;
3 | use wat_syntax::{SyntaxNode, ast::Root};
4 |
5 | #[test]
6 | fn new_line() {
7 | let (tree, _) = wat_parser::parse("\n");
8 | let output = format(
9 | &Root::cast(SyntaxNode::new_root(tree)).unwrap(),
10 | &Default::default(),
11 | );
12 | assert_eq!(output, "\n");
13 | }
14 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__deprecated.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6,
9 | "tags": [
10 | 1
11 | ]
12 | },
13 | {
14 | "label": "1",
15 | "kind": 6,
16 | "tags": [
17 | 1
18 | ]
19 | }
20 | ]
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__sub_type_with_paren.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "func",
8 | "kind": 14
9 | },
10 | {
11 | "label": "struct",
12 | "kind": 14
13 | },
14 | {
15 | "label": "array",
16 | "kind": 14
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__deprecated.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 6,
9 | "tags": [
10 | 1
11 | ]
12 | },
13 | {
14 | "label": "$memory",
15 | "kind": 6,
16 | "tags": [
17 | 1
18 | ]
19 | }
20 | ]
21 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/global.multi-only.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (global i32 i32.const 0)
6 | (global i32
7 | (i32.add
8 | (i32.const 0)
9 | (i32.const 0)))
10 | (global i32
11 | i32.const 0
12 | i32.const 0
13 | i32.add)
14 | (global (ref null func) ref.func $long-long-long-long-func-name))
15 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/rec-type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (rec)
6 | (rec
7 | (type $s0 (struct (field (ref 0))))
8 | (type $s1 (struct (field (ref 0)))))
9 | (rec (type $r (sub $t (struct (field (ref $r))))))
10 | (rec
11 | (type $t1 (sub (func (param i32 (ref $t3)))))
12 | (type $t2 (sub $t1 (func (param i32 (ref $t2)))))))
13 |
--------------------------------------------------------------------------------
/crates/syntax/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "wat_syntax"
3 | version = "0.7.0"
4 | description = "WebAssembly Text Format syntaxes."
5 | authors = ["Pig Fang "]
6 | repository = "https://github.com/g-plane/wasm-language-tools"
7 | license = "MIT"
8 | edition = "2024"
9 | keywords = ["wasm"]
10 |
11 | [dependencies]
12 | rowan.workspace = true
13 |
14 | [lints.clippy]
15 | dbg_macro = "warn"
16 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = ["crates/*"]
3 | resolver = "3"
4 |
5 | [workspace.dependencies]
6 | criterion = "0.7"
7 | insta = { version = "1.43", features = ["glob", "json"] }
8 | line-index = "0.1"
9 | lspt = { version = "0.2", features = ["rustc-hash"] }
10 | rowan = "0.16"
11 | rustc-hash = "2.1"
12 | serde = { version = "1.0", features = ["derive"] }
13 | serde_json = "1.0"
14 | similar-asserts = "1.7"
15 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/global.always.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (global i32
6 | i32.const 0)
7 | (global i32
8 | (i32.add
9 | (i32.const 0)
10 | (i32.const 0)))
11 | (global i32
12 | i32.const 0
13 | i32.const 0
14 | i32.add)
15 | (global (ref null func)
16 | ref.func $long-long-long-long-func-name))
17 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/global.default.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/fmt.rs
3 | ---
4 | (module
5 | (global i32
6 | i32.const 0)
7 | (global i32
8 | (i32.add
9 | (i32.const 0)
10 | (i32.const 0)))
11 | (global i32
12 | i32.const 0
13 | i32.const 0
14 | i32.add)
15 | (global (ref null func)
16 | ref.func $long-long-long-long-func-name))
17 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_declaration__func_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_declaration.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 9
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__block_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 3,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 3,
14 | "character": 10
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__func_as_block.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 3
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 7
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__func_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 9
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__table_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 3
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 8
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/ref-type-as-immediate.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func
3 | (br_on_cast 0 ( ref 0 ) (ref null eq))
4 | (br_on_cast 0 anyref eqref)
5 | (br_on_cast 0 i31ref structref)
6 | (br_on_cast 0 arrayref nullref)
7 | (br_on_cast 0 funcref nullfuncref)
8 | (br_on_cast 0 exnref nullexnref)
9 | (br_on_cast 0 externref nullexternref)
10 | (br_on_cast 0 (ref exn) (ref noexn))
11 | )
12 | )
13 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_declaration__func_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_declaration.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 10
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 15
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__after_func_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 19
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 22
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__block_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 3,
10 | "character": 11
11 | },
12 | "end": {
13 | "line": 3,
14 | "character": 17
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__func_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 10
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 15
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__global_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 12
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 19
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__global_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 11
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__local_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 17
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 23
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__local_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 17
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 21
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__memory_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 12
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 19
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__memory_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 11
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__param_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 17
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 23
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__param_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 17
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 21
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__table_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 9
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 15
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__type_use_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 9
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__global.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 8
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 10
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/features.rs:
--------------------------------------------------------------------------------
1 | mod call_hierarchy;
2 | mod code_action;
3 | mod code_lens;
4 | mod completion;
5 | mod definition;
6 | mod diagnostics;
7 | mod document_highlight;
8 | mod document_symbol;
9 | mod folding_range;
10 | mod formatting;
11 | mod hover;
12 | mod inlay_hint;
13 | mod references;
14 | mod rename;
15 | mod selection_range;
16 | mod semantic_tokens;
17 | mod signature_help;
18 | mod type_hierarchy;
19 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__exported_global_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 11
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__func_in_implicit_module.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 1,
10 | "character": 6
11 | },
12 | "end": {
13 | "line": 1,
14 | "character": 11
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_func_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 19
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 23
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_table_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 17
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 22
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__param_via_type_def.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 21
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 23
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__type_use_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 10
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 15
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__global_mut.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 3
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 7
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__param_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 8
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 10
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__exported_global_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 12
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 19
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_func_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 24
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 29
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_global_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 26
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 33
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_global_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 19
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 25
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_memory_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 26
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 33
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_memory_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 19
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 25
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__imported_table_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 23
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 29
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_definition__param_in_implicit_module.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 1,
10 | "character": 19
11 | },
12 | "end": {
13 | "line": 1,
14 | "character": 22
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__local_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 3
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 7
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__elem__func_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/elem.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$f",
8 | "labelDetails": {
9 | "description": "[] -> []"
10 | },
11 | "kind": 3,
12 | "detail": "(func $f)",
13 | "documentation": {
14 | "kind": "markdown",
15 | "value": ""
16 | }
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/int-literals-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (global i32 (i32.const _100))
3 | (global i32 (i32.const +_100))
4 | (global i32 (i32.const -_100))
5 | (global i32 (i32.const 99_))
6 | (global i32 (i32.const 1__000))
7 | (global i32 (i32.const _0x100))
8 | (global i32 (i32.const 0_x100))
9 | (global i32 (i32.const 0x_100))
10 | (global i32 (i32.const 0x00_))
11 | (global i32 (i32.const 0xff__ffff))
12 | )
13 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__elem__func_idxes.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/elem.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$f",
8 | "labelDetails": {
9 | "description": "[] -> []"
10 | },
11 | "kind": 3,
12 | "detail": "(func $f)",
13 | "documentation": {
14 | "kind": "markdown",
15 | "value": ""
16 | }
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__keywords.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "func",
8 | "kind": 14
9 | },
10 | {
11 | "label": "struct",
12 | "kind": 14
13 | },
14 | {
15 | "label": "array",
16 | "kind": 14
17 | },
18 | {
19 | "label": "sub",
20 | "kind": 14
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__func_int_idx_type_use_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 9
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__full__format_comments.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/full.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 0,
10 | "character": 0
11 | },
12 | "end": {
13 | "line": 0,
14 | "character": 9
15 | }
16 | },
17 | "newText": ";; comment\n"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__ty__array_def_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/ty.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 4,
11 | "character": 14
12 | },
13 | "end": {
14 | "line": 4,
15 | "character": 15
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/signature_help/snapshots/features__signature_help__no_params_no_results.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/signature_help/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "signatures": [
7 | {
8 | "label": "(func $func)",
9 | "documentation": {
10 | "kind": "markdown",
11 | "value": ""
12 | },
13 | "parameters": []
14 | }
15 | ],
16 | "activeSignature": 0
17 | }
18 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/table.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (table 0 funcref))
6 | (module
7 | (table 1 funcref))
8 | (module
9 | (table 0 0 funcref))
10 | (module
11 | (table 0 1 funcref))
12 | (module
13 | (table 1 256 funcref))
14 | (module
15 | (table 0 65536 funcref))
16 | (module
17 | (table 0 0xffff_ffff funcref))
18 | (module
19 | (table 0 funcref
20 | ref.null $a))
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__func__call_named.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/func.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$func",
8 | "labelDetails": {
9 | "description": "[] -> []"
10 | },
11 | "kind": 3,
12 | "detail": "(func $func)",
13 | "documentation": {
14 | "kind": "markdown",
15 | "value": ""
16 | }
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__func_type__sorting.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/func_type.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$a",
8 | "kind": 8,
9 | "sortText": "1"
10 | },
11 | {
12 | "label": "$b",
13 | "kind": 8,
14 | "sortText": "1"
15 | },
16 | {
17 | "label": "$c",
18 | "kind": 8,
19 | "sortText": "0"
20 | }
21 | ]
22 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__global__export.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/global.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "i32"
10 | },
11 | "kind": 6
12 | },
13 | {
14 | "label": "$global",
15 | "labelDetails": {
16 | "description": "i32"
17 | },
18 | "kind": 6
19 | }
20 | ]
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__global__globals.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/global.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "i32"
10 | },
11 | "kind": 6
12 | },
13 | {
14 | "label": "$global",
15 | "labelDetails": {
16 | "description": "i32"
17 | },
18 | "kind": 6
19 | }
20 | ]
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__deprecated.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 8,
9 | "tags": [
10 | 1
11 | ],
12 | "sortText": "0"
13 | },
14 | {
15 | "label": "$t",
16 | "kind": 8,
17 | "tags": [
18 | 1
19 | ],
20 | "sortText": "0"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__func_ident_idx_type_use_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 5
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 9
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__func_int_idx_type_use_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 10
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 15
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__range__fully_covered_node.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/range.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 3,
10 | "character": 4
11 | },
12 | "end": {
13 | "line": 3,
14 | "character": 22
15 | }
16 | },
17 | "newText": "(local.get 0)"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__local__local_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/local.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 3,
11 | "character": 19
12 | },
13 | "end": {
14 | "line": 3,
15 | "character": 20
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__local__param_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/local.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 3,
11 | "character": 19
12 | },
13 | "end": {
14 | "line": 3,
15 | "character": 20
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__ty__array_access_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/ty.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 4,
11 | "character": 14
12 | },
13 | "end": {
14 | "line": 4,
15 | "character": 15
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__ty__struct_access_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/ty.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 4,
11 | "character": 15
12 | },
13 | "end": {
14 | "line": 4,
15 | "character": 16
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__ty__struct_def_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/ty.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 4,
11 | "character": 15
12 | },
13 | "end": {
14 | "line": 4,
15 | "character": 16
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/imports-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (import ())
6 | (import "")
7 | (import "" "")
8 | (import "" ())
9 | (import "" "" ())
10 | (import "" "" (func))
11 | (import "" "" (table))
12 | (import "" "" (memory))
13 | (import "" "" (global))
14 | (func (import))
15 | (func (import ""))
16 | (func (import "env" "f1")
17 | (import "env" "f2")))
18 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__func__extern_idx_func.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/func.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$func",
8 | "labelDetails": {
9 | "description": "[] -> []"
10 | },
11 | "kind": 3,
12 | "detail": "(func $func)",
13 | "documentation": {
14 | "kind": "markdown",
15 | "value": ""
16 | }
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__load_and_store_instr.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 6
9 | },
10 | {
11 | "label": "$memory",
12 | "kind": 6
13 | },
14 | {
15 | "label": "offset=",
16 | "kind": 15
17 | },
18 | {
19 | "label": "align=",
20 | "kind": 15
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__elem_without_parens.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$f",
8 | "labelDetails": {
9 | "description": "[] -> []"
10 | },
11 | "kind": 3,
12 | "detail": "(func $f)",
13 | "documentation": {
14 | "kind": "markdown",
15 | "value": ""
16 | }
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/crates/service/tests/definition/snapshots/features__definition__goto_type_definition__func_ident_idx_type_use_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/definition/goto_type_definition.rs
3 | expression: response
4 | ---
5 | {
6 | "uri": "untitled:test",
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 10
11 | },
12 | "end": {
13 | "line": 2,
14 | "character": 15
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__field_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(field $x i32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 23
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 25
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__global_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(global i32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 22
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 23
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__local_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(local $local i64)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 17
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 23
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__local_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(local i32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 19
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 20
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__memory_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(memory $x 0 1)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__memory_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(memory 0 1)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 16
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 17
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__memory_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(memory $x 0 1)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 3
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 9
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__param_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(param $param i64)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 17
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 23
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__param_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(param i32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 19
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 20
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(param (ref any))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 19
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 20
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__func__func_in_implicit_module-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/func.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 2,
11 | "character": 12
12 | },
13 | "end": {
14 | "line": 2,
15 | "character": 17
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__local__local_access_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/local.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 3,
11 | "character": 19
12 | },
13 | "end": {
14 | "line": 3,
15 | "character": 20
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__local__local_ref_ident_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/local.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 3,
11 | "character": 19
12 | },
13 | "end": {
14 | "line": 3,
15 | "character": 24
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__local__local_ref_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/local.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 3,
11 | "character": 19
12 | },
13 | "end": {
14 | "line": 3,
15 | "character": 20
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/references/snapshots/features__references__local__param_access_int_idx-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/references/local.rs
3 | expression: exclude_decl
4 | ---
5 | [
6 | {
7 | "uri": "untitled:test",
8 | "range": {
9 | "start": {
10 | "line": 3,
11 | "character": 19
12 | },
13 | "end": {
14 | "line": 3,
15 | "character": 20
16 | }
17 | }
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/try-table.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func
3 | (try_table)
4 | (try_table (result i32) (catch $e0 $h))
5 | (try_table (catch_all $h) (unreachable))
6 | (try_table (result i32) (catch $e0 $h0) (catch $e1 $h1))
7 | (try_table (result f32) (catch_ref $e-f32 $h))
8 | (try_table (catch_all 0) (catch_all_ref 0))
9 | try_table $t (result) (catch $e0 $h0) (catch_ref $e1 $h1)
10 | unreachable
11 | end
12 | )
13 | )
14 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__global__global_type_mut_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/global.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "mut",
8 | "kind": 14
9 | },
10 | {
11 | "label": "import",
12 | "kind": 14
13 | },
14 | {
15 | "label": "export",
16 | "kind": 14
17 | },
18 | {
19 | "label": "ref",
20 | "kind": 14
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__range__format_comments.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/range.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 2,
10 | "character": 2
11 | },
12 | "end": {
13 | "line": 4,
14 | "character": 3
15 | }
16 | },
17 | "newText": "(func\n ;; comment\n )"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__field_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(field (mut i32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 17
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 18
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__field_with_mut.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(field (mut i32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 23
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 32
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_as_block.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 7
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 8
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__global_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(global $global i64)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 12
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 19
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__global_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(global $global i64)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 5
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 11
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__local_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(local $local i32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 19
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 25
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__local_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(local $local i64)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 11
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 16
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__memory_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(memory $x 0 1)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 16
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 18
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__param_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(param $param i32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 19
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 25
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__param_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(param $param i64)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 11
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 16
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__param_via_type_def.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(param f32)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 15
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 16
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__select.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nselect\n```\nBinary Opcode: 0x1B"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 9
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__type_use_only_func.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func)\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__array_type_empty.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $array (array))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 20
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 26
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__field_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(field $x (mut i32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 17
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 19
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__field_with_ref_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(field (ref 0))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 23
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 30
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__if_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(if (result i32) (result f32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 5
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 7
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__table_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(table $x 1 (ref null func))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 9
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 11
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__table_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(table 1 (ref null func))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 15
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 16
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__type_decl_empty.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $type (func))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__module_field_memory_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "import",
8 | "kind": 14
9 | },
10 | {
11 | "label": "export",
12 | "kind": 14
13 | },
14 | {
15 | "label": "data",
16 | "kind": 14
17 | },
18 | {
19 | "label": "pagesize",
20 | "kind": 14
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__pagesize_keyword_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "import",
8 | "kind": 14
9 | },
10 | {
11 | "label": "export",
12 | "kind": 14
13 | },
14 | {
15 | "label": "data",
16 | "kind": 14
17 | },
18 | {
19 | "label": "pagesize",
20 | "kind": 14
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__full__tab.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 0,
10 | "character": 0
11 | },
12 | "end": {
13 | "line": 6,
14 | "character": 0
15 | }
16 | },
17 | "newText": "(module\n\t(func (param i32)\n\t\t(local.get 0)))\n"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__global_decl_mut.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(global $global (mut i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 12
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 19
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__global_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(global $global (mut i32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 22
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 29
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__instr_name.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\ni32.const\n```\nBinary Opcode: 0x41"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 11
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 20
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__loop_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(loop (result i32) (result f32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 5
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 9
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__struct_type_empty.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $struct (struct))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 20
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 27
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__table_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(table $x 1 (ref null func))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 15
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 17
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__table_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(table $x 1 (ref null func))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 3
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 8
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/struct.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (struct))
3 | (type (struct (field)))
4 | (type (struct (field i8)))
5 | (type (struct (field i8 i8 i8 i8)))
6 | (type (struct (field $x1 i32) (field $y1 i32)))
7 | (type (struct (field i8 i16 i32 i64 f32 f64 anyref funcref (ref 0) (ref null 1))))
8 | (type (struct (field i32 i64 i8) (field) (field) (field (ref null i31) anyref)))
9 | (type (struct (field $x2 i32) (field f32 f64) (field $y2 i32)))
10 | )
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__local__locals_and_params_in_different_funcs.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/local.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$p",
8 | "labelDetails": {
9 | "description": "i32"
10 | },
11 | "kind": 6
12 | },
13 | {
14 | "label": "$l",
15 | "labelDetails": {
16 | "description": "i32"
17 | },
18 | "kind": 6
19 | }
20 | ]
21 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__full__space2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 0,
10 | "character": 0
11 | },
12 | "end": {
13 | "line": 6,
14 | "character": 0
15 | }
16 | },
17 | "newText": "(module\n (func (param i32)\n (local.get 0)))\n"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__block_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(block (result i32) (result f32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 9
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 10
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__block_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(block (result i32) (result f32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 5
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 10
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__select_with_result.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nselect\n```\nBinary Opcode: 0x1C"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 9
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/signature_help/snapshots/features__signature_help__no_params.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/signature_help/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "signatures": [
7 | {
8 | "label": "(func $func (result i32) (result f32) (result f64))",
9 | "documentation": {
10 | "kind": "markdown",
11 | "value": ""
12 | },
13 | "parameters": []
14 | }
15 | ],
16 | "activeSignature": 0
17 | }
18 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/ref-type-as-immediate.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func
6 | (br_on_cast 0 (ref 0) (ref null eq))
7 | (br_on_cast 0 anyref eqref)
8 | (br_on_cast 0 i31ref structref)
9 | (br_on_cast 0 arrayref nullref)
10 | (br_on_cast 0 funcref nullfuncref)
11 | (br_on_cast 0 exnref nullexnref)
12 | (br_on_cast 0 externref nullexternref)
13 | (br_on_cast 0 (ref exn) (ref noexn))))
14 |
--------------------------------------------------------------------------------
/crates/service/src/refactorings/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod br_if_to_if_br;
2 | pub mod clean_no_types;
3 | pub mod convert_idx;
4 | pub mod expand_ref_type;
5 | pub mod export_as;
6 | pub mod extract_export;
7 | pub mod fix_invalid_mem_arg;
8 | pub mod fix_packing;
9 | pub mod if_br_to_br_if;
10 | pub mod inline_export;
11 | pub mod inline_func_type;
12 | pub mod join_types;
13 | pub mod merge_to_return_call;
14 | pub mod remove_mut;
15 | pub mod simplify_ref_type;
16 | pub mod split_types;
17 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__full__space4.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 0,
10 | "character": 0
11 | },
12 | "end": {
13 | "line": 6,
14 | "character": 0
15 | }
16 | },
17 | "newText": "(module\n (func (param i32)\n (local.get 0)))\n"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__tag_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(tag $e (param i32) (result f32) (result f64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 7
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 9
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__tag_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(tag (param i32) (result f32) (result f64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 3
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 6
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/memory.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (memory 0))
6 | (module
7 | (memory 0 0))
8 | (module
9 | (memory (data)))
10 | (module
11 | (memory (data "x")))
12 | (module
13 | (memory i32 0))
14 | (module
15 | (memory i64 0 1))
16 | (module
17 | (memory 0 (pagesize 1)))
18 | (module
19 | (memory 0 1 (pagesize 65536)))
20 | (module
21 | (memory 0 1 shared)
22 | (memory 0 1 unshared (pagesize 1)))
23 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__array_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $array (array (mut (ref null nofunc))))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 20
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 26
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__num_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\ni32\n```\n\nThe type `i32` classifies 32 bit integers."
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 17
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 20
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_cast_with_abbr_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nref.cast\n```\nBinary Opcode: 0xFB 0x17"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 4
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_cast_with_null_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nref.cast\n```\nBinary Opcode: 0xFB 0x17"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 4
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_test_with_abbr_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nref.test\n```\nBinary Opcode: 0xFB 0x15"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 4
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_test_with_null_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nref.test\n```\nBinary Opcode: 0xFB 0x15"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 4
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__tag_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(tag $e (param i32) (result f32) (result f64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 5,
13 | "character": 12
14 | },
15 | "end": {
16 | "line": 5,
17 | "character": 13
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_cast_with_non_null_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nref.cast\n```\nBinary Opcode: 0xFB 0x16"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 4
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__ref_test_with_non_null_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nref.test\n```\nBinary Opcode: 0xFB 0x14"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 4
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 12
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__tag_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(tag $e (param i32) (result f32) (result f64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 21
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 23
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__two_slots_instr_op_code.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nv128.store\n```\nBinary Opcode: 0xFD 0x0B"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 11
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 21
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__if_end.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 2,
9 | "character": 7
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 11
18 | },
19 | "label": "(if $b)",
20 | "paddingLeft": true
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__loop_end.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 2,
9 | "character": 7
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 13
18 | },
19 | "label": "(loop $b)",
20 | "paddingLeft": true
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/docs/config/format/format-comments.md:
--------------------------------------------------------------------------------
1 | # `formatComments`
2 |
3 | > default: `false`
4 |
5 | Control whether whitespace should be inserted at the beginning and end of comments.
6 |
7 | For example, the following code:
8 |
9 | ```wasm
10 | ;;comment
11 | (;comment;)
12 | ```
13 |
14 | will be formatted to:
15 |
16 | ```wasm
17 | ;; comment
18 | (; comment ;)
19 | ```
20 |
21 | If this option is set to `false`, comments contain leading or trailing whitespace will still be kept as-is.
22 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-locals/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "default": {
3 | "printWidth": 40
4 | },
5 | "never": {
6 | "printWidth": 40,
7 | "wrapBeforeLocals": "never"
8 | },
9 | "overflow": {
10 | "printWidth": 40,
11 | "wrapBeforeLocals": "overflow"
12 | },
13 | "multi-only": {
14 | "printWidth": 40,
15 | "wrapBeforeLocals": "multi-only"
16 | },
17 | "always": {
18 | "printWidth": 40,
19 | "wrapBeforeLocals": "always"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/block-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func (i32.const 0) (block (type $sig) (result i32) (param i32)))
3 | (func (i32.const 0) (block (param i32) (type $sig) (result i32)))
4 | (func (i32.const 0) (block (param i32) (result i32) (type $sig)))
5 | (func (i32.const 0) (block (result i32) (type $sig) (param i32)))
6 | (func (i32.const 0) (block (result i32) (param i32) (type $sig)))
7 | (func (i32.const 0) (block (result i32) (param i32)))
8 | (func block)
9 | )
10 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__catch.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "detail": "(tag)"
13 | },
14 | {
15 | "label": "$e",
16 | "labelDetails": {
17 | "description": "[]"
18 | },
19 | "kind": 6,
20 | "detail": "(tag $e)"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/formatting/snapshots/features__formatting__range__overlap.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/formatting/range.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "range": {
8 | "start": {
9 | "line": 4,
10 | "character": 4
11 | },
12 | "end": {
13 | "line": 12,
14 | "character": 7
15 | }
16 | },
17 | "newText": "(block $a\n (block $b\n (block $c\n (block $b))))"
18 | }
19 | ]
20 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__block_via_type_use.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(block $b (param i32) (param i32) (result i32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 5,
13 | "character": 9
14 | },
15 | "end": {
16 | "line": 5,
17 | "character": 11
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_type_use_with_inlined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $p f64) (result i32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 14
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 19
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__three_slots_instr_op_code.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nf64x2.sqrt\n```\nBinary Opcode: 0xFD 0xEF 0x01"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 11
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 21
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__block_end.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 2,
9 | "character": 7
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 14
18 | },
19 | "label": "(block $b)",
20 | "paddingLeft": true
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__catch_ref.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "detail": "(tag)"
13 | },
14 | {
15 | "label": "$e",
16 | "labelDetails": {
17 | "description": "[]"
18 | },
19 | "kind": 6,
20 | "detail": "(tag $e)"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__extern_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "detail": "(tag)"
13 | },
14 | {
15 | "label": "$e",
16 | "labelDetails": {
17 | "description": "[]"
18 | },
19 | "kind": 6,
20 | "detail": "(tag $e)"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__block_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(block $b (param i64) (param f64) (result i32) (result f32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 11
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 13
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__block_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(block $b (param i64) (param f64) (result i32) (result f32))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 9
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 11
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__local.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 2,
9 | "character": 9
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 25
18 | },
19 | "label": "i64",
20 | "kind": 1,
21 | "paddingLeft": true
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__param.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 2,
9 | "character": 9
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 25
18 | },
19 | "label": "f32",
20 | "kind": 1,
21 | "paddingLeft": true
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__catch_before_label.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "detail": "(tag)"
13 | },
14 | {
15 | "label": "$e",
16 | "labelDetails": {
17 | "description": "[]"
18 | },
19 | "kind": 6,
20 | "detail": "(tag $e)"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__module_field.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "import",
8 | "kind": 14
9 | },
10 | {
11 | "label": "export",
12 | "kind": 14
13 | },
14 | {
15 | "label": "type",
16 | "kind": 14
17 | },
18 | {
19 | "label": "param",
20 | "kind": 14
21 | },
22 | {
23 | "label": "result",
24 | "kind": 14
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__super_type_candidates.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$a",
8 | "kind": 8
9 | },
10 | {
11 | "label": "$b",
12 | "kind": 8
13 | },
14 | {
15 | "label": "$c",
16 | "kind": 8
17 | },
18 | {
19 | "label": "3",
20 | "kind": 8
21 | },
22 | {
23 | "label": "final",
24 | "kind": 14
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__ref_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 2,
9 | "character": 9
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 25
18 | },
19 | "label": "(ref 0)",
20 | "kind": 1,
21 | "paddingLeft": true
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__import__desc_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/import.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "func",
8 | "kind": 14
9 | },
10 | {
11 | "label": "table",
12 | "kind": 14
13 | },
14 | {
15 | "label": "memory",
16 | "kind": 14
17 | },
18 | {
19 | "label": "global",
20 | "kind": 14
21 | },
22 | {
23 | "label": "tag",
24 | "kind": 14
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 14
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/inlay_hint/snapshots/features__inlay_hint__global.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/inlay_hint/mod.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "position": {
8 | "line": 3,
9 | "character": 9
10 | },
11 | "label": "(;0;)",
12 | "paddingLeft": true
13 | },
14 | {
15 | "position": {
16 | "line": 3,
17 | "character": 29
18 | },
19 | "label": "(ref null func)",
20 | "kind": 1,
21 | "paddingLeft": true
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/formatter/tests/fmt/wrap-before-global-expr/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "default": {
3 | "printWidth": 60
4 | },
5 | "never": {
6 | "printWidth": 60,
7 | "wrapBeforeGlobalExpr": "never"
8 | },
9 | "overflow": {
10 | "printWidth": 60,
11 | "wrapBeforeGlobalExpr": "overflow"
12 | },
13 | "multi-only": {
14 | "printWidth": 60,
15 | "wrapBeforeGlobalExpr": "multi-only"
16 | },
17 | "always": {
18 | "printWidth": 60,
19 | "wrapBeforeGlobalExpr": "always"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/ref_instr.rs:
--------------------------------------------------------------------------------
1 | use super::*;
2 | use insta::assert_json_snapshot;
3 | use wat_service::LanguageService;
4 |
5 | #[test]
6 | fn null() {
7 | let uri = "untitled:test".to_string();
8 | let source = "
9 | (module
10 | (type $s)
11 | (func (ref.null )))
12 | ";
13 | let mut service = LanguageService::default();
14 | service.commit(&uri, source.into());
15 | let response = service.completion(create_params(uri, 3, 18));
16 | assert_json_snapshot!(response);
17 | }
18 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/unknown_instr.rs:
--------------------------------------------------------------------------------
1 | use super::*;
2 | use insta::assert_json_snapshot;
3 | use wat_service::LanguageService;
4 |
5 | #[test]
6 | fn with_fuzzy() {
7 | let uri = "untitled:test".to_string();
8 | let source = "(module (func (log)))";
9 | let mut service = LanguageService::default();
10 | service.commit(&uri, source.into());
11 | calm(&mut service, &uri);
12 | let response = service.pull_diagnostics(create_params(uri));
13 | assert_json_snapshot!(response);
14 | }
15 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 5
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 9
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__extern_idx_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "func",
8 | "kind": 14
9 | },
10 | {
11 | "label": "table",
12 | "kind": 14
13 | },
14 | {
15 | "label": "memory",
16 | "kind": 14
17 | },
18 | {
19 | "label": "global",
20 | "kind": 14
21 | },
22 | {
23 | "label": "tag",
24 | "kind": 14
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__module_field_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "import",
8 | "kind": 14
9 | },
10 | {
11 | "label": "export",
12 | "kind": 14
13 | },
14 | {
15 | "label": "type",
16 | "kind": 14
17 | },
18 | {
19 | "label": "param",
20 | "kind": 14
21 | },
22 | {
23 | "label": "result",
24 | "kind": 14
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_import_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 16
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 17
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__struct_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $struct (struct (field i8) (field (mut (ref null any))) (field $x (ref $x))))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 20
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 27
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__type_decl.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $type (func (param $param i32) (param f32) (param f64) (result i32) (result i64)))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__type_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $type (func (param $param i32) (param f32) (param f64) (result i32) (result i64)))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 5
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 9
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__type_use_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type (func (param $param i32) (param f32) (param f64) (result i32) (result i64)))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 16
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 17
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/try-table.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (func
6 | (try_table)
7 | (try_table (result i32) (catch $e0 $h))
8 | (try_table (catch_all $h)
9 | (unreachable))
10 | (try_table (result i32) (catch $e0 $h0) (catch $e1 $h1))
11 | (try_table (result f32) (catch_ref $e-f32 $h))
12 | (try_table (catch_all 0) (catch_all_ref 0))
13 | try_table $t (result) (catch $e0 $h0) (catch_ref $e1 $h1)
14 | unreachable
15 | end))
16 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_import_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 16
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 21
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__func_type_use_only.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 14
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 19
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__keyword__extern_idx_keyword_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/keyword.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "func",
8 | "kind": 14
9 | },
10 | {
11 | "label": "table",
12 | "kind": 14
13 | },
14 | {
15 | "label": "memory",
16 | "kind": 14
17 | },
18 | {
19 | "label": "global",
20 | "kind": 14
21 | },
22 | {
23 | "label": "tag",
24 | "kind": 14
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__type_use_ident_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(type $type (func (param $param i32) (param f32) (param f64) (result i32) (result i64)))\n```"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 3,
13 | "character": 16
14 | },
15 | "end": {
16 | "line": 3,
17 | "character": 21
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__vec_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\nv128\n```\n\nThe type `v128` corresponds to a 128 bit vector of packed integer or floating-point data."
9 | },
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 17
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 21
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__annotation__after_at.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/annotation.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "deprecated",
8 | "kind": 15
9 | },
10 | {
11 | "label": "custom",
12 | "kind": 15
13 | },
14 | {
15 | "label": "name",
16 | "kind": 15
17 | },
18 | {
19 | "label": "js",
20 | "kind": 15
21 | },
22 | {
23 | "label": "metadata.code.branch_hint",
24 | "kind": 15
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/loop-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func (i32.const 0) (loop (type $sig) (result i32) (param i32)))
3 | (func (i32.const 0) (loop (param i32) (type $sig) (result i32)))
4 | (func (i32.const 0) (loop (param i32) (result i32) (type $sig)))
5 | (func (i32.const 0) (loop (result i32) (type $sig) (param i32)))
6 | (func (i32.const 0) (loop (result i32) (param i32) (type $sig)))
7 | (func (i32.const 0) (loop (result i32) (param i32)))
8 | (func (i32.const 0) (loop (param $x i32) (drop)))
9 | (func loop)
10 | )
11 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__annotation__incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/annotation.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "deprecated",
8 | "kind": 15
9 | },
10 | {
11 | "label": "custom",
12 | "kind": 15
13 | },
14 | {
15 | "label": "name",
16 | "kind": 15
17 | },
18 | {
19 | "label": "js",
20 | "kind": 15
21 | },
22 | {
23 | "label": "metadata.code.branch_hint",
24 | "kind": 15
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/rename/snapshots/features__rename__rename__different_kinds.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/rename/rename.rs
3 | expression: response
4 | ---
5 | {
6 | "changes": {
7 | "untitled:test": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 2,
12 | "character": 8
13 | },
14 | "end": {
15 | "line": 2,
16 | "character": 13
17 | }
18 | },
19 | "newText": "$f"
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__call_indirect_following_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 18
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 19
18 | }
19 | },
20 | "newText": "0"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/struct.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (type (struct))
6 | (type (struct (field)))
7 | (type (struct (field i8)))
8 | (type (struct (field i8 i8 i8 i8)))
9 | (type (struct (field $x1 i32) (field $y1 i32)))
10 | (type
11 | (struct (field i8 i16 i32 i64 f32 f64 anyref funcref (ref 0) (ref null 1))))
12 | (type
13 | (struct (field i32 i64 i8) (field) (field) (field (ref null i31) anyref)))
14 | (type (struct (field $x2 i32) (field f32 f64) (field $y2 i32))))
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__call_indirect_following_dollar.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 18
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 19
18 | }
19 | },
20 | "newText": "$table"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__call_indirect_incomplete_ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 18
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 20
18 | }
19 | },
20 | "newText": "$table"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__return_call_indirect_following_int_idx.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 25
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 26
18 | }
19 | },
20 | "newText": "0"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/docs/diagnostics/uninit.md:
--------------------------------------------------------------------------------
1 | # Uninitialized
2 |
3 | This checks when accessing function locals, if they are initialized or not.
4 |
5 | Number types, vector types and nullable reference types are considered "defaultable", so they don't require manual initialization.
6 | For non-nullable reference types, they must be initialized by `local.set` or `local.tee` instructions.
7 |
8 | ```wasm error-5-15-5-16
9 | (module
10 | (func (result i32) (local i32)
11 | local.get 0)
12 | (func (result (ref any)) (local (ref any))
13 | local.get 0))
14 | ```
15 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__extern_idx_memory_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$memory",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 23
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 25
18 | }
19 | },
20 | "newText": "$memory"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__extern_idx_memory_following_dollar.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$memory",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 23
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 24
18 | }
19 | },
20 | "newText": "$memory"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__return_call_indirect_following_dollar.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 25
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 26
18 | }
19 | },
20 | "newText": "$table"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__table__return_call_indirect_incomplete_ident.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/table.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$table",
8 | "kind": 6,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 25
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 27
18 | }
19 | },
20 | "newText": "$table"
21 | }
22 | }
23 | ]
24 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__throw.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[i32, f32]"
10 | },
11 | "kind": 6,
12 | "detail": "(tag (param i32) (param f32) (result i64))"
13 | },
14 | {
15 | "label": "$e",
16 | "labelDetails": {
17 | "description": "[i32]"
18 | },
19 | "kind": 6,
20 | "detail": "(tag $e (param i32) (result f32))"
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/bulk.wat:
--------------------------------------------------------------------------------
1 | ;; segment syntax
2 | (module
3 | (memory 1)
4 | (data "foo"))
5 |
6 | (module
7 | (table 3 funcref)
8 | (elem funcref (ref.func 0) (ref.null func) (ref.func 1))
9 | (func))
10 |
11 | ;; memory.fill
12 | (module
13 | (func (export "fill") (param i32 i32 i32)
14 | (memory.fill
15 | (local.get 0)
16 | (local.get 1)
17 | (local.get 2)))
18 | )
19 |
20 |
21 | (module
22 | (data $p "x")
23 | (data $a (memory 0) (i32.const 0) "x")
24 | )
25 |
26 |
27 | (module
28 | (elem (i32.const 0) $zero $one $two)
29 | )
30 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__doc_comment__after_annotations.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/doc_comment.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```\n---\n## Function with Annotations"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/hover/snapshots/features__hover__doc_comment__before_annotations.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/hover/doc_comment.rs
3 | expression: response
4 | ---
5 | {
6 | "contents": {
7 | "kind": "markdown",
8 | "value": "```wat\n(func $func (param $param i32) (param f32) (param f64) (result i32) (result i64))\n```\n---\n## Function with Annotations"
9 | },
10 | "range": {
11 | "start": {
12 | "line": 4,
13 | "character": 10
14 | },
15 | "end": {
16 | "line": 4,
17 | "character": 15
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__memory__addr_type_incomplete.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/memory.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "i32",
8 | "kind": 7,
9 | "documentation": {
10 | "kind": "markdown",
11 | "value": "The type `i32` classifies 32 bit integers."
12 | }
13 | },
14 | {
15 | "label": "i64",
16 | "kind": 7,
17 | "documentation": {
18 | "kind": "markdown",
19 | "value": "The type `i64` classifies 64 bit integers."
20 | }
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__tag__deprecated.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/tag.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "tags": [
13 | 1
14 | ],
15 | "detail": "(tag)"
16 | },
17 | {
18 | "label": "$e",
19 | "labelDetails": {
20 | "description": "[]"
21 | },
22 | "kind": 6,
23 | "tags": [
24 | 1
25 | ],
26 | "detail": "(tag $e)"
27 | }
28 | ]
29 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/int-literals-malformed.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | (module
5 | (global i32
6 | (i32.const _100))
7 | (global i32
8 | (i32.const +_100))
9 | (global i32
10 | (i32.const -_100))
11 | (global i32
12 | (i32.const 99_))
13 | (global i32
14 | (i32.const 1__000))
15 | (global i32
16 | (i32.const _0x100))
17 | (global i32
18 | (i32.const 0_x100))
19 | (global i32
20 | (i32.const 0x_100))
21 | (global i32
22 | (i32.const 0x00_))
23 | (global i32
24 | (i32.const 0xff__ffff)))
25 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__ty_decl__final_keyword.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/ty_decl.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "kind": 8,
9 | "textEdit": {
10 | "range": {
11 | "start": {
12 | "line": 2,
13 | "character": 15
14 | },
15 | "end": {
16 | "line": 2,
17 | "character": 16
18 | }
19 | },
20 | "newText": "0"
21 | }
22 | },
23 | {
24 | "label": "final",
25 | "kind": 14
26 | }
27 | ]
28 |
--------------------------------------------------------------------------------
/docs/diagnostics/undef.md:
--------------------------------------------------------------------------------
1 | # Undefined
2 |
3 | This checks items that are used but haven't been defined. It checks for:
4 |
5 | - function calls
6 | - parameter usage
7 | - function local usage
8 | - type use
9 | - global usage
10 | - memory usage
11 | - table usage
12 | - block label usage
13 | - WasmGC struct field usage
14 |
15 | Examples:
16 |
17 | ```wasm error-3-8-3-9 error-5-15-5-16 error-6-10-6-22 error-9-16-9-28
18 | (module
19 | (func
20 | br 1)
21 | (func
22 | local.get 0
23 | call $not-defined)
24 | (func
25 | i32.const 0
26 | global.set $not-defined))
27 | ```
28 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__param__type_def_with_inlined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/param.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "$c",
8 | "labelDetails": {
9 | "description": "i64"
10 | },
11 | "kind": 6,
12 | "textEdit": {
13 | "range": {
14 | "start": {
15 | "line": 4,
16 | "character": 15
17 | },
18 | "end": {
19 | "line": 4,
20 | "character": 16
21 | }
22 | },
23 | "newText": "$c"
24 | }
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__immediates__ref_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/immediates.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 17,
12 | "character": 13
13 | },
14 | "end": {
15 | "line": 17,
16 | "character": 14
17 | }
18 | },
19 | "severity": 1,
20 | "code": "immediates",
21 | "source": "wat",
22 | "message": "expected ref type"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__subtyping__explicit_final.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/subtyping.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 16
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "subtyping",
21 | "source": "wat",
22 | "message": "type `$t` is final"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__subtyping__implicit_final.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/subtyping.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 16
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "subtyping",
21 | "source": "wat",
22 | "message": "type `$t` is final"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__start__has_params.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/start.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 9
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 10
17 | }
18 | },
19 | "severity": 1,
20 | "code": "start",
21 | "source": "wat",
22 | "message": "start function must be type of [] -> []"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__start__has_results.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/start.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 9
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 10
17 | }
18 | },
19 | "severity": 1,
20 | "code": "start",
21 | "source": "wat",
22 | "message": "start function must be type of [] -> []"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__tag_type__non_func.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/tag_type.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 13
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 14
17 | }
18 | },
19 | "severity": 1,
20 | "code": "tag-type",
21 | "source": "wat",
22 | "message": "tag type must be function type"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/semantic_tokens/snapshots/features__semantic_tokens__range.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/semantic_tokens/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "data": [
7 | 4,
8 | 0,
9 | 6,
10 | 2,
11 | 0,
12 | 0,
13 | 9,
14 | 9,
15 | 8,
16 | 0,
17 | 0,
18 | 10,
19 | 1,
20 | 2,
21 | 0,
22 | 0,
23 | 4,
24 | 9,
25 | 8,
26 | 0,
27 | 0,
28 | 10,
29 | 1,
30 | 7,
31 | 0,
32 | 1,
33 | 9,
34 | 4,
35 | 8,
36 | 0,
37 | 0,
38 | 5,
39 | 5,
40 | 3,
41 | 0
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/crates/service/tests/code_lens/snapshots/features__code_lens__zero_references.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/code_lens/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "range": {
7 | "start": {
8 | "line": 2,
9 | "character": 2
10 | },
11 | "end": {
12 | "line": 2,
13 | "character": 8
14 | }
15 | },
16 | "command": {
17 | "title": "0 references",
18 | "command": "wasmLanguageTools.showReferences",
19 | "arguments": [
20 | "untitled:test",
21 | {
22 | "character": 2,
23 | "line": 2
24 | },
25 | []
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__block_type__array.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/block_type.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 17
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "block-type",
21 | "source": "wat",
22 | "message": "block type must be function type"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__block_type__structs.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/block_type.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 17
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "block-type",
21 | "source": "wat",
22 | "message": "block type must be function type"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__subtyping__explicit_final_with_super.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/subtyping.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 16
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "subtyping",
21 | "source": "wat",
22 | "message": "type `$s` is final"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__syntax__top_level_error_token.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/syntax.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 8
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 9
17 | }
18 | },
19 | "severity": 1,
20 | "code": "syntax",
21 | "source": "wat",
22 | "message": "syntax error: unexpected token"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__call_undefined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 25
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 29
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find func `$bar` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__field_undefined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 5,
12 | "character": 17
13 | },
14 | "end": {
15 | "line": 5,
16 | "character": 19
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find field `$x` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__global_undefined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 26
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 30
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find global `$bar` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__type_use_undefined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 20
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 22
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find type `$t` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__uninit__block_loop.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/uninit.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 16
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 17
17 | }
18 | },
19 | "severity": 1,
20 | "code": "uninit",
21 | "source": "wat",
22 | "message": "local `1` is read before being initialized"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__uninit__undef.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/uninit.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 14
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 15
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find param or local `0` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__unread__undef.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/unread.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 14
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 15
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find param or local `0` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__start__has_params_and_results.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/start.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 9
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 10
17 | }
18 | },
19 | "severity": 1,
20 | "code": "start",
21 | "source": "wat",
22 | "message": "start function must be type of [] -> []"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__local_undefined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 25
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 26
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find param or local `0` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__uninit__block_block.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/uninit.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 16
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 17
17 | }
18 | },
19 | "severity": 1,
20 | "code": "uninit",
21 | "source": "wat",
22 | "message": "local `1` is read before being initialized"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__uninit__nested_if.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/uninit.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 16,
12 | "character": 14
13 | },
14 | "end": {
15 | "line": 16,
16 | "character": 16
17 | }
18 | },
19 | "severity": 1,
20 | "code": "uninit",
21 | "source": "wat",
22 | "message": "local `$b` is read before being initialized"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__instr__more_dots.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/instr.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "add_u",
8 | "kind": 24
9 | },
10 | {
11 | "label": "sub_u",
12 | "kind": 24
13 | },
14 | {
15 | "label": "and_u",
16 | "kind": 24
17 | },
18 | {
19 | "label": "or_u",
20 | "kind": 24
21 | },
22 | {
23 | "label": "xor_u",
24 | "kind": 24
25 | },
26 | {
27 | "label": "xchg_u",
28 | "kind": 24
29 | },
30 | {
31 | "label": "cmpxchg_u",
32 | "kind": 24
33 | }
34 | ]
35 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__implicit_module__incomplete_module.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/implicit_module.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 7
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 7
17 | }
18 | },
19 | "severity": 1,
20 | "code": "syntax",
21 | "source": "wat",
22 | "message": "syntax error: expected `)`"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__mem_type__invalid_page_size.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/mem_type.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 2,
12 | "character": 24
13 | },
14 | "end": {
15 | "line": 2,
16 | "character": 25
17 | }
18 | },
19 | "severity": 1,
20 | "code": "mem-type",
21 | "source": "wat",
22 | "message": "memory page size must be 1 or 65536"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__mem_type__less_than.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/mem_type.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 2,
12 | "character": 12
13 | },
14 | "end": {
15 | "line": 2,
16 | "character": 13
17 | }
18 | },
19 | "severity": 1,
20 | "code": "mem-type",
21 | "source": "wat",
22 | "message": "maximum size must be greater than minimum size"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__mem_type__shared_without_max.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/mem_type.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 2,
12 | "character": 12
13 | },
14 | "end": {
15 | "line": 2,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "mem-type",
21 | "source": "wat",
22 | "message": "shared memory must have a maximum size"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__drop__incorrect.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/drop.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 4
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 8
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [any], found []"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/semantic_tokens/snapshots/features__semantic_tokens__range_not_boundary.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/semantic_tokens/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "data": [
7 | 4,
8 | 0,
9 | 6,
10 | 2,
11 | 0,
12 | 0,
13 | 9,
14 | 9,
15 | 8,
16 | 0,
17 | 0,
18 | 10,
19 | 1,
20 | 2,
21 | 0,
22 | 0,
23 | 4,
24 | 9,
25 | 8,
26 | 0,
27 | 0,
28 | 10,
29 | 1,
30 | 7,
31 | 0,
32 | 1,
33 | 9,
34 | 4,
35 | 8,
36 | 0,
37 | 0,
38 | 5,
39 | 5,
40 | 3,
41 | 0
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/crates/service/tests/signature_help/snapshots/features__signature_help__return_call_indirect.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/signature_help/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "signatures": [
7 | {
8 | "label": "(func (param f32) (param i32) (result f64))",
9 | "parameters": [
10 | {
11 | "label": [
12 | 6,
13 | 17
14 | ]
15 | },
16 | {
17 | "label": [
18 | 18,
19 | 29
20 | ]
21 | }
22 | ],
23 | "activeParameter": 0
24 | }
25 | ],
26 | "activeSignature": 0
27 | }
28 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/if-malformed.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (func (i32.const 0)
3 | (if (type $sig) (result i32) (param i32) (i32.const 1) (then))
4 | (if (param i32) (type $sig) (result i32) (i32.const 1) (then))
5 | (if (param i32) (result i32) (type $sig) (i32.const 1) (then))
6 | (if (result i32) (type $sig) (param i32) (i32.const 1) (then))
7 | (if (result i32) (param i32) (type $sig) (i32.const 1) (then))
8 | (if (result i32) (param i32) (i32.const 1) (then))
9 | (if (param $x i32) (then (drop)) (else (drop)))
10 | )
11 | (func if)
12 | (func (if (result i32) (i32.const 1)))
13 | (func (if
14 | ))
15 | )
16 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__less_operands.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 27
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 50
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [i32, i32], found [i32]"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/signature_help/snapshots/features__signature_help__call_indirect_type_use.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/signature_help/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "signatures": [
7 | {
8 | "label": "(func (param f32) (param i32) (result f64))",
9 | "parameters": [
10 | {
11 | "label": [
12 | 6,
13 | 17
14 | ]
15 | },
16 | {
17 | "label": [
18 | 18,
19 | 29
20 | ]
21 | }
22 | ],
23 | "activeParameter": 0
24 | }
25 | ],
26 | "activeSignature": 0
27 | }
28 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__param_via_type_def_by_name.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 15
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 17
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find param or local `$a` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__undef__param_via_type_def_with_inlined.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/undef.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 15
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 16
17 | }
18 | },
19 | "severity": 1,
20 | "code": "undef",
21 | "source": "wat",
22 | "message": "cannot find param or local `0` in this scope"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__operand_count_pluralization.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 27
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 36
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [i32], found []"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/signature_help/snapshots/features__signature_help__call_indirect_inline_func_type.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/signature_help/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "signatures": [
7 | {
8 | "label": "(func (param f32) (param i32) (result f64))",
9 | "parameters": [
10 | {
11 | "label": [
12 | 6,
13 | 17
14 | ]
15 | },
16 | {
17 | "label": [
18 | 18,
19 | 29
20 | ]
21 | }
22 | ],
23 | "activeParameter": 0
24 | }
25 | ],
26 | "activeSignature": 0
27 | }
28 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__block__try_table.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/block.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 3,
12 | "character": 27
13 | },
14 | "end": {
15 | "line": 3,
16 | "character": 28
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [i32], found [] at the end"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__less_operands_on_stack.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 8
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 15
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [i32, i32], found [i32]"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__more_operands.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/mod.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 65
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 66
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [], found [i32, i32] at the end"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/docs/diagnostics/duplicated-names.md:
--------------------------------------------------------------------------------
1 | # Duplicated Names
2 |
3 | This checks duplicated identifiers in their same scope:
4 |
5 | ```wasm error-2-9-2-11 error-3-9-3-11
6 | (module
7 | (func $f)
8 | (func $f))
9 | ```
10 |
11 | Same identifier in different scopes is allowed:
12 |
13 | ```wasm
14 | (module
15 | (func (param $p i32))
16 | (func (param $p i32)))
17 | ```
18 |
19 | Though in the same scope, if two identifiers have same name but different kinds, it is allowed:
20 |
21 | ```wasm
22 | (module
23 | (func $f)
24 | (type $f (func)))
25 | ```
26 |
27 | In the example above, the first `$f` is funcidx while the second `$f` is typeidx.
28 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__block__catch.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/block.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "detail": "(try_table)"
13 | },
14 | {
15 | "label": "$b",
16 | "labelDetails": {
17 | "description": "[]"
18 | },
19 | "kind": 6,
20 | "detail": "(block $b)"
21 | },
22 | {
23 | "label": "2",
24 | "labelDetails": {
25 | "description": "[]"
26 | },
27 | "kind": 6,
28 | "detail": "(func)"
29 | }
30 | ]
31 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/snapshots/features__diagnostics__unknown_instr__with_fuzzy.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/unknown_instr.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 0,
12 | "character": 15
13 | },
14 | "end": {
15 | "line": 0,
16 | "character": 18
17 | }
18 | },
19 | "severity": 1,
20 | "code": "unknown-instr",
21 | "source": "wat",
22 | "message": "unknown instruction `log`, do you mean `local.get`?"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__table__non_null.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/table.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 2,
12 | "character": 21
13 | },
14 | "end": {
15 | "line": 2,
16 | "character": 22
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [(ref func)], found [] at the end"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/crates/formatter/tests/parser/bulk.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/formatter/tests/parser.rs
3 | ---
4 | ;; segment syntax
5 | (module
6 | (memory 1)
7 | (data "foo"))
8 |
9 | (module
10 | (table 3 funcref)
11 | (elem funcref
12 | (ref.func 0)
13 | (ref.null func)
14 | (ref.func 1))
15 | (func))
16 |
17 | ;; memory.fill
18 | (module
19 | (func (export "fill") (param i32 i32 i32)
20 | (memory.fill
21 | (local.get 0)
22 | (local.get 1)
23 | (local.get 2))))
24 |
25 | (module
26 | (data $p "x")
27 | (data $a (memory 0)
28 | (i32.const 0) "x"))
29 |
30 | (module
31 | (elem
32 | (i32.const 0) $zero $one $two))
33 |
--------------------------------------------------------------------------------
/crates/parser/tests/parse/array.wat:
--------------------------------------------------------------------------------
1 | (module
2 | (type (array i8))
3 | (type (array i16))
4 | (type (array i32))
5 | (type (array i64))
6 | (type (array f32))
7 | (type (array f64))
8 | (type (array anyref))
9 | (type (array (ref struct)))
10 | (type (array (ref 0)))
11 | (type (array (ref null 1)))
12 | (type (array (mut i8)))
13 | (type (array (mut i16)))
14 | (type (array (mut i32)))
15 | (type (array (mut i64)))
16 | (type (array (mut f32)))
17 | (type (array (mut f64)))
18 | (type (array (mut anyref)))
19 | (type (array (mut (ref struct))))
20 | (type (array (mut (ref 0))))
21 | (type (array (mut (ref null i31))))
22 | )
23 |
--------------------------------------------------------------------------------
/crates/service/tests/completion/snapshots/features__completion__block__catch_all.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/completion/block.rs
3 | expression: response
4 | ---
5 | [
6 | {
7 | "label": "0",
8 | "labelDetails": {
9 | "description": "[]"
10 | },
11 | "kind": 6,
12 | "detail": "(try_table)"
13 | },
14 | {
15 | "label": "$b",
16 | "labelDetails": {
17 | "description": "[]"
18 | },
19 | "kind": 6,
20 | "detail": "(block $b)"
21 | },
22 | {
23 | "label": "2",
24 | "labelDetails": {
25 | "description": "[]"
26 | },
27 | "kind": 6,
28 | "detail": "(func)"
29 | }
30 | ]
31 |
--------------------------------------------------------------------------------
/crates/service/tests/diagnostics/typeck/snapshots/features__diagnostics__typeck__block__params_boundary_missing.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: crates/service/tests/diagnostics/typeck/block.rs
3 | expression: response
4 | ---
5 | {
6 | "kind": "full",
7 | "items": [
8 | {
9 | "range": {
10 | "start": {
11 | "line": 4,
12 | "character": 10
13 | },
14 | "end": {
15 | "line": 4,
16 | "character": 25
17 | }
18 | },
19 | "severity": 1,
20 | "code": "type-check",
21 | "source": "wat",
22 | "message": "expected types [i32, i32], found [i32]"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------