Commit Graph

5899 Commits

Author SHA1 Message Date
Qi Xiao
35e236aee7 pkg/shell: Add more scripting tests. 2022-06-19 22:45:24 +01:00
Qi Xiao
6a1e7b3996 pkg/shell: Add more daemon-related tests.
Also:

- Remove duplicate code for closing daemon client.

- Avoid using (*testing.T).TempDir - it uses test name in the path, which can
  exceed the limit of the address when calling bind(2):
  https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html#tag_13_6
7_04
2022-06-19 21:45:36 +01:00
Qi Xiao
e06bf69a74 pkg/shell: Add tests for DB path. 2022-06-19 20:29:50 +01:00
Qi Xiao
78d914b24b pkg/shell: Run TestInteract_ConnectsToDaemon on Windows too.
This test now succeeds on Windows too, now that the daemon also uses Unix
sockets on Windows.
2022-06-19 19:08:11 +01:00
Qi Xiao
a3cc6a44f0 pkg/daemon: Fix a comment. 2022-06-19 19:06:24 +01:00
Qi Xiao
3d0196b7d3 pkg/shell: De-export makeEvaler and incSHLVL.
Change the test cases against InvSHLVL to test the behavior of the Program
instead.
2022-06-19 15:43:23 +01:00
Qi Xiao
6cb2fd3855 Treat $XDG_DATA_DIRS as semicolon-delimited on Windows. 2022-06-19 14:41:25 +01:00
Qi Xiao
2506b578b9 pkg/shell: Test against XDG environment variables.
Also fix how $XDG_DATA_DIRS is handled.
2022-06-19 14:30:37 +01:00
Qi Xiao
75ee261fcb pkg/eval: Remove access methods for exported fields.
The exported fields are intended to be mutated directly.
2022-06-18 19:01:59 +01:00
Qi Xiao
d48b6f1843 pkg/eval/vals: Replace MakeListFromStrings with a generic MakeListSlice. 2022-06-17 16:50:38 +01:00
Qi Xiao
01756ef57a pkg/daemon: Ignore error when closing connections on shutdown.
The logs are not useful anyway since the reason is invariably that the client
has already closed the connection.

Moreover, timing in the shutdown sequence causes fluctuation in test coverage;
removing this log eliminates the fluctuation.
2022-06-14 21:01:50 +01:00
Qi Xiao
4a6405eeb4 pkg/edit/complete: Improve analysis of variable definitions.
- Remove the sigil from the variable name.

- Recognize function parameters too.
2022-06-14 20:50:57 +01:00
Qi Xiao
be94301004 Symlink vscode/elvish.tmLanguage.json -> syntaxes/elvish.tmLanguage.json. 2022-06-13 23:45:20 +01:00
Qi Xiao
e0ee14ad68 Support completing variables defined in the code being completed. 2022-06-13 23:00:06 +01:00
Qi Xiao
534be70bfb Simplify implementation of variable completion.
There is no need to enumerate namespaces separately, since namespaces are also
variables. The only exceptions are "e:" and "E:", which are handled as special
cases now.
2022-06-13 22:50:44 +01:00
Qi Xiao
6564b14898 Fix crash when completing code with unexpected rune.
This fixes #1530.
2022-06-12 21:39:51 +01:00
Qi Xiao
f3ea882bd2 Warn about files in ~/.elvish instead of the directory itself. 2022-06-12 14:21:57 +01:00
Qi Xiao
14ad776bf4 vscode: Fix syntax highlighting; bump to 0.1.1.
- Don't match "set" within e.g. "set-env".

- Fix the right-hand boundary of keywords such as "except".
2022-06-12 01:23:59 +01:00
Qi Xiao
ae9e6d1565 Fixup for #1531.
- Fix the handling of actual occurrences of U+FFFD.

- Fix an existing bug of QuoteVariableName("$\n").
2022-06-11 21:26:32 +01:00
Kurtis Rader
d0f6858b95 Correctly encode strings with invalid UTF-8
In addition to fixing the encoding bugs standardize on \xNN notation for
bytes rather than \uNNNN; e.g., \x00 rather than \u0000.

Also, update the documentation for double-quoted strings to include the
\e sequence.

Fixes #1528
2022-06-11 20:42:06 +01:00
Qi Xiao
49115dba1d Respect $XDG_* directories on Windows.
This fixes #1481.
2022-06-09 22:48:39 +01:00
Qi Xiao
cb8628bcb6 Print a warning if ~/.elvish exists as a directory.
This addresses #1554.
2022-06-07 23:35:13 +01:00
Qi Xiao
68bce3b4a4 Clarify error message when writing values to port not supporting it.
This fixes #1516.
2022-06-07 20:29:34 +01:00
Qi Xiao
3b2ddaa854 website/get: Remove unreachable Fedora repo.
This fixes #1526.
2022-06-07 20:23:20 +01:00
Qi Xiao
f42c2dda61 Make init value of $f~ actually identical to $nop~.
This fixes #1519.
2022-06-07 20:20:00 +01:00
Qi Xiao
bfd555808f Document that none of (), if and while introduce new scopes.
This addresses #1496.
2022-06-07 00:28:39 +01:00
Qi Xiao
5bf0290741 pkg/cli/term: Support surrogate pairs on Windows.
This fixes #1502.
2022-06-06 23:12:54 +01:00
Qi Xiao
bd3197627a Update vscode/package-lock.json. 2022-06-05 22:46:55 +01:00
Qi Xiao
2c30cf9806 Fix staticcheck errors on Windows. 2022-06-05 22:46:24 +01:00
Qi Xiao
a91935ee93 Document fix of #1448 in 0.19.0 release notes. 2022-06-05 22:39:48 +01:00
Qi Xiao
f043bd33fb Fixup for #1549. 2022-06-05 22:37:52 +01:00
Kurtis Rader
fa704d6ac6 Implement edit:command-abbr
It turns out that the "small word" abbreviation mechanism I added isn't
really what I, or most users, want. What users really want, at least
most of the time, is the Fish shell abbreviation behavior of expanding
an abbreviation only in the command head position.

Resolves #1472
2022-06-05 22:15:07 +01:00
Qi Xiao
8b0c7fdb36 Fix some lint warnings found on Windows. 2022-06-05 22:01:16 +01:00
Qi Xiao
d4dd11a981 pkg/eval/vars: Deexport EnvVariable, use Unset/IsSet via interface 2022-06-05 21:47:51 +01:00
Qi Xiao
26a66284a9 Fixup for #1551. 2022-06-05 16:01:10 +01:00
Tw
d27610b3e4 Fix undefined temporary environment restoring issue
Close #1536

Signed-off-by: Tw <tw19881113@gmail.com>
2022-06-05 15:41:19 +01:00
Qi Xiao
775081b8cc Add tools/pre-push, intended to be used as a Git hook. 2022-06-05 12:44:54 +01:00
Qi Xiao
b24421170a Add VS Code extension. 2022-06-05 12:19:18 +01:00
Qi Xiao
e43968569b More wording changes for the doc for the E: namespace. 2022-06-04 23:52:57 +01:00
Kurtis Rader
aefbe22f94 Improve $E:... documentation
Recent discussions around the fix for b.elv.sh/1448 caused me to notice
that the documentation for $E:... expansion does not explicitly explain
the current behavior. This addresses that shortcoming.
2022-06-04 23:45:28 +01:00
Kurtis Rader
ee309bf1c6 Don't dot import pkg/parse
Qualified imports of pkg/parse outnumber unqualified (66 to 1). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00
Kurtis Rader
345c5c66dd Don't dot import pkg/ui
Qualified imports of pkg/ui outnumber unqualified (82 to 1). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00
Kurtis Rader
71cd3835bc Don't dot import pkg/tt
Qualified imports of pkg/tt outnumber unqualified (27 to 24). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00
Kurtis Rader
f681a73a1d Don't dot import pkg/testutil
Qualified imports of pkg/testutil outnumber unqualified (55 to 7). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00
Qi Xiao
3a4e7ce1fe pkg/lsp: Populate completionProvider capability.
Needed for conforming clients to start requesting autocompletion.
2022-06-03 20:30:46 +01:00
Kurtis Rader
14321f9e82 Make parse.Source naming more consistent
Fixes #1545
2022-05-29 17:36:29 +01:00
D Anzorge
a24977de39 README: Fix Matrix link 2022-05-22 20:42:49 +01:00
Kurtis Rader
6d8b02456a Remove verbiage that is no longer relevant
Fixes #1517
2022-05-22 20:38:45 +01:00
Kurtis Rader
7bae8f2df7 Correctly handle [..=-1] list indexing
Fixes #1518
2022-05-22 20:38:16 +01:00
Qi Xiao
a57275564b Document relationship between *-env commands and E: namespace. 2022-05-22 20:13:17 +01:00