20 Commits (1359c9ecb132fa441bbef5faa102220a5a3a9960)
 

Author SHA1 Message Date
alex 1359c9ecb1 output: print filename under search if there are many
when searching over multiple files, it's unclear where a type is coming
from. zdoc now outputs the filename before printing out search results.
2 years ago
alex 78607c3a96 readme: delete outdated info about 'unimplemented' errors
most of them work now. if anything still shows up, it's probably more of
a bug now.
2 years ago
alex af1b591672 docs: correct optional vs required positional args format
the source arg is always required, identifier is optional.
the opposite was remnant from an earlier version.
2 years ago
alex a684fbb425 cmd: search across the whole zig stdlib if source is exactly 'std'
sometimes, it may be unclear which module a certain type is in.
searching the whole stdlib makes it easier:

    zdoc std ipv6
2 years ago
alex e90e5eefbb output: print doc comments for all container fields and var decl
this was a big omission from when adapting the original
std/zig/render.zig: renderDocComments was a the very top which i
completely forgot about.

with it, double newlines are gone now, too.
2 years ago
alex 802fda7cf7 analyze: add a -s option to search for identifier substring
for example, all expectXxx from the testing module:

    zdoc -s std.testing expect
2 years ago
alex 3fa0f65b54 output: insert empty line between container members
unfortunately, this spits out double newlines between top level
declarations and sometimes in between fields. this is because the
original rendering logic designed to handle a complete source file,
whereas we're printing only public members.

but this makes reading the output of container fields easier.
will take care of double newlines later.
2 years ago
alex dc51518b13 output: enable array literal rendering
can now compile the renderArrayInit with the TypeErasedWriter type of Ais,
added in the previous commit.

example: zdoc std.x.os.net IPv6
2 years ago
alex 56fe08fa7a output: use a comptime type-independent writer
all rendering functions output using Ais (AutoIndentingStream) which
writes to an std.fs.File.Writer but some commented out functions
like renderArrayInit need to use Ais to temporary output a partial
expression into an std.ArrayList(u8) buffer, making a new type of Ais
which renderExpression func cannot accept.

the new TypeErasedWriter abstracts the underlying writer away and so Ais
now always outputs to the same TypeErasedWriter.Writer type. in other
words, a single type of Ais should now satisfy all render functions.
2 years ago
alex b2d59f9f0e output: render unwrap_optional tags and comptime
some pub types are defined at compile time, based on the host properties.
example:

    zdoc std.x.os.socket
2 years ago
alex 8448fa079b output: render 'usingnamespace'
some constructs are imported using "pub usingnamespace". example:

    zdoc std.x
2 years ago
alex 054254c5ab output: enable container_field and aligned variant rendering
this was an oversight. should've enabled it from the start.
for example, IterableDir.Iterator defines an alighted buf:

    zdoc std.fs IterableDir
2 years ago
alex cd961b5dd6 output: enable switch case rendering
some pub const and vars may be defined using switch expressions.
example:

    zdoc std.fs.path sep
    zdoc std.fs.path sep_str
2 years ago
alex 0affa0b302 output: enable blocks and struct init rendering
some global pub vars are defined in blocks and use struct literals.
for example:

    zdoc std.testing allocator_instance
2 years ago
alex 40b8da106a readme: mention zig build test before sending a patch 2 years ago
alex 2a3b2d57d8 analyze: add a couple identifier matching tests 2 years ago
alex 4056c6dbcb build: add test subcommand
zig build test can now run tests defined in main.zig and all files it
imports due to std.testing.refAllDecls.
2 years ago
alex ba68c4a971 analyze: deinit AST once search in a file is done
arena allocator would take care of it upon program exit but deinit'ing earlier
may make a mem footprint difference when searching an arbitrary large
number of files.
2 years ago
alex 6c8e03ebd8 readme: mention unimplemented rendering output 2 years ago
alex 0a505782aa initial import 2 years ago