Commit Graph

226 Commits

Author SHA1 Message Date
Eric Joldasov 50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Krzysztof Wolicki e9da87866c autodoc: Fix rendering of function arguments named _ 2023-06-18 14:41:49 +00:00
Loris Cro 216ef10dc4 Merge branch 'master' into autodoc-searchkey 2023-06-18 09:06:40 +02:00
Krzysztof Wolicki ad6e106f52 autodoc: Fix rendering of some values in main.js 2023-06-04 11:05:53 +00:00
Krzysztof Wolicki 94a7d5b8a5 autodoc: Links to private decls now lead to source files 2023-05-22 00:55:51 +02:00
Krzysztof Wolicki 3e5824d2a6 autodoc: Fix rendering of imported modules 2023-05-16 13:11:33 +02:00
Linus Groh bebb6a45a5 autodoc: Start search on any search input event, not just keydown 2023-05-13 17:52:13 +01:00
Andrew Kelley 7f7bd206dc Merge pull request #15519 from dweiller/issue-15482
Optimize lowering of `s[start..][0..len]`
2023-05-11 08:59:44 -07:00
Loris Cro 5512455974 Merge pull request #15637 from der-teufel-programming/autodoc-layouts
autodoc: Add layout to Struct and Union to handle packed and extern
2023-05-11 17:46:29 +02:00
Loris Cro 8ece99083f Merge pull request #15545 from r00ster91/autodocthing
autodoc: make help modal toggleable and allow entering "?" in search
2023-05-11 17:44:55 +02:00
Krzysztof Wolicki b7ba9aa892 autodoc: Add layout to Struct and Union to properly display packed and extern;
Make rendering of types in exprName more similar to zig fmt
2023-05-10 01:53:00 +02:00
Krzysztof Wolicki 9c8b9719cb autodoc: Fix exprName for struct and union types 2023-05-09 10:51:19 +02:00
Krzysztof Wolicki b488f97e92 autodoc: Analyze and expose backing integer types for packed structs 2023-05-08 22:34:46 +02:00
Krzysztof Wolicki f2aa7c8698 autodoc: Remove rendering "tuple" as part of the name in exprName 2023-05-08 22:29:20 +02:00
dweiller 2c5924c59a autodoc: fix support for slice_length ZIR instruction 2023-05-07 15:55:21 +10:00
Krzysztof Wolicki 538c8258c7 autodoc: Remove debug code 2023-05-05 12:01:00 +02:00
Krzysztof Wolicki e0c65ce3f2 autodoc: main.js exprName cleanup 2023-05-05 02:46:04 +02:00
Krzysztof Wolicki e363ffad90 autodoc: Better comptimeExpr code for blocks 2023-05-05 01:46:19 +02:00
cryptocode 0fc1d39649 Add new shortcut to help popup 2023-05-03 12:10:52 +02:00
r00ster91 eab4cd7a66 autodoc: type "?" instead of opening help modal if search selected
The question mark character can appear in identifiers as part of the
`@"syntax"` so we should allow typing it. Now, when the search is
selected, "?" is entered instead. It also shouldn't be that common in
general for the user to want to open the help modal.
2023-05-02 04:43:06 +02:00
r00ster91 6f1336a50c autodoc: make the help modal toggleable
Now you can simply press "?" again to toggle the help modal instead of
requiring Esc. Both Esc and "?" work.
2023-05-02 04:41:25 +02:00
cryptocode 5d20a4e35c autodoc: Add / as an alternative search key
Per Discord discussion. Motivation: `/` is now the de facto standard for initating search on webpages.
2023-04-29 20:48:18 +02:00
Krzysztof Wolicki aa51a5c557 autodoc: Gather and display decltests 2023-04-29 00:54:23 +02:00
Loris Cro d0311e28b3 autodoc: fix sidebar regression and other minor bugs 2023-04-26 18:20:41 +02:00
Loris Cro b294bff1a8 Autodoc: new decl search system (#15475)
New search system is based on a Radix Tree. The Radix Tree contains a shallow list of all decl names (ie no paths), plus some suffixes, split by following the official style guide (eg "HashMapUnmanaged" also produces "MapUnmanaged" and "Unmanaged", same with snake_case and camelCase names).

Additionally, the search system uses the decl graph data to recognize hierarchical relationships between decls, allowing you to zero on a target namespace for search. As an example "fs create" will score highe all things related to the creation of files and directories inside of `std.fs`, while still showing (but with lower score) matches from `std.Bulild`. 

As another example "fs windows" will prioritize windows-related results in `std.fs`, while "windows fs" will prioritize fs-related results in `std.windows`.
2023-04-26 18:17:20 +02:00
Krzysztof Wolicki a260fa8bf2 autodoc: Change package to module to better reflect the new names 2023-04-23 01:02:09 +02:00
Loris Cro c5fb245f60 Merge branch 'master' into autodoc-src-files-dirs 2023-04-22 19:10:23 +02:00
Krzysztof Wolicki 428f745270 autodoc: Change html file destination dirs
Each file is now saved with its package index in data.json
2023-04-22 02:36:19 +02:00
Krzysztof Wolicki 7e18bd7f71 autodoc: Handle calling conventions better
special case inline cc in exprName
2023-04-21 11:52:07 +02:00
Loris Cro 3cd19dd897 Merge pull request #15304 from der-teufel-programming/autodoc-defaults
autodoc: Fix errors in main.js; add support for defaults in exprName
2023-04-17 20:14:57 +02:00
Loris Cro 3d33a09069 autodoc: more support for linking decls in docs & guides 2023-04-17 20:13:08 +02:00
Krzysztof Wolicki 421ad51dc0 autodoc: Fix errors in main.js; add support for defaults in exprName 2023-04-16 01:37:24 +02:00
Loris Cro bd3e248c7e autodoc: add initial support for linking decls mentioned in markdown
this works both on doc comments and guides
2023-04-15 18:26:53 +02:00
Loris Cro aa765c1d70 autodoc: add support for defining guide sections
For example:

//!zig-autodoc-section: Advanced Topics
2023-04-15 18:26:53 +02:00
Krzysztof Wolicki aea886e2f3 autodoc: main.js formatting 2023-04-13 17:42:29 +02:00
Krzysztof Wolicki 8bbf62c3b9 autodoc: Handling of explicit values for enum fields
Fixes to frontend handling of structs
2023-04-13 17:42:29 +02:00
Krzysztof Wolicki 97b3b36c65 autodoc: Handling of default values for struct fields 2023-04-13 17:42:29 +02:00
Loris Cro 83d1f6b15a autodoc: index in search usingnamespace decls 2023-04-13 17:38:52 +02:00
Loris Cro 602029bb2f Autodoc usingnamespace (#15216)
* autodoc: init support for usingnamespace decls

* autodoc: don't build autodoc when building zig2.c

* autodoc: usingnamespace decls support in frontend (#15203)

* autodoc: init support for usingnamespace decls

* autodoc: usingnamespace decls support in frontend

---------

Co-authored-by: Krzysztof Wolicki <46651553+der-teufel-programming@users.noreply.github.com>
2023-04-12 01:14:02 +00:00
Loris Cro 9cb2919d50 Merge pull request #15127 from der-teufel-programming/autodoc_newbuiltins
autodoc: Add new builtins to Autodoc
2023-03-31 17:30:09 +02:00
Krzysztof Wolicki b69578e19c autodoc: add new builtins 2023-03-31 11:47:14 +02:00
Krzysztof Wolicki Der Teufel 27d2848e00 autodoc: Add struct to tryResolveRefPath
fix rendering of fieldRef in exprName
2023-03-07 00:32:26 +01:00
r00ster91 d6bd00e855 Zir: move set_cold from Inst.Tag to Inst.Extended
If I could mark a builtin function as cold, I would mark @setCold as cold.
We have run out of `Zir.Inst.Tag`s so I had to move a tag from Zir.Inst.Tag to
Zir.Inst.Extended. This is because a new noreturn builtin will be added and
noreturn builtins cannot be part of Inst.Tag:
```
/// `noreturn` instructions may not go here; they must be part of the main `Tag` enum.
pub const Extended = enum(u16) {
```

Here's another reason I went for @setCold:
```
$ git grep setRuntimeSafety | wc -l
322
$ git grep setCold | wc -l
79
$ git grep setEvalBranchQuota | wc -l
82
```

This also simply removes @setCold from Autodoc and the docs frontend because
as far as I could understand it, builtins represented using Zir extended
instructions are not yet supported because I couldn't find
@setStackAlign or @setFloatMode there, either.
2023-03-03 21:16:21 +01:00
Loris Cro 99c11cc8cf Merge pull request #14544 from der-teufel-programming/autodoc-quickfixes
autodoc: main.js cleanup and formatting
2023-02-20 16:37:41 +01:00
Nguyễn Gia Phong b56d4f2150 autodoc: render ordered lists as such 2023-02-16 06:19:43 +09:00
Nguyễn Gia Phong e359308b2b autodoc: fix md list markers matching
Both original Markdown and CommonMark require at least one space or tab
between the list marker and any following content.  Following this allows
starting a line with a negative number or one with a decimal point.
2023-02-16 06:07:39 +09:00
Veikka Tuominen 7199d7c777 split @qualCast into @constCast and @volatileCast 2023-02-15 01:43:57 +02:00
Krzysztof Wolicki Der Teufel 14bf20daeb autodoc: anonymous struct type indentation fix 2023-02-10 14:32:45 +01:00
Krzysztof Wolicki Der Teufel 02bc6356d7 autodoc: main.js cleanup and formatting 2023-02-10 14:32:45 +01:00
Loris Cro 4c7f8286d5 autodoc: fix search regression 2023-02-03 18:05:07 +01:00