Commit Graph

6563 Commits

Author SHA1 Message Date
Qi Xiao
0557e2a3be pkg/eval/evaltests: Make APIs of special matchers functions. 2023-05-08 23:27:53 +01:00
Qi Xiao
cf41f7a01c New "os" module.
This addresses #1659.
2023-05-08 22:40:02 +01:00
Qi Xiao
e8696a5de9 pkg/mods/unix: Clean up some comments and a build tag. 2023-05-08 21:43:07 +01:00
EmilySeville7cfg
96eee86353 feat(snippets): add basic snippets 2023-05-08 15:21:52 +10:00
Qi Xiao
75ee4d0179 pkg/eval: Increase the base sleep time in peach's unit test to 2ms.
The previous value of 1ms caused some false positive on Cirrus's Linux ARM64 runner.
2023-05-07 22:38:22 +01:00
Qi Xiao
ae087dc1e4 pkg/eval: Don't use the new context.Cause API.
Elvish should still be buildable with Go 1.19.
2023-05-07 22:37:08 +01:00
Qi Xiao
f54fe608e8 Clean up some code from adding Context to Frame. 2023-05-07 21:49:27 +01:00
Qi Xiao
da576e221c pkg/eval: Use a Context inside Frame to pass interrupts. 2023-05-07 21:44:28 +01:00
Qi Xiao
6ecc2b306c Fixup for #1691. 2023-05-06 23:55:34 +01:00
Qi Xiao
c0add35e50
Merge pull request #1691 from krader1961/issue-648-peach-num-worker
Add a `&num-workers` option to `peach`
2023-05-01 22:26:01 +01:00
Qi Xiao
1f0d1c8251
Merge branch 'num-workers' into issue-648-peach-num-worker 2023-05-01 22:25:24 +01:00
Qi Xiao
de8e5f2fd6 website: Make the content div have "content" as a class instead of id.
"#content" has a very high specificity and makes it harder to override.

This fixes the override of the <h2> in demo descriptions in the homepage.
2023-05-01 01:01:18 +01:00
Qi Xiao
dad9269af5 website: Properly remove left border of <h1> on home page. 2023-04-29 17:00:29 +01:00
Qi Xiao
ba8614bab3 website: Overhaul styling.
Also rewrite some texts to fit within the now narrower body.
2023-04-29 16:55:10 +01:00
Qi Xiao
c0d5b015d0 website: Reduce the width of ttyshots.
This is to prepare for a stylesheet overhaul that will reduce the width of the
body text.

Also change home/pipelines.elvts to use XKCD instead, which is a bit more
interesting than GitHub and makes for a shorter URL.
2023-04-24 21:34:05 +01:00
Qi Xiao
25a1a7be28 0.20.0 release notes: Document the new LSP hover support. 2023-04-23 00:43:54 +01:00
rsteube
eff34bff12 Implement str:fields 2023-04-23 00:43:02 +01:00
Qi Xiao
27f34b8044 pkg/lsp: Return doc when hovering on the first character of a symbol. 2023-04-23 00:27:41 +01:00
Qi Xiao
6c5d24ad81 Switch to pkg.nimblebun.works/go-lsp for LSP types. 2023-04-23 00:19:26 +01:00
Qi Xiao
1974b30eb6 pkg/lsp: Store parse results synchronously; add tests for hover. 2023-04-23 00:01:32 +01:00
Qi Xiao
bb13140c5b pkg/lsp: Use pkg/parse/np to find the symbol to look up doc for.
Command docs now only show up at command position.

Also look up variable docs.

Remove the now unused parseutil.LeafNodeAtPos.
2023-04-22 22:35:54 +01:00
Qi Xiao
70d77ce849 Move pkg/edit/complete/node_path.go into new package pkg/parse/np. 2023-04-22 22:25:01 +01:00
Qi Xiao
278cce6ff7 pkg/lsp: Fix display of code blocks in on-hover docs.
As can be seen in the screenshot in
https://github.com/elves/elvish/pull/1684#issuecomment-1493016037, the on-hover
doc shows "```elvish" for the code block that contains the usage of the command,
which shouldn't appear in the rendered Markdown.

This is because the response uses the deprecated MarkedString format, where

> The pair of a language and a value is an equivalent to markdown:
> ```${language}
> ${value}
> ```

When this format is used, the "```elvish" code block is embedded inside another
"```markdown" codeblock, which leads to this weird rendering artifact.

Switching to the new MarkupContent format fixes this issue. However, the
github.com/sourcegraph/go-lsp is outdated and doesn't have this type defined, so
define it ourselves for now. In future we should switch to a more up-to-date Go
package that contains the LSP types.

Also remove the superfluous MarkdownShowMaybe function, and just export
doc.Source. The former did nothing useful other than prepending "# symbol". I
tested the on-hover docs of both Go and JavaScript in VS Code, both start with
the declaration of the symbol, not a heading.
2023-04-22 21:28:21 +01:00
Sidharth Kshatriya
e7a591cc6a lsp: provide doc:show in hover, if available 2023-04-22 20:53:39 +01:00
Kurtis Rader
91c819d5d8 Add a &num-workers option to peach
Resolves #648
2023-04-16 20:34:55 -07:00
Qi Xiao
66a4c590eb Explicitly declare all external commands used in epm.elv. 2023-04-16 11:58:13 +01:00
Kurtis Rader
3dad55a252 Remove some external command dependencies
The `epm` module depends unnecessarily on several external commands;
e.g., `cat` and `test`.  Remove those dependencies. It also has a bug in
its `-first-upper` function due to using the obsolete colon slice index
syntax rather than the double period (`..`) syntax. Replace that
function with the `str:title` builtin.

Related: 1661
2023-04-16 11:54:12 +01:00
Sidharth Kshatriya
e9628bfc47 doc: small fix in lang spec 6.10. Order of evaluation 2023-04-10 23:24:40 +01:00
Qi Xiao
bda2879228 pkg/glob: When enumerating files, keep going if Lstat fails.
When encountering files that can't be lstat'ed, simply ignore them instead of
terminating the entire globbing process. This is consistent with how directories
that can't be read are already silently ignored.

This fixes #1674.
2023-04-10 23:22:21 +01:00
Qi Xiao
5f0eebab1f website/ref/str.md: Note that some string utilities are in the builtin module. 2023-03-31 13:28:50 +01:00
Qi Xiao
89bf04a802 pkg/eval: Construct ui.Text using the functions from the ui package.
This fixes #1668, because the crashing listbox rendering code uses "len(line) >
0" (where line is a ui.Text) to test whether it is non-empty. This test doesn't
work with the ui.Text constructed using "styled ''", which creates a ui.Text
with one empty segment.

The functions from the ui package are guaranteed to never return such ui.Text
instances, so switching the implementation of the styled builtin to functions
from the ui package fixes this.
2023-03-14 21:47:38 +00:00
Qi Xiao
be04173825 Bump Go to 1.20.2 in CI. 2023-03-12 22:43:12 +00:00
Qi Xiao
33cca983f1 pkg/sys/ewindows: Regenerate ztyles_windows.go.
Also remove types_src_windows.go; it contains the same content as
types.go.
2023-03-12 22:06:52 +00:00
Kurtis Rader
34bd94dcd6 Remove obsolete build constraints 2023-03-12 21:58:18 +00:00
Qi Xiao
2a4740a523 pkg/sys/eunix: Simplify build constraints for the termiosFlag definition. 2023-03-11 20:08:56 +00:00
Kurtis Rader
2dc067dcb3 Fix some Go build/lint/test constraints 2023-03-11 19:58:54 +00:00
Qi Xiao
f86b32c22e Add an example for flag:call. 2023-03-11 00:37:52 +00:00
Qi Xiao
059a84905f pkg/edit/highlight: Highlight arguments to "del". 2023-03-10 10:11:44 +00:00
Qi Xiao
1a65886e68 Make vscode/LICENSE a copy of LICENSE.
Symlinks won't work well on Windows.

This fixes #1667.
2023-03-08 00:26:05 +00:00
Qi Xiao
2f8b0f7e75 LICENSE: Capitalize "Elvish" and fix punctuation.
This change is purely cosmetic and does not impact how Elvish's source code is licensed.
2023-03-08 00:25:19 +00:00
Qi Xiao
360102f083 Advertise 0.19.2 as the "true" 0.19.x release. /facepalm 2023-03-05 16:15:27 +00:00
Qi Xiao
37f8c47684 Update VersionBase to 0.20.0.
The master branch is now considered to be dev versions of 0.20.0.
2023-03-05 16:10:58 +00:00
Qi Xiao
7b1147a84e Publish release notes for 0.19.1.
The 0.19.0 version was tagged by mistake but has already been picked up by some
package managers. To avoid disrupting them, skip this version number and use
0.19.1.
2023-03-05 01:10:40 +00:00
Qi Xiao
0adf0ec147 Use the unix build tag.
The unix build tag is supported by Go 1.19.
2023-03-03 00:01:26 +00:00
Qi Xiao
4b67567b4e Bump required Go version to 1.19, and binaries builders to 1.20.1. 2023-03-03 00:01:26 +00:00
Qi Xiao
66c491dbc5 pkg/mods/unix: Change table to bullet list in doc.
The pkg/md-based Markdown renderer doesn't support tables, which is itself not a
standard feature of CommonMark.
2023-03-03 00:01:26 +00:00
Qi Xiao
4187d41da4 pkg/cli: Notify about unbound keys.
This gives the user some useful feedback that a key was received but not bound.

The feature was present in the original implementation of the line editor but
was lost during the rewrite.
2023-03-03 00:01:26 +00:00
Qi Xiao
2493659fbb .cirrus.yml: Bump NetBSD to 9.3. 2023-03-02 00:32:45 +00:00
Qi Xiao
5c835b1c5f vscode: Fix package.json. 2023-03-01 22:41:28 +00:00
Qi Xiao
dede073b31 Use .elvts as the standard extension of Elvish transcripts.
Rename the existing ttyshot instruction files to use the new extension too.
2023-03-01 22:39:06 +00:00