Visual Studio Code, rebuilt in Rust
Rust
fix(extensions): activate onLanguage for the search box's model
rokartur1c0061f5b481
diff --git a/native/crates/app/src/host_sync.rs b/native/crates/app/src/host_sync.rsindex 9ad94d40ce9..01b4b6aa112 100644--- a/native/crates/app/src/host_sync.rs+++ b/native/crates/app/src/host_sync.rs@@ -564,6 +564,13 @@ impl HostSync {activation}+ /// languageService.ts `onDidRequestRichLanguageFeatures`: a text model outside an editor, such as a+ /// suggestEnabledInput.ts search box, activates its language's extensions too.+ pub fn request_rich_language_features(&mut self, language_id: &str) {+ drop(self.activate_by_event(&format!("onLanguage:{language_id}")));+ drop(self.activate_by_event("onLanguage"));+ }+/// Sends a request whose answer arrives on the receiver; a host that is gone drops the sender.pub fn call(&self, proxy: &'static str, method: &'static str, args: Vec<Value>) -> oneshot::Receiver<Result<Value, Value>> {let (reply, receiver) = oneshot::channel();diff --git a/native/crates/app/src/workbench/extensions_view.rs b/native/crates/app/src/workbench/extensions_view.rsindex f6f795af878..9af8d325b7b 100644--- a/native/crates/app/src/workbench/extensions_view.rs+++ b/native/crates/app/src/workbench/extensions_view.rs@@ -783,6 +783,8 @@ impl Workbench {/// `doSearch`: the views of the normalized query, each with its model.pub(super) fn show_extensions_views(&mut self, refresh: bool, window: &mut Window, cx: &mut Context<Self>) {+ // suggestEnabledInput.ts:197: the search box's `createModel('', null)` is a plaintext model.+ self.host.request_rich_language_features("plaintext");let value = model::normalized_query(&self.extensions_viewlet.search.value);let descriptors = visible_views(&value, self.extensions_viewlet.has_installed(), self.folder.is_some());let unchanged = !refresh && self.extensions_viewlet.panes.iter().map(|pane| pane.descriptor).eq(descriptors.iter().copied());diff --git a/native/crates/app/src/workbench/extensions_view/tests.rs b/native/crates/app/src/workbench/extensions_view/tests.rsindex dfd5b7259b2..1dc14b13f5d 100644--- a/native/crates/app/src/workbench/extensions_view/tests.rs+++ b/native/crates/app/src/workbench/extensions_view/tests.rs@@ -59,8 +59,9 @@ fn the_views_are_panes_and_an_empty_outdated_view_collapses(cx: &mut gpui::TestAlet app_root = std::path::Path::new(env!("VSCODE_SRC")).to_path_buf();let themes = exthost::scan::scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap();let theme = crate::theme::load_theme(&[themes], "Dark Modern").unwrap();+ let (sender, messages) = std::sync::mpsc::channel();let (workbench, cx) = cx.add_window_view(|_, cx| {- let mut workbench = Workbench::new(theme, app_root.clone(), None, crate::languages::Languages::new(&[]), crate::default_settings(), crate::host_sync::HostSync::new(std::sync::mpsc::channel().0), cx);+ let mut workbench = Workbench::new(theme, app_root.clone(), None, crate::languages::Languages::new(&[]), crate::default_settings(), crate::host_sync::HostSync::new(sender), cx);// An empty window starts without the side bar.workbench.set_part_hidden(crate::workbench::layout::Part::SideBar, false, cx);workbench@@ -68,6 +69,8 @@ fn the_views_are_panes_and_an_empty_outdated_view_collapses(cx: &mut gpui::TestAcx.simulate_resize(gpui::size(gpui::px(1024.), gpui::px(768.)));workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("workbench.extensions.search", vec![serde_json::json!("@updates")], window, cx)));cx.run_until_parked();+ let activations: Vec<_> = messages.try_iter().filter(|message| message.method == "$activateByEvent").map(|message| message.args[0].clone()).collect();+ assert_eq!(activations, ["onCommand:workbench.extensions.search", "onLanguage:plaintext", "onLanguage"], "languageService.ts: the search box's model activates `onLanguage` extensions such as Emmet");let outdated = cx.debug_bounds("pane-header-workbench.views.extensions.searchOutdated").expect("Available Updates is a pane");let recent = cx.debug_bounds("pane-header-workbench.views.extensions.searchRecentlyUpdated").expect("Recently Updated is a pane");assert_eq!(recent.top() - outdated.top(), gpui::px(28.), "the empty Available Updates view is its header");diff --git a/port/ledger.md b/port/ledger.mdindex 9638443b768..d05d0b122e2 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -32,7 +32,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,| Milestones | M15 terminal, tasks, output | done | Integrated terminal (PTY from Rust, VT parser and renderer in GPUI), shell integration, extension terminals and pseudoterminals, tasks and problem matchers, npm/grunt/gulp/jake task providers, external terminal, Output panel and log viewer. Open gaps: the gaps column of its unit rows. | api-tests `terminal.test`, `terminal.shellIntegration.test` and `workspace.tasks.test` pass as in the reference (run with `SHELL=/bin/bash` as the baseline was); `npm: build` task from the fixture runs in a terminal. || Milestones | M16 debug and testing | in progress | Debug adapter protocol client, launch.json, breakpoints in the gutter, call stack, variables, watch, debug console, JS debugger (`ms-vscode.js-debug`), Test Explorer and test results. Open gaps: the gaps column of its unit rows. | api-tests `debug.test` and testing cases pass as in the reference; a breakpoint in a Node script from the fixture stops and shows variables. || Milestones | M17 webviews and notebooks | done | A WKWebView embedded in the GPUI window for webview panels, webview views and custom editors, with the upstream message and resource protocol; Markdown preview, image/media preview, simple browser, editor insets; notebooks (ipynb) with renderers and kernels. Open gaps: the gaps column of its unit rows. | api-tests `webview.test`, `customEditor` and `notebook*.test` cases pass as in the reference; Markdown preview of the fixture README draws next to its source. |-| Milestones | M18 extensions: install, update, gallery | in progress | Extensions view backed by Open VSX, install/uninstall/update/disable, VSIX install, signature and checksum checks, recommendations, ESM extensions added after startup on Bun, language packs and display language. | Installing an extension from Open VSX activates it without restart (an ESM one included); api-tests `extensions.test` pass as in the reference. PORT_GALLERY=1 port/tools/extensions-check: 6 ok; MOCHA_GREP="vscode server cli" port/tools/api-tests: its one test pending, as in the reference (remote only). |+| Milestones | M18 extensions: install, update, gallery | done | Extensions view backed by Open VSX, install/uninstall/update/disable, VSIX install, signature and checksum checks, recommendations, ESM extensions added after startup on Bun, language packs and display language. | Installing an extension from Open VSX activates it without restart (an ESM one included); api-tests `extensions.test` pass as in the reference. PORT_GALLERY=1 port/tools/extensions-check: 6 ok; MOCHA_GREP="vscode server cli" port/tools/api-tests: its one test pending, as in the reference (remote only). || Milestones | M19 product shell, privacy, accessibility, release | done | Welcome page and walkthroughs, update channel for the port's own builds, relaunch, splash, accessibility (VoiceOver through GPUI's accessibility tree, accessibility signals, high-contrast checks), process explorer and performance views, telemetry inert end to end, packaged and signed `.app`. Open gaps: the gaps column of its unit rows. | The telemetry source search (no telemetry endpoint string reachable) and network capture (zero outbound requests in a 10 min session with no user action) pass; VoiceOver reads the editor line and the Explorer rows; the signed `.app` passes `spctl -a`; benchmark rerun against a packaged reference build. || Milestones | M20 parity | in progress | Nothing new; close the gaps the earlier milestones left (the gaps column of the unit rows). Completion check in port-m20-check: api-tests met (318/28/0 in the target's suites, 4/0/0, port/results/api-tests.md); pixel-check met, the remaining differences are the causes in port/results/pixels.md; ledger not met: the `ported` rows, each with its open gaps. Closed in workbench/contrib/comments: comment threads in diff and multi diff editors, floating ones included, with the floating style's `FloatingWidgetRoom`. | `port/tools/api-tests` gives 318/28/0 (folder) and 4/0/0 (workspace): the reference baseline 356/46/0 less the suites and tests of removed features (chat, lm, the integrated browser, `env.remoteName`) (port/results/api-tests-reference.md); pixel-check of every window has no difference beyond anti-aliasing and the causes listed in `port/results/pixels.md`; every ledger row is `verified`, `removed` or `n/a`. || Milestones | M20 multi-instance code editor | done | Upstream every diff side, multi diff file side, notebook cell and walkthrough snippet is its own CodeEditorWidget. The port keeps one focused code editor per group bound to `text_area`, `editor_focus`, the input handler and `editors.active()`, as upstream's one focused widget takes the keys; every other code editor of the group keeps its own viewport, text area cells, minimap layout and find widget (code_editors.rs `parked`, `finds`) and draws through `text_area` as an inactive group's editor, with its own hover, color decorators, bracket guides and overview ruler; a press focuses it, a wheel scrolls it. Through it: the diff editor's original side (focus, selection, find), the multi diff file sides (the modified side takes typing and undo, its diff follows), notebook cells and playground snippets. | `cargo test -p app -- a_file_side_is_a_code_editor every_drawn_file_side the_original_side_takes_the_focus_selection_and_find each_group_keeps_its_own_find_widget the_focused_cell_is_the_code_editor unfocused_cell unfocused_snippet the_host_sees_the_code_editors_of_the_rendered_cells part_view::`: 17 passed; port/notes.md milestone 20, Multi-instance code editor |@@ -537,7 +537,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| workbench/contrib/emergencyAlert | workbench contribution | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert || workbench/contrib/emmet | workbench contribution | M13 | verified | | workbench/emmet.rs: Emmet: Expand Abbreviation (`emmet.expandAbbreviation` with the language at the cursor and the emmet parent mode of its grammar's scope, emmetAction.test.ts cases), Tab with `emmet.triggerExpansionOnTab`, the Edit menu entry: cargo test -p app emmet menubar || workbench/contrib/encryption | workbench contribution | M10 | n/a | | encryption.contribution.ts only migrates Linux `password-store` argv values to gnome-libsecret; the port runs on macOS and keeps secrets in the Keychain |-| workbench/contrib/extensions | workbench contribution | M18 | ported | [3 M] extensions.contribution.ts: the `MenuId.ExtensionContext` item Apply Extension to all Profiles (`toggleApplyToAllProfiles`) waits for application-scoped extensions: extensionsScannerService.ts `scanExtensionsFromProfile` adds the default profile's `isApplicationScoped` entries to every other profile, exthost extension_management.rs `UserExtensions::scan` reads only the current profile's extensions.json; [3 S] the row's activation time in ui-pair `menus/extension-context.json`: languageService.ts `onDidRequestRichLanguageFeatures` sends `onLanguage` for every text model an editor widget asks features of, the view's SuggestEnabledInput search box (`createModel('', null)`) included, host_sync.rs only for open editor documents, so with no editor open the reference's Emmet row shows its activation time (34ms) and the port's none; Developer: Startup Performance lists the eager activations in both | cargo test -p app extension the_manage_menu_lists_the_extension_context_menu the_manage_menu_installs_a_version_and_toggles_an_ignored_recommendation the_manage_menu_auto_updates_a_publisher_and_toggles_a_workspace_recommendation download_specific_version_picks_a_version_then_a_folder a_vsix_name_rejects_a_path_from_the_gallery install_anyway_installs_an_unsigned_extension install_specific_version_installs_the_picked_version an_activated_extensions_row_shows_its_activation_time the_manage_menu_sets_a_theme_of_the_extension the_views_are_panes extension_bisect bisect_finds_the_extension_and_keeps_it_disabled extension_features the_runtime_status_lists_uncaught_errors_and_messages invalid_contributed static_entries_need_the_proposal group_needs_the_proposal debuggers_merge_by_type_and_keep_the_built_in_values skipped_menu_contributions_are_extension_messages contributed_command_messages invalid_views_and_view_containers_are_extension_messages invalid_configuration_is_an_extension_message invalid_json_validation_is_an_extension_message invalid_colors_and_icons_are_extension_messages invalid_semantic_token_contributions_are_extension_messages invalid_problem_patterns_and_matchers_are_extension_messages invalid_grammars_are_extension_messages invalid_notebook_contributions_are_extension_messages (extensionsViews, extensionQuery, extensionEnablementService tests); cargo test -p exthost all_compatible_versions_follow_the_kind_and_the_engine all_versions_ignore_the_engine_but_not_the_block; ui-pair `menus/extension-context.json` with `--extensionDevelopmentPath=<repo>/port/fixtures/extensions/menus`, `menus/extension-theme.json`, port/fixtures/extensions/ui-view.json. Out with removed parts: Report Issue & Continue (contrib/issue), the authentication point and the Account Preferences item (services/authentication), the Install (Do not Sync), Install Pre-Release (Do not Sync) and Sync This Extension items (Settings Sync, no sign-in by decision, port/notes.md) |+| workbench/contrib/extensions | workbench contribution | M18 | verified | | cargo test -p app extension the_manage_menu_lists_the_extension_context_menu the_manage_menu_installs_a_version_and_toggles_an_ignored_recommendation the_manage_menu_auto_updates_a_publisher_and_toggles_a_workspace_recommendation download_specific_version_picks_a_version_then_a_folder a_vsix_name_rejects_a_path_from_the_gallery install_anyway_installs_an_unsigned_extension install_specific_version_installs_the_picked_version an_activated_extensions_row_shows_its_activation_time the_manage_menu_sets_a_theme_of_the_extension the_views_are_panes extension_bisect bisect_finds_the_extension_and_keeps_it_disabled extension_features the_runtime_status_lists_uncaught_errors_and_messages invalid_contributed static_entries_need_the_proposal group_needs_the_proposal debuggers_merge_by_type_and_keep_the_built_in_values skipped_menu_contributions_are_extension_messages contributed_command_messages invalid_views_and_view_containers_are_extension_messages invalid_configuration_is_an_extension_message invalid_json_validation_is_an_extension_message invalid_colors_and_icons_are_extension_messages invalid_semantic_token_contributions_are_extension_messages invalid_problem_patterns_and_matchers_are_extension_messages invalid_grammars_are_extension_messages invalid_notebook_contributions_are_extension_messages (extensionsViews, extensionQuery, extensionEnablementService tests); cargo test -p exthost all_compatible_versions_follow_the_kind_and_the_engine all_versions_ignore_the_engine_but_not_the_block every_profile; ui-pair `menus/extension-context.json` with `--extensionDevelopmentPath=<repo>/port/fixtures/extensions/menus`, `menus/extension-theme.json`, port/fixtures/extensions/ui-view.json. Out with removed parts: Report Issue & Continue (contrib/issue), the authentication point and the Account Preferences item (services/authentication), the Install (Do not Sync), Install Pre-Release (Do not Sync) and Sync This Extension items (Settings Sync, no sign-in by decision, port/notes.md) || workbench/contrib/externalTerminal | workbench contribution | M15 | verified | | workbench/external_terminal.rs: Open New External Terminal (`workbench.action.terminal.openNativeConsole`, cmd+shift+c), with several workspace folders after the Select workspace folder pick (cargo test -p app open_native_console_picks_a_folder_in_a_multi_root_workspace); cargo test -p app external_terminal; ui-pair (port/results/terminal.md) || workbench/contrib/externalUriOpener | workbench contribution | M12 | verified | | workbench/opener.rs: externalUriOpenerService.ts getRequestedOpener (workbench.externalUriOpeners globs), chooseOpener, "How would you like to open: {0}" picker; no Simple Browser (out of scope); verified at port-m12b-verify: cargo test -p app opener 4/4; Simple Browser is out of scope by decision || workbench/contrib/files | workbench contribution | M12 | verified | | explorer.rs, dialog.rs, workbench/workspace_editing.rs, workbench/file_compare.rs: cargo test -p app explorer_actions file_actions view_state nest copy_path copied_path_labels compact get_context compressed_navigation explorer_find find_filters files_dropped_from_finder view_title_and_file_actions new_file_creates file_compare focus_view_commands files_that_do_not_resolve open_editors body_limits_clamp sticky pinned_editors tab_scroll tree_guides hover unpin_hover open_with_opens_the_resource the_context_menu_selects_the_row readonly_keys_follow_the_focused_item_and_its_parent a_failed_create_offers a_folder_dropped_on_the_root a_delete_confirmation_follows_the_dialog_style cmd_v_pastes_the_files_finder_copied dragging_a_root_reorders_the_workspace_folders compacts_single_child_folders_into_one_row a_workspace_root_that_fails_to_resolve_is_decorated_with_its_error a_copy_onto_a_dirty_model_reverts_it_to_the_copied_file an_unreadable_folder_expands_to_no_children (explorerFileNestingTrie.test.ts); ui-pair port/fixtures/ui-pair/m12/workspace-folders.json, port/fixtures/ui-pair/m12/compare-saved.json, m12/compare.json, m12/find-in-folder.json, m12/folder-terminal.json, m12/explorer-ops.json, m12/editor-placeholders.json, m12/open-editors.json, m12/tab-scroll.json, m12/explorer-guides.json, m12/pinned-tabs.json (port/results/contextmenu.md). Differences left (port/notes.md milestone 12): a long tooltip breaks one segment earlier (GPUI line wrapper), the pin action loses its hover after Cmd+W until the pointer moves, a shrink sticky tab with a badge has no room for its name. Virtual workspaces: milestone 25 |