Commit Graph
197 Commits
Author SHA1 Message Date
Max BrunsfeldandMarshall 724c19a223 Add a setting for custom associations between languages and files (#9290)
Closes #5178

Release Notes:

- Added a `file_types` setting that can be used to associate languages
with file names and file extensions. For example, to interpret all `.c`
files as C++, and files called `MyLockFile` as TOML, add the following
to `settings.json`:

    ```json
    {
      "file_types": {
        "C++": ["c"],
        "TOML": ["MyLockFile"]
      }
    }
    ```

As with most zed settings, this can be configured on a per-directory
basis by including a local `.zed/settings.json` file in that directory.

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-03-13 10:23:30 -07:00
Marshall Bowers 5c2bd816ae Fix Clippy warnings in settings crate (#8700)
This PR fixes a number of Clippy warnings in the `settings` crate.

Release Notes:

- N/A
2024-03-02 00:29:29 -05:00
602fd58929 Fix for toggles on the Welcome page (#8159)
Release Notes:

The issue is that when welcome page appears settings.json file is not
created yet. So the idea of this fix is to create the file in case it is
not there yet.

- Fixed the toggles on the welcome screen not working if no settings
file exists yet.
([#8153](https://github.com/zed-industries/zed/issues/8153)).

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-23 18:24:04 +01:00
Kirill Bulatov 2679457b02 Rename runnables into tasks (#8119)
Release Notes:

- N/A
2024-02-21 14:56:43 +02:00
gmorenz 8f5d7db875 First pass at making a linux keymap (#8082)
Undoubtedly not perfect, but this should be something we can work off
of.

Note that matching keybindings with ctrl in them is currently broken on
linux (or at least x11). This keymap might just manage to be less useful
than using the macos one on linux until that is fixed... the proximate
cause of this is that the `key` field of the `Keystroke` struct looks
like `"\u{e}"` instead of `"n"` when `ctrl-n` is pressed.

Release Notes:

- N/A
2024-02-20 13:51:54 -08:00
f17d0b5729 Add static Runnables (#8009)
Part of #7108

This PR includes just the static runnables part. We went with **not**
having a dedicated panel for runnables.
This is just a 1st PR out of N, as we want to start exploring the
dynamic runnables front. Still, all that work is going to happen once
this gets merged.

Release Notes:

- Added initial, static Runnables support to Zed. Such runnables are defined in
`runnables.json` file (accessible via `zed: open runnables` action) and
they can be spawned with `runnables: spawn` action.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Pitor <pitor@zed.dev>
Co-authored-by: Beniamin <beniamin@zagan.be>
2024-02-19 18:41:43 +02:00
Matt Bond 2b39a9512a Canonicalize settings to avoid overwriting symlinks (#7632)
Release Notes:

- Fixed theme selector overwriting settings file symlinks
([#4469](https://github.com/zed-industries/zed/issues/4469)).
2024-02-09 22:31:14 +02:00
Conrad Irwin 2187513026 app version to server (#7130)
- Send app version and release stage to collab on connect
- Read the new header on the server

Release Notes:

- Added the ability to collaborate with users on different releases of
Zed.
2024-01-31 15:46:24 -07:00
Mikayla MakiandNathan f98d636203 WIP: Add a setting to visually redact enviroment variables (#7124)
Release Notes:

- Added bash syntax highlighting to `.env` files. 
- Added a `private_files` setting for configuring which files should be
considered to contain environment variables or other sensitive
information.
- Added a `redact_private_values` setting to add or remove censor bars
over variable values in files matching the `private_files` patterns.
-(internal) added a new `redactions.scm` query to our language support,
allowing different config file formats to indicate where environment
variable values can be identified in the syntax tree, added this query
to `bash`, `json`, `toml`, and `yaml` files.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-01-31 11:42:09 -08:00
e6ebe7974d gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of
global, which results in oddities at runtime.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 14:08:20 -05:00
Conrad Irwin dfbcaf36fc nightly url setting (#7037)
Release Notes:

- Added the ability to set settings per-release stage
- Added a `"server_url"` setting
2024-01-30 11:35:07 -07:00
Piotr OsiewiczandKirill 1761e60362 Improve performance of JSON schema creation (#6770)
JSON LSP adapter now caches the schema. `workspace_configuration` is
back to being async, and we are also no longer asking for font names
twice while constructing the schema.
Release Notes:
- Improved performance when opening the .json files.

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-01-26 19:54:45 +01:00
Piotr Osiewicz 6c82380232 chore: Fix clippy::needless_borrow up to an editor 2024-01-21 15:03:24 +01:00
Marshall Bowers 01f06f96a1 Update tenses of doc comment summary lines (#4161)
This PR updates the tenses used by the summary line of doc comments to
match the [Rust API documentation
conventions](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#summary-sentence).

Specifically:

> The summary line should be written in third person singular present
indicative form. Basically, this means write ‘Returns’ instead of
‘Return’.

I'm sure there are plenty occurrences that I missed.

Release Notes:

- N/A
2024-01-19 11:18:50 -05:00
Max BrunsfeldandMarshall 5e3d4885bf Fix some bugs in keymap handling (#3895)
- `base_keymap` setting was not respected, now it is
- without a `~/.config/zed/keymap.json` file, we would fail to load the
*default* keymap

Co-authored-by: Marshall <marshall@zed.dev>
2024-01-04 16:04:17 -05:00
Max BrunsfeldandMikayla 0cf65223ce Remove 2 suffix for collab, rope, settings, menu
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:29:16 -08:00
Max Brunsfeld 64e512232d Start work on supporting custom languages 2024-01-02 08:01:59 -08:00
Max Brunsfeld 404f76739c Format let-else statements 2023-08-25 10:11:32 -07:00
Joseph T. LyonsandMikayla a836f9c23d Add a default_open_ai_model setting for the assistant (#2876)
[This PR has been sitting around for a
bit](https://github.com/zed-industries/zed/pull/2845). I received a bit
of mixed opinions from the team on how this setting should work, if it
should use the full model names or some simpler form of it, etc. I went
ahead and made the decision to do the following:

- Use the full model names in settings - ex: `gpt-4-0613`
- Default to `gpt-4-0613` when no setting is present
- Save the full model names in the conversation history files (this is
how it was prior) - ex: `gpt-4-0613`
- Display the shortened model names in the assistant - ex: `gpt-4`
- Not worry about adding an option to add custom models (can add in a
follow-up PR)
- Not query what models are available to the user via their api key (can
add in a follow-up PR)

Release Notes:

- Added a `default_open_ai_model` setting for the assistant (defaults to
`gpt-4-0613`).

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-22 02:55:27 -04:00
Mikayla 48553d7c8f Revert "Remove semantic search UI"
This reverts commit c0f042b39a.
2023-08-18 16:18:28 -07:00
Mikayla c0f042b39a Remove semantic search UI 2023-08-17 17:28:09 -07:00
Kirill BulatovandMikayla Maki 4c51ab8a25 Accept null as a valid action, to disable a keystroke
co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-07-04 21:11:28 +03:00
Piotr Osiewicz 2a3c660d1f settings: accept trailing commas (#2606)
Z-2357

I've found a crate that handles both comments and trailing commas in
JSON. It is a fork of `serde_json`, but it is maintained & up-to-date.
Sadly RawValue seems to not play nicely with it; I've ran into
deserialisation issues around use of RawValue. For this PR I've migrated
to `Value` API.

Obviously this is just a point of discussion, not something I'd merge
straight away. There may be better solutions to this particular problem.

I've also noticed that `serde_json_lenient` does not handle trailing
commas after bindings array. I'm not sure how big of an issue that is.

Release Notes:
- Improved handling of trailing commas in settings files.
[#1322](https://github.com/zed-industries/community/issues/1322)
2023-06-19 18:29:03 +02:00
Max Brunsfeld 1cd11bfe66 Remove panic when programatically updating an invalid setting 2023-06-13 09:43:57 -07:00
Max Brunsfeld dbbd0558c3 Eliminate assets crate 2023-06-06 11:46:46 -07:00
Max Brunsfeld 296a0bf510 Populate created local settings file with an empty JSON object and comments 2023-06-05 18:20:02 -07:00
Max Brunsfeld 7417835f06 Avoid writing spurious nulls to settings file when updating it programatically 2023-06-02 13:02:17 -07:00
Mikayla Makiandmax 2390815d67 Make settings store handle no user settings
co-authored-by: max <max@zed.dev>
2023-06-01 10:09:04 -07:00
51c82da840 Avoid blocking forever on startup if config files do not exist
The files will still get created if the user opens their settings and
saves, otherwise everything will transparently work

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-06-01 12:04:45 -04:00
Max Brunsfeld 8f95435548 Replicate project-specific settings when collaborating 2023-05-30 18:08:03 -07:00
Max Brunsfeld 89446c7fd4 Start work on respecting project-specific settings 2023-05-29 14:25:49 -07:00
Max Brunsfeld 21ada545b0 Remove assertions about behavior on invalid settings file 2023-05-22 08:48:37 -07:00
Max Brunsfeld e32233c826 Fix spurious setting error logs on non-existent setting keys 2023-05-19 17:15:05 -07:00
Max BrunsfeldandKirill 71ad7e7612 Define empty theme for tests regardless of cargo features
Co-authored-by: Kirill <kirill@zed.dev>
2023-05-18 09:01:38 -07:00
Max Brunsfeld 823e15d85a Refresh windows when settings file changes 2023-05-17 16:02:21 -07:00
Max Brunsfeld 667f476f7f Remove unused watched_json file 2023-05-17 16:02:08 -07:00
Max Brunsfeld 42eca3048f Move font size adjustment code to the theme crate 2023-05-17 15:56:32 -07:00
Max Brunsfeld 258723566f Rename settings::register_setting -> settings::register 2023-05-17 15:06:11 -07:00
Max Brunsfeld 2d5f03e148 Remove optional path argument when getting settings 2023-05-17 15:05:20 -07:00
Max Brunsfeld 67a25126d4 Define theme/ui text style settings in theme crate 2023-05-17 14:44:59 -07:00
Max Brunsfeld 5c729c0e56 Define base keymap setting in welcome crate 2023-05-17 11:23:09 -07:00
Max Brunsfeld d2ba18eae9 Customize language settings JSON schema in language crate 2023-05-17 09:26:36 -07:00
Max Brunsfeld 6403bb86e1 Define workspace settings in workspace crate 2023-05-16 20:25:18 -07:00
Max Brunsfeld cbd4771f10 Define project settings in project crate 2023-05-16 17:45:04 -07:00
Max Brunsfeld 65e3713d4d Define editor settings in editor crate 2023-05-16 17:30:29 -07:00
Max Brunsfeld 39618ae32d Define language settings in the language crate 2023-05-16 17:29:53 -07:00
Max Brunsfeld 9ae10a5dd9 Add a better API for updating settings in the SettingsStore in tests 2023-05-11 17:24:58 -07:00
Max Brunsfeld bc5b78198a Define terminal settings in terminal crate 2023-05-10 17:43:10 -07:00
Max Brunsfeld cee7edabf9 Ensure the SettingsStore global is added in tests 2023-05-10 16:39:59 -07:00
Max Brunsfeld 68867fe2e1 Define journal settings in journal crate 2023-05-10 12:59:24 -07:00