Commit Graph

298 Commits

Author SHA1 Message Date
Marshall Bowers
c9ac7b8e35
assistant: Remove unused NowPlaceholder (#13713)
This PR removes the `NowPlaceholder` component, as it was no longer
used.

Release Notes:

- N/A
2024-07-01 15:33:47 -04:00
Bennet Bo Fenner
e243856559
Add terminal inline assistant (#13638)
Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-07-01 20:53:56 +02:00
Gilles Peiffer
065ab93ca7
Use user-defined font weight, where appropriate (#13653)
Release Notes:

- N/A
2024-07-01 09:45:01 -04:00
Kirill Bulatov
7d767ff0a3
Use a human-readable date format for the now command's label (#13632)
Before:

![image](https://github.com/zed-industries/zed/assets/2690773/063887fb-1a28-4922-afd1-b2dc4117a03d)

After:
<img width="435" alt="Screenshot 2024-06-28 at 18 52 08"
src="https://github.com/zed-industries/zed/assets/2690773/8e9fd285-1991-4088-a93a-5ea3259d364a">
<img width="480" alt="Screenshot 2024-06-28 at 18 52 10"
src="https://github.com/zed-industries/zed/assets/2690773/7853fc90-6a63-4e66-bb83-2ed37d41b1b9">


Release Notes:

- N/A
2024-06-28 18:57:29 +03:00
Kirill Bulatov
00d1561156
Use better names for prompts duplicated (#13630)
Repeats project panel duplicated file name logic for prompts:
* add a ` copy` suffix
* if conflicts still, add a ` i` digit suffix, where `i` is the first
number available starting from 1

Release Notes:

- N/A
2024-06-28 10:26:45 +03:00
Nathan Sobo
61bbb3539a
Fix a stupid bug that was dropping system prompts for Claude (#13626)
Release Notes:

- Fixed a bug that was causing system prompts to be dropped for
Anthropic models.

@JosephTLyons @notpeter We probably need to hot-fix this as I'm pretty
sure this affects the regular anthropic provider in addition to just the
feature-flagged cloud stuff. Wouldn't mind confirming that first so we
can communicate around it. 😬
2024-06-27 22:08:47 -06:00
Nate Butler
0b57df5deb
Extract title_bar crate (#13597)
This PR extracts a singular title bar (`title_bar::TitleBar`) from
`ui::TitleBar` and
`collab_ui::collab_titlebar_item::CollabTitlebarItem`.

This is a first step towards organizing title bar things into one place,
and standardizing platform titlebar/window control implementations.

Release Notes:

- N/A
2024-06-27 19:14:13 -04:00
Kirill Bulatov
b16075d00c
Enable "duplicate prompt" button (#13588)
Release Notes:

- N/A
2024-06-27 16:11:43 +03:00
Tristan Hume
c0a3642f77
Improve prompt for Claude models (#13531)
This inline assistant prompt is one I designed that in my experience
works much better with Claude 3.5 Sonnet than the default prompt.

Mainly because it takes advantage of a weird property of our finetuning
which is that when you use XML tags it knows that it's doing a
machine-read tasks and stops trying to elide things for brevity. The
default prompt will often remove comments and otherwise add elisions for
brevity when doing large rewrites.

It also avoids giving the entire file content twice when the rewrite
region is large relative to the non-rewritten region.

Not necessarily meant to be merged as-is since it may mess up OAI
models. This is mainly meant for your reference. But everyone should be
using 3.5 Sonnet for coding use cases now anyhow 😛

Release Notes:

- N/A
2024-06-26 20:41:40 +02:00
ᴀᴍᴛᴏᴀᴇʀ
922fcaf5a6
Add the ability to customize available models for OpenAI-compatible services (#13276)
Closes #11984, closes #11075.

Release Notes:

- Added the ability to customize available models for OpenAI-compatible
services ([#11984](https://github.com/zed-industries/zed/issues/11984))
([#11075](https://github.com/zed-industries/zed/issues/11075)).


![image](https://github.com/zed-industries/zed/assets/32017007/01057e7b-1f21-49ad-a3ad-abc5282ffaf0)
2024-06-25 16:37:02 -04:00
Nate Butler
9f88460870
Move token count in prompt editor (#13524)
Moves the token count back up to the editor header.

Release Notes:

- N/A
2024-06-25 16:10:05 -04:00
ᴀᴍᴛᴏᴀᴇʀ
7e694d1bcf
Fix an issue where provider settings were lost when switching between Ollama models (#13402)
Closes #13399.

Release Notes:

- Fixed an issue where provider settings were lost when switching
between Ollama models
([#13399](https://github.com/zed-industries/zed/issues/13399)).
2024-06-25 11:58:13 -04:00
Nate Butler
890443241d
Prompt Library Refinements (#13470)
TODO:

- [x] Moving the cursor out of the title editor should unselect any
selected text

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard <richard@zed.dev>
2024-06-25 11:43:30 -04:00
Antonio Scandurra
a4cdca5141
Refine UX for assistants (#13502)
<img width="1652" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/376d1915-1e15-4d6c-966e-48f55f7cb249">


Release Notes:

- N/A
2024-06-25 13:41:55 +02:00
Tristan Hume
88000eb7e2
Fix bug with inline assist and indentation on empty lines (#13489)
Fix a minor bug when the inline assistant model spits out an empty line
with leading indentation on it. This happens sometimes with Claude 3.5
Sonnet and currently it causes the following line to have the wrong
indentation.

Release Notes:

- N/A
2024-06-25 10:11:21 +02:00
Bennet Bo Fenner
edca195e3c
assistant: Fix gutter width (#13373)
The gutter width of the assistant panel was wider then expected after
#13329 was merged.

Release Notes:

- N/A
2024-06-21 19:59:46 +02:00
Sean Billig
d3b3e072a7
Make Claude 3.5 the default Anthropic model (#13324)
Release Notes:

- N/A

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-06-21 18:47:38 +02:00
Antonio Scandurra
4072ad2858
Add support for Claude 3.5 Sonnet (#13371)
Release Notes:

- Added support for Claude 3.5 Sonnet.
2024-06-21 18:32:26 +02:00
Antonio Scandurra
cb0b8b4c4b
Introduce multi-cursor inline transformations (#13368)
https://github.com/zed-industries/zed/assets/482957/591def34-e5c8-4402-9c6b-372cbca720c3

Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2024-06-21 17:41:43 +02:00
Bennet Bo Fenner
abb46473c9
assistant: Include diagnostics in slash commands by default (#13359)
Include error diagnostics by default for the following slash commands:
`/file`, `/tabs`, `/active`

Release Notes:

- N/A
2024-06-21 14:28:12 +02:00
Bennet Bo Fenner
04a79780d8
assistant: Include worktree name in diagnostics slash command (#13354)
Files included with the diagnostics command now include the worktree
name, making it more consistent with the way other commands work
(`/active`, `/tabs`, `/file`). Also, the diagnostics command will now
insert nothing when there are no diagnostics.

Release Notes:

- N/A
2024-06-21 11:48:52 +02:00
Bennet Bo Fenner
2c545ce0bc
assistant: Improve discoverability of slash command errors (#13331)
https://github.com/zed-industries/zed/assets/53836821/fca5deef-3a4b-4670-8b92-79f052ea8417



Release Notes:

- N/A
2024-06-20 21:39:53 +02:00
Bennet Bo Fenner
0150192e26
assistant: Add term slash command (#13162)
This adds a `term` slash command to the assistant which allows to inject
the latest terminal output into the context.

Release Notes:

- N/A
2024-06-20 20:20:34 +02:00
Bennet Bo Fenner
5a6c55149a
assistant: Make including warnings for the diagnostic command more discoverable (#13323)
This makes the `--include-warnings` argument more discoverable

<img width="651" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/02d32496-ad7a-4670-85ce-eda945c0f1c2">

Release Notes:

- N/A
2024-06-20 19:48:13 +02:00
Marshall Bowers
ddf07253c4
assistant: Strip out general website chrome in /fetch command (#13264)
This PR updates the `/fetch` command to strip out general website chrome
that likely won't contain content on any websites.

Release Notes:

- N/A
2024-06-19 09:50:02 -04:00
Marshall Bowers
db0d843fb1
Allow completing slash command arguments from extensions (#13240)
This PR extends the extension API with support for completing slash
command arguments for slash commands defined in extensions.

Release Notes:

- N/A
2024-06-18 17:58:57 -04:00
Mikayla Maki
6b9ddbfef2
Add more menus to Zed (#12940)
### TODO

- [x] Make sure keybinding shows up in pane + menu
- [x] Selection tool in the editor toolbar
- [x] Application Menu
- [x] Add more options to pane + menu
   - Go to File...
  - Go to Symbol in Project... 
- [x] Add go items to the selection tool in the editor:
   - Go to Symbol in Editor...
   - Go to Line/Column...
   - Next Problem
   - Previous Problem
- [x] Fix a bug where modals opened from a context menu aren't focused
correclty
- [x] Determine if or what needs to be done with project actions:
- Difficulty is that these are exposed in the UI via clicking the
project name in the titlebar or by right clicking the root entry in the
project panel. But they require reading and are two clicks away. Is that
sufficient?
    - Add Folder to Project
    - Open a new project
    - Open recent
 - [x] Get a style pass 
 - [x] Implement style pass
   - [x] Fix the wrong actions in the selection menu
   - [x] Show selection tool toggle in the 'editor settings' thing
- [x] Put preferences section from the app menu onto the right hand user
menu
- [x] Add Project menu into app menu to replace 'preferences' section,
and put the rest of the actions there
- [ ] ~~Adopt `...` convention for opening a surface~~ uncertain what
this convention is.
   - [x] Adopt link styling  for webview actions
   - [x] Set lucide hamburger for menu icon
   - [x] Gate application menu to only show on Linux and Windows




Release Notes:

- Added a 'selection and movement' tool to the Editor's toolbar, as well
as controls to toggle it and a setting to remove it (`"toolbar":
{"selections_menu": true/false }`)
- Changed the behavior of the `+` menu in the tab bar to use standard
actions and keybindings. Replaced 'New Center Terminal' with 'New
Terminal', and 'New Search', with the usual 'Deploy Search'. Also added
item-creating actions to this menu.
- Added an 'application' menu to the titlebar to Linux and Windows
builds of Zed
2024-06-18 12:16:54 -07:00
Marshall Bowers
81475ac4cd
paths: Replace lazy_static! with OnceLock (#13213)
This PR replaces the `lazy_static!` usages in the `paths` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

The paths are now exposed as accessor functions that reference a private
static value.

Release Notes:

- N/A
2024-06-18 12:22:37 -04:00
Piotr Osiewicz
5dc26c261d
util: Use GlobSet in PathMatcher (#13197)
Previously we were using a single globset::Glob in PathMatcher; higher
up the stack, we were then resorting to using a list of PathMatchers.
globset crate exposes a GlobSet type that's better suited for this use
case. In my benchmarks, using a single PathMatcher with GlobSet instead
of a Vec of PathMatchers with Globs is about 3 times faster with the
default 'file_scan_exclusions' values. This slightly improves our
project load time for projects with large # of files, as showcased in
the following videos of loading a project with 100k source files. This
project is *not* a git repository, so it should measure raw overhead on
our side.

Current nightly: 51404d4ea0


https://github.com/zed-industries/zed/assets/24362066/e0aa9f8c-aae6-4348-8d42-d20bd41fcd76

versus this PR:


https://github.com/zed-industries/zed/assets/24362066/408dcab1-cee2-4c9e-a541-a31d14772dd7



Release Notes:

- Improved performance in large worktrees
2024-06-18 16:12:24 +02:00
Antonio Scandurra
e4ba336971
Preserve sections generated by slash commands when reloading a context (#13199)
Release Notes:

- N/A
2024-06-18 14:49:53 +02:00
Marshall Bowers
258a8a37d8
Extract paths out of util (#13182)
This PR extracts the definition of the various Zed paths out of `util`
and into a new `paths` crate.

`util` is for generic utils, while these paths are Zed-specific. For
instance, `gpui` depends on `util`, and it shouldn't have knowledge of
these paths, since they are only used by Zed.

Release Notes:

- N/A
2024-06-17 19:27:42 -04:00
Marshall Bowers
78e0f71a28
ui: Use PopoverMenu::new for constructing PopoverMenus (#13178)
This PR replaces the `popover_menu` function for constructing
`PopoverMenu`s with a `PopoverMenu::new` associated function.

This brings `PopoverMenu` in line with our other UI components.

Release Notes:

- N/A
2024-06-17 18:14:37 -04:00
Marshall Bowers
59104a08fd
assistant: Show an indicator when a crate is being indexed (#13174)
This PR adds an indicator when a crate is being indexed as part of the
`/rustdoc` command invocation.


https://github.com/zed-industries/zed/assets/1486634/0dd4b663-658c-4be5-a342-cfbd7a938fca

Release Notes:

- N/A
2024-06-17 17:39:38 -04:00
Antonio Scandurra
d95c424d18
Show correct line number for entry placeholders in /search (#13151)
Release Notes:

- N/A
2024-06-17 18:19:44 +02:00
Marshall Bowers
2e87e1d26e
assistant: Fix loading local crate docs (#13147)
This PR fixes an issue where loading the crate-level docs with
`/rustdoc` wasn't working as expected.

Release Notes:

- N/A
2024-06-17 11:55:53 -04:00
Marshall Bowers
e8862c45cc
assistant: Indicate when the /rustdoc output is from the index (#13148)
This PR makes it so that when `/rustdoc` returns content from the local
index it indicates as such in the placeholder.

Release Notes:

- N/A
2024-06-17 11:53:23 -04:00
Antonio Scandurra
b075ce8f04
Rename flaps to creases (#13144)
This is a simple rename and should be transparent for users.

Release Notes:

- N/A
2024-06-17 16:58:59 +02:00
Antonio Scandurra
6322351f00
Draw gutter highlights and indicators on top of blocks (#13142)
This ensures that the gutter progress in the inline assistant is
contiguous.

Release Notes:

- N/A
2024-06-17 15:34:05 +02:00
Antonio Scandurra
78091fa91e
Don't include prompt titles / "Default Prompt:" in slash command output (#13139)
This only includes a newline to ensure there's always something to fold.

Release Notes:

- N/A
2024-06-17 13:53:52 +02:00
Bennet Bo Fenner
d5735dab9a
assistant: Add glob matching for file slash command (#13137)
This PR adds support for glob matching when using the `file` slash
command inside the assistant panel:


https://github.com/zed-industries/zed/assets/53836821/696612d2-486c-4ab0-bf3c-d23a3eeefd25

Release Notes:

- N/A
2024-06-17 13:53:27 +02:00
Antonio Scandurra
03c54623d4
Allow cursor to be moved into an unconfirmed prompt editor via esc (#13134)
This also swaps the icons in the prompt editor.

Release Notes:

- N/A
2024-06-17 12:19:06 +02:00
Antonio Scandurra
2b46a4a0e9
Ensure context inserted via commands is syntax-highlighted (#13133)
Release Notes:

- N/A
2024-06-17 11:57:56 +02:00
Richard Feldman
4855da53df
Don't hide inline assist when editor loses focus (#12990)
Release Notes:

- Now when an editor loses focus (e.g. from switching tabs) and then
gains focus again, it doesn't close the inline assist. Instead, it only
closes when you move the cursor outside of it, e.g. by clicking
somewhere else in its parent editor.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-06-17 09:43:52 +02:00
Kyle Kelley
53f702c92f
Allow Ollama Model KeepAlive to be None, defaulting to indefinite (#13059)
Putting this back to `Option<KeepAlive>` to make existing configs keep
working.

Release Notes:

- N/A
2024-06-14 10:33:28 -07:00
Kyle Kelley
1413b5af93
Select the first available model when none configured for Ollama (#13048)
Selects the first available model for Ollama if a model is not
configured.

Release Notes:

- N/A
2024-06-14 09:35:13 -07:00
Marshall Bowers
44f66aa426
rustdoc: Add CrateName newtype (#13056)
This PR adds a `CrateName` newtype used to represent crate names.

This makes the code a bit more self-descriptive and prevents confusing
other string values for a crate name.

It also changes the internal representation from a `String` to an
`Arc<str>` for cheaper clones.

Release Notes:

- N/A
2024-06-14 12:21:03 -04:00
Conrad Irwin
3b84b106e2
vim gigv (#13028)
Release Notes:

- vim: Fix `gi` when the insert ended at the end of a line (#12162)
- vim: Add `gv` to restore previous visual selection (#12888)
- vim: Fix `gl` when the first match is at the end of a line
2024-06-14 10:16:59 -06:00
Bennet Bo Fenner
0d8e6e6b12
assistant: Add diagnostics slash command (#12998)
This adds a `diagnostics` command to the assistant which allows to
inject compile errors/warnings into the context.

Release Notes:

- N/A
2024-06-14 17:14:50 +02:00
Marshall Bowers
86167138a9
rustdoc: Automatically index crates (#13014)
This PR removes the need to use `/rustdoc --index <CRATE_NAME>` and
instead indexes the crates once they are referenced.

As soon as the first `:` is added after the crate name, the indexing
will kick off in the background and update the index as it goes.

Release Notes:

- N/A
2024-06-13 18:30:15 -04:00
Marshall Bowers
6181ac6bad
rustdoc: Index crates progressively (#13011)
This PR updates the rustdoc indexing to be more progressive.

Rather than waiting until we've crawled the entire crate to begin
writing to the database, we instead start writing the docs as we go.

This makes it so you can start getting completions while the indexing is
still running.

Release Notes:

- N/A
2024-06-13 16:40:06 -04:00