Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai a738209cbe fix(editor): Sort Lines orders by character code
Sort Lines used a locale-aware collator, which interleaves upper- and
lowercase letters. It now compares UTF-16 code units, the order IDEA's
Sort Lines uses (String.compareTo) and LC_ALL=C sort gives.

Closes #3516
2026-11-15 22:46:55 +08:00
238 змінених файлів з 1225 додано та 2544 видалено

No files matched your search

-1
Переглянути файл
@@ -42,7 +42,6 @@ Visual style: dark, low-contrast greys, one cool accent
shortcuts live in `src/platform/keymaps/`.
- Styling: CSS Modules + tokens only (no hex literals in components). Inline SVG
icons from `src/ui/icons.tsx`, never emoji. Real `<button>`/`<input>`; `aria-label` on icon buttons.
`gap` uses the `--space-*` scale (`src/styles/tokens.css`, 4px grid) where a value is on it.
- User-visible text goes through the text catalog: add every new string to both
`src/platform/locales/text/en.json` and `zh.json` (`textCatalog.test.ts` enforces it).
Other locales may lack entries; their UI shows the English text until a translator adds it.
+3 -29
Переглянути файл
@@ -1861,24 +1861,12 @@ impl Task {
let s = self.state.lock();
s.busy && s.task.status == AgentStatus::Running
};
let Some((live, method)) = live
.filter(|l| running && (prompt.images.is_empty() || l.capabilities.images))
.and_then(|l| steer_method(&l.init).map(|m| (l, m)))
else {
let Some(live) = live.filter(|l| running && (prompt.images.is_empty() || l.capabilities.images)) else {
return Err(prompt);
};
let content = self.content(&live, &prompt).await;
let sent: Result<Value, RpcError> =
live.peer.request(method, json!({ "sessionId": live.session, "prompt": content }), None).await;
// `_session/steering` answers with an outcome: only `injected` joined the turn
// (`promptRequired`: no turn is running any more).
let sent = match sent {
Ok(reply) => match reply.get("outcome").and_then(Value::as_str) {
None | Some("injected") => Ok(()),
Some(outcome) => Err(reply.get("reason").and_then(Value::as_str).unwrap_or(outcome).to_owned()),
},
Err(e) => Err(e.to_string()),
};
live.peer.request("_openidea/steer", json!({ "sessionId": live.session, "prompt": content }), None).await;
if let Err(e) = sent {
// The turn ended meanwhile: the message waits for the next one instead.
tracing::debug!("agent task {}: steering failed: {e}", self.id);
@@ -2877,27 +2865,13 @@ fn shown_background(tasks: &[Value], known: &[AgentBackgroundTask]) -> Vec<Agent
.collect()
}
/// The method that adds a message to the running turn: OpenIDEA's own, or the
/// `_session/steering` extension an agent advertises in the response's top-level `_meta`
/// (OMP).
fn steer_method(init: &acp::Negotiated) -> Option<&'static str> {
let supported = |v: Option<&Value>| v.and_then(Value::as_bool) == Some(true);
if supported(init.meta("/openidea/steer")) {
Some("_openidea/steer")
} else if supported(init.meta.as_ref().and_then(|m| m.pointer("/steering/supported"))) {
Some("_session/steering")
} else {
None
}
}
fn capabilities_of(init: &acp::Negotiated) -> (AgentCapabilities, bool) {
let meta = |p: &str| init.meta(p).and_then(Value::as_bool) == Some(true);
let capabilities = AgentCapabilities {
images: init.prompt("image"),
fork: init.session("fork"),
rollback: meta("/openidea/rollback"),
steer: steer_method(init).is_some(),
steer: meta("/openidea/steer"),
background_tasks: meta("/openidea/backgroundTasks"),
read_only: false,
};
-50
Переглянути файл
@@ -51,9 +51,6 @@ struct FakeAgent {
/// Config options `session/new` reports after the model one (per-model efforts, say).
extra_options: Mutex<Vec<Value>>,
model_options: Mutex<HashMap<String, Vec<Value>>>,
/// Advertises steering as OMP does (`_meta.steering` at the top of `initialize`)
/// instead of `_meta.openidea.steer`.
session_steering: bool,
}
impl FakeAgent {
@@ -159,10 +156,6 @@ impl Handler for FakeAgent {
if params.pointer("/clientCapabilities/subagents").is_some_and(Value::is_object) {
self.calls.lock().push("subagents".into());
}
if self.session_steering {
return Ok(json!({"protocolVersion": 1, "agentCapabilities": {"loadSession": true},
"_meta": {"steering": {"supported": true}}}));
}
Ok(
json!({"protocolVersion": 1, "authMethods": self.auth_methods, "agentCapabilities": {"loadSession": !self.no_load,
"sessionCapabilities": {"fork": {}}, "_meta": {"openidea": {"rollback": true, "steer": true, "backgroundTasks": true}}}}),
@@ -190,13 +183,6 @@ impl Handler for FakeAgent {
self.calls.lock().push(format!("{method} {detail}"));
Ok(json!({}))
}
"_session/steering" => {
let text = params["prompt"][0]["text"].clone();
self.calls.lock().push(format!("{method} {text}"));
// OMP answers whether the message joined the turn rather than failing.
let outcome = if text == "too late" { "promptRequired" } else { "injected" };
Ok(json!({"outcome": outcome, "queue": "steering"}))
}
"session/load" => {
self.say(&session, "replayed history");
Ok(json!({}))
@@ -1074,42 +1060,6 @@ fn text(t: &str) -> AgentPrompt {
AgentPrompt { text: t.into(), ..AgentPrompt::default() }
}
#[tokio::test(flavor = "multi_thread")]
async fn steers_through_session_steering() {
let tmp = tempfile::tempdir().unwrap();
let agent = Arc::new(FakeAgent { session_steering: true, ..FakeAgent::default() });
let mgr = manager(tmp.path(), agent.clone());
let task = mgr
.create(NewAgentTask {
project_root: None,
prompt: text("wait"),
provider: "claude".into(),
config: vec![],
isolation: Isolation::Local,
base: None,
})
.await
.unwrap();
wait_for(&mgr, &task.id, AgentStatus::Running).await;
assert!(mgr.task(&task.id).unwrap().state.lock().task.capabilities.steer);
mgr.prompt(&task.id, text("also this"), true).await.unwrap();
assert!(agent.calls.lock().iter().any(|c| c == "_session/steering \"also this\""));
let entries = mgr.entries(&task.id, None).unwrap();
assert!(matches!(entries.last(), Some(AgentEntry::User { steered: true, .. })));
assert!(mgr.task(&task.id).unwrap().state.lock().task.queue.is_empty());
// The agent didn't take it into the turn: the turn stops and it goes next, as without
// steering (the fake agent's next turn asks for permission).
mgr.prompt(&task.id, text("too late"), true).await.unwrap();
wait_for(&mgr, &task.id, AgentStatus::NeedsInput).await;
let entries = mgr.entries(&task.id, None).unwrap();
assert!(entries.iter().any(|e| matches!(e, AgentEntry::User { text, steered: false, .. } if text == "too late")));
assert!(!entries.iter().any(|e| matches!(e, AgentEntry::User { text, steered: true, .. } if text == "too late")));
mgr.cancel(&task.id, None).unwrap();
wait_for(&mgr, &task.id, AgentStatus::Ready).await;
}
#[tokio::test(flavor = "multi_thread")]
async fn messages_sent_while_busy_are_queued_and_send_now_interrupts() {
let tmp = tempfile::tempdir().unwrap();
+1 -3
Переглянути файл
@@ -1275,9 +1275,7 @@ impl Project {
}
let defaults = self.documents.file_defaults();
let fallback = defaults.fallback_for(path);
// The working file only when it is a regular file: a path that is a directory there
// (a committed symlink to a folder, a file replaced by a folder) has only its blob.
if path.is_file() {
if path.exists() {
let loaded = ide_vfs::load_text_with_fallback(path, fallback)?;
return encoding_rs::Encoding::for_label(loaded.encoding.as_bytes())
.ok_or_else(|| ide_core::IdeError::invalid("unknown file encoding"));
-46
Переглянути файл
@@ -111,49 +111,3 @@ async fn gbk_document_gutter_diff_stage_and_rollback_share_encoding() {
assert_eq!(vcs::vcs_file_at(&host, "main", utf8, None).await.unwrap().as_deref(), Some(old));
host.close_project("main");
}
/// A committed symlink to a folder (#3528): its revision is the link target, even though the
/// working path is a directory.
#[cfg(unix)]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn a_directory_symlink_revision_is_its_target() {
let temp = tempfile::tempdir().unwrap();
let base = dunce::canonicalize(temp.path()).unwrap();
let root = base.join("project");
std::fs::create_dir_all(root.join("target")).unwrap();
git(&root, &["init", "-b", "main"]);
git(&root, &["config", "user.name", "Test"]);
git(&root, &["config", "user.email", "[email protected]"]);
git(&root, &["config", "commit.gpgsign", "false"]);
std::fs::write(root.join("target/file.txt"), "example\n").unwrap();
std::os::unix::fs::symlink("target", root.join("dir-link")).unwrap();
git(&root, &["add", "."]);
git(&root, &["commit", "-m", "Add a directory symlink"]);
let host = Host::new(HostConfig {
config_dir: base.join("config"),
data_dir: base.join("data"),
local_data_dir: base.join("data"),
languages: Arc::new(ide_language::LanguageRegistry::load(None).unwrap()),
syntax: Arc::default(),
sink_for: Box::new(|_| Arc::new(NullSink)),
owner: |w| w,
runtime: tokio::runtime::Handle::current(),
project_environment: false,
});
host.trust.decide(&root, true, false).unwrap();
let project = host.open_project("main", &root).unwrap();
for _ in 0..500 {
if !project.repos().is_empty() {
break;
}
tokio::time::sleep(Duration::from_millis(10)).await;
}
let link = root.join("dir-link");
assert!(link.is_dir());
assert_eq!(
vcs::vcs_file_at(&host, "main", link.clone(), Some("HEAD".into())).await.unwrap().as_deref(),
Some("target")
);
assert_eq!(vcs::vcs_file_mode(&host, "main", link, Some("HEAD".into())).await.unwrap().as_deref(), Some("120000"));
host.close_project("main");
}
+11 -25
Переглянути файл
@@ -78,8 +78,8 @@ impl Needle {
let mut b = 0;
if n.eq_ignore_ascii_case(q) {
b += EXACT;
} else if let Some(dot) = n.iter().position(|&b| b == b'.')
&& n[..dot].eq_ignore_ascii_case(q)
} else if let Some(dot) = name.find('.')
&& name.as_bytes()[..dot].eq_ignore_ascii_case(q)
{
b += EXACT_STEM;
} else if n.len() >= q.len() && n[..q.len()].eq_ignore_ascii_case(q) {
@@ -97,31 +97,17 @@ fn hump_bonus(s: &str, indices: &[u32]) -> u32 {
if indices.is_empty() {
return 0;
}
// One pass over `s`: `indices` is sorted, and whether position `i` is a
// word start only needs the char before it, so no `Vec<char>` is collected.
let is_start = |prev: Option<char>, c: char| match prev {
None => true,
Some(p) => {
!p.is_alphanumeric()
|| (p.is_lowercase() && c.is_uppercase())
|| (!p.is_ascii_digit() && c.is_ascii_digit())
let chars: Vec<char> = s.chars().collect();
let is_start = |i: usize| {
if i == 0 {
return true;
}
let (p, c) = (chars[i - 1], chars[i]);
!p.is_alphanumeric() || (p.is_lowercase() && c.is_uppercase()) || (!p.is_ascii_digit() && c.is_ascii_digit())
};
let (mut humps, mut next, mut first_start) = (0u32, 0usize, false);
let (mut prev, mut at) = (None, 0u32);
for c in s.chars() {
if next < indices.len() && indices[next] == at {
let started = is_start(prev, c);
humps += u32::from(started);
if next == 0 {
first_start = started;
}
next += 1;
}
prev = Some(c);
at += 1;
}
humps * HUMP + u32::from(first_start) * FIRST_AT_START
let humps = indices.iter().filter(|&&i| (i as usize) < chars.len() && is_start(i as usize)).count() as u32;
let first = if is_start(indices[0] as usize) { FIRST_AT_START } else { 0 };
humps * HUMP + first
}
#[derive(Clone, Copy)]
-5
Переглянути файл
@@ -170,11 +170,6 @@ pub struct LanguageServerConfig {
/// basedpyright): only used while none of those is installed.
#[serde(default)]
pub fallback: bool,
/// Names of servers listed after this one that it makes redundant (a PHP server
/// with its own Laravel support replaces `laravel-lsp`): they aren't used while
/// this one serves the file.
#[serde(default)]
pub replaces: Vec<String>,
/// What the server is used for (`completion`, `code-action`, `diagnostics`,
/// … `FEATURES` in `ide-lsp/src/caps.rs`); empty means everything. The other
/// capabilities it announces are ignored, so a refactoring-only server next
+1 -4
Переглянути файл
@@ -758,10 +758,7 @@ mod tests {
let cfg = reg.get(&LanguageId::new("php")).unwrap();
let names: Vec<&str> = cfg.language_servers.iter().map(|s| s.name.as_str()).collect();
// After the fallback: hover, rename and symbols stay with Intelephense.
assert_eq!(names, ["intelephense", "phpactor", "phoxite", "laravel-lsp"]);
// Phoxite answers the Laravel strings itself.
let phoxite = cfg.language_servers.iter().find(|s| s.name == "phoxite").unwrap();
assert!(phoxite.fallback && phoxite.replaces == ["laravel-lsp"]);
assert_eq!(names, ["intelephense", "phpactor", "laravel-lsp"]);
let lsp = cfg.language_servers.iter().find(|s| s.name == "laravel-lsp").unwrap();
assert_eq!(lsp.command.as_str(), "laravel-lsp");
// Its `lsp` command takes no options and speaks over stdio; `--stdio` stops it at startup.
+9 -26
Переглянути файл
@@ -660,17 +660,15 @@ impl LspManager {
/// The servers serving `path`: every regular one, and each `fallback` one
/// only while all servers listed before it have given up (missing, not
/// launchable, or crashed for good). One that requires a root marker serves
/// only files below one, and stands in for no other. One that a server before
/// it `replaces` is left out while that server serves the file.
/// only files below one, and stands in for no other.
fn servers_for(&self, language: &LanguageId, path: &Path) -> Vec<Arc<Server>> {
if let Some(servers) = self.arduino_servers(language, path) {
return servers;
}
let mut out = Vec::new();
let mut available_before = false;
let mut replaced: Vec<String> = Vec::new();
for sc in &self.language_servers(language) {
if (sc.fallback && available_before) || replaced.contains(&sc.name) {
if sc.fallback && available_before {
continue;
}
if sc.require_root_marker
@@ -680,9 +678,6 @@ impl LspManager {
}
let server = self.server_for(sc, language, path);
available_before |= !sc.require_root_marker && !server.gave_up();
if !server.gave_up() {
replaced.extend(sc.replaces.iter().cloned());
}
out.push(server);
}
out
@@ -870,7 +865,7 @@ impl LspManager {
ide_core::event::ServerStatus::Missing,
Some(message),
) {
self.fallbacks_take_over().await;
self.attach_fallbacks();
}
return;
}
@@ -883,7 +878,7 @@ impl LspManager {
ide_core::event::ServerStatus::Misconfigured,
Some(message),
) {
self.fallbacks_take_over().await;
self.attach_fallbacks();
}
return;
}
@@ -896,7 +891,7 @@ impl LspManager {
ide_core::event::ServerStatus::Crashed,
Some(message),
) {
self.fallbacks_take_over().await;
self.attach_fallbacks();
}
return;
}
@@ -1044,7 +1039,7 @@ impl LspManager {
}
}
// Gave up (crashed repeatedly, or its build expired): the fallbacks it hid take over.
None => self.fallbacks_take_over().await,
None => self.attach_fallbacks(),
}
}
@@ -3469,10 +3464,7 @@ impl LspManager {
virtual_doc::is_decompiled(&text)
};
let title = title.unwrap_or_else(|| virtual_doc::title(uri, decompiled));
let mut detected = self.languages.detect(Path::new(&title), None);
if let Some(stem) = title.strip_suffix(".class").filter(|_| virtual_doc::is_java_class_stub(&text)) {
detected = self.languages.detect(Path::new(&format!("{stem}.java")), None);
}
let detected = self.languages.detect(Path::new(&title), None);
let language_id = if detected == LanguageId::plain_text() {
languages.first().cloned().unwrap_or(detected)
} else {
@@ -3836,16 +3828,8 @@ impl LspManager {
}
}
/// A server gave up: its fallbacks take over the open documents, and the servers
/// they replace leave.
async fn fallbacks_take_over(&self) {
self.attach_fallbacks();
self.detach_shadowed_fallbacks().await;
}
/// A server enabled again shadows the fallbacks attached in its place, and a
/// fallback that took over may replace a server attached earlier: they leave the
/// open documents, and stop once no document uses them.
/// A server enabled again shadows the fallbacks attached in its place: they
/// leave the open documents, and stop once no document uses them.
async fn detach_shadowed_fallbacks(&self) {
let open: Vec<(DocId, LanguageId, PathBuf)> =
self.docs.lock().iter().map(|(id, d)| (*id, d.language.clone(), d.path.clone())).collect();
@@ -3861,7 +3845,6 @@ impl LspManager {
.filter(|a| {
!wanted.iter().any(|w| w.id == a.server.id)
&& (configs.iter().any(|c| c.fallback && c.name == a.server.name)
|| configs.iter().any(|c| c.replaces.contains(&a.server.name))
|| (a.server.name == "clangd" && wanted.iter().any(|s| s.name == arduino::SERVER)))
})
.map(|a| a.server.id)
-22
Переглянути файл
@@ -110,17 +110,6 @@ pub fn is_decompiled(text: &str) -> bool {
})
}
/// Whether a `.class` stub is written in Java: its first `package` or `import` line ends with `;`.
/// The Kotlin language server shows Java classes from jars as Java and Kotlin ones as Kotlin, under
/// the same `.class` name.
pub fn is_java_class_stub(text: &str) -> bool {
text.lines()
.take(200)
.map(str::trim)
.find(|line| line.starts_with("package ") || line.starts_with("import "))
.is_some_and(|line| line.ends_with(';'))
}
/// `scheme` of a URI (`jdt` for `jdt://…`).
pub fn scheme(uri: &str) -> &str {
uri.split_once(':').map(|(s, _)| s).unwrap_or("")
@@ -216,17 +205,6 @@ mod tests {
const JDT: &str = "jdt://contents/spring-boot-4.1.1.jar/org.springframework.boot/SpringApplication.class?=spring-demo/%5C/Users%5C/me%5C/.m2%5C/repository%5C/spring-boot-4.1.1.jar%3Corg.springframework.boot%28SpringApplication.class";
#[test]
fn class_stubs_in_java_or_kotlin() {
let java = "// IntelliJ API Decompiler stub source generated from a class file\n\npackage com.boydti.fawe.util;\n\npublic class EditSessionBuilder {\n}\n";
let kotlin = "// IntelliJ API Decompiler stub source generated from a class file\n// Implementation of methods is not available\n\npackage kotlin.collections\n\npublic fun <T> listOf(): List<T> { /* compiled code */ }\n";
let imports_only = "import java.util.List;\n\npublic class A {}\n";
assert!(is_java_class_stub(java));
assert!(is_java_class_stub(imports_only));
assert!(!is_java_class_stub(kotlin));
assert!(!is_java_class_stub("public class A {}"));
}
#[test]
fn csharp_metadata_titles_and_kinds() {
for (uri, expected) in [
-62
Переглянути файл
@@ -264,7 +264,6 @@ fn server_cfg(name: &str) -> LanguageServerConfig {
install_hint: Some(format!("install {name}")),
connect: None,
fallback: false,
replaces: Vec::new(),
features: Vec::new(),
code_action_kinds: Vec::new(),
max_java: None,
@@ -3287,67 +3286,6 @@ async fn a_server_requiring_a_root_marker_serves_only_files_below_one() {
h.wait_status("alt", ServerStatus::Ready).await;
}
/// A server that `replaces` another (a PHP server with its own Laravel support and
/// `laravel-lsp`) keeps it away while it serves, and only then.
#[tokio::test(flavor = "multi_thread")]
async fn a_replaced_server_stays_away_while_its_replacement_serves() {
let servers = [("main", incremental_caps()), ("alt", incremental_caps()), ("framework", incremental_caps())];
let configure = |cfg: &mut LanguageServerConfig| match cfg.name.as_str() {
"alt" => {
cfg.fallback = true;
cfg.replaces = vec!["framework".into()];
}
"framework" => cfg.require_root_marker = true,
_ => {}
};
let h = harness_configured("mock", "mk", &servers, configure);
let disabled: Arc<Mutex<Vec<String>>> = Default::default();
{
let disabled = disabled.clone();
h.mgr.set_servers_hook(Box::new(move |_, defined| {
defined.iter().filter(|c| !disabled.lock().contains(&c.name)).cloned().collect()
}));
}
std::fs::write(h.root.join("mock.toml"), "").unwrap();
let (_, path) = h.open("a.mk", "x");
let uri = uri_of(&path);
// The preferred server serves: the framework's server joins it, the alternative stays away.
h.wait_status("main", ServerStatus::Ready).await;
h.wait_status("framework", ServerStatus::Ready).await;
eventually(|| h.launcher.state("framework").docs.lock().contains_key(&uri)).await;
assert!(h.statuses("alt").is_empty());
// The alternative takes over: the server it replaces closes the document and stops.
disabled.lock().push("main".into());
h.mgr.reconfigure().await;
h.wait_status("alt", ServerStatus::Ready).await;
eventually(|| h.launcher.state("alt").docs.lock().contains_key(&uri)).await;
assert!(!h.launcher.state("framework").notified("textDocument/didClose").is_empty());
assert_eq!(h.statuses("framework").last(), Some(&ServerStatus::Stopped));
assert_eq!(h.mgr.servers().iter().map(|s| s.name.as_str()).collect::<Vec<_>>(), ["alt"]);
// The preferred server again: the framework's server comes back with it.
disabled.lock().clear();
h.mgr.reconfigure().await;
h.wait_status("main", ServerStatus::Ready).await;
eventually(|| h.statuses("framework").last() == Some(&ServerStatus::Ready)).await;
assert_eq!(h.statuses("alt").last(), Some(&ServerStatus::Stopped));
// A preferred server that is not installed: the alternative replaces the framework's
// server although that one attached first.
let servers = [("ghost", json!({})), ("alt", incremental_caps()), ("framework", incremental_caps())];
let h = harness_configured("mock", "mk", &servers, configure);
h.launcher.state("ghost").missing.store(true, Ordering::SeqCst);
std::fs::write(h.root.join("mock.toml"), "").unwrap();
let (_, path) = h.open("a.mk", "x");
let uri = uri_of(&path);
h.wait_status("ghost", ServerStatus::Missing).await;
h.wait_status("alt", ServerStatus::Ready).await;
eventually(|| h.launcher.state("alt").docs.lock().contains_key(&uri)).await;
eventually(|| !h.mgr.servers().iter().any(|s| s.name == "framework")).await;
}
#[tokio::test(flavor = "multi_thread")]
async fn a_fallback_leaves_when_the_preferred_server_is_enabled_again() {
let h = harness_with_fallbacks(&[("main", incremental_caps()), ("alt", incremental_caps())], &["alt"]);
-3
Переглянути файл
@@ -419,7 +419,6 @@ async fn missing_binary_is_reported_with_install_hint() {
install_hint: Some("npm i -g nope-ls".into()),
connect: None,
fallback: false,
replaces: Vec::new(),
features: Vec::new(),
code_action_kinds: Vec::new(),
max_java: None,
@@ -693,7 +692,6 @@ async fn typescript_language_server_end_to_end() {
install_hint: None,
connect: None,
fallback: false,
replaces: Vec::new(),
features: Vec::new(),
code_action_kinds: Vec::new(),
max_java: None,
@@ -747,7 +745,6 @@ fn npm_server(tools: &Path, name: &str, bin: &str, init: Option<serde_json::Valu
install_hint: None,
connect: None,
fallback: false,
replaces: Vec::new(),
features: Vec::new(),
code_action_kinds: Vec::new(),
max_java: None,
-1
Переглянути файл
@@ -1306,7 +1306,6 @@ fn custom_server(name: &str, ls: &LanguageServerSettings) -> LanguageServerConfi
}),
connect: None,
fallback: false,
replaces: Vec::new(),
features: Vec::new(),
code_action_kinds: Vec::new(),
max_java: None,
-1
Переглянути файл
@@ -35,7 +35,6 @@ pub(crate) fn server(name: &str) -> LanguageServerConfig {
install_hint: None,
connect: None,
fallback: false,
replaces: Vec::new(),
features: Vec::new(),
code_action_kinds: Vec::new(),
max_java: None,
-22
Переглянути файл
@@ -170,28 +170,6 @@ mod tests {
assert_eq!(select_asset(&["laravel-lsp"], rules, LINUX_X64), None);
}
#[test]
fn phoxite_assets() {
let names = [
"phoxite-lsp-aarch64-apple-darwin",
"phoxite-lsp-x86_64-apple-darwin",
"phoxite-lsp-aarch64-unknown-linux-gnu",
"phoxite-lsp-x86_64-unknown-linux-gnu",
"phoxite-lsp-x86_64-pc-windows-msvc.exe",
// Not for any platform here: the musl build, the checksums, the VS Code packages.
"phoxite-lsp-x86_64-unknown-linux-musl",
"phoxite-lsp-x86_64-unknown-linux-gnu.sha256",
"phoxite-lsp-x86_64-pc-windows-msvc.exe.sha256",
"phoxite-linux-x64-0.2.1.vsix",
];
let rules = crate::registry::find("phoxite").unwrap().asset_rules();
assert_eq!(select_asset(&names, rules, MAC_ARM), Some(names[0]));
assert_eq!(select_asset(&names, rules, MAC_X64), Some(names[1]));
assert_eq!(select_asset(&names, rules, LINUX_ARM), Some(names[2]));
assert_eq!(select_asset(&names, rules, LINUX_X64), Some(names[3]));
assert_eq!(select_asset(&names, rules, WIN), Some(names[4]));
}
#[test]
fn kmp_lsp_assets_include_the_native_jar_indexer() {
let names = [
-32
Переглянути файл
@@ -458,38 +458,6 @@ pub static TOOLS: &[ToolSpec] = &[
homepage: "https://github.com/laravel/lsp",
needs: &[],
},
ToolSpec {
name: "phoxite",
display: "Phoxite",
kind: LanguageServer,
commands: &["phoxite-lsp"],
// Plain binaries per platform (`phoxite-lsp-<target triple>[.exe]`), each with a
// `.sha256` beside it.
method: Method::Release {
source: ReleaseSource::GitHub { repo: "samehelhawary/phoxite" },
assets: &[
rule(Mac, Arm64, "phoxite-lsp-aarch64-apple-darwin"),
rule(Mac, X64, "phoxite-lsp-x86_64-apple-darwin"),
rule(Linux, Arm64, "phoxite-lsp-aarch64-unknown-linux-gnu"),
rule(Linux, X64, "phoxite-lsp-x86_64-unknown-linux-gnu"),
rule(Windows, Arm64, "phoxite-lsp-aarch64-pc-windows-msvc.exe"),
rule(Windows, X64, "phoxite-lsp-x86_64-pc-windows-msvc.exe"),
],
locate: &[
"phoxite-lsp",
"phoxite-lsp-aarch64-apple-darwin",
"phoxite-lsp-x86_64-apple-darwin",
"phoxite-lsp-aarch64-unknown-linux-gnu",
"phoxite-lsp-x86_64-unknown-linux-gnu",
"phoxite-lsp-aarch64-pc-windows-msvc",
"phoxite-lsp-x86_64-pc-windows-msvc",
],
},
fallback: None,
version: ver("phoxite-lsp"),
homepage: "https://github.com/samehelhawary/phoxite",
needs: &[],
},
ToolSpec {
name: "gopls",
display: "gopls",
+1 -2
Переглянути файл
@@ -146,8 +146,7 @@ Closing a selected result activates its left neighbor, or its right neighbor if
**Edit Data** (`F4`) opens a table in an editor tab with server-side paging (100 to 5,000 rows), a `WHERE` filter and an `ORDER BY` field (both with completion). Click a column header to sort; `Shift`-click to add more sort columns.
- Double-click, `Enter` or `F2` edits a cell; `Shift+Enter` opens a larger editor. Pasting tab-separated text fills several cells.
- **Add Row** (`⌘N` / `Alt+Insert`), **Delete Rows** (`Ctrl+Y` on Windows and Linux), **Set NULL** (`⌘⌫` / `Ctrl+Backspace`), **Set DEFAULT** (`⌘⇧⌫` / `Ctrl+Shift+Backspace`). `Space` toggles booleans.
- **Reload Page** (`⌘R` / `Ctrl+F5`), **Previous Page** and **Next Page** (`⌘⌥↑` / `⌘⌥↓`, `Ctrl+Alt+Up` / `Ctrl+Alt+Down`). These, the copy commands and **Export Data** are actions: find them with **Find Action** and assign shortcuts in **Settings › Keymap**.
- **Add Row**, **Delete Rows**, **Set NULL** (`⌘⌫` / `Ctrl+Backspace`), **Set DEFAULT** (`⌘⇧⌫` / `Ctrl+Shift+Backspace`). `Space` toggles booleans.
- **Submit** (`⌘Enter` / `Ctrl+Enter`) sends all pending changes in one transaction; **Revert** (`⌘⌥Z` / `Ctrl+Alt+Z`) discards them.
Console results are editable the same way when the query is a plain select from one table that includes the primary key. Tables without a primary key, joins, aggregates, `UNION` queries, read-only data sources and ClickHouse results are read-only.
-1
Переглянути файл
@@ -101,7 +101,6 @@ Each entry starts one LSP server. Servers are listed in order; all regular serve
| `settings` | table | Answers the server's `workspace/configuration` requests. Without it, the requested sections are looked up in `initialization-options`. |
| `install-hint` | string | Shown when the server is missing and the IDE cannot install it. |
| `fallback` | bool | An alternative to the servers listed before it; used only while none of them is installed. |
| `replaces` | string array | Names of servers listed after this one that it makes redundant. They are not used while this server serves the file. Use it for an alternative that covers what an added server does. |
| `features` | string array | Use the server only for these features; empty means everything. Values: `completion`, `inline-completion`, `hover`, `signature-help`, `definition`, `declaration`, `type-definition`, `implementation`, `references`, `document-highlight`, `document-symbol`, `workspace-symbol`, `code-action`, `code-lens`, `rename`, `formatting`, `inlay-hint`, `semantic-tokens`, `document-link`, `call-hierarchy`, `type-hierarchy`, `folding-range`, `selection-range`, `diagnostics`. |
| `code-action-kinds` | string array | Keep only these code action kinds, matched by prefix (`refactor` keeps `refactor.extract`); empty keeps all. |
| `connect` | string | `host:port` of a server that speaks LSP over TCP. See [TCP servers](#tcp-servers). |
+1 -1
Переглянути файл
@@ -148,7 +148,7 @@ The table lists every built-in language definition. Server and debugger names in
| OCaml | `ocaml` | `.ml`, `.mll`, `.mly` | Yes | Yes | ocamllsp | ocamlearlybird |
| OCaml Interface | `ocaml.interface` | `.mli` | Yes | Yes | ocamllsp | — |
| Perl | `perl` | `.pl`, `.pm`, `.pod`, `.psgi`, `.cgi` | Yes | — | **perlnavigator** | — |
| PHP | `php` | `.php`, `.phtml`, `.php3`, `.php4`, `.php5`, … | Yes | Yes | **intelephense** → phpactor → **phoxite** + **laravel-lsp** | **php-debug** |
| PHP | `php` | `.php`, `.phtml`, `.php3`, `.php4`, `.php5`, … | Yes | Yes | **intelephense** → phpactor + **laravel-lsp** | **php-debug** |
| Plain Text | `plaintext` | `.txt`, `.text` | — | — | — | — |
| PowerShell | `powershell` | `.ps1`, `.psm1`, `.psd1`, `.pssc`, `.psrc` | Yes | — | powershell-editor-services | — |
| Prisma | `prisma` | `.prisma` | Yes | Yes | **prisma-language-server** | — |
+7 -11
Переглянути файл
@@ -7,14 +7,11 @@ OpenIDEA highlights PHP files (`.php`, `.phtml`, `.phpt` and older `.php3`–`.p
## Language servers
| Server | When it runs |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `intelephense` | Default. Workspace root: `composer.json`, `.phpactor.json` or `index.php`. |
| `phpactor` | Fallback: used only while Intelephense is not installed. |
| `phoxite` | Alternative with its own Laravel and Blade support: used while neither server above is installed, or when you pick it in **Settings › Languages & Frameworks › Language Servers**. |
| `laravel-lsp` | Laravel projects only (below an `artisan` file): hover, definition and completion inside `config('…')`, `route('…')` and `view('…')`. |
While Phoxite serves a project, `laravel-lsp` is not started: Phoxite answers the Laravel strings itself.
| Server | When it runs |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `intelephense` | Default. Workspace root: `composer.json`, `.phpactor.json` or `index.php`. |
| `phpactor` | Fallback: used only while Intelephense is not installed. |
| `laravel-lsp` | Laravel projects only (below an `artisan` file): hover, definition and completion inside `config('…')`, `route('…')` and `view('…')`. |
Intelephense checks code against the project's PHP version (see [Language level](#language-level)) and indexes the stubs and include paths you configure.
@@ -28,7 +25,6 @@ When a `.php` file opens and Intelephense is missing, a notification offers **In
| ------------------ | ---------------------------------------------------------------------- |
| Intelephense | npm (`intelephense`) |
| Laravel LSP | GitHub release (`laravel/lsp`) |
| Phoxite | GitHub release (`samehelhawary/phoxite`) |
| PHP Debug (Xdebug) | Open VSX (`xdebug.php-debug`); needs Node.js to run |
| phpactor | Not installable from the IDE; install it yourself and put it on `PATH` |
@@ -81,12 +77,12 @@ See [Debugging](/en/guide/debugging).
## Framework support
- **Laravel**: Laravel LSP for `config()`, `route()` and `view()` strings, and an `artisan serve` configuration. With Phoxite as the PHP server, routes, views, config, translations and Eloquent models get completion, navigation and rename from it instead.
- **Laravel**: Laravel LSP for `config()`, `route()` and `view()` strings, and an `artisan serve` configuration.
- **WordPress** and similar platforms: add their stubs under **Additional stubs** and the platform folder under **Include paths**.
## Limitations
- No Blade or Twig template support with Intelephense; only `.php` files get PHP code insight. Phoxite adds code insight in `.blade.php` files, without Blade highlighting.
- No Blade or Twig template support; only `.php` files get PHP code insight.
- phpactor is not installed by the IDE.
- Run with Coverage is not available for PHPUnit.
- Debugging needs the Xdebug extension in your PHP; the IDE does not install it.
+1 -2
Переглянути файл
@@ -145,8 +145,7 @@ SQL 补全基于已连接的架构:`FROM`/`JOIN` 后补全表(并根据外
**编辑数据**(`F4`)在编辑器标签页中打开表,服务器端分页(每页 100 到 5,000 行),并提供 `WHERE` 过滤和 `ORDER BY` 字段(都支持补全)。点击列标题排序,按住 `Shift` 点击可以追加排序列。
- 双击、`Enter` 或 `F2` 编辑单元格;`Shift+Enter` 打开更大的编辑框。粘贴制表符分隔的文本可以一次填写多个单元格。
- **添加行**(`⌘N` / `Alt+Insert`)、**删除行**(Windows 和 Linux 上为 `Ctrl+Y`)、**设为 NULL**(`⌘⌫` / `Ctrl+Backspace`)、**设为默认值**(`⌘⇧⌫` / `Ctrl+Shift+Backspace`)。`Space` 切换布尔值。
- **重新加载页面**(`⌘R` / `Ctrl+F5`)、**上一页** 和 **下一页**(`⌘⌥↑` / `⌘⌥↓`,`Ctrl+Alt+Up` / `Ctrl+Alt+Down`)。这些命令、各种复制命令和 **导出数据** 都是操作:可以在 **查找操作** 中找到,并在 **设置 › 按键映射** 中设置快捷键。
- **添加行**、**删除行**、**设为 NULL**(`⌘⌫` / `Ctrl+Backspace`)、**设为默认值**(`⌘⇧⌫` / `Ctrl+Shift+Backspace`)。`Space` 切换布尔值。
- **提交**(`⌘Enter` / `Ctrl+Enter`)在一个事务中提交所有待定更改;**还原**(`⌘⌥Z` / `Ctrl+Alt+Z`)放弃更改。
如果控制台查询是对单表的简单 select 且包含主键,结果同样可以编辑。没有主键的表、连接查询、聚合、`UNION` 查询、只读数据源和 ClickHouse 的结果都是只读的。
-1
Переглянути файл
@@ -101,7 +101,6 @@ root-markers = ["angular.json", "node_modules/@angular/core"]
| `settings` | 表 | 用于响应服务器的 `workspace/configuration` 请求。不写时,从 `initialization-options` 中查找请求的配置节。 |
| `install-hint` | 字符串 | 服务器缺失且 IDE 无法安装时显示的提示。 |
| `fallback` | 布尔 | 作为前面服务器的备选,只在它们都未安装时使用。 |
| `replaces` | 字符串数组 | 排在它后面、因它而变得多余的服务器名称。它为文件提供服务时,这些服务器不会被使用。用于能覆盖附加服务器功能的备选服务器。 |
| `features` | 字符串数组 | 只把服务器用于这些功能;为空表示全部。可选值:`completion`、`inline-completion`、`hover`、`signature-help`、`definition`、`declaration`、`type-definition`、`implementation`、`references`、`document-highlight`、`document-symbol`、`workspace-symbol`、`code-action`、`code-lens`、`rename`、`formatting`、`inlay-hint`、`semantic-tokens`、`document-link`、`call-hierarchy`、`type-hierarchy`、`folding-range`、`selection-range`、`diagnostics`。 |
| `code-action-kinds` | 字符串数组 | 只保留这些种类的代码操作,按前缀匹配(`refactor` 包含 `refactor.extract`);为空则全部保留。 |
| `connect` | 字符串 | 通过 TCP 提供 LSP 的服务器地址 `host:port`,见 [TCP 服务器](#tcp-服务器)。 |
+1 -1
Переглянути файл
@@ -143,7 +143,7 @@ IDE 安装工具从不需要 `sudo`。工具装在本地数据目录下 IDE 自
| OCaml | `ocaml` | `.ml`, `.mll`, `.mly` | 是 | 是 | ocamllsp | ocamlearlybird |
| OCaml Interface | `ocaml.interface` | `.mli` | 是 | 是 | ocamllsp | — |
| Perl | `perl` | `.pl`, `.pm`, `.pod`, `.psgi`, `.cgi` | 是 | — | **perlnavigator** | — |
| PHP | `php` | `.php`, `.phtml`, `.php3`, `.php4`, `.php5`, … | 是 | 是 | **intelephense** → phpactor → **phoxite** + **laravel-lsp** | **php-debug** |
| PHP | `php` | `.php`, `.phtml`, `.php3`, `.php4`, `.php5`, … | 是 | 是 | **intelephense** → phpactor + **laravel-lsp** | **php-debug** |
| Plain Text | `plaintext` | `.txt`, `.text` | — | — | — | — |
| PowerShell | `powershell` | `.ps1`, `.psm1`, `.psd1`, `.pssc`, `.psrc` | 是 | — | powershell-editor-services | — |
| Prisma | `prisma` | `.prisma` | 是 | 是 | **prisma-language-server** | — |
+7 -11
Переглянути файл
@@ -7,14 +7,11 @@ OpenIDEA 开箱即可高亮 PHP 文件(`.php`、`.phtml`、`.phpt` 以及老
## 语言服务器
| 服务器 | 启用条件 |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `intelephense` | 默认。工作区根:`composer.json`、`.phpactor.json` 或 `index.php`。 |
| `phpactor` | 备选:仅在未安装 Intelephense 时使用。 |
| `phoxite` | 备选,自带 Laravel 和 Blade 支持:仅在以上两个服务器都未安装时使用,或在 **设置 › 语言和框架 › 语言服务器** 中选中它时使用。 |
| `laravel-lsp` | 仅限 Laravel 项目(`artisan` 文件所在目录之下):在 `config('…')`、`route('…')`、`view('…')` 中提供悬停、跳转和补全。 |
Phoxite 为项目提供服务时不会启动 `laravel-lsp`:Laravel 相关的字符串由 Phoxite 自己处理。
| 服务器 | 启用条件 |
| -------------- | --------------------------------------------------------------------------------------------------------------------- |
| `intelephense` | 默认。工作区根:`composer.json`、`.phpactor.json` 或 `index.php`。 |
| `phpactor` | 备选:仅在未安装 Intelephense 时使用。 |
| `laravel-lsp` | 仅限 Laravel 项目(`artisan` 文件所在目录之下):在 `config('…')`、`route('…')`、`view('…')` 中提供悬停、跳转和补全。 |
Intelephense 会按项目的 PHP 版本检查代码(见下文“语言级别”),并索引你配置的 stub 和包含路径。
@@ -28,7 +25,6 @@ Intelephense 会按项目的 PHP 版本检查代码(见下文“语言级别
| ------------------ | -------------------------------------------------- |
| Intelephense | npm(`intelephense`) |
| Laravel LSP | GitHub release(`laravel/lsp`) |
| Phoxite | GitHub release(`samehelhawary/phoxite`) |
| PHP Debug (Xdebug) | Open VSX(`xdebug.php-debug`),运行时需要 Node.js |
| phpactor | IDE 不负责安装,请自行安装并放到 `PATH` 上 |
@@ -81,12 +77,12 @@ PHPUnit 运行配置类型包含 **目标**、**配置文件**、**测试过滤
## 框架支持
- **Laravel**:Laravel LSP 支持 `config()`、`route()`、`view()` 中的字符串,并提供 `artisan serve` 运行配置。以 Phoxite 作为 PHP 服务器时,路由、视图、配置、翻译和 Eloquent 模型的补全、跳转和重命名改由它提供。
- **Laravel**:Laravel LSP 支持 `config()`、`route()`、`view()` 中的字符串,并提供 `artisan serve` 运行配置。
- **WordPress** 等平台:在 **附加存根** 中加入对应 stub,在 **包含路径** 中加入平台代码目录。
## 已知限制
- 使用 Intelephense 时不支持 Blade 或 Twig 模板,只有 `.php` 文件有 PHP 代码智能。Phoxite 为 `.blade.php` 文件提供代码智能,但没有 Blade 语法高亮。
- 不支持 Blade 或 Twig 模板,只有 `.php` 文件有 PHP 代码智能。
- IDE 不会安装 phpactor。
- PHPUnit 不支持使用覆盖率运行。
- 调试需要 PHP 已安装 Xdebug 扩展,IDE 不负责安装。
-11
Переглянути файл
@@ -26,17 +26,6 @@ args = ["language-server"]
root-markers = ["composer.json", ".phpactor.json"]
install-hint = "Install phpactor (https://phpactor.readthedocs.io/en/master/usage/standalone.html)"
# Alternative with its own Laravel and Blade support. https://github.com/samehelhawary/phoxite
[[language-servers]]
name = "phoxite"
fallback = true
command = "phoxite-lsp"
args = []
root-markers = ["composer.json", "artisan", "index.php"]
# It answers the Laravel strings itself.
replaces = ["laravel-lsp"]
install-hint = "Install phoxite-lsp from https://github.com/samehelhawary/phoxite/releases and put it on PATH"
# Laravel projects only: hover, definition and completion inside
# config('…'), route('…') and view('…'). Last: Intelephense keeps PHP hover,
# rename and symbols. https://github.com/laravel/lsp
-14
Переглянути файл
@@ -290,20 +290,6 @@ export const documentSynced = Facet.define<() => Promise<void>, (() => Promise<v
combine: (values) => values[0] ?? null,
});
/**
* Undo / Redo of an editor whose history is kept outside CodeMirror (notebook cells share
* the notebook's backend history). Commands that would call CodeMirror's history (Vim's
* `u` / `Ctrl-R`) go through it instead.
*/
export interface ExternalHistory {
undo(): void;
redo(): void;
}
export const externalHistory = Facet.define<ExternalHistory, ExternalHistory | null>({
combine: (values) => values[0] ?? null,
});
export function whenSynced(view: EditorView): Promise<void> {
return view.state.facet(documentSynced)?.() ?? Promise.resolve();
}
+2 -25
Переглянути файл
@@ -75,7 +75,7 @@ import { resetAllEditorsFontZoom, stepAllEditorsFontZoom } from "./cm/prefs";
import { useProject } from "@/platform/project";
import { call, commands } from "@/platform/ipc";
import { editorPrefs } from "@/platform/editorSettings";
import { menuGroupItems, notifications } from "@/workbench/contributions";
import { notifications } from "@/workbench/contributions";
import { togglePinSelectedContent } from "@/workbench/toolwindows/content";
import { useToolWindowLayout } from "@/workbench/toolwindows/store";
import { toggleReadOnly } from "./fileAttributes";
@@ -529,29 +529,7 @@ function copyReference(reference: Promise<string>) {
function copyPathReferencePopup(view: EditorView, slot: EditorSlot) {
const path = slot.model.path;
const { doc, selection } = view.state;
const line = doc.lineAt(selection.main.head).number;
const { from, to } = selection.main;
// The selected lines, leaving out the one a selection ends at the start of.
const first = doc.lineAt(from).number;
const last = Math.max(first, doc.lineAt(to).number - (to > from && doc.lineAt(to).from === to ? 1 : 0));
const contributed = menuGroupItems("copyPath", {
paths: [path],
line: first - 1,
endLine: last > first ? last - 1 : undefined,
}).flatMap((item) =>
(item.kind ?? "item") === "item" && "run" in item && item.id && item.run && item.preview
? [
{
id: item.id,
label: item.verbatim ? item.label : tx(item.label),
preview: item.preview,
shortcut: shortcutLabel(item.id),
run: item.run,
},
]
: [],
);
const line = view.state.doc.lineAt(view.state.selection.main.head).number;
const flavours = [
{ id: "project.copyAbsolutePath", label: "Absolute Path", value: pathToCopy("absolute", path) },
{ id: "project.copyFileName", label: "File Name", value: pathToCopy("name", path) },
@@ -579,7 +557,6 @@ function copyPathReferencePopup(view: EditorView, slot: EditorSlot) {
void executeAction(f.id, f.id === "editor.copyPathWithLineNumber" ? f.value : path);
},
})),
...contributed,
{
id: "editor.copyReference",
label: tx("Reference"),
+2 -5
Переглянути файл
@@ -1,7 +1,4 @@
import { tags as t, type styleTags } from "@lezer/highlight";
/**
* @lezer/javascript styles `.` as a deref operator, but not `?.`; it tags `this` as `self` (Python's
* `self` colour) and `super` as an atom, which WebStorm colours as keywords.
*/
export const JS_TAGS: Parameters<typeof styleTags>[0] = { "?.": t.derefOperator, "this super": t.keyword };
/** @lezer/javascript styles `.` as a deref operator, but not `?.`. */
export const JS_TAGS: Parameters<typeof styleTags>[0] = { "?.": t.derefOperator };
-25
Переглянути файл
@@ -270,31 +270,6 @@ describe("language modes", () => {
}
});
it("colours `this` and `super` as keywords in Java, JavaScript, TypeScript and C++", async () => {
const highlighter = tagHighlighter([
{ tag: t.keyword, class: "keyword" },
{ tag: t.self, class: "self" },
{ tag: t.atom, class: "atom" },
]);
for (const [mode, path, doc, expected] of [
["Java", "/p/A.java", "class A extends B { A() { super(); this.a = 1; } }", ["super", "this"]],
["JavaScript", "/p/a.js", "class A extends B { m() { super.m(); this.a = 1; } }", ["super", "this"]],
["TypeScript", "/p/a.ts", "class A extends B { m() { super.m(); this.a = 1; } }", ["super", "this"]],
["C++", "/p/a.cpp", "void A::m() { this->a = 1; }", ["this"]],
] as const) {
const support = await loadSupport(findLanguageDescription(mode, path)!);
const found: Array<[string, string]> = [];
highlightTree(support!.language.parser.parse(doc), highlighter, (from, to, style) =>
found.push([doc.slice(from, to), style]),
);
const words = new Set<string>(expected);
expect(
found.filter(([text]) => words.has(text)),
mode,
).toEqual(expected.map((word) => [word, "keyword"]));
}
});
it("recognizes go.mod and go.work files by mode and filename", async () => {
for (const [mode, path] of [
["GoMod", "/project/go.mod"],
+1 -5
Переглянути файл
@@ -293,11 +293,9 @@ const CSS_TAGS: Parameters<typeof styleTags>[0] = {
"ClassName IdName PseudoClassName ColorLiteral CallTag": t.tagName,
};
// @lezer/java tags annotations as plain identifiers, and `this` as `self` (Python's `self` colour);
// IntelliJ colours `this` as a keyword.
// @lezer/java tags annotations as plain identifiers.
export const JAVA_TAGS: Parameters<typeof styleTags>[0] = {
"MarkerAnnotation/Identifier Annotation/Identifier MarkerAnnotation Annotation": t.annotation,
this: t.keyword,
};
/** Highlighting the stock grammars lack or colour unlike IntelliJ. */
@@ -308,8 +306,6 @@ const EXTRA_TAGS: Record<string, Parameters<typeof styleTags>[0]> = {
JSX: JS_TAGS,
TSX: JS_TAGS,
Java: JAVA_TAGS,
// CLion colours `this` as a keyword.
"C++": { this: t.keyword },
PHP: {
"; ,": t.separator,
"ClassDeclaration/Name BaseClause/Name InterfaceClause/Name": t.className,
+1 -39
Переглянути файл
@@ -10,7 +10,7 @@ import { LspPopups } from "@/editor/lsp/Popups";
import { registerProjectActions } from "@/features/project-tree/actions";
import { useProjectTree } from "@/features/project-tree/store";
import { useContextMenuStore } from "@/ui";
import { provideNotificationService, registerMenuGroup, type MenuGroupContext } from "@/workbench/contributions";
import { provideNotificationService } from "@/workbench/contributions";
import * as controller from "./controller";
import { createMemoryBackend } from "./backend";
import { registerEditorActions } from "./actions";
@@ -189,44 +189,6 @@ describe("editor Copy Path/Reference chooser", () => {
expect(useLspPopup.getState().popup).toBeNull();
});
it("lists contributed links before Reference, for the selected lines", async () => {
const contexts: MenuGroupContext[] = [];
const run = vi.fn();
disposers.push(
registerMenuGroup({
id: "test.link",
menus: ["copyPath"],
items: (_menu, ctx) => {
contexts.push(ctx);
return [{ id: "test.copyLink", label: "Host Link", verbatim: true, preview: "https://host/a#L1", run }];
},
}),
);
const view = ctrl.activeSlot!.view!;
await executeAction("editor.copyPathReference");
expect(
popup()
.items.map((item) => item.label)
.slice(-2),
).toEqual(["Host Link", "Reference"]);
expect(popup().items.at(-2)).toMatchObject({
preview: "https://host/a#L1",
shortcut: shortcutLabel("test.copyLink"),
});
await popup().items.at(-2)!.run();
expect(run).toHaveBeenCalledOnce();
// From the first line into the second; then ending at the start of the second line.
view.dispatch({ selection: { anchor: 0, head: documentText.indexOf("A {}") } });
await executeAction("editor.copyPathReference");
view.dispatch({ selection: { anchor: 0, head: documentText.indexOf("class") } });
await executeAction("editor.copyPathReference");
expect(contexts.map(({ paths, line, endLine }) => [paths, line, endLine])).toEqual([
[[path], 1, undefined],
[[path], 0, 1],
[[path], 0, undefined],
]);
});
it("adds the chooser to Copy / Paste Special", () => {
vi.spyOn(ctrl.activeSlot!.view!, "posAtCoords").mockReturnValue(null);
ctrl.onContextMenu(ctrl.activeSlot!, new MouseEvent("contextmenu"));
+8 -8
Переглянути файл
@@ -74,7 +74,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px 0 8px;
}
.pin {
@@ -89,7 +89,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-height: 36px;
padding: 0 12px;
background: var(--bg-editor-banner, color-mix(in srgb, var(--accent) 7%, var(--bg-editor, var(--bg-elev))));
@@ -133,8 +133,8 @@
display: grid;
grid-template-columns: minmax(220px, 420px) auto 1fr;
align-items: center;
column-gap: var(--space-1-5);
row-gap: var(--space-1-5);
column-gap: 6px;
row-gap: 6px;
padding: 6px 8px 6px 10px;
background: var(--bg-editor-inline, var(--bg-elev));
border-bottom: 1px solid var(--border-editor-tabs, var(--border));
@@ -155,7 +155,7 @@
.findButtons {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
}
.findCount {
font-size: var(--fs-ui);
@@ -173,14 +173,14 @@
.replaceButtons {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
/* Go to line */
.gotoBody {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 8px 16px 0;
}
.gotoHint {
@@ -316,7 +316,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
height: 26px;
padding: 0 8px;
overflow: hidden;
+1 -1
Переглянути файл
@@ -115,7 +115,7 @@ function EmptyEditorArea() {
return (
<div ref={ref} className={styles.area}>
<EmptyEditor />
{over && <div className={styles.dropZone} aria-hidden="true" />}
{over && <div className={clsx(styles.dropZone, styles["drop-center"])} aria-hidden="true" />}
</div>
);
}
+2 -2
Переглянути файл
@@ -58,7 +58,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-list-row);
padding: 0 6px;
border-radius: var(--radius-row);
@@ -87,7 +87,7 @@
.childHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-list-row);
padding: 0 6px;
margin-bottom: 2px;
+10 -10
Переглянути файл
@@ -11,7 +11,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 0 12px;
font-size: var(--fs-ui);
font-weight: 600;
@@ -96,7 +96,7 @@
.item {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
width: 100%;
font-size: var(--fs-ui);
@@ -263,7 +263,7 @@
bottom: 0;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 6px;
border-top: 1px solid var(--border-popup);
background: var(--bg-popup);
@@ -283,7 +283,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 6px 0 12px;
background: var(--bg-popup-inline, var(--bg-elev));
border-bottom: 1px solid var(--border-popup);
@@ -342,7 +342,7 @@
height: var(--h-row);
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 0 14px;
font-size: var(--fs-ui);
}
@@ -368,7 +368,7 @@
flex: none;
display: flex;
align-items: flex-start;
gap: var(--space-1-5);
gap: 6px;
padding: 10px 14px 0;
font-size: var(--fs-ui);
color: var(--fg-muted);
@@ -421,7 +421,7 @@
border: 0;
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.reformatLegend {
margin-bottom: 6px;
@@ -432,21 +432,21 @@
.reformatOption {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
font-size: var(--fs-ui);
}
.pasteImports {
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
padding: 14px;
font-size: var(--fs-ui);
}
.pasteImportList {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
max-height: 280px;
overflow: auto;
overflow-wrap: anywhere;
+3 -3
Переглянути файл
@@ -19,7 +19,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.targets {
@@ -41,7 +41,7 @@
display: grid;
grid-template-columns: 1fr 110px;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 0 8px;
min-height: var(--h-list-row);
}
@@ -88,6 +88,6 @@
.busy {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--fg-muted);
}
+10 -10
Переглянути файл
@@ -35,7 +35,7 @@
.agentRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 100%;
min-width: 0;
padding: 0 8px;
@@ -69,7 +69,7 @@
.registryState {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 12px;
border-top: 1px solid var(--border);
color: var(--fg-muted);
@@ -79,7 +79,7 @@
.customActions {
display: flex;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
padding: 8px;
border-top: 1px solid var(--border);
}
@@ -116,7 +116,7 @@
.facts {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
margin-top: 2px;
color: var(--fg-muted);
@@ -143,12 +143,12 @@
.actions {
display: flex;
flex: none;
gap: var(--space-1-5);
gap: 6px;
}
.progress {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
max-width: 360px;
margin: 10px 0 0 34px;
}
@@ -182,7 +182,7 @@
}
.links {
display: flex;
gap: var(--space-3);
gap: 12px;
}
.link {
padding: 0;
@@ -209,7 +209,7 @@
.sectionTitle {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: 22px;
margin-bottom: 4px;
color: var(--fg-strong);
@@ -244,7 +244,7 @@
grid-template-columns: minmax(150px, max-content) minmax(0, 1fr);
align-items: center;
column-gap: 10px;
row-gap: var(--space-1);
row-gap: 4px;
min-width: 0;
}
.label {
@@ -278,7 +278,7 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
max-width: 480px;
}
+1 -1
Переглянути файл
@@ -575,7 +575,7 @@ function Details({
{job && (
<div className={styles.progress}>
<ProgressBar value={job.fraction} aria-label={tx`Installing ${agent.name}`} />
<span>{job.message}</span>
<span className={styles.hint}>{job.message}</span>
</div>
)}
{!job && installed && update && <p className={styles.notice}>{tx`${update} is available`}</p>}
+6 -6
Переглянути файл
@@ -18,14 +18,14 @@
min-height: 0;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: var(--space-3);
gap: 12px;
}
.column {
min-height: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 10px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-control);
@@ -42,7 +42,7 @@
min-height: 120px;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
overflow: auto;
}
@@ -50,9 +50,9 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
background: var(--bg-hover);
background: var(--bg-subtle);
border-radius: var(--radius-control);
font-family: var(--font-mono);
font-size: var(--fs-small);
@@ -65,7 +65,7 @@
.add {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.input {
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
.body {
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
height: 100%;
min-height: 0;
}
+7 -7
Переглянути файл
@@ -31,7 +31,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
}
@@ -105,7 +105,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 24px 12px;
color: var(--fg-muted);
}
@@ -154,7 +154,7 @@
.dockedBar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 2px 8px;
border-bottom: 1px solid var(--border);
}
@@ -215,7 +215,7 @@
padding: 4px 12px 8px;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.external > .row {
flex: none;
@@ -225,7 +225,7 @@
.chooser {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.chooserList {
height: 312px;
@@ -242,14 +242,14 @@
.chooserRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
width: 100%;
}
.chooserFooter {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
}
.chooserFolder {
flex: 0 0 auto;
+12 -12
Переглянути файл
@@ -75,7 +75,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
gap: 8px;
border-radius: inherit;
background: color-mix(in srgb, var(--bg-popup) 82%, transparent);
color: var(--fg-strong);
@@ -85,7 +85,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 6px 6px;
cursor: default;
}
@@ -95,13 +95,13 @@
flex-wrap: wrap;
align-items: center;
min-width: 0;
gap: var(--space-0-5);
gap: 2px;
}
.actions {
display: flex;
flex: none;
align-items: center;
gap: var(--space-1);
gap: 4px;
margin-left: auto;
}
/* Attach/reference buttons share the send button's 24px footprint and chrome. */
@@ -135,7 +135,7 @@
display: grid;
grid-template-columns: minmax(0, 80px) minmax(0, 1fr);
align-items: center;
gap: var(--space-3);
gap: 12px;
margin-top: 8px;
}
.settingsLabel {
@@ -147,7 +147,7 @@
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-control);
min-width: 0;
padding: 0 4px 0 6px;
@@ -229,7 +229,7 @@
display: flex;
align-items: baseline;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
}
.effortValue {
color: var(--fg-strong);
@@ -295,7 +295,7 @@
.modeOption {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 24px;
margin: 0 6px;
padding: 0 8px;
@@ -318,7 +318,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
margin-top: 6px;
padding: 8px 14px 2px;
border-top: 1px solid var(--border);
@@ -329,7 +329,7 @@
.bar {
flex-direction: row;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.toolbar {
flex-wrap: nowrap;
@@ -392,7 +392,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 10px 0;
cursor: default;
}
@@ -539,7 +539,7 @@
.popupFooter {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) 14px;
gap: 4px 14px;
padding: 5px 12px 6px;
border-top: 1px solid var(--border);
color: var(--fg-subtle);
+4 -4
Переглянути файл
@@ -15,7 +15,7 @@
width: min(var(--agent-conversation-width), 100%);
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.fitWidth .inner {
width: 100%;
@@ -35,7 +35,7 @@
flex-wrap: wrap;
align-items: center;
/* The chips' own padding spaces them. */
gap: var(--space-0-5);
gap: 2px;
padding: 0 2px;
font-size: var(--fs-small);
}
@@ -66,7 +66,7 @@
padding: 16px 12px 12px;
}
.docked .inner {
gap: var(--space-2);
gap: 8px;
}
.docked .where {
flex-wrap: nowrap;
@@ -95,7 +95,7 @@
.notes {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
height: 0;
}
.docked .notes {
+17 -11
Переглянути файл
@@ -10,13 +10,13 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
}
.headerActions {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.title {
@@ -52,7 +52,7 @@
.error {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 8px;
border-radius: var(--radius-control);
background: color-mix(in srgb, var(--danger) 12%, transparent);
@@ -63,7 +63,7 @@
.notice {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 8px;
border-radius: var(--radius-control);
background: var(--accent-soft);
@@ -89,13 +89,13 @@
justify-content: space-between;
min-height: 32px;
padding: 2px 4px;
gap: var(--space-2);
gap: 8px;
}
.sectionToggle {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
flex: 1;
min-width: 0;
padding: 4px 2px;
@@ -143,6 +143,12 @@
padding: 2px 0 6px;
}
.emptySection {
padding: 6px 24px 8px;
color: var(--fg-muted);
font-size: var(--fs-small);
}
.sectionNote {
margin: 0;
padding: 2px 24px 6px;
@@ -155,7 +161,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
padding: 6px 8px 6px 22px;
border-radius: var(--radius-control);
}
@@ -167,7 +173,7 @@
.rowMain {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
flex: 1;
}
@@ -191,7 +197,7 @@
.rowActions {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
flex-shrink: 0;
}
@@ -200,7 +206,7 @@
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
align-items: start;
gap: 10px var(--space-3);
gap: 10px 12px;
padding: 12px 16px 4px;
}
@@ -217,7 +223,7 @@
.formControl {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
+3 -3
Переглянути файл
@@ -2,7 +2,7 @@
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
max-width: 100%;
height: 20px;
padding: 0 6px 0 4px;
@@ -126,7 +126,7 @@
.cardHead {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 10px;
}
.cardPath {
@@ -201,7 +201,7 @@
.codeHead {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 26px;
padding: 0 4px 0 8px;
border-bottom: 1px solid var(--border);
+54 -79
Переглянути файл
@@ -91,7 +91,7 @@
flex-wrap: wrap;
/* The changes chip sits above the line; the facts stay on that line's baseline. */
align-items: flex-end;
gap: var(--space-0-5) var(--space-1-5);
gap: 2px 6px;
min-width: 0;
padding: 0 2px;
overflow: hidden;
@@ -104,7 +104,7 @@
flex: 0 1 auto;
max-width: 100%;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: 22px;
min-width: 0;
color: var(--fg-secondary);
@@ -122,7 +122,7 @@
max-width: 100%;
align-items: center;
/* The chips' own padding spaces them. */
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
overflow: hidden;
}
@@ -144,7 +144,7 @@
flex: 1 1 auto;
flex-wrap: wrap;
align-items: center;
gap: var(--space-0-5) var(--space-2);
gap: 2px 8px;
min-width: 0;
}
/* Shrinks before the terminal buttons do: in a narrow docked session the meters clip, not the controls. */
@@ -154,7 +154,7 @@
margin-left: auto;
align-items: center;
height: 22px;
gap: var(--space-2);
gap: 8px;
max-width: 100%;
min-width: 0;
overflow: hidden;
@@ -163,13 +163,13 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
}
/* What changed (files, commits) above the meters; both open the Changes pane. */
.statusChips {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
max-width: 100%;
min-width: 0;
}
@@ -177,7 +177,7 @@
composes: surface from "../../ui/Chip.module.css";
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
max-width: 100%;
min-width: 0;
padding: 0 8px;
@@ -207,31 +207,6 @@
color: var(--fg-subtle);
}
/* The archived-task notice: an editor notification banner above the conversation. */
.banner {
flex: none;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: var(--space-1) var(--space-2);
min-height: 36px;
padding: 9px 12px;
background: var(--bg-feedback-warning);
border-bottom: 1px solid var(--border-feedback-warning);
color: var(--fg-strong);
}
.bannerText {
flex: 1 1 240px;
min-width: 0;
max-height: 33vh;
overflow-y: auto;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.bannerSpacer {
flex: 1;
}
/* The conversation with its find bar. */
.streamArea {
min-width: 0;
@@ -345,7 +320,7 @@
.messageFooter {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-height: var(--h-control-small);
max-width: 100%;
flex-wrap: wrap;
@@ -403,7 +378,7 @@
}
.messageActions {
display: inline-flex;
gap: var(--space-1);
gap: 4px;
max-width: 100%;
flex-wrap: wrap;
opacity: 0;
@@ -467,7 +442,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -523,14 +498,14 @@
.editBar {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
margin-top: 6px;
font-size: var(--fs-small);
}
.editButtons {
display: flex;
gap: var(--space-1-5);
gap: 6px;
margin-left: auto;
}
@@ -760,7 +735,7 @@
.thought summary {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
height: var(--h-row);
color: var(--fg-muted);
@@ -798,7 +773,7 @@
.tool {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
box-sizing: border-box;
min-height: var(--h-row);
@@ -853,7 +828,7 @@
.processSummary {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
width: 100%;
max-width: 100%;
box-sizing: border-box;
@@ -901,7 +876,7 @@
.processBody {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
max-height: calc(var(--h-row) * 16);
overflow-y: auto;
margin-top: 2px;
@@ -925,7 +900,7 @@
.plan {
display: grid;
gap: var(--space-0-5);
gap: 2px;
}
.planTitle {
font-weight: 600;
@@ -934,7 +909,7 @@
.planItem {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.planDone {
color: var(--fg-muted);
@@ -1042,7 +1017,7 @@
.error {
display: flex;
gap: var(--space-1-5);
gap: 6px;
align-items: flex-start;
color: var(--danger);
white-space: pre-wrap;
@@ -1052,7 +1027,7 @@
.working {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-muted);
}
@@ -1074,7 +1049,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
align-self: center;
width: 100%;
max-width: calc(var(--session-content-width) + var(--space-3) * 2);
@@ -1085,12 +1060,12 @@
.background {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.backgroundTask {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 24px;
padding: 0 4px 0 8px;
border-radius: var(--radius-row);
@@ -1110,12 +1085,12 @@
.queue {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.queued {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 0 4px 0 8px;
border-radius: var(--radius-row);
@@ -1170,7 +1145,7 @@
.images {
display: flex;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
margin-top: 4px;
}
.imageItem {
@@ -1210,14 +1185,14 @@
.attachments {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) var(--space-1-5);
gap: 4px 6px;
margin-top: 4px;
font-size: var(--fs-small);
}
.attachment {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.changes {
@@ -1250,7 +1225,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 32px;
flex: none;
padding: 0 6px 0 10px;
@@ -1295,7 +1270,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.changeName {
flex: 0 1 auto;
@@ -1327,7 +1302,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.changeGroupName {
min-width: 0;
@@ -1342,7 +1317,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.changeCommitHash {
flex: none;
@@ -1373,7 +1348,7 @@
.subagent {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
padding: 6px 8px;
border: 1px solid var(--border);
border-radius: var(--radius-small);
@@ -1382,7 +1357,7 @@
.subagentHead {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.subagentOpen {
@@ -1390,7 +1365,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 2px 4px;
margin: -2px -4px;
border: 0;
@@ -1466,7 +1441,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 30px;
padding: 0 8px 0 6px;
border-bottom: 1px solid var(--border);
@@ -1477,7 +1452,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
overflow: hidden;
}
.crumb {
@@ -1523,12 +1498,12 @@
.subagentStrip {
display: flex;
flex-wrap: wrap;
gap: var(--space-1);
gap: 4px;
}
.subagentChip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
max-width: 240px;
height: 22px;
padding: 0 8px;
@@ -1556,7 +1531,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
max-height: 50vh;
overflow-y: auto;
/* The composer's width, so the card sits exactly over the box it belongs to. */
@@ -1598,7 +1573,7 @@
.question {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
margin: 0;
padding: 0;
@@ -1632,7 +1607,7 @@
.questionChoices {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.question .questionChoices > * {
border: 1px solid var(--border);
@@ -1658,7 +1633,7 @@
.questionChoice {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.questionOptionText {
display: flex;
@@ -1688,19 +1663,19 @@
.questionBody {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.questionChoices {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
}
@container question-card (min-width: 640px) {
.questionBodyWithPreview {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: var(--space-3);
gap: 12px;
align-items: start;
}
.questionBodyWithPreview .questionPreview {
@@ -1716,7 +1691,7 @@
display: flex;
flex-direction: column;
grid-area: 1 / 1;
gap: var(--space-1);
gap: 4px;
min-width: 0;
visibility: hidden;
}
@@ -1749,12 +1724,12 @@
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: var(--space-2);
gap: 8px;
}
.questionPager {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.questionPage {
color: var(--fg-subtle);
@@ -1796,7 +1771,7 @@
.tray {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.tray:empty {
display: none;
@@ -1808,12 +1783,12 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.trayChip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-row);
padding: 0 var(--space-2);
border: none;
@@ -1832,7 +1807,7 @@
.trayPlan {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
padding: 2px var(--space-2) 4px calc(var(--space-2) * 2);
font-size: var(--fs-small);
}
+6 -6
Переглянути файл
@@ -16,13 +16,13 @@
.activity {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.after {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.seconds {
@@ -35,7 +35,7 @@
min-height: 120px;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
padding: 8px;
overflow: auto;
border: 1px solid var(--border-strong);
@@ -46,9 +46,9 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
background: var(--bg-hover);
background: var(--bg-subtle);
border-radius: var(--radius-control);
}
@@ -64,7 +64,7 @@
.add {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.input {
+12 -12
Переглянути файл
@@ -18,7 +18,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-row);
padding: 0 10px;
border-bottom: 1px solid var(--border);
@@ -39,7 +39,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -115,7 +115,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
width: 100%;
height: var(--h-row);
padding: 0 8px;
@@ -163,7 +163,7 @@
.scope {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
margin: 0;
padding: 0;
border: 0;
@@ -176,7 +176,7 @@
.radioRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 3px 0;
color: var(--fg);
cursor: default;
@@ -187,7 +187,7 @@
}
.dirRow {
display: flex;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 0 0 22px;
}
.grow {
@@ -197,7 +197,7 @@
.fieldRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.languageSelect {
min-width: 180px;
@@ -245,7 +245,7 @@
.previewItem {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -257,7 +257,7 @@
flex: 1;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.previewWhere {
color: var(--fg-subtle);
@@ -298,7 +298,7 @@
.details {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 10px 12px;
overflow: auto;
border-left: 1px solid var(--border);
@@ -312,7 +312,7 @@
.detailsTitle {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--fg-strong);
}
.detailsMessage {
@@ -322,5 +322,5 @@
}
.detailsActions {
display: flex;
gap: var(--space-1-5);
gap: 6px;
}
+3 -3
Переглянути файл
@@ -1,19 +1,19 @@
.body {
display: flex;
flex-direction: column;
gap: var(--space-4);
gap: 16px;
padding: 20px;
}
.field {
display: grid;
grid-template-columns: 80px 1fr;
align-items: center;
gap: var(--space-3);
gap: 12px;
}
.row {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.row > input {
-2
Переглянути файл
@@ -499,7 +499,6 @@ describe("launch", () => {
path: "/x/b.txt",
left: { type: "file", path: "/x/a.txt", label: "/x/a.txt" },
right: { type: "worktree", label: "/x/b.txt" },
swappable: true,
},
]);
});
@@ -515,7 +514,6 @@ describe("launch", () => {
path: "/p/b.txt",
left: { type: "file", path: "/p/a.txt", label: "a.txt" },
right: { type: "worktree", label: "b.txt" },
swappable: true,
},
]);
});
+9 -9
Переглянути файл
@@ -14,7 +14,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
line-height: 1.55;
}
.productName {
@@ -37,7 +37,7 @@
}
.fact {
display: flex;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.fact dt {
@@ -57,7 +57,7 @@
.links {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) var(--space-4);
gap: 4px 16px;
}
.link {
padding: 0;
@@ -94,7 +94,7 @@
.keymapBar {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
padding: 8px 12px;
border-bottom: 1px solid var(--border-popup);
}
@@ -139,7 +139,7 @@
.keymapRow {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
min-height: var(--h-row);
padding: 0 4px;
border-radius: var(--radius-row);
@@ -157,13 +157,13 @@
.keymapKeys {
flex: none;
display: flex;
gap: var(--space-1);
gap: 4px;
}
.invalidateBody {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 14px;
color: var(--fg);
font-size: var(--fs-ui);
@@ -185,13 +185,13 @@
.importSummary {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.importList {
margin: 0;
display: grid;
grid-template-columns: max-content 1fr;
gap: var(--space-0-5) var(--space-4);
gap: 2px 16px;
}
.importList dt {
color: var(--fg-muted);
-2
Переглянути файл
@@ -78,9 +78,7 @@ export function appActions(): Action[] {
id,
title: t(key),
category: t("app.category.edit"),
// The native ⌘C / Ctrl+C keep working unbound; listed so another key can be added (IDEA's $Copy…).
hidden: true,
keymap: true,
run: editCommand(command),
});
return [
+7 -7
Переглянути файл
@@ -31,7 +31,7 @@
.entry {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 100%;
height: 26px;
padding: 0 8px;
@@ -68,7 +68,7 @@
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
align-items: center;
gap: var(--space-2) var(--space-3);
gap: 8px 12px;
}
.label {
color: var(--fg);
@@ -76,7 +76,7 @@
}
.inline {
display: flex;
gap: var(--space-2);
gap: 8px;
}
.inline > :first-child {
flex: 1;
@@ -103,7 +103,7 @@
.missing {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
padding: 8px 10px;
border: 1px solid var(--border-feedback-warning);
border-radius: var(--radius-control, 4px);
@@ -136,17 +136,17 @@
.dependencies {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.chips {
display: flex;
flex-wrap: wrap;
gap: var(--space-1);
gap: 4px;
}
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: 22px;
padding: 0 6px 0 8px;
border: 1px solid var(--border);
+8 -8
Переглянути файл
@@ -9,7 +9,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.sep {
@@ -22,7 +22,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 2px 10px;
font-size: var(--fs-small);
@@ -57,14 +57,14 @@
.loading {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 12px;
color: var(--fg-muted);
}
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -110,7 +110,7 @@
.popupHeader {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-row);
padding: 4px 10px 0;
font-size: var(--fs-small);
@@ -124,7 +124,7 @@
.inputRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 10px;
border-bottom: 1px solid var(--border-popup);
}
@@ -164,7 +164,7 @@
.completion {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
flex: 1;
}
@@ -196,7 +196,7 @@
.popupFooter {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 6px 10px;
border-top: 1px solid var(--border-popup);
font-size: var(--fs-small);
+7 -7
Переглянути файл
@@ -10,7 +10,7 @@
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
min-height: 36px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
@@ -37,7 +37,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 2px 10px;
font-size: var(--fs-small);
@@ -74,7 +74,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -124,7 +124,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 32px;
padding: 0 10px;
border-bottom: 1px solid var(--border);
@@ -142,7 +142,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 10px;
font-size: var(--fs-small);
color: var(--fg-secondary);
@@ -162,7 +162,7 @@
.usageHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 26px;
}
.usageVersion {
@@ -190,7 +190,7 @@
.step {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 22px;
white-space: nowrap;
}
+1 -1
Переглянути файл
@@ -22,7 +22,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+2 -2
Переглянути файл
@@ -14,7 +14,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.sep {
@@ -43,7 +43,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+1 -1
Переглянути файл
@@ -29,7 +29,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+1 -1
Переглянути файл
@@ -50,7 +50,7 @@
.line {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-height: 24px;
}
.name {
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 3px 6px;
flex-shrink: 0;
}
+2 -2
Переглянути файл
@@ -9,7 +9,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 0 10px;
border-bottom: 1px solid var(--border-popup);
font-size: var(--fs-small);
@@ -62,7 +62,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
width: 100%;
}
+3 -3
Переглянути файл
@@ -14,7 +14,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 0;
border-right: 1px solid var(--border);
}
@@ -29,7 +29,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 10px;
font-size: var(--fs-ui);
color: var(--fg-subtle);
@@ -72,7 +72,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+3 -3
Переглянути файл
@@ -46,7 +46,7 @@
bottom: 0;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 104px;
height: 54px;
padding: 0 10px;
@@ -79,7 +79,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
color: var(--fg-muted);
font-size: var(--fs-small);
text-align: center;
@@ -111,7 +111,7 @@
.recent {
display: grid;
grid-template-columns: repeat(10, minmax(0, 1fr));
gap: var(--space-2) 5px;
gap: 8px 5px;
margin: 12px 12px 0;
padding-top: 10px;
border-top: 1px solid var(--border);
+6 -6
Переглянути файл
@@ -20,7 +20,7 @@
display: grid;
grid-template-columns: minmax(120px, 1fr) 170px 170px;
align-items: center;
column-gap: var(--space-2);
column-gap: 8px;
}
.header.noBranches,
.row.noBranches {
@@ -35,7 +35,7 @@
.headerCell {
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
padding: 0;
border: 0;
@@ -62,7 +62,7 @@
.name {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.icon {
@@ -75,7 +75,7 @@
.cell {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.bar {
@@ -112,7 +112,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
/* Manage Coverage Reports */
@@ -126,7 +126,7 @@
.reportRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+46 -46
Переглянути файл
@@ -31,7 +31,7 @@
position: relative;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 0 6px;
border-right: 1px solid var(--border);
overflow: hidden;
@@ -139,7 +139,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
height: var(--h-header);
padding: 0 6px;
flex: none;
@@ -237,7 +237,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.dbToolbarSep {
@@ -259,7 +259,7 @@
.nodeRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
/* The whole tree row, indent included, so a coloured source and its children form one band. */
@@ -307,7 +307,7 @@
.consoleBar {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -338,7 +338,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 8px;
color: var(--fg-muted);
}
@@ -352,7 +352,7 @@
.pager {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
color: var(--fg-secondary);
font-size: var(--fs-small);
white-space: nowrap;
@@ -370,7 +370,7 @@
display: grid;
grid-template-columns: fit-content(40%) minmax(0, 1fr);
align-items: center;
gap: var(--space-2) var(--space-3);
gap: 8px 12px;
min-width: 0;
padding: 14px;
overflow-wrap: anywhere;
@@ -397,7 +397,7 @@
}
.formRow {
display: flex;
gap: var(--space-2);
gap: 8px;
align-items: center;
}
.formRow[hidden],
@@ -409,7 +409,7 @@
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-strong);
}
.formSection::after {
@@ -490,7 +490,7 @@
.colorValue {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.colorSwatch {
width: 12px;
@@ -500,12 +500,12 @@
.namePicker {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.nameList {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
max-height: 180px;
overflow: auto;
padding-left: 22px;
@@ -513,14 +513,14 @@
.propertyTable {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.propertyHead,
.propertyRow {
display: grid;
grid-template-columns: 1fr 1fr 24px;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.propertyHead {
color: var(--fg-secondary);
@@ -620,7 +620,7 @@
:global(.cm-openidea-db-banner) {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-height: 28px;
padding: 0 6px 0 10px;
background: color-mix(in srgb, var(--danger) 10%, var(--bg-editor));
@@ -682,7 +682,7 @@
.previewBlock {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.previewTitle {
@@ -734,7 +734,7 @@
}
.modifyToolbar {
display: flex;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 4px;
border-bottom: 1px solid var(--border);
}
@@ -746,7 +746,7 @@
.modifyItem {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 24px;
padding: 0 8px;
cursor: default;
@@ -767,7 +767,7 @@
grid-template-columns: max-content 1fr;
align-content: start;
align-items: center;
gap: var(--space-2) var(--space-3);
gap: 8px 12px;
padding: 12px;
overflow: auto;
}
@@ -777,17 +777,17 @@
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.quickDocRows {
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.quickDocRows > div {
display: flex;
gap: var(--space-1-5);
gap: 6px;
}
.quickDocRows dt {
font-weight: 600;
@@ -837,7 +837,7 @@
right: 12px;
bottom: 12px;
display: flex;
gap: var(--space-2);
gap: 8px;
align-items: center;
padding: 3px 10px;
border: 1px solid var(--border);
@@ -859,7 +859,7 @@
.columnsPopup {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
width: 320px;
padding: 8px;
}
@@ -870,14 +870,14 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
white-space: nowrap;
}
.filterPopup {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
width: 280px;
padding: 8px;
}
@@ -888,7 +888,7 @@
.filterValue {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: var(--h-row);
}
.filterValue > :first-child {
@@ -910,7 +910,7 @@
.filterButtons {
display: flex;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
}
.sidePanel {
flex: none;
@@ -934,24 +934,24 @@
.recordFields {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 8px;
}
.recordField {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.recordLabel {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
color: var(--fg-secondary);
}
.valueView {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
padding: 8px;
box-sizing: border-box;
@@ -998,7 +998,7 @@
flex-direction: column;
flex: 1;
min-height: 0;
gap: var(--space-1-5);
gap: 6px;
overflow: hidden;
}
.valueWindowBody .valueEditor {
@@ -1040,7 +1040,7 @@
.chartBar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-header);
padding: 0 8px;
flex: none;
@@ -1102,7 +1102,7 @@
.planRow {
display: grid;
grid-template-columns: minmax(160px, 1fr) 1fr;
gap: var(--space-3);
gap: 12px;
width: 100%;
}
.planHeader {
@@ -1113,7 +1113,7 @@
.planOperation {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -1144,14 +1144,14 @@
/* Export / history / import dialogs. */
.exportDialog {
display: flex;
gap: var(--space-4);
gap: 16px;
height: 420px;
padding: 14px;
}
.exportOptions {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
width: 300px;
flex: none;
}
@@ -1164,7 +1164,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.exportPreviewText,
.historyPreview {
@@ -1206,21 +1206,21 @@
}
.historyDialog {
display: flex;
gap: var(--space-3);
gap: 12px;
height: 440px;
padding: 14px;
}
.historyList {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
width: 300px;
flex: none;
min-height: 0;
}
.historyItem {
display: flex;
gap: var(--space-2);
gap: 8px;
align-items: baseline;
width: 100%;
min-width: 0;
@@ -1263,7 +1263,7 @@
}
.sqlCompletionOption {
display: flex;
gap: var(--space-3);
gap: 12px;
align-items: center;
width: 100%;
padding: 4px 8px;
@@ -1346,7 +1346,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 4px 8px;
background: var(--bg-elev);
border-bottom: 1px solid var(--border);
@@ -1382,7 +1382,7 @@
transform: translateX(-50%);
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 4px;
border: 1px solid var(--border-popup, var(--border));
border-radius: var(--radius-small);
+8 -24
Переглянути файл
@@ -409,23 +409,6 @@ export function Grid(props: GridProps) {
const anchor = scrollRef.current?.querySelectorAll<HTMLElement>("[data-column-filter]")[sel!.c1];
if (anchor) props.onFilter!(sel!.c1, anchor);
},
canEditCell: () => {
if (!canEdit()) return false;
const n = norm(sel!);
return n.top === n.bottom && n.left === n.right && props.rowState?.(n.top) !== "deleted";
},
editCell: () => {
if (actions.canEditCell()) startEdit(sel!.r1, sel!.c1);
},
hasSelection: () => !!sel && !editing,
copy: (kind) => {
if (!actions.hasSelection()) return;
if (kind === "header") copy("tsv", true);
else if (kind === "rowsTsv") copy("tsv", true, true);
else if (kind === "rowsCsv") copy("csv", true, true);
else copy(kind, false);
},
selectedRows,
};
Object.assign((cellActions.current ??= {} as CellActions), actions);
});
@@ -546,19 +529,20 @@ export function Grid(props: GridProps) {
{
label: "Copy as",
submenu: [
{ kind: "action", action: "db.copyAsTsv", label: "TSV", arg: cellActions.current },
{ kind: "action", action: "db.copyAsCsv", label: "CSV", arg: cellActions.current },
{ kind: "action", action: "db.copyAsOneRow", label: "One-Row", arg: cellActions.current },
{ label: "TSV", verbatim: true, run: () => copy("tsv", false) },
{ label: "CSV", verbatim: true, run: () => copy("csv", false) },
{ label: "One-Row", run: () => copy("onerow", false) },
],
},
{ kind: "action", action: "db.copyWithHeader", arg: cellActions.current },
{ kind: "action", action: "db.copyRowsAsTsv", arg: cellActions.current },
{ kind: "action", action: "db.copyRowsAsCsv", arg: cellActions.current },
{ label: "Copy with Header", run: () => copy("tsv", true) },
{ label: "Copy Rows as TSV", run: () => copy("tsv", true, true) },
{ label: "Copy Rows as CSV", run: () => copy("csv", true, true) },
];
if (editable && onEdit) {
const n = norm(sel);
items.push(
{ kind: "separator" },
{ kind: "action", action: "db.editCell", arg: cellActions.current },
{ label: "Edit Cell", disabled: n.top !== n.bottom || n.left !== n.right, run: () => startEdit(n.top, n.left) },
{ kind: "action", action: "db.setCellNull", arg: cellActions.current },
{ kind: "action", action: "db.setCellDefault", arg: cellActions.current },
);
+21 -81
Переглянути файл
@@ -137,8 +137,7 @@ function readonlyNotice(reason: EditBlockReason): string {
}
/** IDEA's pager at the bottom of a result: |< < 1-500 of 501+ > >| and the page size; paging runs the query again. */
/** The result tab's page position and the page moves it allows, shared by the pager and the `db.*Page` actions. */
function pagerOf(tab: ResultTab) {
function Pager({ tab }: { tab: ResultTab }) {
const r = tab.outcome.result!;
const page = tab.page ?? 0;
const pageSize = tab.pageSize ?? Math.max(r.rows.length, 1);
@@ -155,21 +154,6 @@ function pagerOf(tab: ResultTab) {
}
if (lastPage !== null && lastPage !== page) go(lastPage);
};
return {
page,
pageSize,
w,
canPage,
go,
goLast,
canPrevious: canPage && page > 0,
canNext: canPage && r.hasMore,
canLast: canPage && !((!r.hasMore && w.total !== null) || (w.total === null && !countable(tab))),
};
}
function Pager({ tab }: { tab: ResultTab }) {
const { page, pageSize, w, canPage, go, goLast, canPrevious, canNext, canLast } = pagerOf(tab);
const { first, last } = w;
const total = w.total === null ? `${w.last + 1}+` : String(w.total);
const sizes = PAGE_SIZES.includes(pageSize) ? PAGE_SIZES : [...PAGE_SIZES, pageSize].sort((a, b) => a - b);
@@ -178,17 +162,15 @@ function Pager({ tab }: { tab: ResultTab }) {
<IconButton
icon="page-first"
title="First Page"
shortcut={shortcutLabel("db.firstPage")}
size="small"
disabled={!canPrevious}
disabled={!canPage || page === 0}
onClick={() => go(0)}
/>
<IconButton
icon="chevron-left"
title="Previous Page"
shortcut={shortcutLabel("db.previousPage")}
size="small"
disabled={!canPrevious}
disabled={!canPage || page === 0}
onClick={() => go(page - 1)}
/>
<button
@@ -203,17 +185,15 @@ function Pager({ tab }: { tab: ResultTab }) {
<IconButton
icon="chevron-right"
title="Next Page"
shortcut={shortcutLabel("db.nextPage")}
size="small"
disabled={!canNext}
disabled={!canPage || !r.hasMore}
onClick={() => go(page + 1)}
/>
<IconButton
icon="page-last"
title="Last Page"
shortcut={shortcutLabel("db.lastPage")}
size="small"
disabled={!canLast}
disabled={!canPage || (!r.hasMore && w.total !== null) || (w.total === null && !countable(tab))}
onClick={() => void goLast()}
/>
<Select
@@ -385,10 +365,6 @@ function Result({ tab }: { tab: ResultTab }) {
return { ...e, deletes, inserts: e.inserts.filter((_, i) => !insertsGone.has(i)) };
});
const addRow = () => setEdits((e) => ({ ...e, inserts: [...e.inserts, new Map()] }));
const restoreRows = (rows: number[]) =>
setEdits((e) => ({ ...e, deletes: new Set([...e.deletes].filter((d) => !rows.includes(d))) }));
const dirty = hasEdits(edits);
const submitting = useSyncExternalStore(subscribeResults, () => !!r && submittingResults.has(r));
const busy = submitting || !!tab.busy;
@@ -421,17 +397,6 @@ function Result({ tab }: { tab: ResultTab }) {
}
};
const showExport = (at: { x: number; y: number }) =>
r &&
showContextMenu(
at,
exportMenu(
{ columns, rows: r.rows, driver, table: queryTable(text, { driver }) },
queryTable(text, { driver }),
extractor,
),
);
// Submit / Revert / Go to Column (⌘↩ / ⌥⌘Z / ⌘F12) reach the latest state through the handle, as in the table editor.
const canSubmit = editable && dirty && !busy;
const viewRef = useRef<HTMLDivElement>(null);
@@ -456,30 +421,6 @@ function Result({ tab }: { tab: ResultTab }) {
const rect = viewRef.current?.getBoundingClientRect();
if (view === "table" && rect) setColumnsAt({ x: rect.left + rect.width / 2, y: rect.top + 48 });
};
const pager = r ? pagerOf(tab) : null;
const rowsEditable = editable && !busy && view === "table";
handle.commands = pager
? {
reload: { enabled: () => !busy, run: () => void rerunResult(tab.id) },
firstPage: { enabled: () => pager.canPrevious, run: () => pager.go(0) },
previousPage: { enabled: () => pager.canPrevious, run: () => pager.go(pager.page - 1) },
nextPage: { enabled: () => pager.canNext, run: () => pager.go(pager.page + 1) },
lastPage: { enabled: () => pager.canLast, run: () => void pager.goLast() },
addRow: { enabled: () => editable && !busy, run: addRow },
exportData: {
enabled: () => true,
run: () => {
const rect = viewRef.current?.querySelector("[data-db-export]")?.getBoundingClientRect();
if (rect) showExport({ x: rect.left, y: rect.bottom });
},
},
deleteRows: { enabled: (rows) => rowsEditable && rows.length > 0, run: deleteRows },
restoreRows: {
enabled: (rows) => rowsEditable && rows.some((row) => edits.deletes.has(row)),
run: restoreRows,
},
}
: undefined;
tableEditorChanged(handle);
});
const hasResult = !!r;
@@ -489,6 +430,12 @@ function Result({ tab }: { tab: ResultTab }) {
);
if (!r) return null;
const data = (): ExportData => ({
columns,
rows: r.rows,
driver,
table: queryTable(text, { driver }),
});
const tableLabel = target ? `${target.schema ? `${target.schema}.` : ""}${target.table}` : "";
const tablePkCount = detailsValue?.columns.filter((c) => c.primaryKey).length ?? 0;
let notice: string | null = null;
@@ -509,13 +456,7 @@ function Result({ tab }: { tab: ResultTab }) {
<IconButton icon="database" title="Table" aria-pressed={view === "table"} onClick={() => setView("table")} />
<IconButton icon="db-chart" title="Chart" aria-pressed={view === "chart"} onClick={() => setView("chart")} />
<span className={styles.toolbarSeparator} />
<IconButton
icon="refresh"
title="Rerun Query"
shortcut={shortcutLabel("db.reloadPage")}
disabled={busy}
onClick={() => void rerunResult(tab.id)}
/>
<IconButton icon="refresh" title="Rerun Query" disabled={busy} onClick={() => void rerunResult(tab.id)} />
<PinButton tab={tab} />
{view === "table" && (
<IconButton
@@ -531,9 +472,8 @@ function Result({ tab }: { tab: ResultTab }) {
<IconButton
icon="plus"
title="Add Row"
shortcut={shortcutLabel("db.addRow")}
disabled={busy}
onClick={addRow}
onClick={() => setEdits((e) => ({ ...e, inserts: [...e.inserts, new Map()] }))}
/>
<Button
size="small"
@@ -563,9 +503,7 @@ function Result({ tab }: { tab: ResultTab }) {
<IconButton
icon="export"
title="Export Data"
shortcut={shortcutLabel("db.exportData")}
data-db-export=""
onClick={(e) => showExport({ x: e.clientX, y: e.clientY })}
onClick={(e) => showContextMenu(e, exportMenu(data(), queryTable(text, { driver }), extractor))}
/>
{view === "table" && <PanelToggle panel={panel} onChange={setPanel} />}
</Toolbar>
@@ -603,13 +541,15 @@ function Result({ tab }: { tab: ResultTab }) {
rowMenu={(rows) =>
editable && !busy
? [
{ label: "Delete Rows", icon: "trash", run: () => deleteRows(rows) },
{
kind: "action",
action: "db.deleteRows",
icon: "trash",
arg: { rows, editor: handleRef.current },
label: "Restore Rows",
run: () =>
setEdits((e) => ({
...e,
deletes: new Set([...e.deletes].filter((d) => !rows.includes(d))),
})),
},
{ kind: "action", action: "db.restoreRows", arg: { rows, editor: handleRef.current } },
]
: []
}
+30 -53
Переглянути файл
@@ -215,61 +215,18 @@ export function TableEditor({ input }: { input: EditorInput }) {
const r = viewRef.current?.getBoundingClientRect();
if (page && r) setColumnsAt({ x: r.left + r.width / 2, y: r.top + 48 });
};
const addRow = () => setEdits((e) => ({ ...e, inserts: [...e.inserts, new Map()] }));
const restoreRows = (rows: number[]) =>
setEdits((e) => ({ ...e, deletes: new Set([...e.deletes].filter((d) => !rows.includes(d))) }));
const showExport = (at: { x: number; y: number }) =>
page &&
showContextMenu(
at,
exportMenu(
{
columns: gridColumns,
rows: page.result.rows,
table: ref.table,
driver: sourceById(ref.id)?.driver ?? "sqlite",
},
`${ref.schema}.${ref.table}`,
extractor,
),
);
const canPrevious = offset > 0 && !loading;
const canNext = !!page?.result.hasMore && !loading;
handle.commands = {
reload: { enabled: () => !loading, run: reload },
firstPage: { enabled: () => canPrevious, run: () => setOffset(0) },
previousPage: { enabled: () => canPrevious, run: () => setOffset(Math.max(0, offset - limit)) },
nextPage: { enabled: () => canNext, run: () => setOffset(offset + limit) },
addRow: { enabled: () => editable, run: addRow },
exportData: {
enabled: () => !!page,
run: () => {
const r = viewRef.current?.querySelector("[data-db-export]")?.getBoundingClientRect();
if (r) showExport({ x: r.left, y: r.bottom });
},
},
deleteRows: { enabled: (rows) => editable && rows.length > 0, run: deleteRows },
restoreRows: { enabled: (rows) => editable && rows.some((r) => edits.deletes.has(r)), run: restoreRows },
};
useEffect(() => registerTableEditor(viewRef.current!, handle), [handle]);
useEffect(() => tableEditorChanged(handle), [handle, dirty, editable]);
const orderInvalid = orderDraft !== null && !parseOrderBy(orderDraft, names);
return (
<div className={styles.view} ref={viewRef} data-db-table-editor="">
<div className={styles.toolbar}>
<IconButton
icon="refresh"
title="Reload Page"
shortcut={shortcutLabel("db.reloadPage")}
onClick={reload}
disabled={loading}
/>
<IconButton icon="refresh" title="Reload Page" onClick={reload} disabled={loading} />
<div className={styles.pager}>
<IconButton
icon="chevron-left"
title="Previous Page"
shortcut={shortcutLabel("db.previousPage")}
disabled={!canPrevious}
disabled={offset === 0 || loading}
onClick={() => setOffset(Math.max(0, offset - limit))}
/>
<span>
@@ -279,8 +236,7 @@ export function TableEditor({ input }: { input: EditorInput }) {
<IconButton
icon="chevron-right"
title="Next Page"
shortcut={shortcutLabel("db.nextPage")}
disabled={!canNext}
disabled={!page?.result.hasMore || loading}
onClick={() => setOffset(offset + limit)}
/>
<Select
@@ -295,7 +251,11 @@ export function TableEditor({ input }: { input: EditorInput }) {
</div>
{editable && (
<>
<IconButton icon="plus" title="Add Row" shortcut={shortcutLabel("db.addRow")} onClick={addRow} />
<IconButton
icon="plus"
title="Add Row"
onClick={() => setEdits((e) => ({ ...e, inserts: [...e.inserts, new Map()] }))}
/>
<Button
size="small"
variant="primary"
@@ -321,10 +281,23 @@ export function TableEditor({ input }: { input: EditorInput }) {
<IconButton
icon="export"
title="Export Data"
shortcut={shortcutLabel("db.exportData")}
data-db-export=""
disabled={!page}
onClick={(e) => showExport({ x: e.clientX, y: e.clientY })}
onClick={(e) =>
page &&
showContextMenu(
e,
exportMenu(
{
columns: gridColumns,
rows: page.result.rows,
table: ref.table,
driver: sourceById(ref.id)?.driver ?? "sqlite",
},
`${ref.schema}.${ref.table}`,
extractor,
),
)
}
/>
<IconButton
icon="import"
@@ -423,8 +396,12 @@ export function TableEditor({ input }: { input: EditorInput }) {
rowMenu={(rows) =>
editable
? [
{ kind: "action", action: "db.deleteRows", icon: "trash", arg: { rows, editor: handle } },
{ kind: "action", action: "db.restoreRows", arg: { rows, editor: handle } },
{ label: "Delete Rows", icon: "trash", run: () => deleteRows(rows) },
{
label: "Restore Rows",
run: () =>
setEdits((e) => ({ ...e, deletes: new Set([...e.deletes].filter((d) => !rows.includes(d))) })),
},
]
: []
}
-38
Переглянути файл
@@ -1,8 +1,6 @@
import { registerActions, type ActionContext } from "@/platform/actions";
import { setContext } from "@/platform/context";
export type CellCopy = "tsv" | "csv" | "onerow" | "header" | "rowsTsv" | "rowsCsv";
export interface CellActions {
canToggle(): boolean;
canSetNull(): boolean;
@@ -13,31 +11,11 @@ export interface CellActions {
setDefault(): void;
/** Opens the local filter of the selected cell's column. */
filter(): void;
canEditCell(): boolean;
editCell(): void;
hasSelection(): boolean;
copy(kind: CellCopy): void;
/** Rows of the selection, top to bottom. */
selectedRows(): number[];
}
const grids = new WeakMap<Element, CellActions>();
let active: CellActions | null = null;
/** The focused grid (not while a text field in it has focus). */
export function activeCellGrid(): CellActions | null {
return active;
}
const COPIES: Array<[CellCopy, string, string]> = [
["tsv", "db.copyAsTsv", "Copy as TSV"],
["csv", "db.copyAsCsv", "Copy as CSV"],
["onerow", "db.copyAsOneRow", "Copy as One-Row"],
["header", "db.copyWithHeader", "Copy with Header"],
["rowsTsv", "db.copyRowsAsTsv", "Copy Rows as TSV"],
["rowsCsv", "db.copyRowsAsCsv", "Copy Rows as CSV"],
];
export function registerCellGrid(root: Element, actions: CellActions): () => void {
grids.set(root, actions);
return () => {
@@ -92,22 +70,6 @@ export function installCellActions(): () => void {
enabled: (c) => handle(c)?.canFilter() ?? false,
run: (c) => handle(c)?.filter(),
},
{
id: "db.editCell",
title: "Edit Cell",
category: "Database",
keyWhen: "dbCellGridFocus",
enabled: (c) => handle(c)?.canEditCell() ?? false,
run: (c) => handle(c)?.editCell(),
},
...COPIES.map(([kind, id, title]) => ({
id,
title,
category: "Database",
keyWhen: "dbCellGridFocus",
enabled: (c: ActionContext) => handle(c)?.hasSelection() ?? false,
run: (c: ActionContext) => handle(c)?.copy(kind),
})),
]);
return () => {
dispose();
+2 -45
Переглянути файл
@@ -8,15 +8,8 @@ import { lazyComponent, lazyWhen, type MenuItem } from "@/ui";
import { activeEditor, lazyEditorExtension, registerEditorContribution } from "@/editor/api";
import { tx } from "@/platform/i18n";
import { onIdeEvent } from "@/platform/ipc";
import { registerActions, type ActionContext } from "@/platform/actions";
import { activeCellGrid } from "./cellActions";
import {
activeTableEditor,
focusedTableEditor,
installTableEditorFocus,
type TableCommand,
type TableCommandTarget,
} from "./tableEditorFocus";
import { registerActions } from "@/platform/actions";
import { activeTableEditor, installTableEditorFocus } from "./tableEditorFocus";
import { useProject } from "@/platform/project";
import {
registerEditorKind,
@@ -60,25 +53,6 @@ function useDatabaseHeaderMenu(): MenuItem[] {
const useDialogOpen = () => useDatabase((s) => !!s.dialog);
/** Table editor / result grid commands as actions (IDEA's data editor actions). */
const TABLE_COMMANDS: Array<[TableCommand, string, string, string[]]> = [
["reload", "db.reloadPage", "Reload Page", ["refresh", "rerun"]],
["firstPage", "db.firstPage", "First Page", ["pagination"]],
["previousPage", "db.previousPage", "Previous Page", ["pagination"]],
["nextPage", "db.nextPage", "Next Page", ["pagination"]],
["lastPage", "db.lastPage", "Last Page", ["pagination"]],
["addRow", "db.addRow", "Add Row", ["insert row", "new row"]],
["exportData", "db.exportData", "Export Data", ["export", "save as"]],
["deleteRows", "db.deleteRows", "Delete Rows", ["remove rows"]],
["restoreRows", "db.restoreRows", "Restore Rows", ["undelete rows"]],
];
/** The editor and rows a menu passed (focus has moved to the menu), else the focused grid's. */
function tableTarget(arg: unknown): TableCommandTarget {
if (arg && typeof arg === "object" && "rows" in arg) return arg as TableCommandTarget;
return { rows: activeCellGrid()?.selectedRows() ?? [], editor: null };
}
export function activate(): () => void {
const disposers = [
onIdeEvent("dbSourcesChanged", () => {
@@ -306,23 +280,6 @@ export function activate(): () => void {
when: "dbTableEditorFocus && dbTableEditorChanges",
run: () => activeTableEditor()?.revert(),
},
...TABLE_COMMANDS.map(([command, id, title, keywords]) => ({
id,
title,
category: "Tools",
keywords: ["table editor", "data editor", ...keywords],
keyWhen: "dbTableEditorFocus",
enabled: ({ arg }: ActionContext) => {
const { rows, editor } = tableTarget(arg);
const handler = (editor ?? focusedTableEditor())?.commands?.[command];
return !!handler && handler.enabled(rows);
},
run: ({ arg }: ActionContext) => {
const { rows, editor } = tableTarget(arg);
const handler = (editor ?? activeTableEditor())?.commands?.[command];
if (handler?.enabled(rows)) handler.run(rows);
},
})),
{
id: "db.explainPlan",
title: "Explain Plan",
+1 -33
Переглянути файл
@@ -2,7 +2,7 @@ import { act, fireEvent, render, screen } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { DbDriver, DbTablePage } from "@/platform/ipc";
import { installKeyboardDispatcher, useKeymap } from "@/platform/keymap";
import { activeCellGrid, installCellActions } from "./cellActions";
import { installCellActions } from "./cellActions";
import { getContext } from "@/platform/context";
import { TableEditor } from "./TableEditor";
import { activeTableEditor, installTableEditorFocus } from "./tableEditorFocus";
@@ -128,38 +128,6 @@ describe("table editor capabilities", () => {
}
});
it("runs the row and toolbar commands of the db.* actions on the focused grid's selection (#3506)", async () => {
backend.driver = "postgres";
const uninstallFocus = installTableEditorFocus();
const uninstallCells = installCellActions();
try {
await act(async () => {
render(<TableEditor input={tableInput("source", "public", "users")} />);
});
const cell = await screen.findByRole("gridcell", { name: "Ann" });
fireEvent.mouseDown(cell, { button: 0 });
act(() => screen.getByRole("grid").focus());
const rows = activeCellGrid()!.selectedRows();
expect(rows).toEqual([0]);
const commands = activeTableEditor()!.commands!;
expect(commands.nextPage!.enabled(rows)).toBe(false);
expect(commands.previousPage!.enabled(rows)).toBe(false);
expect(commands.exportData!.enabled(rows)).toBe(true);
expect(commands.restoreRows!.enabled(rows)).toBe(false);
act(() => commands.deleteRows!.run(rows));
expect(getContext().dbTableEditorChanges).toBe(true);
expect(activeTableEditor()!.commands!.restoreRows!.enabled(rows)).toBe(true);
act(() => activeTableEditor()!.commands!.restoreRows!.run(rows));
expect(getContext().dbTableEditorChanges).toBe(false);
act(() => activeTableEditor()!.commands!.addRow!.run([]));
expect(screen.getAllByRole("row").length).toBeGreaterThan(2);
expect(getContext().dbTableEditorChanges).toBe(true);
} finally {
uninstallCells();
uninstallFocus();
}
});
it("counts the editor-area host focusing the tab as table-editor focus (#2307)", async () => {
backend.driver = "postgres";
const uninstall = installTableEditorFocus();
-31
Переглянути файл
@@ -6,37 +6,11 @@
import { flushSync } from "react-dom";
import { setContext } from "@/platform/context";
/** Toolbar and row commands of a table editor or result grid, run as `db.*` actions. */
export type TableCommand =
| "reload"
| "firstPage"
| "previousPage"
| "nextPage"
| "lastPage"
| "addRow"
| "exportData"
| "deleteRows"
| "restoreRows";
export interface TableCommandHandler {
enabled(rows: number[]): boolean;
/** `rows`: the grid's selected rows (row commands). */
run(rows: number[]): void;
}
/** What a row menu passes to a `db.*` row action: the menu holds focus, not the grid. */
export interface TableCommandTarget {
rows: number[];
editor: TableEditorHandle | null;
}
export interface TableEditorHandle {
dirty: boolean;
submit(): void;
revert(): void;
showColumns(): void;
/** The commands this view has; one it lacks is disabled. */
commands?: Partial<Record<TableCommand, TableCommandHandler>>;
}
const handles = new WeakMap<Element, TableEditorHandle>();
@@ -81,11 +55,6 @@ export function tableEditorChanged(handle: TableEditorHandle) {
if (active === handle) update();
}
/** The active editor as is, for enablement checks (no side effects). */
export function focusedTableEditor(): TableEditorHandle | null {
return active;
}
/** The active editor, after confirming the cell being edited so its value counts. */
export function activeTableEditor(): TableEditorHandle | null {
const el = document.activeElement;
+10 -10
Переглянути файл
@@ -16,7 +16,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-2) var(--space-4);
gap: 8px 16px;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
}
@@ -25,14 +25,14 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.title,
.totals {
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: var(--space-3);
column-gap: 12px;
min-width: 0;
}
.label {
@@ -56,7 +56,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.compare {
width: 200px;
@@ -126,7 +126,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -138,7 +138,7 @@
.note {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 12px;
color: var(--fg-subtle);
}
@@ -177,7 +177,7 @@
display: grid;
grid-template-columns: var(--heap-columns);
align-items: center;
column-gap: var(--space-3);
column-gap: 12px;
width: 100%;
}
.head {
@@ -252,7 +252,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
}
.treeRow > :first-child {
flex: 1;
@@ -274,7 +274,7 @@
.object {
display: inline-flex;
align-items: baseline;
gap: var(--space-2);
gap: 8px;
min-width: 0;
max-width: 100%;
overflow: hidden;
@@ -336,5 +336,5 @@
.openProgress {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
+4 -4
Переглянути файл
@@ -6,7 +6,7 @@
padding: 6px 12px 8px;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.title {
@@ -31,13 +31,13 @@
.groups {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) 20px;
gap: 4px 20px;
}
.group {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.groupTitle {
@@ -49,6 +49,6 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 22px;
}
+5 -5
Переглянути файл
@@ -9,7 +9,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -23,7 +23,7 @@
.categories {
display: flex;
flex: none;
gap: var(--space-0-5);
gap: 2px;
}
.category {
@@ -49,7 +49,7 @@
.actions {
display: flex;
gap: var(--space-1);
gap: 4px;
padding-top: 6px;
}
@@ -78,7 +78,7 @@
.row {
display: grid;
grid-template-columns: minmax(120px, 3fr) minmax(60px, 1.4fr) 64px 88px 76px 76px;
gap: var(--space-2);
gap: 8px;
padding: 0 8px;
align-items: center;
min-height: 22px;
@@ -159,7 +159,7 @@
.header {
display: flex;
gap: var(--space-2);
gap: 8px;
font-family: var(--font-mono);
font-size: var(--fs-small);
user-select: text;
+3 -3
Переглянути файл
@@ -36,7 +36,7 @@
.item {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 24px;
padding: 0 8px 0 12px;
}
@@ -76,7 +76,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 10px 12px;
}
@@ -126,7 +126,7 @@
.actions {
display: flex;
gap: var(--space-2);
gap: 8px;
}
.note {
+3 -3
Переглянути файл
@@ -12,7 +12,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: var(--h-row);
padding: 0 4px 0 12px;
border-bottom: 1px solid var(--border);
@@ -35,7 +35,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 4px 12px;
font-size: var(--fs-ui);
}
@@ -95,7 +95,7 @@
}
.message {
gap: var(--space-2);
gap: 8px;
color: var(--fg-subtle);
}
+6 -6
Переглянути файл
@@ -12,7 +12,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -52,7 +52,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
padding-block: 4px;
border-bottom: 1px solid var(--border);
}
@@ -85,7 +85,7 @@
display: grid;
grid-template-columns: var(--memory-columns);
align-items: center;
column-gap: var(--space-3);
column-gap: 12px;
width: 100%;
}
@@ -106,7 +106,7 @@
flex: 1;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
height: 100%;
padding: 0;
@@ -161,7 +161,7 @@
.className {
display: flex;
align-items: baseline;
gap: var(--space-2);
gap: 8px;
min-width: 0;
font-family: var(--font-mono);
}
@@ -223,7 +223,7 @@
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: var(--space-3);
column-gap: 12px;
padding: 4px 12px;
border-top: 1px solid var(--border);
color: var(--fg-muted);
+6 -6
Переглянути файл
@@ -23,7 +23,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 8px 0 4px;
border-bottom: 1px solid var(--border);
min-width: 0;
@@ -47,7 +47,7 @@
.tabs {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
flex: none;
}
@@ -112,7 +112,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 8px;
border-radius: var(--radius-small);
text-align: left;
@@ -180,7 +180,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 0 4px 0 12px;
border-bottom: 1px solid var(--border);
}
@@ -190,7 +190,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.prompt {
@@ -231,7 +231,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 0;
border-right: 1px solid var(--border);
}
+1 -1
Переглянути файл
@@ -11,7 +11,7 @@
.item {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-list-row);
margin: 0 6px;
padding: 0 8px 0 6px;
+11 -11
Переглянути файл
@@ -12,7 +12,7 @@
.field {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.label {
@@ -26,13 +26,13 @@
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.bpTitle {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-emphasis);
font-weight: 500;
}
@@ -71,14 +71,14 @@
.bpFooter {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
margin-top: 2px;
}
.link {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--accent);
font-size: var(--fs-ui);
cursor: pointer;
@@ -108,7 +108,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 8px 0 12px;
border-bottom: 1px solid var(--border-popup);
}
@@ -122,7 +122,7 @@
.chooserRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
width: 100%;
padding: 0 8px;
@@ -185,7 +185,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1) var(--space-2);
gap: 4px 8px;
}
/* Grows with the dialog when it is resized. */
@@ -211,7 +211,7 @@
padding: 6px 12px 8px;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.exceptionsTitle {
font-size: var(--fs-small);
@@ -226,7 +226,7 @@
.exceptionGroup {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.exceptionAdapter {
font-size: var(--fs-small);
@@ -260,7 +260,7 @@
.evalInputRow {
display: flex;
align-items: flex-start;
gap: var(--space-1);
gap: 4px;
}
.evalInput {
flex: 1;
+11 -11
Переглянути файл
@@ -10,7 +10,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.serverSelect {
@@ -42,14 +42,14 @@
display: flex;
flex-direction: column;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
padding: 10px;
}
.center {
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
gap: 8px;
padding: 16px;
color: var(--fg-subtle);
}
@@ -72,7 +72,7 @@
.report {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.reportErrors {
margin: 0;
@@ -98,7 +98,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
padding: 10px 16px;
flex: none;
}
@@ -111,7 +111,7 @@
.sync {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
height: 100%;
min-height: 0;
padding: 8px 10px 0;
@@ -121,7 +121,7 @@
flex-wrap: wrap;
align-items: center;
flex: none;
gap: var(--space-1);
gap: 4px;
}
.separator {
height: 20px;
@@ -151,7 +151,7 @@
.fileFilter {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
white-space: nowrap;
}
.compareBy select {
@@ -179,7 +179,7 @@
.comparisonRoots > span {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
border: 1px solid var(--border);
border-radius: var(--radius-control, 4px);
@@ -244,7 +244,7 @@
.fileName {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -315,7 +315,7 @@
display: flex;
align-items: flex-start;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
}
/* SSH password prompt */
+3 -3
Переглянути файл
@@ -8,7 +8,7 @@
.header {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.login {
color: var(--fg-strong);
@@ -34,7 +34,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 100%;
min-width: 0;
}
@@ -68,7 +68,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
gap: 8px;
}
.muted {
color: var(--fg-subtle);
+2 -2
Переглянути файл
@@ -7,7 +7,7 @@
import { useMemo, useRef, useState, type MouseEvent, type ReactNode } from "react";
import { buildFileTree, dirKeys, type FileTreeNode } from "@/features/vcs/fileTree";
import { openDiff, withChain } from "@/features/vcs/diffInput";
import { KIND_COLOR, fileCount, renameFrom, type EffectiveKind } from "@/features/vcs/model";
import { KIND_COLOR, baseName, fileCount, type EffectiveKind } from "@/features/vcs/model";
import type { Commit } from "@/platform/ipc";
import { tx } from "@/platform/i18n";
import { Icon, IconButton, Spinner, T, Tree, fileIconName, showContextMenu, type MenuItem } from "@/ui";
@@ -252,7 +252,7 @@ function ChangeRow({ node }: { node: FileTreeNode<CreateChange> }) {
<span className={styles.fileName} style={{ color: KIND_COLOR[kindOf(f)] }}>
{node.name}
</span>
{f.oldPath && <span className={styles.fileDetail}>{renameFrom(f.path, f.oldPath)}</span>}
{f.oldPath && <span className={styles.fileDetail}>{tx`renamed from ${baseName(f.oldPath)}`}</span>}
</span>
);
}
+15 -15
Переглянути файл
@@ -21,7 +21,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 0;
padding: 12px;
text-align: center;
@@ -44,7 +44,7 @@
.textLink {
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
padding: 0;
border: none;
@@ -73,7 +73,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
padding: 8px 12px;
}
@@ -97,7 +97,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 8px 0;
}
.headRepo > :last-child {
@@ -128,7 +128,7 @@
.headRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
padding: 0 8px;
overflow: hidden;
@@ -157,7 +157,7 @@
display: flex;
flex: none;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
max-height: 50%;
padding: 2px 12px 8px;
overflow: auto;
@@ -165,7 +165,7 @@
.commitsHeader {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-height: 28px;
}
.commitsTitle {
@@ -177,12 +177,12 @@
.commitInfo {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.commitTop {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.commitTop > .textLink {
flex: none;
@@ -213,7 +213,7 @@
.fileRow {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
white-space: nowrap;
}
@@ -297,7 +297,7 @@
.userItem {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
/* Status and the option button */
@@ -312,19 +312,19 @@
.status {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
max-width: 100%;
}
.statusRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.statusText {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.ellipsis {
@@ -375,7 +375,7 @@
.dialogForm {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.dialogLabel {
color: var(--fg);
+2 -2
Переглянути файл
@@ -10,7 +10,7 @@
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent } from "react";
import clsx from "clsx";
import { dirKeys, type FileTreeNode } from "@/features/vcs/fileTree";
import { dirName, fileCount, KIND_COLOR, renameFrom } from "@/features/vcs/model";
import { baseName, dirName, fileCount, KIND_COLOR } from "@/features/vcs/model";
import { currentRepoRoot } from "@/features/vcs/store";
import { useTx } from "@/platform/i18n";
import { Icon, Tree, fileIconName, showContextMenu, T, type MenuItem, type TreeHandle } from "@/ui";
@@ -202,7 +202,7 @@ function ChangeRow(props: {
{node.name}
</span>
{flat && dirName(f.filename) && <span className={styles.fileDir}>{dirName(f.filename)}</span>}
{f.previousFilename && <span className={styles.fileDir}>{renameFrom(f.filename, f.previousFilename)}</span>}
{f.previousFilename && <span className={styles.fileDir}>{tx`renamed from ${baseName(f.previousFilename)}`}</span>}
</>
) : (
<>
+18 -18
Переглянути файл
@@ -16,7 +16,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 0;
padding: 12px;
color: var(--fg-secondary);
@@ -46,7 +46,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
align-self: flex-start;
max-width: 100%;
padding: 0;
@@ -74,13 +74,13 @@
display: flex;
flex: none;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 16px 14px 16px 16px;
}
.titleRow {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.title {
flex: 1;
@@ -110,7 +110,7 @@
flex: none;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
gap: 8px;
min-width: 0;
padding: 0 14px 4px 16px;
}
@@ -118,13 +118,13 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 6px 0 5px;
}
.branch {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
padding: 6px 0 5px;
}
@@ -162,7 +162,7 @@
.advertiser {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
margin-top: 4px;
padding: 5px 10px;
border-top: 1px solid var(--border);
@@ -198,7 +198,7 @@
.commitRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
margin: 0 6px;
padding: 0 8px;
@@ -226,7 +226,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
@@ -235,13 +235,13 @@
display: flex;
flex: none;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 0 14px 12px 16px;
}
.commitInfoTop {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.commitInfoTitle {
flex: 1;
@@ -279,7 +279,7 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
white-space: nowrap;
}
@@ -309,7 +309,7 @@
.counter {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
color: var(--fg-secondary);
}
.readSlot {
@@ -365,7 +365,7 @@
.statusRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
padding: 5px 0;
}
@@ -404,7 +404,7 @@
.progressText {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--fg-secondary);
}
/* JBOptionButton: the main action and an arrow opening the others. */
@@ -439,7 +439,7 @@
.submitPopup {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
width: var(--submit-width);
min-width: 320px;
height: var(--submit-height);
@@ -477,5 +477,5 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
+1 -1
Переглянути файл
@@ -29,6 +29,6 @@
.page {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 4px 0;
}
+5 -5
Переглянути файл
@@ -42,7 +42,7 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
padding: 2px 10px 4px;
margin-bottom: -2px;
@@ -92,7 +92,7 @@
.chipMain {
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
height: 100%;
max-width: 200px;
padding: 0 4px 0 6px;
@@ -170,7 +170,7 @@
.right {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.left {
@@ -211,7 +211,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding-right: 1px;
color: var(--fg);
font-variant-numeric: tabular-nums;
@@ -259,7 +259,7 @@
.balloonRow {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: 24px;
white-space: nowrap;
}
+1 -1
Переглянути файл
@@ -16,7 +16,7 @@
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-1);
gap: 4px;
height: 22px;
min-width: 22px;
padding: 0 3px;
+3 -3
Переглянути файл
@@ -44,7 +44,7 @@
.commits {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.commit {
display: flex;
@@ -65,7 +65,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
gap: 4px;
max-width: calc(42em + 32px);
padding: 16px 10px;
text-align: center;
@@ -84,7 +84,7 @@
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.composer {
padding: 10px 16px;
+17 -17
Переглянути файл
@@ -31,7 +31,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
max-width: var(--gh-content-width, 42em);
}
@@ -41,7 +41,7 @@
.header {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-height: 20px;
}
.title {
@@ -49,7 +49,7 @@
flex: 1;
flex-wrap: wrap;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.author {
@@ -68,7 +68,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
margin-left: auto;
}
.tag {
@@ -109,7 +109,7 @@
.status {
display: flex;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.status::before {
@@ -149,7 +149,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
max-width: var(--gh-content-width, 42em);
}
@@ -182,19 +182,19 @@
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: var(--space-3);
gap: 12px;
}
.hints {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
gap: 12px;
min-width: 0;
color: var(--fg-secondary);
font-size: var(--fs-small);
}
.buttons {
display: flex;
gap: var(--space-2);
gap: 8px;
}
.mentions {
max-height: 240px;
@@ -205,7 +205,7 @@
.mention {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 2px 8px;
white-space: nowrap;
cursor: pointer;
@@ -219,12 +219,12 @@
.reactions {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
gap: 8px;
}
.pill {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: 24px;
padding: 0 8px 0 6px;
border: 1px solid transparent;
@@ -279,7 +279,7 @@
.threadContent {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.preview {
display: -webkit-box;
@@ -300,7 +300,7 @@
.fileHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 2px 6px 2px 10px;
}
@@ -364,7 +364,7 @@
.foldedReplies {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.compactFooter {
display: flex;
@@ -393,7 +393,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--gh-bubble-border);
background: var(--bg-editor);
@@ -418,7 +418,7 @@
.commitPopup {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
width: 450px;
padding: 10px;
}
+59 -4
Переглянути файл
@@ -18,11 +18,25 @@
.listTab {
padding-top: 8px;
}
.column {
display: flex;
flex: 1;
flex-direction: column;
min-height: 0;
}
.grow {
flex: 1;
min-height: 0;
}
.scroll {
height: 100%;
overflow: auto;
}
.loading {
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
color: var(--fg-secondary);
}
@@ -36,18 +50,24 @@
.tabs {
min-width: 0;
}
.repoTitle {
overflow: hidden;
color: var(--fg-secondary);
text-overflow: ellipsis;
white-space: nowrap;
}
/* Repository selector (several GitHub remotes) */
.selector {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 12px;
}
.selectorRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.error {
color: var(--danger);
@@ -59,7 +79,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 26px;
padding: 0 6px 0 10px;
border-bottom: 1px solid var(--border);
@@ -76,3 +96,38 @@
}
/* Placeholder panels */
.plainRow {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
padding: 0 13px;
overflow: hidden;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.secondary {
color: var(--fg-secondary);
font-size: var(--fs-small);
}
.detailsTitle {
color: var(--fg-strong);
font-weight: 600;
}
.buttons {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 6px;
}
.timelineStub {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
max-width: 720px;
text-align: left;
}
+10 -5
Переглянути файл
@@ -87,7 +87,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
max-width: 100%;
color: var(--fg);
white-space: nowrap;
@@ -120,7 +120,7 @@
.chooserRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
padding: 0 8px;
overflow: hidden;
@@ -152,7 +152,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 10px 6px;
color: var(--fg-secondary);
font-size: var(--fs-small);
@@ -227,7 +227,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 0;
padding: 16px;
color: var(--fg-secondary);
@@ -242,9 +242,14 @@
.form {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 14px;
}
.formRow {
display: flex;
align-items: center;
gap: 10px;
}
.fieldLabel {
color: var(--fg-secondary);
font-size: var(--fs-small);
+9 -6
Переглянути файл
@@ -14,7 +14,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 0;
border-right: 1px solid var(--border);
}
@@ -40,7 +40,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 10px;
font-size: var(--fs-ui);
color: var(--fg-subtle);
@@ -51,7 +51,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding-right: 10px;
white-space: nowrap;
}
@@ -68,6 +68,9 @@
.ok {
color: var(--success);
}
.code {
font-weight: 600;
}
.result {
height: 100%;
display: flex;
@@ -79,7 +82,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 10px;
white-space: nowrap;
border-bottom: 1px solid var(--border);
@@ -132,7 +135,7 @@
.editorToolbar {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -269,7 +272,7 @@
.envToolbar {
flex: none;
display: flex;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 4px;
border-bottom: 1px solid var(--border);
}
+5 -5
Переглянути файл
@@ -19,7 +19,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -45,7 +45,7 @@
.entry {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-list-row);
padding: 0 8px;
border: none;
@@ -66,7 +66,7 @@
.runningRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-list-row);
padding: 0 8px;
color: var(--fg-secondary);
@@ -112,7 +112,7 @@
.statusLine {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
height: var(--h-header);
padding: 0 8px;
flex: none;
@@ -195,7 +195,7 @@
.pendingLine {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-secondary);
}
.pendingRequest {
+2 -2
Переглянути файл
@@ -10,7 +10,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
background: var(--bg-elev);
@@ -53,7 +53,7 @@
left: 0;
width: 100%;
display: flex;
gap: var(--space-2);
gap: 8px;
padding: 0 8px;
box-sizing: border-box;
white-space: pre-wrap;
+4 -4
Переглянути файл
@@ -1,5 +1,5 @@
.status {
gap: var(--space-1-5);
gap: 6px;
}
.dot {
width: 8px;
@@ -10,14 +10,14 @@
.edit {
display: grid;
grid-template-columns: 220px 1fr;
gap: var(--space-3);
gap: 12px;
height: 300px;
padding: 14px;
}
.column {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
min-height: 0;
}
.list {
@@ -34,7 +34,7 @@
}
.buttons {
display: flex;
gap: var(--space-1-5);
gap: 6px;
}
.empty {
padding: 6px 8px;
+1 -5
Переглянути файл
@@ -12,7 +12,7 @@ import {
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
import { bracketMatching, indentOnInput, syntaxHighlighting } from "@codemirror/language";
import type { NotebookCellDoc } from "@/bindings";
import { cellEditorExtensions, embeddedEditorExtensions, externalHistory } from "@/editor/api";
import { cellEditorExtensions, embeddedEditorExtensions } from "@/editor/api";
import { openideaTheme } from "@/editor/core/cm/theme";
import { openideaHighlightStyle } from "@/editor/core/cm/highlight";
import { selectionMarks } from "@/editor/core/cm/selectionMarks";
@@ -97,10 +97,6 @@ export function CellEditor({
]),
),
keymap.of([indentWithTab, ...defaultKeymap]),
externalHistory.of({
undo: () => void session.undo().catch((e) => session.report(e)),
redo: () => void session.redo().catch((e) => session.report(e)),
}),
embeddedEditorExtensions(session.path),
language.of([]),
services.current.of(languageServices(type, initialDoc.current)),
+4 -4
Переглянути файл
@@ -42,7 +42,7 @@
.error {
display: flex;
align-items: flex-start;
gap: var(--space-3);
gap: 12px;
padding: 8px 12px;
color: var(--danger, var(--fg));
border-bottom: 1px solid var(--border);
@@ -93,7 +93,7 @@
.cellToolbar {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-height: 28px;
padding: 2px 6px;
background: var(--bg-elev, var(--bg-app));
@@ -202,7 +202,7 @@
.addBar {
display: flex;
justify-content: center;
gap: var(--space-2);
gap: 8px;
flex-wrap: wrap;
padding: 12px 16px 32px;
}
@@ -211,7 +211,7 @@
padding: 5px;
}
.toolbar {
gap: var(--space-0-5);
gap: 2px;
}
.interpreter {
max-width: 180px;
Loaded 100 of 238 files, more files were not shown because too many files have changed in this diff. Show more