Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
678605a
Add a status indicator to indicate the current file's encoding. When …
EuclidDivisionLemma Aug 19, 2025
18cd271
Implement the actual encoding selector. There are currently only two …
EuclidDivisionLemma Aug 23, 2025
6c25c99
refactor: `encoding` in `EncodingIndicator` is now an optional trait …
EuclidDivisionLemma Aug 24, 2025
ee70462
Make the status bar encoding indicator update the encoding when an en…
EuclidDivisionLemma Aug 24, 2025
d3e95b9
Add a new `load_with_encoding` function to handle files with various …
EuclidDivisionLemma Aug 25, 2025
12e21b5
Add support for saving and opening files in different encodings. The …
EuclidDivisionLemma Aug 26, 2025
1078f85
feat: Make the encoding indicator appear only when an editor is open.
EuclidDivisionLemma Aug 26, 2025
a61d94d
fix: Fix an issue which caused the focus to not be on `EncodingSelect…
EuclidDivisionLemma Aug 27, 2025
cca3bb8
- Fix cargo clippy errors
EuclidDivisionLemma Aug 30, 2025
6e1a5fa
Migrate from `encoding` to `encoding_rs`
EuclidDivisionLemma Sep 1, 2025
93281b2
Fix cargo clippy errors
EuclidDivisionLemma Aug 31, 2025
3b77f57
- Format code properly
EuclidDivisionLemma Sep 1, 2025
009c4ea
Fix issues caused by Cargo.lock
EuclidDivisionLemma Sep 3, 2025
81376dd
Add a licence symlink
EuclidDivisionLemma Sep 4, 2025
0e2eda0
Add UTF-16 LE/BE support and remove unused serde code
EuclidDivisionLemma Sep 5, 2025
27376e0
Write BOM once for UTF-16 files
EuclidDivisionLemma Sep 5, 2025
680a72b
- Update encoding detection to automatically switch to UTF-16LE/BE if
EuclidDivisionLemma Sep 6, 2025
2a193ae
Make the `EncodingSaveOrReopenSelector` open only when the current bu…
EuclidDivisionLemma Sep 6, 2025
fb6ec66
Fix an error caused by UTF-16 BOM checking when there are no BOMs
EuclidDivisionLemma Sep 6, 2025
dd5ddbf
- Remove unnecessary calls to `collect`
EuclidDivisionLemma Sep 7, 2025
591fe9f
- Remove `load_with_encoding` from the `Fs` trait and make appropriate
EuclidDivisionLemma Oct 3, 2025
9dc21f5
Re-Add `load_with_encoding` method to the `Fs` trait
EuclidDivisionLemma Oct 5, 2025
6561c89
- Make `File::load` use `load_with_encoding`
EuclidDivisionLemma Oct 5, 2025
8063144
Update `tests` in `copilot.rs` to match the new `load` method signature
EuclidDivisionLemma Oct 5, 2025
13ea13b
Pass file path to `EncodingSelector` via `Toggle` action, if there is
EuclidDivisionLemma Oct 5, 2025
37754b0
Add a call to `open_abs_path` to enable opening of files from
EuclidDivisionLemma Oct 5, 2025
44abaed
- Return an error if the file contains invalid bytes for the specified
EuclidDivisionLemma Oct 5, 2025
183bff5
- Add a field `encoding` in both `Workspace` and `Project`
EuclidDivisionLemma Oct 5, 2025
d515ddd
- Add optional encoding parameter to Worktree::load_file
EuclidDivisionLemma Oct 5, 2025
0d3095a
Clicking on `Choose another encoding` and selecting an encoding should
EuclidDivisionLemma Oct 6, 2025
b629b1f
Enable a file to be opened with an invalid encoding with the invalid
EuclidDivisionLemma Oct 12, 2025
25c6af4
Fix an issue that caused a reopened buffer to use UTF-8 even if the
EuclidDivisionLemma Oct 18, 2025
0e38704
Fix an issue that caused the buffer to be in a modified state after
EuclidDivisionLemma Oct 19, 2025
1d95a18
Create a new crate `encodings` that will have all that is not related to
EuclidDivisionLemma Oct 19, 2025
8580683
- Move the functionality in `fs::encodings` to a seperate crate
EuclidDivisionLemma Oct 19, 2025
b2187e5
- Fix an issue that caused UTF-8 to be used when a file was closed and
EuclidDivisionLemma Oct 21, 2025
c130110
Remove calls to `lock` and `unwrap` as they are no longer needed
EuclidDivisionLemma Oct 21, 2025
0e89634
Fix conflicts
EuclidDivisionLemma Oct 22, 2025
19b06e5
Fix conflicts
EuclidDivisionLemma Oct 22, 2025
08032bd
Move the invalid encoding UI from `project` to `workspace`
EuclidDivisionLemma Oct 24, 2025
0b942fe
- Use `EncodingOptions` for parameters
EuclidDivisionLemma Oct 28, 2025
2e18a5b
Use `Buffer::update` and `Buffer::update_encoding` to set the `encoding`
EuclidDivisionLemma Nov 1, 2025
4330e5f
- Change the order in which `cx` and `encoding` appear
EuclidDivisionLemma Nov 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added ..gitignore.swp
Empty file.
108 changes: 108 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 7 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ members = [
"crates/zeta2_tools",
"crates/editor",
"crates/eval",
"crates/encodings",
"crates/encodings_ui",
"crates/explorer_command_injector",
"crates/extension",
"crates/extension_api",
Expand Down Expand Up @@ -221,6 +223,8 @@ members = [

"tooling/perf",
"tooling/xtask",
"crates/encodings",
"crates/encodings_ui",
]
default-members = ["crates/zed"]

Expand All @@ -242,7 +246,6 @@ activity_indicator = { path = "crates/activity_indicator" }
agent_ui = { path = "crates/agent_ui" }
agent_settings = { path = "crates/agent_settings" }
agent_servers = { path = "crates/agent_servers" }
ai = { path = "crates/ai" }
ai_onboarding = { path = "crates/ai_onboarding" }
anthropic = { path = "crates/anthropic" }
askpass = { path = "crates/askpass" }
Expand All @@ -252,7 +255,6 @@ assistant_slash_command = { path = "crates/assistant_slash_command" }
assistant_slash_commands = { path = "crates/assistant_slash_commands" }
audio = { path = "crates/audio" }
auto_update = { path = "crates/auto_update" }
auto_update_helper = { path = "crates/auto_update_helper" }
auto_update_ui = { path = "crates/auto_update_ui" }
aws_http_client = { path = "crates/aws_http_client" }
bedrock = { path = "crates/bedrock" }
Expand Down Expand Up @@ -315,6 +317,8 @@ edit_prediction = { path = "crates/edit_prediction" }
edit_prediction_button = { path = "crates/edit_prediction_button" }
edit_prediction_context = { path = "crates/edit_prediction_context" }
zeta2_tools = { path = "crates/zeta2_tools" }
encodings = {path = "crates/encodings"}
encodings_ui = {path = "crates/encodings_ui"}
inspector_ui = { path = "crates/inspector_ui" }
install_cli = { path = "crates/install_cli" }
journal = { path = "crates/journal" }
Expand Down Expand Up @@ -355,8 +359,6 @@ panel = { path = "crates/panel" }
paths = { path = "crates/paths" }
perf = { path = "tooling/perf" }
picker = { path = "crates/picker" }
plugin = { path = "crates/plugin" }
plugin_macros = { path = "crates/plugin_macros" }
prettier = { path = "crates/prettier" }
settings_profile_selector = { path = "crates/settings_profile_selector" }
project = { path = "crates/project" }
Expand Down Expand Up @@ -390,7 +392,6 @@ snippets_ui = { path = "crates/snippets_ui" }
sqlez = { path = "crates/sqlez" }
sqlez_macros = { path = "crates/sqlez_macros" }
story = { path = "crates/story" }
storybook = { path = "crates/storybook" }
streaming_diff = { path = "crates/streaming_diff" }
sum_tree = { path = "crates/sum_tree" }
supermaven = { path = "crates/supermaven" }
Expand All @@ -407,7 +408,6 @@ terminal_view = { path = "crates/terminal_view" }
text = { path = "crates/text" }
theme = { path = "crates/theme" }
theme_extension = { path = "crates/theme_extension" }
theme_importer = { path = "crates/theme_importer" }
theme_selector = { path = "crates/theme_selector" }
time_format = { path = "crates/time_format" }
title_bar = { path = "crates/title_bar" }
Expand Down Expand Up @@ -501,6 +501,7 @@ documented = "0.9.1"
dotenvy = "0.15.0"
ec4rs = "1.1"
emojis = "0.6.1"
encoding_rs = "0.8"
env_logger = "0.11"
exec = "0.3.1"
fancy-regex = "0.14.0"
Expand Down Expand Up @@ -790,11 +791,7 @@ codegen-units = 16
[profile.dev.package]
taffy = { opt-level = 3 }
cranelift-codegen = { opt-level = 3 }
cranelift-codegen-meta = { opt-level = 3 }
cranelift-codegen-shared = { opt-level = 3 }
resvg = { opt-level = 3 }
rustybuzz = { opt-level = 3 }
ttf-parser = { opt-level = 3 }
wasmtime-cranelift = { opt-level = 3 }
wasmtime = { opt-level = 3 }
# Build single-source-file crates with cg=1 as it helps make `cargo build` of a whole workspace a bit faster
Expand All @@ -804,7 +801,6 @@ breadcrumbs = { codegen-units = 1 }
collections = { codegen-units = 1 }
command_palette = { codegen-units = 1 }
command_palette_hooks = { codegen-units = 1 }
extension_cli = { codegen-units = 1 }
feature_flags = { codegen-units = 1 }
file_icons = { codegen-units = 1 }
fsevent = { codegen-units = 1 }
Expand Down
4 changes: 3 additions & 1 deletion assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,9 @@
// Whether to show the cursor position button in the status bar.
"cursor_position_button": true,
// Whether to show active line endings button in the status bar.
"line_endings_button": false
"line_endings_button": false,
// Whether to show the encoding indicator in the status bar.
"encoding_indicator": true
},
// Settings specific to the terminal
"terminal": {
Expand Down
1 change: 1 addition & 0 deletions crates/agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ collections.workspace = true
context_server.workspace = true
db.workspace = true
derive_more.workspace = true
encodings.workspace = true
fs.workspace = true
futures.workspace = true
git.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/agent/src/tools/edit_file_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ mod tests {
use super::*;
use crate::{ContextServerRegistry, Templates};
use client::TelemetrySettings;
use encodings::Encoding;
use fs::Fs;
use gpui::{TestAppContext, UpdateGlobal};
use language_model::fake_provider::FakeLanguageModel;
Expand Down Expand Up @@ -744,6 +745,7 @@ mod tests {
path!("/root/src/main.rs").as_ref(),
&Rope::from_str_small("initial content"),
language::LineEnding::Unix,
Encoding::default(),
)
.await
.unwrap();
Expand Down Expand Up @@ -911,6 +913,7 @@ mod tests {
path!("/root/src/main.rs").as_ref(),
&Rope::from_str_small("initial content"),
language::LineEnding::Unix,
Encoding::default(),
)
.await
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/agent_ui/src/acp/message_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ fn full_mention_for_directory(
worktree_id,
path: worktree_path,
};
buffer_store.open_buffer(project_path, cx)
buffer_store.open_buffer(project_path, &Default::default(), cx)
})
});

Expand Down
2 changes: 1 addition & 1 deletion crates/agent_ui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl DirectoryContextHandle {
let open_task = project.update(cx, |project, cx| {
project.buffer_store().update(cx, |buffer_store, cx| {
let project_path = ProjectPath { worktree_id, path };
buffer_store.open_buffer(project_path, cx)
buffer_store.open_buffer(project_path, &Default::default(), cx)
})
});

Expand Down
1 change: 1 addition & 0 deletions crates/collab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ chrono.workspace = true
clock.workspace = true
collections.workspace = true
dashmap.workspace = true
encodings.workspace = true
envy = "0.4.2"
futures.workspace = true
gpui.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/collab/src/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use buffer_diff::{DiffHunkSecondaryStatus, DiffHunkStatus, assert_hunks};
use call::{ActiveCall, ParticipantLocation, Room, room};
use client::{RECEIVE_TIMEOUT, User};
use collections::{HashMap, HashSet};
use encodings::Encoding;
use fs::{FakeFs, Fs as _, RemoveOptions};
use futures::{StreamExt as _, channel::mpsc};
use git::{
Expand Down Expand Up @@ -3701,6 +3702,7 @@ async fn test_buffer_reloading(
path!("/dir/a.txt").as_ref(),
&new_contents,
LineEnding::Windows,
Encoding::default(),
)
.await
.unwrap();
Expand Down Expand Up @@ -4481,6 +4483,7 @@ async fn test_reloading_buffer_manually(
path!("/a/a.rs").as_ref(),
&Rope::from_str_small("let seven = 7;"),
LineEnding::Unix,
Encoding::default(),
)
.await
.unwrap();
Expand Down
Loading
Loading