Commit Graph

1403 Commits

Author SHA1 Message Date
Conrad Irwin
d17d38fe70
vim: Command (#2951)
Release Notes:

- vim: Add v1 of command mode
([#279](https://github.com/zed-industries/community/issues/279)). The
goal was to cover 90% of what most people actually do, but it is very
incomplete. Known omissions are that ranges cannot be specified (except
that `:%s//` must always specify the % range), commands cannot take
arguments (you can `:w` but not `:w [file]`), and there is no history.
Please file feature requests on
https://github.com/zed-industries/community as you notice things that
could be better.
- `:` triggers zed's command palette. If you type a known vim command it
will run it, otherwise you get zed's normal fuzzy search. For this
release supported commands are limited to:
- - `:w[rite][!]`, `:wq[!]`, `:q[uit][!]`, `:wa[ll][!]`, `:wqa[ll][!]`,
`:qa[ll][!]`, `:[e]x[it][!]`, `:up[date]` to save/close tab(s) and
pane(s).
- - `:cq` to quit completely.
- - `:vs[plit]`, `:sp[lit]` to split vertically/horizontally
- - `:new`, `:vne[w]` to create a new file in a new pane above or to the
left
- - `:tabedit`, `:tabnew` to create a new file in a new tab.
- - `:tabn[ext]`, `:tabp[rev]` to go to previous/next tabs
- - `:tabc[lose]` to close tabs
- - `:cn[ext]`, `:cp[rev]`, `:ln[ext]`, `:lp[rev]` to go to the
next/prev diagnostics.
- - `:cc`, `:ll` to open the errors page
- - `:<number>` to jump to a line number.
- - `:$` to jump to end of file
- - `:%s/foo/bar/` (note that /g is always implied, the range must
always be %, and zed uses different regex syntax to vim)
- - `:/foo` and `:?foo` to jump to next/prev line matching foo
- - `:j[oin]`, to join the current line (no range is yet supported)
- - `:d[elete][l][p]`, to delete the current line (no range is yet
supported)
- - `:s[ort] [i]` to sort the current selection (case-insensitively)
- vim: Add `ctrl-w o` (closes everything except the current item) and
`ctrl-w n` (creates a new file in the pane above).
([#1884](https://github.com/zed-industries/community/issues/1884))
- all: Add a "Discard" option to prompt when saving a file with
conflicts (previously this only appeared on close, not on save).

Internal changes:
- The Picker will now wait for pending queries before confirming (to
handle people typing `: w enter` rapidly.
- workspace::save_item and Pane::save_item are now merged together, and
the behavior controlled by `workspace::SaveIntent`.
- Many actions related to closing/saving items now take an optional
`SaveIntent`.
-
2023-09-25 14:07:22 -05:00
Mikayla Maki
591ec02cea
Add support for the experimental Next LS for Elixir (#3024)
This is a PR I built for a friend of a friend at StrangeLoop, who is
making a much better LSP for elixir that elixir folks want to experiment
with. This PR also improves the our debug log viewer to handle LSP
restarts.

TODO:
- [ ] Make sure NextLS binary loading works.

Release Notes:

- Added support for the experimental Next LS for Elxir, to enable it add
the following field to your settings to enable:

```json
"elixir": {
    "next": "on"
}
```
2023-09-25 12:52:56 -05:00
Mikayla
c2fca054ae
Fix compile and test errors 2023-09-25 10:46:09 -07:00
Conrad Irwin
769c330b3d Merge branch 'vim-command' 2023-09-25 11:41:13 -06:00
Mikayla
ad7c1f3c81
Download next-ls automatically from github 2023-09-25 10:40:20 -07:00
Mikayla
8b63e45f0b
Implement LSP adapter methods for syntax highlighting 2023-09-24 05:08:05 -07:00
Mikayla
052cb459a6
Improve lsp log viewer's behavior in the presence of LSP restarts
Improve settings interface to local LSP
2023-09-24 04:59:55 -07:00
KCaverly
48e151495f introduce ai crate with completion providers 2023-09-21 22:44:56 -04:00
KCaverly
5f6334696a rename ai crate to assistant crate 2023-09-21 21:54:59 -04:00
Mikayla
02a85b1252
Add local next LSP adapter 2023-09-21 18:09:02 -07:00
Conrad Irwin
32f8733313 Code review changes 2023-09-20 21:29:45 -06:00
Conrad Irwin
7a7ff4bb96 Fix save related tests, and refactor saves again 2023-09-20 20:44:42 -06:00
Conrad Irwin
2d9db0fed1 Flesh out v1.0 of vim : 2023-09-20 20:44:41 -06:00
Conrad Irwin
ea3a1745f5 Add vim-specific interactions to command
This mostly adds the commonly requested set (:wq and friends) and
a few that I use frequently
:<line> to go to a line number
:vsp / :sp to create a split
:cn / :cp to go to diagnostics
2023-09-20 20:44:26 -06:00
Joseph T. Lyons
a86dc942d6 v0.106.x dev 2023-09-20 13:02:13 -04:00
Mikayla
0cceb3fdf1
Get nextLS running 2023-09-20 06:55:24 -07:00
Kirill Bulatov
5b0b2fe50b Add a specific server id to a Copilot LSP 2023-09-19 12:32:05 +03:00
Max Brunsfeld
099969ed79 Ensure the chat panel is fully feature flagged 2023-09-15 10:13:43 -07:00
Max Brunsfeld
9d8c6a7ed1 Merge branch 'main' into chat-again 2023-09-14 14:50:45 -07:00
Joseph T. Lyons
a6cb5f99f3 v0.105.x dev 2023-09-13 12:22:33 -04:00
Nathan Sobo
fe6f0a253b Merge remote-tracking branch 'origin/main' into chat-again 2023-09-11 12:08:01 -06:00
Mikayla
2be34ef254
Add syntax highlighting for nu scripts 2023-09-09 15:39:39 -07:00
Mikayla
ef03e206d6
WIP: Add nushell support 2023-09-09 14:01:53 -07:00
Conrad Irwin
4c92172cca Partially roll back refactoring 2023-09-08 16:49:50 -06:00
Conrad Irwin
ba1c350dad vim: Add ZZ and ZQ
The major change here is a refactoring to allow controling the save
behaviour when closing items, which is pre-work needed for vim command
palette.

For zed-industries/community#1868
2023-09-08 16:25:20 -06:00
Max Brunsfeld
ddda5a559b Restore chat functionality with a very rough UI 2023-09-08 09:59:35 -07:00
Julia
74ccb3df63 Fix Python's cached binary retrieval being borked
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-09-08 12:09:31 -04:00
Julia
1969a12a0b Include JS template literal as string type for overrides 2023-09-07 10:55:04 -04:00
Joseph T. Lyons
15609b4803 v0.104.x dev 2023-09-06 12:53:50 -04:00
Julia
8d672f5d4c Remove NodeRuntime static & add fake implementation for tests 2023-09-06 11:18:55 -04:00
Kirill Bulatov
ddc6214216
Tailwind autocomplete (#2920)
Release Notes:
- Added basic Tailwind CSS autocomplete support
([#746](https://github.com/zed-industries/community/issues/746)).
2023-08-31 16:55:46 +03:00
Kirill Bulatov
5731ef51cd Fix plugin LSP adapter intefrace 2023-08-31 15:32:24 +03:00
Kirill Bulatov
9e12df43d0 Post-rebase fixes 2023-08-31 11:53:46 +03:00
Julia
ff3865a4ad Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04:00
Julia
529adb95a1 Scope Tailwind in JS/TS to within string
In some situations outside JSX elements Tailwind will never
respond to a completion request, holding up the tsserver completions.

Only submit the request to Tailwind when we wouldn't get tsserver
completions anyway and don't submit to Tailwind when we know we won't
get Tailwind completions

Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
2023-08-30 21:14:39 -04:00
Kirill Bulatov
0f619e0b67 Do not write TRACE logs into file for Lua 2023-08-31 01:14:37 +03:00
Joseph T. Lyons
7204c245ea v0.103.x dev 2023-08-30 13:41:09 -04:00
Antonio Scandurra
ea17d1638e
Introduce code generation (#2901)
![CleanShot 2023-08-28 at 12 24
36@2x](https://github.com/zed-industries/zed/assets/482957/f97cb399-1ac2-4fa9-94a7-137d1eec711c)


Release Notes:

- Added a new "Inline Assist" feature that lets you transform a
selection or generate new code at the cursor location by hitting
`ctrl-enter`.
2023-08-30 14:58:22 +02:00
Max Brunsfeld
7ae5ee699f
Debounce code action and document highlight requests (#2905)
Lately, I've been finding Rust-analyzer unusably slow when editing large
files (like `editor_tests.rs`, or `integration_tests.rs`). When I
profile the Rust-analyzer process, I see that it sometimes saturates up
to 10 cores processing a queue of code actions requests.

Additionally, sometimes when collaborating on large files like these, we
see long delays in propagating buffer operations. I'm still not sure why
this is happening, but whenever I look at the server logs in Datadog, I
see that there are remote `CodeActions` and `DocumentHighlights`
messages being processed that take upwards of 30 seconds. I think what
may be happening is that many such requests are resolving at once, and
the responses are taking up too much of the host's bandwidth.

I think that both of these problems are caused by us sending way too
many code action and document highlight requests to rust-analyzer. This
PR adds a simple debounce between changing selections and making these
requests.

From my local testing, this debounce makes Rust-analyzer *much* more
responsive when moving the cursor around a large file like
`editor_tests.rs`.
2023-08-29 09:30:36 -07:00
Nathan Sobo
84b9c22170 Merge branch 'main' into ai-refactoring 2023-08-29 10:17:01 -06:00
Piotr Osiewicz
ea0e5e880e
chore: Use IsTerminal trait instead of relying on libc to detect stdout being a terminal (#2908)
IsTerminal was added in 1.70.

Release Notes:
- N/A
2023-08-29 15:56:50 +02:00
Max Brunsfeld
791f6cf9e7 Update some tests to reflect code action debouncing 2023-08-28 17:45:32 -07:00
Julia
35b7787e02 Add Tailwind server to TSX 2023-08-28 15:19:16 -04:00
Julia
ded6decb29 Initial unstyled language server short name in completions
Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
2023-08-28 11:27:45 -04:00
Antonio Scandurra
44f554f489 Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-28 12:16:24 +02:00
Antonio Scandurra
1fb7ce0f4a Show icon to toggle inline assist 2023-08-28 12:13:44 +02:00
Piotr Osiewicz
07b9c6c302
language: Make Buffer::new take an explicit ID (#2900)
See Linear description for the full explanation of the issue. This PR is
mostly a mechanical change, except for the one case where we do pass in
an explicit `next_id` instead of `model_id` in project.rs.

Release Notes:
- Fixed a bug where some results were not reported in project search in
presence of unnamed buffers.
2023-08-28 11:51:50 +02:00
Mikayla
74565ed0b8
Add feature flags handling to the client, rewrite staff mode to a trait extension style 2023-08-25 17:00:53 -07:00
Julia
fc457d45f5 Add word_characters to language overrides & use for more things
Use word_characters to feed completion trigger characters as well and
also recognize kebab as a potential sub-word splitter. This is fine for
non-kebab-case languages because we'd only ever attempt to split a word
with a kebab in it in language scopes which are kebab-cased

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-08-25 18:46:30 -04:00
Max Brunsfeld
404f76739c Format let-else statements 2023-08-25 10:11:32 -07:00