The Name field now contains the qualified name, with the "$" prefix for variables.
The Content field no longer contains the usage text for functions. That is now
stored in a separate Fn field, and the FullContent method now returns what used
to be the Content field.
- evaltest.TestTranscriptsInFS runs transcripts in .elv and .elvts files as
tests.
- Extend the syntax of Elvish transcripts with headings and comments; the former
is used to split a single .elvts file into multiple sessions.
The pattern "if err := ...; err != nil" is popular in certain Go projects as it
saves one line of code, but Elvish's codebase only uses the init clause in an if
statement when the init clause is used to calculate something that's only used
in the condition or the if body. In this case addFlag has side effects that's
relevant outside the if block, so shouldn't be put in the init clause.
Remove the `epm` dependency on `rm` with `os:remove-all` so it is slightly
easier to use the `epm` command on Windows.
There aren't any unit tests for this but I verified it worked by running
the following statements on my macOS and Windows systems:
epm:install github.com/doubleagent/rivendell
epm:uninstall github.com/doubleagent/rivendell
Related #1661
*Exception.Show used to work differently when the traceback contains one frame
vs more frames. Harmonize how they work, and consistent with how parse errors
and compilation errors are shown.
The former is unused, and the latter is only used from pkg/edit/config_api.go.
Subsume the logic into ShowError, and use that from pkg/edit/config_api.go.
- Change Context to export all its fields.
- Include end position in Context, and include it in Show.
- Remove the Type field from Error, and express it using an ErrorTag type
parameter instead.
- Make {Pack Unpack}CognateErrors type-safe with the new ErrorTag mechanism, and
rename them to just {Pack Unpack}Errors.
- Use reflection to derive function name.
- Take test cases as variadic arguments, instead of requiring them to be wrapped
in a Table.
- Support naming test cases.
- Run test cases as subtests with t.Run.
We now assume that the directory name under pkg/mods match exactly with the
Elvish module name in several places, and this mismatch broke website building.
Go allows dashes in directory names; it just forbids them in the package name
and there's actually no requirement that the directory name and the package name
be the same.
This command used to depend on pkg/mods/doc to access the embedded .elv, which
in turn depends on all the packages that implement builtin modules. The latter
set of packages depends on almost all the Elvish packages transitively. As a
result, almost any change in any Elvish package will trigger a rebuild of this
command and the whole website.
This commit minimizes the dependency on Elvish packages by having it read the
.elv files during runtime instead (enabled by
9112eb1ab2).
Additionally:
- Move HighlightCodeBlock, needed by website/cmd/md2html, from pkg/mods/doc
to pkg/elvdoc. Moving it is necessary to completely remove the dependency of
website/cmd/md2html on pkg/mods/doc.
- Remove the dependency of pkg/edit/highlight on pkg/eval. It only uses
eval.UnpackCompilationErrors; move this work to the supplied Check function.
This removes the transitive dependency of website/cmd/md2html on pkg/eval.
- Augment website/tools/md-deps to recognize @module lines and add dependency on
the corresponding .elv files.
This syntax has been documented to have an implicit destination of
builtin.html#foo, but it never worked correctly outside builtin.html itself.
Also do some minor cleanups of the package, including removing bogus package
godocs that were inherited from the previous version where the components were
separate programs.
Instead of having each individual module embed their .elv files and collect all
of them in pkg/mods/doc, have a single embed.FS at pkg that includes everything,
and use that pkg/mods/doc.
Implement a function that extracts all module elvdocs, and put it in pkg/elvdoc.