Restructure prompts & the prompt library.
- Prompts are now written in markdown
- The prompt manager has a picker and editable prompts
- Saving isn't wired up yet
- This also removes the "Insert active prompt" button as this concept doesn't exist anymore, and will be replaced with slash commands.
I didn't staff flag this, but if you do play around with it expect it to still be pretty rough.
Release Notes:
- N/A
---------
Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Release Notes:
- Added glob support for file_types configuration
([#10765](https://github.com/zed-industries/zed/issues/10765)).
`file_types` can now be written like this:
```json
"file_types": {
"Dockerfile": [
"Dockerfile",
"Dockerfile.*",
]
}
```
This pull request adds ability to pass `initialization_options` to both
`solargraph` and `ruby-lsp` language servers. Additionally it updates
the documentation to reflect that and the recently added `ruby-lsp`
server.
Release Notes:
- Pass `initialization_options` to Ruby LSP servers.
### Title
Update macOS Development Documentation with Dispatch.h Error Solution
### Description
This PR updates the macOS development documentation to include a
solution for the `dispatch/dispatch.h` file not found error. This error
is encountered during local development when using the `cargo run`
command. The documentation now includes steps to ensure the Xcode
command line tools are properly installed and set, and instructions to
set the `BINDGEN_EXTRA_CLANG_ARGS` environment variable.
### Changes
- Added troubleshooting section for `dispatch/dispatch.h` error in
`development/macos.md`.
### Related Issues
- Closes [#11963](https://github.com/zed-industries/zed/issues/11963)
### Testing Instructions
1. Follow the steps in the updated `development/macos.md` to configure
your environment.
2. Run `cargo clean` and `cargo run` to ensure the build completes
successfully.
Release Notes:
- N/A
Data migration plan:
- [X] Make a duplicate table of `copilot_events`
- Name: `inline_completion_events`
- Omit `suggestion_id` column
- [X-reverted-skipping] In collab, continue to match on copilot_events,
but simply stuff their data into inline_completion_events, to forward it
to the new table
- [skipping] Once collab is deployed, ensure no events are being sent to
copilot_events, migrate `copilot_events` to new table via a transaction
- [skipping] Delete `copilot_events` table
---
- [X] Locally test that copilot events sent from old clients get put
into inline_completions_table
- [X] Locally test that copilot events and supermaven events sent from
new clients get put into inline_completions_table
---
- [X] Why are discard events being spammed?
- A:
8d4315712b/crates/editor/src/editor.rs (L2147)
![scr-20240514-pqmg](https://github.com/zed-industries/zed/assets/19867440/e51e7ae4-21b8-47a2-bfaa-f68fb355e409)
This will throw off the past results for accepted / dismissed that I was
wanting to use to evaluate Supermaven quality, by comparing its rate
with copilot's rate.
I'm not super thrilled with this fix, but I think it'll do. In the
`supermaven_completions_provider`, we check if there's a `completion_id`
before sending either an accepted or discard completion event. I don't
see a similar construct in the `copilot_completions_provider` to
piggyback off of, so I begrudgingly introduced
`should_allow_event_to_send` and had it follow the same pattern that
`completion_id` does. Maybe there's a better way?
---
Adds events to supermaven suggestions. Makes "CopilotEvents" generic ->
"InlineCompletionEvents".
Release Notes:
- N/A
This PR adds a Prompt Library to Zed, powering custom prompts and any
default prompts we want to package with the assistant.
These are useful for:
- Creating a "default prompt" - a super prompt that includes a
collection of things you want the assistant to know in every
conversation.
- Adding single prompts to your current context to help guide the
assistant's responses.
- (In the future) dynamically adding certain prompts to the assistant
based on the current context, such as the presence of Rust code or a
specific async runtime you want to work with.
These will also be useful for populating the assistant actions typeahead
we plan to build in the near future.
## Prompt Library
The prompt library is a registry of prompts. Initially by default when
opening the assistant, the prompt manager will load any custom prompts
present in your `~/.config/zed/prompts` directory.
Checked prompts are included in your "default prompt", which can be
inserted into the assitant by running `assistant: insert default prompt`
or clicking the `Insert Default Prompt` button in the assistant panel's
more menu.
When the app starts, no prompts are set to default. You can add prompts
to the default by checking them in the Prompt Library.
I plan to improve this UX in the future, allowing your default prompts
to be remembered, and allowing creating, editing and exporting prompts
from the Library.
### Creating a custom prompt
Prompts have a simple format:
```json
{
// ~/.config/zed/prompts/no-comments.json
"title": "No comments in code",
"version": "1.0",
"author": "Nate Butler <iamnbutler@gmail.com>",
"languages": ["*"],
"prompt": "Do not add inline or doc comments to any returned code. Avoid removing existing comments unless they are no longer accurate due to changes in the code."
}
```
Ensure you properly escape your prompt string when creating a new prompt
file.
Example:
```json
{
// ...
"prompt": "This project using the gpui crate as it's UI framework for building UI in Rust. When working in Rust files with gpui components, import it's dependencies using `use gpui::{*, prelude::*}`.\n\nWhen a struct has a `#[derive(IntoElement)]` attribute, it is a UI component that must implement `RenderOnce`. Example:\n\n```rust\n#[derive(IntoElement)]\nstruct MyComponent {\n id: ElementId,\n}\n\nimpl MyComponent {\n pub fn new(id: impl Into<ElementId>) -> Self {\n Self { id.into() }\n }\n}\n\nimpl RenderOnce for MyComponent {\n fn render(self, cx: &mut WindowContext) -> impl IntoElement {\n div().id(self.id.clone()).child(text(\"Hello, world!\"))\n }\n}\n```"
}
```
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Fix typos on the Assistant Panel page, also including removal of
unnecessary commas and standardization to US English.
Release Notes:
- N/A
PS: Assuming here US English is the preferred style (e.g., "canceled"
vs. "cancelled".) Happy to revert if that's not the case! :)
Standardize the blockquote "Notes" usage, so all places are using the
`>` blockquote notation, as well as a consistent style for the "Note"
word.
PS: Thought that bolding the word "**Note**" would make for a higher
visual distinction, so went for it in all existing cases! No strong
feelings, though; happy to roll back to just "Note:" if that's
preferrable!
Release Notes:
- N/A
I assume this was an older file name or just a typo as I can't find any
other references to a `keybindings.json` file. Either way it was
confusing for a bit :)
Release Notes:
- N/A
This PR removes the references to initializing Git submodules as part of
building Zed.
These are no longer needed, as our only submodule was removed in #11672.
Release Notes:
- N/A
This PR fixes copying code blocks in the docs.
The problem was that some of the elements we removed from the base
mdBook template were causing errors in the script, which prevented the
right event listeners from being registered for the copy button.
To remedy this, the elements have been restored, but are using `display:
none` so that they don't appear in the UI.
Resolves#11592.
Release Notes:
- N/A
This PR is another step to tabless editing (#6424, #4963). It adds
support for tab bar settings that allow the user to change its placement
or to hide completely.
Configuraton:
```json
"tab_bar": {
"show": true
}
```
Placemnet options are "top", "bottom" and "no".
This PR intentionally doesn't affect tab bars of other panes (Terminal
for instance) to keep code changes small. I guess we'll do the rest in
separate PRs.
Release Notes:
- Added support for configuring the editor tab bar (part of #6424,
#4963).
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Just adding a short note about `cargo build --release` and the location
of the compiled binary. It helps a lot to streamline usage of Zed day to
day on Linux.
Release Notes:
- N/A
This PR updates the system requirements in the docs to note that Linux
and Windows can be built from source.
This matches the messaging we have in place on the [download
page](https://zed.dev/download).
Release Notes:
- N/A
This PR fixes the links in the README to account for the changes in the
docs structure.
Also, somehow the README had gotten added with `\r\n` newlines, so I
changed it back to `\n` newlines.
Release Notes:
- N/A
This PR sets up deployments for the docs using mdBook.
Right now the new docs are hosted at
[zed.dev/docs2](https://zed.dev/docs2/).
The docs are deployed to Cloudflare Pages on merges to `main`, and we
have a Cloudflare Worker that routes traffic from `zed.dev/docs2` to the
docs deployment.
We can iterate on the docs for a bit, and then promote them to
`zed.dev/docs` when we're all ready for the switchover.
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This PR adds support for replacing the current preview tab when using
GoToDefinition. Previously a tab, that was navigated away from, was
converted into a permanent tab and the new tab was opened as preview.
Without `enable_preview_from_code_navigation`:
https://github.com/zed-industries/zed/assets/53836821/99840724-d6ff-4738-a9c4-ee71a0001634
With `enable_preview_from_code_navigation`:
https://github.com/zed-industries/zed/assets/53836821/8c60efcb-d597-40bf-b08b-13faf5a289b6
Note: In the future I would like to improve support for the navigation
history, because right now tabs that are not "normal" project items,
e.g. FindAllReferences cannot be reopened
Release Notes:
- Added support for replacing the current preview tab when using code
navigation (`enable_preview_from_code_navigation`)
https://github.com/zed-industries/zed/assets/2072378/18f0bb28-0546-4234-a11f-39af6c9fcc12
`rulesCustomizations` is an array of rule severity overrides. Globs can
be used to apply default severities for multiple rules. See
[docs](553e632fb4/README.md (L312-L333))
& [type
definitions](553e632fb4/%24shared/settings.ts (L168))
Example Zed `settings.json` to override all eslint errors to warnings:
```jsonc
{
"lsp": {
"eslint": {
"settings": {
"rulesCustomizations": [
// set all eslint errors/warnings to show as warnings
{ "rule": "*", "severity": "warn" }
]
}
}
}
}
```
Release Notes:
- Added support for configuring ESLint's `rulesCustomizations` settings,
ie. `{"lsp": {"eslint": {"settings": {"rulesCustomizations": [{"rule":
"*", "severity": "warn"}]}}}}`
How it looks:
https://github.com/zed-industries/zed/assets/2101250/f564111c-1019-4442-b8a6-de338e12b12e
This PR adds cursor markers to the scrollbar. They work similar to
VSCode:
1. A cursor marker takes the whole scrollbar width.
2. It's always 2px high.
3. It uses the player's `cursor` color, so it may be helpful in the
collaboration mode.
There's a setting to switch cursor markers on/off:
```json
{
"scrollbar": {
"cursors": true
}
}
```
Implementation details:
- Unlike other markers, cursor markers are displayed synchronously.
Otherwise they don't feel smooth and sometimes freez on prolonged
up/down navigation.
- Cursor markers are automatically switched off when it's more than 100
of them.
- The minimum (non-cursor) marker height is now 5px. It allows the user
to see other markers under the cursor marker.
- The way the minimum height is imposed on markers has changed a bit to
keep consistency between markers of different types.
- Selected symbol markers use less vibrant color (`info` faded out a
little).
Release Notes:
- Added displaying of cursor markers in the scrollbar. They can be
switched on/off by the `scrollbar.cursors` setting.
This PR updates the releases docs to make a note about
`bump_patch_version` action through the GitHub UI.
Not all of us have `gh` (or `brew`) installed.
Release Notes:
- N/A