Repository navigation
Conversation
|
|
||
| world target-world { | ||
| include wasi:http/proxy@0.2.3; | ||
| include wasi:http/proxy@0.2.3; |
There was a problem hiding this comment.
up to us what indentation we prefer, this can be set in .topiary/languages.ncl similar to the indent key here:
https://github.com/topiary/topiary/blob/c72efbfd164f98e5d2fab70a7c984280e0a90378/topiary-config/languages.ncl#L284-L294
| (code_fence_content) @injection.content | ||
| ; mdBook inline macro | ||
| (#not-match? @info ".*(nofmt|rust).*") | ||
| (#not-match? @injection.content "\\{\\{\\#include") |
There was a problem hiding this comment.
used to skip mdbook directives
| A WASI 0.2 read call returned a single `input-stream` resource and surfaced terminal errors only as you consumed it. WASI 0.3 splits those concerns: the call returns a `stream<u8>` for the data and a `future<result<_, error-code>>` for the outcome, packed into a tuple. | ||
|
|
||
| ```wit | ||
| ```wit nofmt |
There was a problem hiding this comment.
nofmt is picked up by this query to skip WIT fragments:
| include wasi:cli/imports@0.2.0; | ||
|
|
||
| export add; | ||
| } No newline at end of file |
There was a problem hiding this comment.
up to us if we want to preserve double newlines between certain items
There was a problem hiding this comment.
Yeah let's have newlines between this, but only for worlds? I like the idea of separating the imports, includes and exports in a world declaration
|
Neat thing about component-docs/component-model/src/tutorial.md Lines 128 to 133 in 969ae33 |
…ources/rust.md --skip-stage host --skip-language rust`
| }, | ||
| queries.injections.source.path = "queries/injections.scm", | ||
| }, | ||
| wit.indent = " ", # 4 spaces |
There was a problem hiding this comment.
The repo has a mix of 2 and 4 space indentation for WIT and this helps align it.
|
|
| An `enum` type is a variant type where none of the cases have associated data: | ||
|
|
||
| ```wit | ||
| ```wit nofmt |
There was a problem hiding this comment.
nofmt will eventually be removed once hideline fragments are properly handled in topiary:
| ```wit nofmt | |
| ```wit,hidelines=!!! | |
| !!! interface foo { |
| enum op { | ||
| add, | ||
| } | ||
| eval-expression: func(op: op, x: u32, y: u32) -> u32; |
There was a problem hiding this comment.
It would be nice if we defaulted to a space between items inside an interface.
There was a problem hiding this comment.
Should this apply to worlds as well? We can do only a subset of each as well:
https://github.com/bytecodealliance/tree-sitter-wit/blob/f777cdbe11281ccc68ffa30bd7ea34cdf4ddbec6/grammar.js#L139-L146
world_definition: ($) =>
choice(
$.export_item,
$.import_item,
$.use_item,
$.typedef_item,
$.include_item,
),
// ...
_interface_definition: ($) =>
choice(
$.use_item,
seq(optional($.external_id), choice($.typedef_item, $.func_item)),
),
!!WIP!!
WIT formatting:
topiary fmt ./**/*.witmarkdown formatting (only formats WIT, toml codeblocks):
topiary fmt ./**/*.md --skip-stage host --skip-language rust