Commit Graph

18 Commits

Author SHA1 Message Date
Qi Xiao
a3f4384495 Move all elvdocs into .d.elv files.
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.

Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
2022-11-20 21:59:45 +00:00
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
84b72af4ca Support using styled text in &display to edit:complex-candidate.
This fixes #1011.
2022-01-03 20:30:00 +00:00
Qi Xiao
5bf688cf4d New flag module. 2021-12-31 18:03:24 +00:00
Qi Xiao
e01e5dd2f5 pkg/getopt: Revamp the API and implementation.
- Don't require creating a Getopt object in the API.

- Add a new Parse function, and rename the existing method to Complete.

- Add an Unknown field to Option to indicate unknown options.

- Rewrite the tests.

- Numerous stylistic changes.
2021-12-31 14:36:01 +00:00
Qi Xiao
71e5bff8da Replace direct reference to persistent types with their aliases in eval/vals. 2021-12-17 00:21:20 +00:00
Kurtis Rader
d4b4edbbbe Replace legacy lambda with new lambda examples
I was surprised to see so many legacy lambda syntax examples in the
documentation. This replaces all of them with the new syntax -- excluding
the handful of cases meant to explicitly verify the legacy form is still
valid. This also adds a link to the issue in the release notes which
documents the change in syntax.

Related #664
2021-11-28 21:30:59 +00:00
Qi Xiao
23ed9a8baa pkg/edit: Improve coverage of complete_getopt.go. 2021-09-08 00:21:11 +01:00
Kurtis Rader
85c499f110 Lint cleanups
This change addresses issues reported by the `staticcheck` tool and a
couple reported by the `golint` tool. It also adds missing issue links
to a couple of entries in the release notes. This change deliberately
does not address these warnings since it is unclear whether the project
owner would prefer to suppress or address them:

    pkg/store/cmd.go:8:2: should not use dot imports (ST1001)
    pkg/store/db_store.go:10:2: should not use dot imports (ST1001)
    pkg/store/dir.go:8:2: should not use dot imports (ST1001)
2021-07-07 23:21:02 +01:00
Qi Xiao
20274d3245 pkg/edit: Test edit builtins bubble output errors.
Two different strategies are used:

- For commands that don't actually depend on the editor (but happens to live
  inside the edit: module), their tests are changed to use the evaltest
  framework.

- For commands that do depend on the editor, a new helper
  testThatOutputErrorIsBubbled is used to test them.

Also fix a bug where edit:complete-getopt does not correctly bubble the
exception thrown from callbacks, and where matchers do not bubble output errors.
2021-06-24 22:46:49 +01:00
Qi Xiao
657b73122f Change all builtin commands writing value output to surface ReaderGone.
Also replace (*Frame).OutputChan with (*Frame).ValueOutput, which returns a
small interface for writing to the value output that is also aware when the
reader is gone.
2021-06-18 00:14:59 +01:00
Qi Xiao
91b6f6dd72 Use the integrated persistent package. 2021-05-03 22:17:46 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Kurtis Rader
28798ac053 Convert "XXX" to "TODO" comments
I stumbled across a comment that began with "XXX". It was clearly meant as
a "TODO" comment. This changes all such occurrences. However, a few "XXX"
comments are ambiguous and a better prefix might be "WARNING". The "TODO"
prefix at least ensures someone, eventually, looks into the situation
and either rewords the comment or fixes the problem. This change means
everyone can assume searching for "// TODO" will find all such comments
rather than requiring they also know to search for "// XXX".
2020-08-16 16:29:34 +01:00
Qi Xiao
e28ba5d6cd Remove support for &display-suffix in edit:complex-candidate. 2020-08-16 16:21:29 +01:00
Qi Xiao
af6b523e02 pkg/eval: Remove Frame.{eval,Call}. 2020-04-09 21:01:14 +01:00
Qi Xiao
f63eaf8e7e pkg/edit: Support &display to edit:complex-candidate.
The &display-suffix command is still supported but will be deprecated once #898
is fixed.
2020-01-17 08:05:10 -05:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00