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

...
Автор SHA1 Повідомлення Дата
l0ng-ai e5a51f8c33 test(vim): count Select in Project View as a known action
#7011 mapped IDEA's SelectInProjectView to navigate.selectInProjectView, which has no default shortcut in any preset, so the :action id check failed.
2026-11-30 20:39:44 +08:00
Anka Tamaтаxirf 53a1e9255e fix(vcs): reopen the repository after its volume was remounted (#6949)
The cached gitoxide handle kept pack mappings from the old mount; after a remount with the same device, inodes and mtimes it was reused and reading it raised SIGBUS. The cache now detects the remount and reopens the repository. A volume lost in the middle of a git operation is not covered.

Refs #6948

Co-authored-by: xirf <[email protected]>
2026-11-30 20:27:43 +08:00
audichuang 40ab249cb8 fix(http): route WebSocket tunnels through the macOS PAC in Auto mode (#6939)
In Auto mode the TCP/CONNECT tunnel used for WebSockets resolved the proxy with the system matcher only, so a macOS PAC script was ignored. It now asks the PAC resolver first on a blocking thread and falls back to the matcher when there is no PAC or an env proxy is set.

Co-authored-by: audichuang <[email protected]>
2026-11-30 20:27:28 +08:00
LU XIANGRUIтаwildcatDownstairs 9da3d6d9b5 feat(typescript): Go to Source Definition, Project Configuration, Move to File and TS Server log through vtsls (#6935)
Five vtsls commands, run through workspace/executeCommand on a vtsls server that advertises them (other TypeScript servers report that vtsls is needed). Go to Source Definition opens the JavaScript implementation instead of the .d.ts; Go to Project Configuration opens the file's tsconfig.json or jsconfig.json; Move to File appears in Refactor > Move and the intention menu, offering tsserver's suggested target files and Choose File, and applies the move with its import updates as one workspace edit; Open TS Server Log offers to turn on logging through the new languages.typescript.tsserverLog setting, which restarts vtsls, and then opens the log.

Closes #6922

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 20:24:55 +08:00
l0ng-ai 0df7cb1da2 fix(keymap): list Select Opened File in the VS Code preset (#7038)
project.selectOpenedFile (#7011) was added to the IntelliJ presets only, so the keymap test that the VS Code preset covers every IntelliJ action id failed on main.
2026-11-30 20:23:48 +08:00
LU XIANGRUIтаwildcatDownstairs ee9b50179e feat(welcome): import recent projects and groups from a JetBrains IDE (#6979)
Import Recent Projects from JetBrains IDE (Welcome screen more menu, File > Manage IDE Settings) reads the IDE's options/recentProjects.xml and merges its recent projects and project groups into OpenIDEA's. Entries keep their custom or display name and the later of their open and activation times; hidden (LightEdit) entries are skipped, $USER_HOME$ and $APPLICATION_CONFIG_DIR$ are expanded, and projects whose folder is gone are skipped and counted. Existing entries and groups are kept, a taken group name gets a number, and importing twice adds nothing. Import Settings from JetBrains IDE lists the recent projects as a row of its confirmation and merges them too.

Closes #6970

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 20:15:11 +08:00
Muuтаmuutot baab92c804 feat(vcs): create patches from selected historical files (#6981)
Git Log and File History changed files get Create Patch and Copy as Patch to Clipboard, in the toolbar and the context menu. Only the selected repository-relative paths are exported, as path-filtered revision diffs with Git's empty tree on the missing side of additions and deletions and both names for renames. The existing patch dialog, base directory defaults, reverse option and clipboard flow are reused; empty, malformed, no-op, mixed-repository and external-repository selections are disabled.

Co-authored-by: muutot <[email protected]>
2026-11-30 20:08:11 +08:00
l0ng-ai 2b7a18ffd7 fix(search): start Find in Files from the selection in its preview (#7033)
Find in Files and Search Everywhere took the selection only from the active editor tab, so text selected in the Find in Files preview (or another focused editor, such as a diff pane) was ignored when the action ran again. The focused editor's selection now comes first, then the active editor's.

Fixes #6992
2026-11-30 20:04:14 +08:00
Muuтаmuutot f47a83828c feat(structure): temporarily enable filters to find matches (#6934)
With Narrow down on typing on, a File Structure query that matches nothing now turns on the unchecked filters (Show fields, Show non-public, Show inherited members) one at a time until a match appears. Filters enabled this way are restored as the query gets shorter and when the popup closes, and are never saved; a checkbox the user changes by hand keeps its new state, and the cascade stops right after a backspace restores a filter.

Co-authored-by: muutot <[email protected]>
2026-11-30 19:58:05 +08:00
薛纪克таxuejike 4d5ee2d01c feat(agents): drag and delete the whole task list selection (#6933)
In the Agents task list, dragging a row of a multi-selection moves every selected task (into a group, Pinned, a status group, or before or after a task, keeping their order), and Delete deletes the selection while the list has focus. Tree collapsed the selection to the pressed row on mouse down, before a drag could start; a press on a selected row now narrows the selection only on a release without movement. agents.deleteTasks gets a list-focus key binding like agents.archiveTasks, and a click or arrow key opens the session without taking focus from the list; Enter and double-click still focus it.

Closes #6932

Co-authored-by: xuejike <[email protected]>
2026-11-30 19:56:24 +08:00
l0ng-ai 2ecb44098a fix(debugger): drop lldb-dap pseudo paths on Windows too (#7030)
A referenced source's pseudo path such as /usr/lib/swift/libswiftCore.dylib`swift_willThrow was kept on Windows, where a path with a root but no drive is not absolute, so frames_drop_pseudo_paths_of_referenced_sources failed on Rust (windows-latest) since #6961. A rooted path now counts.
2026-11-30 19:48:37 +08:00
Mollo-i b1039bc175 feat(search): select Search Everywhere results in the Project view (#6955)
File, symbol and text results in Search Everywhere get Select in Project View, in the Alt+Enter menu and in a new right-click menu on the row: it closes the popup and selects the result in the Project tool window. This helps with files that open in another application, such as a .doc, where choosing the result leaves no trace of where the file lives. The item is offered only for paths inside the project. One item list now feeds both menus, and Open to the Side is disabled for folders.

Co-authored-by: Greenker <[email protected]>
2026-11-30 19:43:10 +08:00
薛纪克таxuejike 182c7c1dbb feat(editor): double-click the empty tab strip to maximize the editor (#6969)
A double click on the empty part of an editor tab strip (not on a tab, a button or trailing content) now maximizes the editor by hiding all tool windows, the same as a double click on a regular tab; doing it again restores them. Tabs gets an onBlankDoubleClick callback that fires only for the strip itself or its scroller.

Closes #6968

Co-authored-by: xuejike <[email protected]>
2026-11-30 19:42:00 +08:00
l0ng-ai c8dc613485 fix(projects): offer New Tab when opening a remote project or from a remote window (#7017)
The Open Project prompt gated Attach and New Tab on one flag that required a local project in a local window, so opening an SSH/WSL project, or any project from a remote window, offered only New Window and This Window, and "Open project in: tab" fell back to a new window. Attach still needs a local project in a local window, but a project tab is a window of its own joined to this window's group, so it now applies whenever this window has a project: a remote project opens in a new window that joins the group.

Fixes #6923
2026-11-30 18:36:46 +08:00
audichuang 88a6bbca14 perf(vcs): run Git outside the log index lock so commit details and one-commit queries do not wait for a history walk (#7006)
history::log held the log index lock for its whole run, so every Git subprocess it started (file history, path selection, range ids, rev-list, the --grep text filter) ran under the lock, and commit details plus the one-commit queries behind inline blame waited for the whole walk. The lock is now taken per phase: Git runs unlocked and only in-memory work holds the guard. update_head_reachable runs under the guard that builds the rows, and the shared nodes are used only when they were built for the query's shallow set, rebuilt otherwise, so a query stays on one snapshot while others run in between.

Co-authored-by: audichuang <[email protected]>
2026-11-30 18:32:37 +08:00
Ivan b9e555300f fix(macos): defer moving a full-screen tab out of its group until the app is active (#6997)
Close Project on a tab of a native full-screen group moves the tab into a window, and so a full-screen Space, of its own. While the app is inactive, AppKit's enter-full-screen transition for that Space crashes in SLSWindowServerClientSpaceAddWindowsAndRemoveFromSpaces as soon as the web view draws its next frame, taking every project window with it. Detaching such a tab is now deferred: the tab stays in its group (showing Welcome) and moves to its own Space when the app is next activated. Foreground closes and windowed groups detach immediately as before.

Fixes #6937

Co-authored-by: Pecnikas <[email protected]>
2026-11-30 18:30:57 +08:00
l0ng-ai 7ff223001b fix(fonts): keep Latin text monospaced when the chosen font isn't installed (#7013)
With a fallback font set and a primary family that isn't installed, every glyph came from the fallback. A CJK fallback such as PingFang SC has proportional Latin letters, and the terminal sized its cells for the widest of them, so text came out spread apart. Once the native font catalog shows the family is missing, the bundled JetBrains Mono now stands in for it ahead of the fallback, which still covers the glyphs it lacks. Applies to every monospace stack built from the editor or terminal font settings.

Fixes #6974
2026-11-30 18:25:17 +08:00
l0ng-ai cc9279a6d6 fix(editor): indent Slint element blocks by their braces (#7012)
Slint borrows the C mode for highlighting until slint-lsp's semantic tokens arrive, and Enter used that mode's statement indentation: after a child element's closing brace the next line went back to column 0, and nested blocks below it opened one level short. Slint now uses the brace-based fallback indentation even though a highlighting mode is loaded. No other language with a borrowed mode has this mismatch.

Fixes #6976
2026-11-30 18:22:26 +08:00
l0ng-ai 1cfbb24b31 fix(project-tree): add Select Opened File as a Project View action for the keymap (#7011)
The keymap listed "Select Opened File" only as the Database view action, so a shortcut assigned to it revealed the file in the Database view and did nothing in a project without data sources. Like IDEA's SelectOpenedFileInProjectView, the Project view now has its own Select Opened File action (the toolbar button runs it), and imported IDEA keymaps map SelectOpenedFileInProjectView and SelectInProjectView.

Fixes #6978
2026-11-30 18:18:33 +08:00
l0ng-ai a8a0cdb315 fix(plugins): load precompiled plugin components in the signed macOS app (#7010)
compile_cached loaded the cached .cwasm with Component::deserialize_file, which maps the file and makes its pages executable; the hardened runtime of the signed app refuses that, so every activation discarded the cache and compiled the plugin again. The file is now read into memory and deserialized from the bytes. A new test checks the cache is hit; signed with the app entitlements it fails with the old code.

Refs #6954
2026-11-30 18:16:20 +08:00
l0ng-ai 8ab776ada6 fix(keymap): import an Emacs-based IDEA keymap on top of $default, not macOS (#7008)
presetOf picked the macOS preset for any parent whose name contains "mac", including "Emacs", so a keymap derived from IDEA's Emacs keymap was imported as based on macOS. The match is now on the word (Mac OS X, macOS), and Emacs and its copies map to the $default preset they inherit in IDEA.

Refs #6896
2026-11-30 18:14:01 +08:00
LU XIANGRUIтаwildcatDownstairs 88b463d888 fix(debugger): let a tsx program behind a remote root run under Attach to Node.js (#6926)
On a loopback address js-debug makes the program require its child-process bootloader by a local path; behind a remote root (published container port, SSH tunnel) that path is missing, tsx's esbuild worker exits and the program waits for it forever. Attach to Node.js with a remote root, and Node.js debugging on SSH/Docker/Compose run targets, now pass autoAttachChildProcesses: false.

Closes #6925

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 18:11:42 +08:00
LU XIANGRUIтаwildcatDownstairs ac88059d0f fix(plugins): index the first 20,000 files of a large project instead of none (#6958)
Plugin navigation discovery refused the whole project above 20,000 matching files, counted out-of-scope and git-ignored files toward the cap, and showed the raw error text half translated. Discovery now keeps the first 20,000 in-scope, non-ignored files, reports total/truncated, and shows one warning naming the project and the counts.

Fixes #6940

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 18:11:27 +08:00
Waiting-Night a09c9aa9ad fix(java): navigate inherited method references to their declarations (#6953)
JDT's selection-based definition can answer the functional interface method (Function.apply) for a method reference whose method is inherited. Go to Definition on a Java method reference now asks the app-owned JDT command openidea.java.methodReferenceDefinition (java-usages 1.20.1) for the AST method binding; Lombok accessors without a source range fall back to their field or declaring type. The bundled jar is reproducible from source (SHA-256 a111a935...); tests/method-reference.py checks the command against a real JDT LS.

Co-authored-by: wangyuewen-china <[email protected]>
2026-11-30 18:06:54 +08:00
LU XIANGRUIтаwildcatDownstairs 7fef1e10a8 fix(ai-completion): say why no suggestions appear and let the model be chosen (#6936)
The plugin's optional net:localhost permission is not ticked by default, and a missing Ollama model answers 404; both only reached the IDE log. Failed requests now show one warning that says why and what to do, and a new AI Completion: Set Model command (Set Endpoint URL also asks for its value from the palette). The host answers an empty list instead of "no server supports inline completion" when a plugin offers ghost text, so the editor keeps asking while typing.

Fixes #6930

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 18:03:40 +08:00
l0ng-ai 1748c98ac8 test(agents): type the store import of the long agent form e2e (#7004)
The e2e from #7003 imported the store by a literal /src path, which pnpm typecheck rejects (TS2307); it now imports through a variable typed as the store module.
2026-11-30 17:59:41 +08:00
l0ng-ai 399ae25ab6 fix(agents): keep a long agent form scrollable above the composer (#7003)
An agent form (ACP elicitation, used by opencode for its questions) had no height limit, so a form with several fields pushed its last choices, its buttons and the composer out of view with nothing to scroll. FormCard now uses the pinned question card layout (at most half the window, scrolling within), and the pinned card shrinks when the session is shorter so the composer stays in view.

Fixes #6945
2026-11-30 17:58:47 +08:00
audichuang f28dd8125b fix(deps): update yanked async-executor 1.14.0 to 1.14.1 (#6971)
crates.io yanked async-executor 1.14.0 for a use-after-free when a Waker fires during Executor::drop (smol-rs/async-executor#164). Lock-only update to 1.14.1.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:51:51 +08:00
arookieofcтаarookieofc d5f7e0a99b fix(maven): delegate launch classpath to Maven without jdtls (#6984)
With delegateBuild on a Maven module, launches without jdtls (java-analyzer) used the language server classpath, which ignores child POM exclusions. They now merge the classpath Maven resolves, as the jdtls path does, and fall back to the server classpath when the probe fails.

Fixes #5586

Co-authored-by: arookieofc <[email protected]>
2026-11-30 17:50:57 +08:00
audichuang a66c9e6d05 fix(vcs): retry git status without rename detection when a partial clone cannot fetch a blob (#6987)
In a blobless partial clone rename detection needs a staged blob it cannot fetch (Restricted Mode sets GIT_NO_LAZY_FETCH, or the promisor is unreachable) and git status fails. Status retries once with --no-renames when git reports the promisor remote.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:50:44 +08:00
audichuang 59bcf7eac5 fix(refactor): keep external changes when a file move's reference edits are rejected (#6990)
FileMoves::perform restored its pre-edit snapshots when the reference edits were rejected, overwriting a change another program wrote after the snapshot. apply_edit is transactional and leaves nothing behind on error, so a rejected edit is now returned without a restore; a failed move still rolls back the applied edits.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:50:29 +08:00
LU XIANGRUIтаwildcatDownstairs fe21c67537 fix(debugger): do not open lldb-dap's disassembly pseudo paths as files (#6961)
lldb-dap reports frames without debug info with a sourceReference and a pseudo path such as libswiftCore.dylib`swift_willThrow, which opened as a missing file. An absolute path that does not exist on a referenced source is dropped, so the stop selects the first frame with source.

Closes #6960

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 17:50:10 +08:00
audichuang c085f52b59 fix(editor): paste an image from the Markdown editor's context menu without WebKit's Paste callout (#6994)
On macOS the context-menu Paste in a Markdown editor called execCommand(paste), which shows the WebKit Paste callout. Images and copied image files are read through the backend instead; text takes the native path.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:43:14 +08:00
Bin 0104ed63c1 fix(project-tree): open external files on double-click only (#6993)
Single-click in the project tree opened files associated with an external application. Those now open on double-click only.

Co-authored-by: ffgenius <[email protected]>
2026-11-30 17:42:57 +08:00
Chris-young42таChris-young42 a441b2a906 fix(java): remove extra spaces from annotation completions (#6989)
JDT LS appends a space to annotation completions; it is dropped when nothing follows that needs a separator, so no trailing whitespace after @Override or space before the parenthesis.

Co-authored-by: Chris-young42 <[email protected]>
2026-11-30 17:42:42 +08:00
audichuang c4f7fec86c fix(build): keep output the channel delivers after the build result (#6988)
Tauri delivers channel messages over 8 KiB through an async fetch and holds later ones back, so output can arrive after the command result. Output and step events of the latest build are still applied after it finished, until another build takes the window.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:42:28 +08:00
audichuang 37a8aae018 fix(vcs): keep focused and unsaved all-in-one diff blocks mounted while the view has no height (#6983)
With no height (a maximized tool window over the diff) the virtualizer rendered no range and unmounted the focused and unsaved blocks, saving an unsaved index edit. The view now reports at least 1 px and keeps the last measured block sizes while hidden.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:42:16 +08:00
LU XIANGRUIтаwildcatDownstairs acc48a4816 fix(run): clear a selected test's output with Clear All (#6982)
A selected test node shows the output captured on that node, which Clear All did not touch. Clear All now drops captured test output as well; statuses and the tree stay.

Closes #6975

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 17:42:00 +08:00
audichuang 8301326289 fix(ui): remeasure the custom scrollbar when its content grows without the scroller resizing (#6973)
The custom scrollbar observed only the scroller, whose size does not change when its content grows (a Markdown preview reflowing after a width change). It now also observes the scroller children, re-observing them when they are replaced.

Co-authored-by: audichuang <[email protected]>
2026-11-30 17:41:43 +08:00
sonnartliao 4c71299745 fix(editor): resolve C declarations without include metadata (#6959)
Without a compilation database clangd leaves nested includes unresolved or answers with the call site itself. For C-family files an empty or self-only answer falls back to syntax and the project index (including identifiers in macro bodies), Go to Implementation from a header finds the source definition, and member access is never guessed by bare name.

Co-authored-by: sonnartliao <[email protected]>
2026-11-30 17:41:27 +08:00
Jimmy Song 08249ca5fd fix(viewers): reload preview images when files change on disk (#6952)
Preview image data URLs were cached by path forever. The cache now drops entries on fsChanged and open Markdown and reStructuredText previews reload the affected images.

Co-authored-by: zhiai007 <[email protected]>
2026-11-30 17:41:09 +08:00
Waiting-Night edd6746439 fix(editor): stop type hierarchy searches from library gutter markers (#6951)
Library gutter markers asked jdtls for inheritors of every visible class, which on a JDK interface ran a full type hierarchy search and timed out. Library sources keep super-method markers but ask for no inheritors; Go to Implementation still answers.

Co-authored-by: wangyuewen-china <[email protected]>
2026-11-30 17:40:54 +08:00
LU XIANGRUIтаwildcatDownstairs 695424beb2 fix(editor): reopen restored library source tabs read-only (#6950)
The library-source mark lived only in memory, so a tab restored after a reload opened the same file editable. The editor session now saves the mark and restores it before the documents open.

Closes #6947

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 17:40:41 +08:00
LU XIANGRUIтаwildcatDownstairs 9943d71d02 fix(editor): show no diagnostics in library sources (#6946)
Language servers publish errors for files they generate or read outside the project (sourcekit-lsp parse errors in its .swiftinterface). Library sources open read-only, so their diagnostics are dropped from the editor and the Problems view.

Closes #6943

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 17:40:25 +08:00
l0ng-ai e03c5507f7 ci: publish a nightly prerelease of main every day (#6962)
nightly.yml builds main at 18:00 UTC, when it has moved since the last
nightly, as v<next patch>-nightly.<date>: a tag on a commit over main that
only sets the version (scripts/nightly-prepare.ts), built and published by
release.yml, which can now be called with `nightly: true` (notes from the
previous nightly; no official plugins, CNB mirror or Homebrew cask).

Nightly apps update from the rolling `nightly` release, which holds the
newest nightly's latest.json, and skip the CNB mirror, which carries only
stable releases. Stable apps keep reading releases/latest, never a
prerelease. The MSI gets a numeric version (last release + run number),
and the newest 14 nightlies are kept.
2026-11-30 15:55:50 +08:00
l0ng-ai 745099feaa chore: v0.1.56 2026-11-30 15:07:20 +08:00
l0ng-ai 6894d0a4e3 fix(web): declare the GTK dialog probe and hotkey probe as always allowed in the web shell (#6967)
file_dialog_needs_gtk and system_probe_hotkeys are trust = always on the desktop, but the web shell table still declared them Trusted, so commands::tests::web_shell_commands_match_the_desktop_declarations failed on every Rust job on main.
2026-11-30 15:06:25 +08:00
l0ng-ai f80be658ea fix(run-targets): apply a published ports edit that hasn't left the field (#6966)
Published ports and the other list fields of a run target were stored only on blur, so OK pressed with Enter, or applying the settings while the field still had focus, dropped the edit. The list is now staged on every change; the text stays as typed while the field has focus.
2026-11-30 15:01:45 +08:00
l0ng-ai 1c377b7f66 fix(run): show configuration types in the UI language in Add New Configuration (#6965)
The Add New Configuration type picker and the Edit Configurations Templates list showed each type's English label while the form showed the translation. Rows now carry the translated label, which the list also sorts and searches by.
2026-11-30 15:01:28 +08:00
LU XIANGRUIтаwildcatDownstairs 093cf6fdf8 feat(cpp): switch between a header and its source file (#6928)
A Switch Header/Source action (F10; Alt+O in the VS Code keymaps) opens the counterpart of the current C, C++, Objective-C or Objective-C++ file. It asks clangd with textDocument/switchSourceHeader (new lsp_switch_source_header, cancellable), so headers in include/ and sources in src/ are found; without clangd or an answer it opens a project file with the same stem and a counterpart extension, as Related Symbol does.

Closes #6927

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 12:00:32 +08:00
LU XIANGRUIтаwildcatDownstairs 9b578c2fad feat(run): debug Node.js on SSH, Docker and Compose run targets (#6919)
Debug on a Node.js configuration or a .js / .ts file run whose run target is SSH, Docker or Compose now debugs the program there, extending the Python flow. A js-debug configuration starts node with --inspect-brk on a free port (0.0.0.0 inside the container, published on this machine's loopback only; the host's loopback over the existing SSH forward). The run prints the project folder on the target as a system line, which the frontend reads to map sources before attaching js-debug. tsx is refused for now (it hangs once js-debug attaches); other programs get an error naming the fix.

Closes #6901

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:52:59 +08:00
LU XIANGRUIтаwildcatDownstairs f5bb97babd feat(js): CSS completion and diagnostics in styled-components and emotion templates (#6917)
Adds the managed tool typescript-styled-plugin (@styled/typescript-styled-plugin, pinned, hosted by vtsls). ide_sdk::apply::configure_styled adds it to vtsls' globalPlugins when it is installed and a package.json at, above or below the server root depends on styled-components or emotion; a tsconfig that declares the plugin keeps one copy. Opening a script that imports one of those libraries offers the install once per project and session. The bounded walk below the root is now shared with CSS Modules Kit.

Closes #6900

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:49:27 +08:00
l0ng-ai e23088d558 fix(vfs): don't cache ignore rules read before an invalidation (#6929)
GitignoreStack::matcher_for read a directory's ignore files outside the cache lock and stored the matcher afterwards, so a watcher-thread lookup racing a command that rewrote .gitignore and invalidated could leave the older rules cached; the next listing then missed the new entry. Invalidations now bump a generation counter under the cache lock and a lookup stores its matcher only when none happened since it started reading. This made rpc::serves_projects_files_documents_search_and_runs fail intermittently on Windows.
2026-11-30 11:48:07 +08:00
LU XIANGRUIтаwildcatDownstairs 7279f515db feat(xcode): run macOS app schemes on the Mac (#6918)
Xcode run configurations only ran iOS apps on the Simulator. The run now reads the scheme's build settings without a destination and, when its first application supports macOS but not the iOS Simulator (or the Simulator field is macos), builds with -destination platform=macOS and execs the app's executable, so its output reaches the Run console and Stop's SIGINT reaches it; NSUnbufferedIO=YES is set as Xcode does. The destination choice is shared by Clean Build Folder, which now cleans a macOS app's build for the Mac too.

Closes #6907

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:36:02 +08:00
LU XIANGRUIтаwildcatDownstairs 710d120689 feat(swift): debug SwiftPM executables from swift build's bin path (#6914)
Debug on a SwiftPM executable configuration launched lldb-dap on a hardcoded .build/debug/<product>, which misses -c release, --scratch-path / --build-path and the .build/out/Products layout of recent toolchains. The launch now carries a swiftpm key (product and the swift run build options), and ide-dap resolves program with swift build <options> --show-bin-path, like the cargo key. The Swift docs describe the SwiftPM run configurations and Debug.

Closes #6913

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:33:15 +08:00
JunChang Peng 38709947fe feat(database): give a table's tab its data source's colour (#6916)
A table's EditorInput has no path, so the path-keyed file decorations that tint console tabs never reached it. Editor kinds can now supply tabTint, read next to tabTrailing and refreshed by notifyTabTintsChanged when a source's colour changes; the table kind answers with its source's colour, and the data view's toolbar carries it too. A selected tinted tab now shows the colour at full strength instead of mixing it with the selection background, and inactive tinted tabs are dimmed.

Closes #6915

Co-authored-by: junchangpeng <[email protected]>

Co-authored-by: junchangpeng <[email protected]>
2026-11-30 11:31:00 +08:00
JunChang Peng d9fbb19787 feat(database): show a table's DDL from the data view (#6909)
The data view's toolbar gets a DDL button that opens the table's definition through the same openDdl the tree's Go to DDL uses, so checking an index or constraint no longer means leaving the rows. It is disabled while the DDL loads, for custom JDBC sources (no vendor DDL) and for catalog-qualified tables.

Closes #6910

Co-authored-by: junchangpeng <[email protected]>

Co-authored-by: junchangpeng <[email protected]>
2026-11-30 11:30:32 +08:00
LU XIANGRUIтаwildcatDownstairs 6aa613d4ec fix(editor): drop the unused gutter icon group re-exports that fail knip (#6920)
prefs.ts re-exported GUTTER_ICON_GROUPS and GutterIconGroup from ./localAppearance, but their users import localAppearance directly, so pnpm knip failed on main since #6912.

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:26:32 +08:00
LU XIANGRUIтаwildcatDownstairs 60ef498deb feat(run): add Clean Build Folder and Delete DerivedData for Xcode schemes (#6902)
Xcode projects had no way to clean a scheme's build or clear its DerivedData. Clean Build Folder runs xcodebuild clean in the Run tool window with the same flags as an xcode run. Delete DerivedData resolves the project's <Name>-<hash> folder from xcodebuild -showBuildSettings (never a guessed hash) plus the IDE's own run builds, asks, moves them to the Trash and restarts sourcekit-lsp. Both are in a new Build › Xcode submenu, Find Action and the .xcodeproj / .xcworkspace context menu; Flutter's and Xcode's build submenus now come from one dynamic_submenu table in both menu renderers.

Closes #6897

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:25:40 +08:00
LU XIANGRUIтаwildcatDownstairs 719b73ecd9 feat(xcode): flag new source files an Xcode project doesn't build (#6888)
xcodebuild compiles only the files a target lists, so a source file created or renamed in the IDE inside a classic .xcodeproj group was silently left out of the build. After file operations in the IDE (one check per burst), an XcodeGen or Tuist project gets an offer to regenerate it, and a classic project without synchronized folders gets a warning naming the files project.pbxproj doesn't list, with Open in Xcode. Regenerate Xcode Project is also in Find Action and in the context menus of project.yml / Project.swift. Names are matched as whole file names, and file operations without source files skip the check.

Closes #6887

Co-authored-by: wildcatDownstairs <[email protected]>

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 11:20:17 +08:00
l0ng-ai 6c3284c300 fix(settings): change the local data directory without an open project (#6921)
The Caches settings commands were trusted-only, so the welcome window could neither show the current location nor apply a custom directory, though the directory is an app-wide setting. Reading it now runs everywhere and changing it runs outside Restricted Mode. The Linux GTK file chooser and the global hotkey probe had the same gate and are now always allowed.

Fixes #6886
2026-11-30 11:15:49 +08:00
Bert Verhelstтаbertyhell 69cec11761 ci: run the release jobs that read secrets in the release environment (#6873)
The signing keys and tokens are repository secrets, readable by any workflow on any branch, and secrets: inherit hands them all to the called release workflows. The jobs that read a secret other than GITHUB_TOKEN now name environment: release (plugins, plugin-keys, build, server-signatures, mirror, cask). secrets: inherit stays until the secrets move into the environment, so releases build and sign as before; the environment is created on first use with no rules. Refs #6701.

Co-authored-by: bertyhell <[email protected]>
2026-11-30 10:52:02 +08:00
l0ng-ai 6c76cfd316 fix(editor): keep the run gutter from loading the editor preferences (#6912)
runGutter, which the Language smoke loads, imported gutterIconsOn from cm/prefs, pulling about 40 editor modules into the smoke inputs and failing scripts/smoke-paths.test.ts on main. The gutter icon groups and the per-editor appearance override move to cm/localAppearance, which prefs re-exports; the gutter providers import it directly and language-smoke.yml lists the new file.
2026-11-30 10:51:33 +08:00
audichuang 66496221b9 fix(ci): run Language smoke for every language when ide-http changes (#6905)
Since #6893 ide-tools depends on ide-http on macOS, so ide-http is an input of the Language smoke, but the Changes step still listed it as unused and scripts/smoke-paths.test.ts failed on main. Removes ide-http from that list.

Co-authored-by: audichuang <[email protected]>
2026-11-30 10:49:13 +08:00
l0ng-ai e9f3aef5ae fix(markdown): keep the preview painted while scrolling (#6908)
Trackpad scrolling in the Markdown preview could leave a large part of it blank until the next scroll. The preview moves itself on each wheel event with scrollBy, and in WebKit a run of scrollBy calls can leave the compositor at an older, never-painted offset than the page's. Setting scrollTop/scrollLeft keeps them in step; the source editor's large wheel jumps and the diff divider's wheel did the same and now set offsets too.

A fenced code block overflowing by a pixel no longer counts as a vertical scroller, and a nested scroller keeps the wheel only while it can still move in that direction, so scrolling no longer stops over code blocks.
2026-11-30 10:31:45 +08:00
LU XIANGRUIтаwildcatDownstairs 4ca46032c4 feat(run): debug Xcode run configurations on the iOS Simulator (#6889)
Debug on an Xcode run configuration builds and installs the app as Run does, launches it suspended on the iOS Simulator (simctl launch --wait-for-debugger) and attaches lldb-dap to its pid, so breakpoints in the app's Swift sources hit while its output stays in the Run console; stopping the debug session stops the run. simctl holds back its <bundle id>: <pid> line when stdout is a pipe, so the launch script prints it once the suspended process under the installed bundle appears. Detected and new Xcode configurations get debugAdapter lldb-dap. Closes #6885.

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 10:27:53 +08:00
Muuтаmuutot 8d8f66dfe5 feat(editor): add active-editor appearance toggles (#6891)
Show Line Numbers, Show Whitespaces, Show Gutter Icons and Show Indent Guides can be toggled for the active editor without changing the global setting. Overrides live in each CodeMirror EditorState, so split panes on one document can differ and untouched editors keep following the settings; line numbers, whitespace marks, indent guides and gutter providers reconfigure through one appearance path, and a local Gutter Icons override can enable providers even when the global setting is off. The toggles are in View > Active Editor, with IdeaVim aliases and unbound keymap entries.

Co-authored-by: muutot <[email protected]>
2026-11-30 10:26:06 +08:00
LU XIANGRUIтаwildcatDownstairs 5229e44a9c feat(swift): resolve and update Swift packages from the IDE (#6899)
Resolve Swift Packages and Update Swift Packages run swift package resolve / update in the Run tool window from the folder of Package.swift, like Go Mod Tidy, using the swiftpm run kind. They are in Find Action (category Swift) and on a single Package.swift in the Project view, editor and tab menus; when the run ends, run configurations and external libraries reload. sourcekit-lsp already reloads on Package.resolved changes through its file watcher, so no restart is added. Documented on the Swift page.

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-30 10:17:00 +08:00
audichuang 7be55e4eec fix(tools): follow the macOS PAC script for tool downloads in Auto proxy mode (#6893)
Tool downloads run through the system curl, which in Auto proxy mode only got the manual macOS proxy from Matcher::from_system(), never the PAC script, so on a PAC-only network language-server installs went direct while the rest of the IDE followed the PAC.

Http::base now asks the same PacResolver the HTTP client uses (ide_http::system_pac_route, evaluated inline with the per-host cache) and passes its proxy to curl as --proxy; while the script loads or fails it answers with the manual proxy, as before. Linux and Windows build the same command as before.

Co-authored-by: audichuang <[email protected]>
2026-11-30 10:14:57 +08:00
l0ng-ai ce206f74af fix(deps): update curve25519-dalek to 5.1.0 (RUSTSEC-2026-0620) (#6903)
cargo deny failed on RUSTSEC-2026-0620: curve25519-dalek 5.0.0, pulled in by ed25519-dalek for extension signature checks in ide-extension, has an AVX-512 backend bug in scalar multiplication. Our builds do not enable that backend; lock-only update to the fixed 5.1.0.
2026-11-30 10:13:10 +08:00
Muuтаmuutot 3c6bc1b29f feat(editor): zoom Quick Documentation with the mouse wheel (#6883)
With Editor > General > Change font size with Ctrl/Command+Mouse Wheel enabled, Ctrl/Cmd+wheel over Quick Documentation changes the documentation font size. One persisted zoom (-6..36 px) is shared by the hover, the F1 popup and the Documentation tool window, and the focused Increase/Decrease/Reset Font Size actions go through the existing font-zoom surface registry. Only documentation typography scales; editor text, toolbar controls and popup scrolling are unchanged.

Co-authored-by: muutot <[email protected]>
2026-11-30 09:12:45 +08:00
audichuang f9a8ad3fa7 fix(editor): do not recreate a file deleted outside the IDE on autosave (#6884)
A dirty buffer whose file another program deleted (git switch, git stash -u, a build clean) was written back by the next autosave, because check_disk_conflict only ran when fs::metadata succeeded.

A missing file (NotFound) now goes through the existing disk-conflict path: autosave refuses and the buffer stays dirty. DocDiskConflict carries deleted, so the notice says the file was deleted and offers no Load Changes from Disk; an explicit save recreates the file and clears the conflict.

Co-authored-by: audichuang <[email protected]>
2026-11-30 09:10:13 +08:00
audichuang 3d3ed6e120 fix(editor): update the status bar when a file's encoding or line ending changes (#6882)
When another program rewrote a clean open file in a different encoding or line ending, Documents::reload_from_disk re-detected and stored the new values but nothing sent them to the editor's DocMeta, so the status bar kept the old encoding and line separator until the tab was reopened; Load Changes from Disk had the same gap for the BOM.

Adds IdeEvent::DocEncoding (modelled on DocLanguage): both reload paths emit it through one helper only when the encoding, BOM or line ending changed, and the DocumentManager updates the meta.

Co-authored-by: audichuang <[email protected]>
2026-11-30 08:00:08 +08:00
Deng Liuтаdengliu 61dbb2f863 docs(agents): add agent resources and lifecycle guide (#6875)
Adds an English and Chinese guide under Guide > AI explaining how plugins, memory, MCP, tools and skills interact across an agent task, and what enters the LLM context window: plugin mcpTools reach the model through the built-in server's tools/list while plugin code stays out of the prompt. Linked from the Agents guide. The walkthrough video was left out to keep large binaries out of the repository.

Co-authored-by: dengliu <[email protected]>
2026-11-30 07:51:43 +08:00
Deng Liuтаdengliu 79e5ddda3e feat(agents): inspect built-in openidea MCP tools in MCP Connections (#6878)
The built-in openidea card in Settings > Agents > MCP Connections is now expandable like the other servers: it shows the tool count, status, stdio command and HTTP endpoint, lists the core and enabled plugin-contributed tools, and the search box filters them.

A read-only mcp_server_tools host command (trust = always) lists them through the same tools_for helper as Registry::tools, so Restricted Mode filtering and plugin tools match what agents see, while external server probing stays trusted-only. Tool descriptions are clamped to two lines with the full text in a tooltip.

Co-authored-by: dengliu <[email protected]>
2026-11-30 07:50:28 +08:00
Elmir Abkerimov 53cc0059a4 perf(macos): unlock 120Hz scrolling in WKWebView (#6874)
WebKit enables PreferPageRenderingUpdatesNear60FPSEnabled by default, throttling rendering updates (requestAnimationFrame, scrolling, viewport updates) to about 60 Hz on ProMotion and other high-refresh displays. The webview configuration now disables it through the private feature API (_features, falling back to _experimentalFeatures on macOS 12.0-13.2), sharing one helper with the TextInputClientSelectionUpdatesEnabled workaround.

To keep frames within the shorter budget: the window-level wheel listener stays passive unless a wheel shortcut is bound (none by default), horizontalScrollHold skips unchanged writes, and the overview lane moves its thumb with a transform and folds the pass-through hit test into its measure pass.

Co-authored-by: w4terlaw <[email protected]>
2026-11-30 07:40:26 +08:00
audichuang 6c945c73ad fix(github): look the pull request up again when the review repository's upstream changes (#6880)
When the review repository is not the VCS store's branch root, connectedBranch() reports upstream: null, so a change of that branch's upstream under the same HEAD (git branch -u, git push -u) never triggered a new pull request lookup.

For such a root each VCS refresh re-reads branch.<head>.remote/.merge and looks the pull request up again only when they differ from the last lookup; the change is recorded when read so a later reset also supersedes a late answer. The single-repository path is unchanged and no GitHub request is sent while the config is unchanged.

Co-authored-by: audichuang <[email protected]>
2026-11-30 07:26:25 +08:00
audichuang 51b93d25bd fix(github): check out the Review Mode branch in the repository the sync check uses (#6879)
"Update Branch to Enable Review Mode..." ran gh pr checkout in connectedRoot() while the sync check and pull request lookup use reviewRoot() (#6622), so with a worktree or a second clone selected the update acted on another repository and could fail with "refusing to fetch into branch checked out at ...".

checkoutPullRequest takes an optional root (default connectedRoot(), so other callers keep theirs); updateReviewBranch captures reviewRoot() before the details reload so a selection change during the reload cannot move the checkout.

Co-authored-by: audichuang <[email protected]>
2026-11-30 07:25:46 +08:00
l0ng-ai c0b5789dd6 fix(run): rebuild the WAR before redeploying a copied Tomcat update (#6871)
Update classes while debugging copies the compiled outputs into the exploded
deployment, then HotSwaps. When HotSwap could not apply the change (a new
class or method) it fell back to a redeploy, which explodes the recorded WAR
into the deployment again; that WAR predates the change, so the old classes
came back and classes added since were removed while the IDE reported
"Application updated". The WAR is now rebuilt before that redeploy.

Refs #6603
2026-11-30 02:05:05 +08:00
l0ng-ai 016240ac1b fix(windows): open one Settings window when it is requested in a burst (#6870)
The auxiliary-window commands are async, so several requests for the same
window (Ctrl+Alt+S pressed quickly or held) could all pass the already-open
check before the first window registered; five parallel requests opened
five Settings windows for one project window. The window's creation is now
claimed before the check, and a request arriving during the build leaves
its launch for that window and returns.

Fixes #6630
2026-11-30 01:36:01 +08:00
l0ng-ai 97598641be fix(agents): keep the reader's place when streamed content reflows above or below (#6863)
Scrolled away from the end while a reply streams, the view jumped when rows
changed height (a reasoning folding once the next tool call arrives, a lone
call joining a folded run): WebKit has no scroll anchoring. Away from the
end, Stream now keeps the row at the top of the view in place after every
render, row resize and scroll; content that gets shorter below leaves blank
room (now an ::after spacer) instead of pulling the view down. Following
the end is unchanged.
2026-11-30 01:25:34 +08:00
l0ng-ai f220ceb117 feat(data-dirs): portable installs with an openidea.properties file (#6869)
An openidea.properties next to the executable (the AppImage file on Linux,
the folder holding OpenIDEA.app on macOS) sets the OPENIDEA_CONFIG_DIR,
OPENIDEA_DATA_DIR, OPENIDEA_LOCAL_DATA_DIR and OPENIDEA_LOG_DIR variables at
start, so a portable install needs no environment. Relative paths are taken
from the file's folder and the environment wins. Applied first thing in main
so every directory and child process sees the same locations.

Closes #6207
Closes #6437
2026-11-30 01:06:22 +08:00
l0ng-ai 263c95738e fix(test-runner): show the run's time when the runner reports no total (#6868)
The test status bar only showed a duration from the runner's summary line.
JUnit runs through the IDE's runner report each test's time but no total,
so the bar showed none. TestResults.totalDurationMs() now falls back to the
tests' summed time; the status bar and the export share it.
2026-11-30 00:55:13 +08:00
l0ng-ai 3a07f05a75 fix(endpoints): keep every Spring controller in large multi-project trees (#6867)
The Spring route source scan kept every Java/Kotlin file containing
"Mapping" (MapStruct mappers, DTOs, @Mapping) and stopped at 1024 files.
In a large multi-module backend those filled the budget and, with the
parallel walk, which controllers survived varied between runs.

Only files naming a request mapping annotation and a controller or Feign
client are kept now (what the endpoint index reads), the caps are raised
to 8192 files / 128 MB, and hitting a cap is logged.
2026-11-30 00:48:16 +08:00
Muuтаmuutot 81d0ada2f3 feat(vcs): maximize selected Git Log commit messages (#6864)
Adds Maximize Commit Message after Copy Revision Number in the Git Log and
File History commit menus and on the commit details toolbar. It opens a
resizable, scrollable dialog with the full message and metadata of every
selected commit (read-only commits included); disabled without a
selection.

Co-authored-by: muutot <[email protected]>
2026-11-30 00:45:16 +08:00
Muuтаmuutot 04bea8718e feat(vcs): refresh Git Log with the Refresh shortcut (#6862)
Adds the Git Log Refresh action (Vcs.Log.Refresh) for Git Log and File
History, bound to the Refresh shortcut (Ctrl+F5 on Windows/Linux, Cmd+R on
macOS) and scoped to the log so other bindings keep the key elsewhere. The
toolbar button and the action share one refresh path that keeps the current
log while reloading, invalidates commit-detail caches for the visible
repositories and is ignored while the log is already loading.

Co-authored-by: muutot <[email protected]>
2026-11-30 00:36:23 +08:00
l0ng-ai 7f32d04b19 feat(plugins): open files as text and contribute to Open In (API 1.19) (#6866)
Plugins can open a file in the built-in text editor even when a custom
editor claims it (workspace.editor open-as-text, SDK open_editor_as_text),
and commands can contribute to the Open In submenu (openIn menu location,
file as the argument, no submenus). Docs, versioning table and rebuilt
components included.

Fixes #6852
Fixes #6853
2026-11-30 00:32:41 +08:00
Muuтаmuutot 4a714b2eff feat(editor): speed-search navigation bar children (#6855)
Typing in a Navigation Bar child list (the floating Alt+Home bar and the status-bar breadcrumbs) filters its rows with fuzzy matching and highlights the matched characters; Backspace edits the query, Escape clears it before closing, and Enter opens the selected match. The query resets when the list moves to another folder or back to a parent.

The typed text shows in a row above the list, red when nothing matches, as in the project tree's speed search.

Co-authored-by: muutot <[email protected]>
2026-11-30 00:07:33 +08:00
l0ng-ai 83b273ec4c fix(editor): keep a horizontally scrolled view in place while line-end hints refresh (#6865)
Line-end hints (inline blame, line-end lenses, plugin messages) draw from a zero-width anchor: they widen the scroll range but not the content, and most leave on an edit and return a moment later. While one was away the range shrank and the browser clamped scrollLeft, so a horizontally scrolled editor jumped sideways on every keystroke.

A 1px spacer at the visible right edge, moved on every scroll and geometry change, keeps the range from shrinking under the view without adding scroll room. Covers every line-end hint, not only blame.

Fixes #6624
2026-11-30 00:02:14 +08:00
Muuтаmuutot 37e2e250e9 feat(vcs): focus Git Log text filter with Ctrl+L (#6861)
Adds Focus Text Filter (Vcs.Log.FocusTextFilter, Ctrl+L) to Git Log and File History: from the commit list it focuses the message filter, from inside the filters toolbar it returns to the commit list.

The action is ordered ahead of the Agents input (also Ctrl+L in the Windows keymap), which otherwise took the key whenever an agent task was on screen, and it leaves popups their own Ctrl+L. Eclipse keymaps share Go to Line's Ctrl+L with it; the title has a zh entry.

Co-authored-by: muutot <[email protected]>
2026-11-29 23:48:08 +08:00
490 змінених файлів з 13760 додано та 1341 видалено

No files matched your search

+1
Переглянути файл
@@ -21,6 +21,7 @@ concurrency:
jobs:
mirror:
environment: release
runs-on: ubuntu-latest
timeout-minutes: 120
env:
+1
Переглянути файл
@@ -23,6 +23,7 @@ concurrency:
jobs:
cask:
environment: release
runs-on: ubuntu-latest
timeout-minutes: 30
env:
+3 -2
Переглянути файл
@@ -34,6 +34,7 @@ on:
- "src/editor/relatedProviders.ts"
- "src/editor/core/cm/cornerInset.ts"
- "src/editor/core/cm/iconArea.ts"
- "src/editor/core/cm/localAppearance.ts"
- "src/editor/lsp/availability.ts"
- "src/editor/lsp/diagnostics.ts"
- "src/editor/lsp/files.ts"
@@ -106,9 +107,9 @@ jobs:
# SDKs, build tools, the project model, Find Usages candidates, debug stream traces):
# cargo metadata, ide-host's direct deps ide-search/ide-streams and the deps of
# ide-lsp/dap/run/sdk/tools.
unused='^crates/(ide-agent|ide-analysis|ide-android|ide-cli|ide-clipboard|ide-coverage|ide-db|ide-docker|ide-fonts|ide-github|ide-http|ide-mcp|ide-notebook|ide-profiler|ide-scaffold|ide-spell|ide-ssh|ide-vcs|ide-web)/'
unused='^crates/(ide-agent|ide-analysis|ide-android|ide-cli|ide-clipboard|ide-coverage|ide-db|ide-docker|ide-fonts|ide-github|ide-mcp|ide-notebook|ide-profiler|ide-scaffold|ide-spell|ide-ssh|ide-vcs|ide-web)/'
# The workflow's paths, less those handled per language below.
smoke='^(crates/|Cargo\.(toml|lock)$|src/features/(run|debugger|build|build-tools)/|src/platform/|src/workbench/|src/ui/|src/editor/(api|navigationProviders|refactorProviders|relatedProviders|core/cm/(cornerInset|iconArea)|lsp/(availability|diagnostics|files|hint|lsp|positions|snippet))\.ts$|src/bindings\.ts$|src/styles/tokens\.css$|src/test/setup\.ts$|src-tauri/icons/128x128\.png$|smoke/|vite\.config\.ts$|tsconfig\.json$|package\.json$|pnpm-(lock|workspace)\.yaml$|patches/|\.github/workflows/language-smoke\.yml$|\.github/tool-versions\.env$)'
smoke='^(crates/|Cargo\.(toml|lock)$|src/features/(run|debugger|build|build-tools)/|src/platform/|src/workbench/|src/ui/|src/editor/(api|navigationProviders|refactorProviders|relatedProviders|core/cm/(cornerInset|iconArea|localAppearance)|lsp/(availability|diagnostics|files|hint|lsp|positions|snippet))\.ts$|src/bindings\.ts$|src/styles/tokens\.css$|src/test/setup\.ts$|src-tauri/icons/128x128\.png$|smoke/|vite\.config\.ts$|tsconfig\.json$|package\.json$|pnpm-(lock|workspace)\.yaml$|patches/|\.github/workflows/language-smoke\.yml$|\.github/tool-versions\.env$)'
langs=""
while read -r f; do
case "$f" in
+104
Переглянути файл
@@ -0,0 +1,104 @@
name: Nightly
# Builds main every night, when it has moved since the last nightly, into a prerelease
# v<next patch>-nightly.<date> (scripts/nightly-prepare.ts: the tag points at a commit on top of
# main that only sets the version). Nightly apps update from the rolling `nightly` release, which
# holds the newest nightly's latest.json; stable apps read releases/latest, which is never a
# prerelease, so they never see a nightly. The newest 14 nightlies are kept.
on:
schedule:
- cron: "0 18 * * *" # 02:00 Beijing
workflow_dispatch:
inputs:
force:
description: "Build even when main has not changed since the last nightly"
type: boolean
default: false
permissions:
contents: read
concurrency:
group: nightly
jobs:
prepare:
if: github.repository == 'l0ng-ai/openidea'
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with: { ref: main, fetch-depth: 0 }
- id: changed
env:
FORCE: ${{ inputs.force == true }}
run: |
last="$(git tag --list 'v*-nightly.*' --sort=-creatordate | head -1)"
if [ "$FORCE" != true ] && [ -n "$last" ] && [ "$(git rev-parse "$last^")" = "$(git rev-parse HEAD)" ]; then
echo "::notice::main has not changed since $last"
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
if: steps.changed.outputs.skip != 'true'
with: { node-version: 22 }
- name: Version commit and tag
id: tag
if: steps.changed.outputs.skip != 'true'
env:
BUILD: ${{ github.run_number }}
run: |
version="$(node scripts/nightly-prepare.ts --date "$(date -u +%Y%m%d)" --build "$BUILD" | tail -1)"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -q -m "chore: v$version"
git tag "v$version"
# Pushed with GITHUB_TOKEN, the tag does not start release.yml: the job below calls it.
git push origin "refs/tags/v$version"
echo "tag=v$version" >> "$GITHUB_OUTPUT"
release:
needs: prepare
if: needs.prepare.outputs.tag != ''
permissions:
contents: write
uses: ./.github/workflows/release.yml
with:
tag: ${{ needs.prepare.outputs.tag }}
nightly: true
secrets: inherit
# Points the nightly channel at the new nightly and drops the old ones.
channel:
needs: [prepare, release]
permissions:
contents: write
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TAG: ${{ needs.prepare.outputs.tag }}
steps:
- name: Nightly manifest
run: |
if ! gh release download "$TAG" -p latest.json -D "$RUNNER_TEMP/manifest"; then
echo "::warning::$TAG has no latest.json (unsigned build): the nightly channel stays where it was"
exit 0
fi
notes="The update channel of the [nightly builds](https://github.com/$GH_REPO/releases?q=nightly&expanded=true): its latest.json is the newest nightly's, [$TAG](https://github.com/$GH_REPO/releases/tag/$TAG)."
if gh release view nightly >/dev/null 2>&1; then
gh release edit nightly --notes "$notes"
else
gh release create nightly --prerelease --target main --title "OpenIDEA Nightly" --notes "$notes"
fi
gh release upload nightly "$RUNNER_TEMP/manifest/latest.json" --clobber
- name: Drop old nightlies
run: |
gh release list --limit 200 --json tagName,createdAt \
--jq '[.[] | select(.tagName | test("^v.*-nightly\\."))] | sort_by(.createdAt) | reverse | .[14:][] | .tagName' |
while read -r old; do
gh release delete "$old" --cleanup-tag --yes
done
+3
Переглянути файл
@@ -19,6 +19,7 @@ env:
jobs:
plugin-keys:
permissions: {}
environment: release
runs-on: ubuntu-latest
outputs:
keys: ${{ steps.keys.outputs.keys }}
@@ -43,6 +44,7 @@ jobs:
contents: write
needs: plugin-keys
name: Build (${{ matrix.name }})
environment: release
env:
OPENIDEA_OFFICIAL_PLUGIN_KEYS: ${{ needs.plugin-keys.outputs.keys }}
strategy:
@@ -227,6 +229,7 @@ jobs:
permissions:
contents: write
needs: server
environment: release
runs-on: ubuntu-latest
steps:
- name: Signing configured
+30 -8
Переглянути файл
@@ -7,19 +7,27 @@ on:
tag:
description: "Tag to release (e.g. v0.1.0); must already exist"
required: true
# nightly.yml: a nightly is a prerelease whose notes start at the previous nightly, without the
# official plugins, the CNB mirror or the Homebrew cask.
workflow_call:
inputs:
tag: { type: string, required: true }
nightly: { type: boolean, default: false }
permissions:
contents: read
concurrency:
group: release-${{ github.event.inputs.tag || github.ref_name }}
group: release-${{ inputs.tag || github.ref_name }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
TAG: ${{ github.event.inputs.tag || github.ref_name }}
TAG: ${{ inputs.tag || github.ref_name }}
COMMUNITY_PLUGINS_INDEX: https://github.com/l0ng-ai/openidea-plugins/releases/download/index/index.json
# The jobs that read a signing key or token, here and in the workflows called below, run in
# the `release` environment, which holds those secrets.
jobs:
# Creates (or reuses) one draft release that every platform build uploads into.
create-release:
@@ -50,6 +58,8 @@ jobs:
fi
- id: release
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
NIGHTLY: ${{ inputs.nightly == true }}
with:
script: |
const tag = process.env.TAG;
@@ -61,8 +71,13 @@ jobs:
core.setOutput("id", existing.id);
return;
}
// Prereleases are skipped: the notes span stable release to stable release.
const previous = releases.find((r) => !r.draft && !r.prerelease);
// Prereleases are skipped: the notes span stable release to stable release. A
// nightly's span from the newest published release, nightly or stable (not the
// rolling `nightly` release, which only holds the channel's manifest).
const nightly = process.env.NIGHTLY === "true";
const previous = releases.find(
(r) => !r.draft && r.tag_name !== "nightly" && (nightly || !r.prerelease),
);
const { data: notes } = await github.rest.repos.generateReleaseNotes({
owner, repo, tag_name: tag, previous_tag_name: previous?.tag_name,
});
@@ -78,7 +93,7 @@ jobs:
needs: create-release
uses: ./.github/workflows/release-build.yml
with:
tag: ${{ github.event.inputs.tag || github.ref_name }}
tag: ${{ inputs.tag || github.ref_name }}
release_id: ${{ needs.create-release.outputs.release_id }}
secrets: inherit
@@ -96,13 +111,18 @@ jobs:
contents: write
needs: create-release
name: Official plugins
environment: release
runs-on: ubuntu-22.04
env:
SIGNING_KEY: ${{ secrets.PLUGIN_SIGNING_KEY }}
NIGHTLY: ${{ inputs.nightly == true }}
steps:
- id: key
run: |
if [ -z "$SIGNING_KEY" ]; then
if [ "$NIGHTLY" = true ]; then
echo "a nightly does not publish the official plugins"
echo "skip=true" >> "$GITHUB_OUTPUT"
elif [ -z "$SIGNING_KEY" ]; then
echo "::warning::PLUGIN_SIGNING_KEY is not set: the official plugins are not published"
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
@@ -175,13 +195,15 @@ jobs:
# The China mirror the updater's CNB source reads; a failure here leaves the GitHub release as is.
cnb-mirror:
needs: publish
if: ${{ !inputs.nightly }}
uses: ./.github/workflows/cnb-mirror.yml
with: { tag: "${{ github.event.inputs.tag || github.ref_name }}" }
with: { tag: "${{ inputs.tag || github.ref_name }}" }
secrets: inherit
# The cask in l0ng-ai/homebrew-tap; skipped for prereleases and without HOMEBREW_TAP_DEPLOY_KEY.
homebrew:
needs: publish
if: ${{ !inputs.nightly }}
uses: ./.github/workflows/homebrew.yml
with: { tag: "${{ github.event.inputs.tag || github.ref_name }}" }
with: { tag: "${{ inputs.tag || github.ref_name }}" }
secrets: inherit
Створено
+55 -53
Переглянути файл
@@ -252,9 +252,9 @@ dependencies = [
[[package]]
name = "async-executor"
version = "1.14.0"
version = "1.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37"
dependencies = [
"async-task",
"concurrent-queue",
@@ -1552,9 +1552,9 @@ dependencies = [
[[package]]
name = "curve25519-dalek"
version = "5.0.0"
version = "5.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5eed333089e2e1c1ac8c6c0398e5e2497b4c9926ca6d0365ed1e099afa5bc23"
checksum = "94c1aa5a9b7626ed65ac0cf5ea9d4f1547af89017fbac20bd4de40022fff516f"
dependencies = [
"cfg-if",
"cpufeatures 0.3.1",
@@ -4154,7 +4154,7 @@ checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]]
name = "ide-agent"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4183,7 +4183,7 @@ dependencies = [
[[package]]
name = "ide-analysis"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ast-grep-core",
"ide-core",
@@ -4195,7 +4195,7 @@ dependencies = [
[[package]]
name = "ide-android"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"serde",
@@ -4207,7 +4207,7 @@ dependencies = [
[[package]]
name = "ide-build"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"chardetng",
@@ -4225,7 +4225,7 @@ dependencies = [
[[package]]
name = "ide-cli"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -4239,7 +4239,7 @@ dependencies = [
[[package]]
name = "ide-clipboard"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"gtk",
"objc2 0.6.5",
@@ -4250,7 +4250,7 @@ dependencies = [
[[package]]
name = "ide-command"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -4261,7 +4261,7 @@ dependencies = [
[[package]]
name = "ide-core"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"dirs 6.0.0",
@@ -4283,7 +4283,7 @@ dependencies = [
[[package]]
name = "ide-coverage"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"ide-run",
@@ -4296,7 +4296,7 @@ dependencies = [
[[package]]
name = "ide-dap"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"futures",
@@ -4326,7 +4326,7 @@ dependencies = [
[[package]]
name = "ide-db"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"bb8",
@@ -4365,7 +4365,7 @@ dependencies = [
[[package]]
name = "ide-docker"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"serde",
@@ -4378,7 +4378,7 @@ dependencies = [
[[package]]
name = "ide-drag-out"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"gtk",
"objc2 0.6.5",
@@ -4392,7 +4392,7 @@ dependencies = [
[[package]]
name = "ide-extension"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4412,7 +4412,7 @@ dependencies = [
[[package]]
name = "ide-flutter"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-android",
"ide-core",
@@ -4423,7 +4423,7 @@ dependencies = [
[[package]]
name = "ide-fonts"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"objc2-core-foundation",
"objc2-core-text",
@@ -4435,7 +4435,7 @@ dependencies = [
[[package]]
name = "ide-github"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"ide-vcs",
@@ -4447,7 +4447,7 @@ dependencies = [
[[package]]
name = "ide-heap"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"criterion",
"ide-core",
@@ -4466,7 +4466,7 @@ dependencies = [
[[package]]
name = "ide-host"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4549,7 +4549,7 @@ dependencies = [
[[package]]
name = "ide-http"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"http",
@@ -4572,7 +4572,7 @@ dependencies = [
[[package]]
name = "ide-index"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"criterion",
@@ -4595,7 +4595,7 @@ dependencies = [
[[package]]
name = "ide-jdwp"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-jvm-inspect",
"proptest",
@@ -4607,7 +4607,7 @@ dependencies = [
[[package]]
name = "ide-jsonrpc"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"encoding_rs",
"ide-core",
@@ -4623,7 +4623,7 @@ dependencies = [
[[package]]
name = "ide-jvm-attach"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"libc",
"tempfile",
@@ -4632,7 +4632,7 @@ dependencies = [
[[package]]
name = "ide-jvm-inspect"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"futures",
"serde",
@@ -4643,7 +4643,7 @@ dependencies = [
[[package]]
name = "ide-language"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"criterion",
@@ -4702,7 +4702,7 @@ dependencies = [
[[package]]
name = "ide-lsp"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"criterion",
"dunce",
@@ -4732,7 +4732,7 @@ dependencies = [
[[package]]
name = "ide-mcp"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"bytes",
"dunce",
@@ -4751,7 +4751,7 @@ dependencies = [
[[package]]
name = "ide-notebook"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"futures",
"ide-core",
@@ -4776,7 +4776,7 @@ dependencies = [
[[package]]
name = "ide-plugin"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"dunce",
@@ -4798,7 +4798,7 @@ dependencies = [
[[package]]
name = "ide-profiler"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"ide-jvm-attach",
@@ -4812,7 +4812,7 @@ dependencies = [
[[package]]
name = "ide-remote"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"dunce",
"futures",
@@ -4832,7 +4832,7 @@ dependencies = [
[[package]]
name = "ide-run"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"dunce",
@@ -4858,7 +4858,7 @@ dependencies = [
[[package]]
name = "ide-scaffold"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"ide-tools",
@@ -4874,7 +4874,7 @@ dependencies = [
[[package]]
name = "ide-sdk"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"dirs 6.0.0",
@@ -4900,7 +4900,7 @@ dependencies = [
[[package]]
name = "ide-search"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"criterion",
"encoding_rs",
@@ -4921,7 +4921,7 @@ dependencies = [
[[package]]
name = "ide-spell"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"parking_lot 0.12.5",
@@ -4934,7 +4934,7 @@ dependencies = [
[[package]]
name = "ide-ssh"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"dirs 6.0.0",
"flate2",
@@ -4959,7 +4959,7 @@ dependencies = [
[[package]]
name = "ide-streams"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"ide-language",
@@ -4972,7 +4972,7 @@ dependencies = [
[[package]]
name = "ide-syntax"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"ide-language",
@@ -4987,7 +4987,7 @@ dependencies = [
[[package]]
name = "ide-terminal"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"ide-core",
"libc",
@@ -5001,7 +5001,7 @@ dependencies = [
[[package]]
name = "ide-text"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"criterion",
"ide-core",
@@ -5014,7 +5014,7 @@ dependencies = [
[[package]]
name = "ide-tools"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -5023,6 +5023,7 @@ dependencies = [
"http",
"hyper-util",
"ide-core",
"ide-http",
"ide-language",
"libc",
"minisign-verify",
@@ -5040,7 +5041,7 @@ dependencies = [
[[package]]
name = "ide-vcs"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"dunce",
@@ -5062,7 +5063,7 @@ dependencies = [
[[package]]
name = "ide-vfs"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"chardetng",
"dunce",
@@ -5089,7 +5090,7 @@ dependencies = [
[[package]]
name = "ide-web"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"dirs 6.0.0",
"ide-core",
@@ -5105,7 +5106,7 @@ dependencies = [
[[package]]
name = "ide-workspace"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"blake3",
"dunce",
@@ -5115,6 +5116,7 @@ dependencies = [
"ide-text",
"ide-vfs",
"parking_lot 0.12.5",
"quick-xml 0.42.0",
"semver",
"serde",
"serde_json",
@@ -6753,7 +6755,7 @@ dependencies = [
[[package]]
name = "openidea"
version = "0.1.55"
version = "0.1.56"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -9859,7 +9861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom 0.4.3",
"getrandom 0.3.4",
"once_cell",
"rustix",
"windows-sys 0.61.2",
+1 -1
Переглянути файл
@@ -5,7 +5,7 @@ members = ["crates/*", "src-tauri"]
exclude = ["sdk", "plugins"]
[workspace.package]
version = "0.1.55"
version = "0.1.56"
edition = "2024"
rust-version = "1.96"
license = "Apache-2.0"
+11
Переглянути файл
@@ -155,6 +155,8 @@ pub enum IdeEvent {
DocDiskConflict {
doc: DocId,
path: String,
/// The file no longer exists: saving recreates it, and there is nothing to load.
deleted: bool,
},
/// A complete workspace edit can be undone as one operation.
WorkspaceEditApplied {
@@ -174,6 +176,15 @@ pub enum IdeEvent {
/// See `DocumentInfo::ui_mode`.
ui_mode: Option<String>,
},
/// A reload from disk changed an open document's encoding, BOM or line ending (the file
/// was rewritten by another program), which the editor only learns when it opens.
DocEncoding {
doc: DocId,
encoding: String,
has_bom: bool,
/// A `LineEnding` in its serialized form: `lf`, `crLf` or `cr`.
line_ending: String,
},
/// Full replacement of diagnostics for one file from one producer.
Diagnostics {
path: crate::IpcPath,
+36 -1
Переглянути файл
@@ -1975,6 +1975,10 @@ pub struct TypeScriptSettings {
/// plugin (hybrid mode; a Vue project's program alone needs ~3 GiB, and the
/// vtsls default 3072 dies in a GC death spiral), else unset (vtsls default).
pub tsserver_max_memory: u32,
/// tsserver's log (`typescript.tsserver.log`). TypeScript: Open TS Server Log opens it.
#[serde(deserialize_with = "or_default")]
#[specta(type = TsServerLog)]
pub tsserver_log: TsServerLog,
/// Problems › TypeScript project errors: the project's own `tsc --watch` per root
/// `tsconfig.json` reports the errors of files that are not open.
pub watch_problems: bool,
@@ -1982,10 +1986,27 @@ pub struct TypeScriptSettings {
impl Default for TypeScriptSettings {
fn default() -> Self {
Self { version: "bundled".into(), tsserver_max_memory: 0, watch_problems: false }
Self {
version: "bundled".into(),
tsserver_max_memory: 0,
tsserver_log: TsServerLog::Off,
watch_problems: false,
}
}
}
/// tsserver's log verbosity, as vtsls' `typescript.tsserver.log` spells it.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub enum TsServerLog {
#[default]
Off,
Terse,
Normal,
RequestTime,
Verbose,
}
/// Dependency scope for a module dependency or project library (IDEA's Modules › Dependencies).
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
@@ -2168,6 +2189,20 @@ mod tests {
assert_eq!(serde_json::to_value(&on).unwrap()["languages"]["ruff"]["fixOnSave"], true);
}
#[test]
fn tsserver_log_reads_known_levels_and_drops_anything_else() {
let log = |v: &str| {
let s: Settings =
serde_json::from_str(&format!(r#"{{"languages":{{"typescript":{{"tsserverLog":{v}}}}}}}"#)).unwrap();
s.languages.typescript.tsserver_log
};
assert_eq!(log(r#""requestTime""#), TsServerLog::RequestTime);
assert_eq!(log(r#""verbose""#), TsServerLog::Verbose);
assert_eq!(log(r#""--trace""#), TsServerLog::Off);
assert_eq!(log("3"), TsServerLog::Off);
assert_eq!(serde_json::to_value(TsServerLog::RequestTime).unwrap(), "requestTime");
}
#[test]
fn python_interpreter_may_name_a_run_target() {
let python = |interpreter: &str| PythonSettings { interpreter: interpreter.into(), ..Default::default() };
+19 -1
Переглянути файл
@@ -24,6 +24,7 @@ pub mod kotlin_lsp;
mod memory;
mod session;
mod stream_trace;
mod swiftpm;
pub mod unity;
use adapter::{AdapterIo, AdapterLauncher, AdapterSpec, ProcessLauncher};
@@ -613,6 +614,16 @@ pub(crate) fn take_debug_server(arguments: &mut Value) -> IdeResult<Option<Debug
Ok(Some(DebugServer { host, port }))
}
/// A source served only through the `source` request whose `path` is no file, such as
/// lldb-dap's ``/usr/lib/swift/libswiftCore.dylib`swift_willThrow`` for a frame without
/// debug info. Opening it would show an error tab; without a path the stop selects the
/// first frame with source instead. Non-file paths (`jdt://`, `<node_internals>`) stay.
/// Rooted rather than absolute: on Windows a `/usr/…` path has a root but no drive.
fn is_pseudo_path(source: Option<&Value>, path: &str) -> bool {
let reference = source.and_then(|s| s.get("sourceReference")).and_then(Value::as_i64).unwrap_or(0);
reference > 0 && Path::new(path).has_root() && !Path::new(path).exists()
}
/// DAP stack frame → [`StackFrame`] (1-based → 0-based).
pub(crate) fn frame_from(f: &Value) -> StackFrame {
let source = f.get("source");
@@ -625,7 +636,11 @@ pub(crate) fn frame_from(f: &Value) -> StackFrame {
StackFrame {
id: f.get("id").and_then(Value::as_i64).unwrap_or_default(),
name: f.get("name").and_then(Value::as_str).unwrap_or_default().to_owned(),
path: source.and_then(|s| s.get("path")).and_then(Value::as_str).map(Into::into),
path: source
.and_then(|s| s.get("path"))
.and_then(Value::as_str)
.filter(|p| !is_pseudo_path(source, p))
.map(Into::into),
line: (f.get("line").and_then(Value::as_u64).unwrap_or(0) as u32).saturating_sub(1),
column: (f.get("column").and_then(Value::as_u64).unwrap_or(0) as u32).saturating_sub(1),
presentation_hint: hint,
@@ -1080,6 +1095,9 @@ impl DebugManager {
.await?;
arguments["program"] = json!(program);
}
if let Some(spm) = arguments.as_object_mut().and_then(|o| o.remove("swiftpm")) {
arguments["program"] = json!(swiftpm::program(&cwd, &spm, &cancel).await?);
}
// Attach to a Node process started without `--inspect`: open its inspector first.
if config.adapter == "js-debug" && config.request == "attach" && arguments.get("port").is_none() {
let pid = arguments.get("processId").and_then(|p| match p {
+68
Переглянути файл
@@ -0,0 +1,68 @@
//! SwiftPM launch integration: a launch request may carry
//! `"swiftpm": {"product": "greet", "buildArgs": ["-c", "release"]}` instead of `program`.
//! The run configuration's before launch task has built the product; this asks
//! `swift build <buildArgs> --show-bin-path` where it went (`.build/<triple>/<configuration>`,
//! or wherever `--scratch-path` / `--build-path` put it) and launches it from there.
use crate::adapter::find_binary;
use ide_core::{IdeError, IdeResult};
use serde_json::Value;
use std::path::{Path, PathBuf};
use std::process::Stdio;
/// `swift build` arguments that print the bin path for `buildArgs` without building.
pub fn bin_path_args(swiftpm: &Value) -> Vec<String> {
let mut args = vec!["build".to_owned()];
if let Some(a) = swiftpm.get("buildArgs").and_then(Value::as_array) {
args.extend(a.iter().filter_map(|v| v.as_str().map(str::to_owned)));
}
args.push("--show-bin-path".into());
args
}
/// The built product of `swiftpm` (see the module docs).
pub async fn program(cwd: &Path, swiftpm: &Value, cancel: &ide_core::CancellationToken) -> IdeResult<PathBuf> {
let product = swiftpm
.get("product")
.and_then(Value::as_str)
.filter(|p| !p.is_empty())
.ok_or_else(|| IdeError::invalid("the SwiftPM launch names no product"))?;
let swift = find_binary("swift", cwd).ok_or_else(|| IdeError::unavailable("`swift` not found on PATH"))?;
let args = bin_path_args(swiftpm);
let mut cmd = tokio::process::Command::new(swift);
cmd.current_dir(cwd);
ide_core::process::prepare(cmd.as_std_mut());
cmd.args(&args).stdin(Stdio::null()).stdout(Stdio::piped()).stderr(Stdio::piped()).kill_on_drop(true);
let out = tokio::select! {
biased;
_ = cancel.cancelled() => return Err(IdeError::cancelled()),
out = cmd.output() => out.map_err(|e| IdeError::unavailable(format!("failed to run swift: {e}")))?,
};
if !out.status.success() {
let err = String::from_utf8_lossy(&out.stderr);
return Err(IdeError::invalid(format!("swift {} failed: {}", args.join(" "), err.trim())));
}
// The bin path is the last line: SwiftPM may print warnings about the manifest first.
let stdout = String::from_utf8_lossy(&out.stdout);
let dir = stdout.lines().map(str::trim).rfind(|l| !l.is_empty()).unwrap_or_default();
if dir.is_empty() {
return Err(IdeError::invalid("swift build --show-bin-path printed no path"));
}
let exe = if cfg!(windows) { format!("{product}.exe") } else { product.to_owned() };
Ok(cwd.join(dir).join(exe))
}
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
#[test]
fn asks_swift_build_for_the_bin_path_of_the_run_configurations_build() {
assert_eq!(bin_path_args(&json!({"product": "greet"})), ["build", "--show-bin-path"]);
assert_eq!(
bin_path_args(&json!({"product": "greet", "buildArgs": ["-c", "release"]})),
["build", "-c", "release", "--show-bin-path"]
);
}
}
+15
Переглянути файл
@@ -2164,6 +2164,21 @@ fn frames_keep_their_instruction_pointer() {
assert!(json.get("instructionPointerReference").is_none());
}
#[test]
fn frames_drop_pseudo_paths_of_referenced_sources() {
let frame = |path: &str, reference: i64| {
frame_from(&json!({"id": 1, "name": "f", "line": 1,
"source": {"path": path, "sourceReference": reference}}))
.path
};
let lldb = "/usr/lib/swift/libswiftCore.dylib`swift_willThrow";
assert_eq!(frame(lldb, 1), None, "lldb-dap disassembly");
assert_eq!(frame(lldb, 0).as_deref(), Some(Path::new(lldb)), "no reference: kept as sent");
let here = env!("CARGO_MANIFEST_DIR");
assert_eq!(frame(here, 3).as_deref(), Some(Path::new(here)), "an existing file");
assert!(frame("jdt://contents/rt.jar/java.lang/String.class", 2).is_some(), "not a file path");
}
#[tokio::test]
async fn smart_step_into_and_reset_frame() {
let h = harness(Script::default());
+76
Переглянути файл
@@ -14,6 +14,65 @@ pub const DATA_ENV: &str = "OPENIDEA_DATA_DIR";
/// Moves the logs.
pub const LOG_ENV: &str = "OPENIDEA_LOG_DIR";
/// A portable install's settings file, next to the executable: `NAME=value` lines setting the
/// variables above (and only those), so the install needs no environment. A variable already set
/// in the environment wins; a relative value is taken from the file's folder.
pub const PROPERTIES_FILE: &str = "openidea.properties";
/// The folder `openidea.properties` is read from: the executable's, the AppImage file's when run
/// from one, the folder holding the `.app` bundle on macOS.
fn install_dir() -> Option<PathBuf> {
let exe = std::env::current_exe().ok()?;
// `APPIMAGE` is inherited by everything started from inside one; only trust it for the
// executable it mounted.
let appdir = std::env::var_os("APPDIR").filter(|v| !v.is_empty());
if let (Some(image), Some(appdir)) = (std::env::var_os("APPIMAGE").filter(|v| !v.is_empty()), appdir)
&& exe.starts_with(appdir)
{
return PathBuf::from(image).parent().map(Path::to_path_buf);
}
let dir = exe.parent()?;
if cfg!(target_os = "macos")
&& let Some(bundle) = dir.ancestors().nth(2).filter(|b| b.extension().is_some_and(|e| e == "app"))
{
return bundle.parent().map(Path::to_path_buf);
}
Some(dir.to_path_buf())
}
/// The variables an `openidea.properties` in `dir` sets, made absolute, leaving out those
/// `is_set` reports the environment already has. Unknown keys and comments (`#`, `!`) are ignored.
fn properties_in(dir: &Path, text: &str, is_set: impl Fn(&str) -> bool) -> Vec<(&'static str, PathBuf)> {
let mut out: Vec<(&'static str, PathBuf)> = Vec::new();
for line in text.lines().map(str::trim) {
if line.starts_with(['#', '!']) {
continue;
}
let Some((key, value)) = line.split_once('=') else { continue };
let (key, value) = (key.trim(), value.trim());
let Some(name) = [CONFIG_ENV, DATA_ENV, LOCAL_DATA_ENV, LOG_ENV].into_iter().find(|n| *n == key) else {
continue;
};
if value.is_empty() || is_set(name) || out.iter().any(|(n, _)| *n == name) {
continue;
}
// An absolute value replaces `dir`.
out.push((name, dir.join(value)));
}
out
}
/// Applies the install's `openidea.properties` to the environment, so the directories below and
/// every process the IDE starts see the same locations. Call first thing in `main`.
pub fn load_properties_file() {
let Some(dir) = install_dir() else { return };
let Ok(text) = fs::read_to_string(dir.join(PROPERTIES_FILE)) else { return };
for (name, value) in properties_in(&dir, &text, |n| std::env::var_os(n).is_some_and(|v| !v.is_empty())) {
// SAFETY: called at the start of `main`, before any other thread exists.
unsafe { std::env::set_var(name, value) };
}
}
/// `$OPENIDEA_CONFIG_DIR/<identifier>` when set, else the OS configuration directory
/// (Tauri's `app_config_dir`). Like the local data, the identifier keeps release and
/// per-worktree debug builds apart under one root; a relative path is an error.
@@ -664,6 +723,23 @@ mod tests {
assert!(!tmp.path().join("copy/Default/Cache").exists());
}
#[test]
fn a_properties_file_sets_the_directory_variables_relative_to_its_folder() {
let dir = std::env::temp_dir().join("portable");
let abs = std::env::temp_dir().join("elsewhere");
let text = format!(
"# portable install\n! also a comment\nOPENIDEA_CONFIG_DIR = data\nOPENIDEA_DATA_DIR=data\n\
OPENIDEA_LOCAL_DATA_DIR={}\nOPENIDEA_LOG_DIR=\nOPENIDEA_CONFIG_DIR=ignored\nPATH=/bin\nnot a pair\n",
abs.display()
);
let set = properties_in(&dir, &text, |_| false);
assert_eq!(set, [(CONFIG_ENV, dir.join("data")), (DATA_ENV, dir.join("data")), (LOCAL_DATA_ENV, abs.clone())]);
// The environment wins over the file.
let set = properties_in(&dir, &text, |n| n == CONFIG_ENV);
assert_eq!(set.iter().map(|(n, _)| *n).collect::<Vec<_>>(), [DATA_ENV, LOCAL_DATA_ENV]);
assert!(set.iter().all(|(_, v)| v.is_absolute()));
}
#[test]
fn config_data_and_log_dirs_follow_the_os_unless_their_variable_is_set() {
let os = Some(PathBuf::from("/os"));
+17 -5
Переглянути файл
@@ -60,6 +60,22 @@ fn allowed(tool: &ide_mcp::Tool, trusted: bool) -> bool {
trusted || tool.read_only
}
fn tools_for(host: &Host, root: &Path, trusted: bool) -> Vec<ide_mcp::Tool> {
let mut all: Vec<_> = tools().into_iter().map(|t| t.metadata).collect();
if let Some(plugins) = host.plugin_host() {
all.extend(plugins.mcp_tools(root).into_iter().map(|(_, _, tool)| tool));
}
all.into_iter().filter(|t| allowed(t, trusted)).collect()
}
/// Lists the built-in IDE and plugin-contributed MCP tools visible to `window`.
pub(crate) fn list_tools_for_window(host: &Host, window: &str) -> Vec<ide_mcp::Tool> {
match host.project(window).ok().filter(|p| !p.light) {
Some(project) => tools_for(host, &project.root, project.is_trusted()),
None => tools_for(host, Path::new(""), true),
}
}
impl Registry {
/// The window that answers for `root`: one with the root open, or one it is attached in.
fn window(&self, root: &Path) -> Result<Option<(String, Arc<crate::Project>)>, String> {
@@ -127,11 +143,7 @@ impl ToolRegistry for Registry {
}
fn tools(&self, root: &Path) -> Result<Vec<ide_mcp::Tool>, String> {
let trusted = self.lists_as_trusted(root)?;
let mut all: Vec<_> = tools().into_iter().map(|t| t.metadata).collect();
if let Some(plugins) = self.0.plugin_host() {
all.extend(plugins.mcp_tools(root).into_iter().map(|(_, _, tool)| tool));
}
Ok(all.into_iter().filter(|t| allowed(t, trusted)).collect())
Ok(tools_for(&self.0, root, trusted))
}
fn call(
&self,
+54
Переглянути файл
@@ -246,6 +246,29 @@ pub fn mcp_server_status(host: &Host, window: &str) -> IdeResult<McpServerStatus
})
}
/// Lists the tools advertised by OpenIDEA's built-in MCP server (core IDE tools plus
/// enabled plugin-contributed `mcpTools`) for the window's project.
#[command(trust = always)]
pub fn mcp_server_tools(host: &Host, window: &str) -> IdeResult<ide_agent::McpProbeResult> {
let started = Instant::now();
let tools = super::list_tools_for_window(host, window)
.into_iter()
.map(|tool| ide_agent::McpToolSummary {
name: tool.name,
description: (!tool.description.trim().is_empty()).then_some(tool.description),
})
.collect();
Ok(ide_agent::McpProbeResult {
ok: true,
server_name: Some("OpenIDEA".into()),
server_version: Some(env!("CARGO_PKG_VERSION").into()),
protocol_version: Some(ide_mcp::PROTOCOL_VERSION.into()),
tools,
duration_ms: u32::try_from(started.elapsed().as_millis()).unwrap_or(u32::MAX),
error: None,
})
}
/// Settings › Agents › IDE MCP Server › Regenerate Token: forgets the kept token, and restarts the
/// server with a new one. Clients configured with the old token stop working.
#[command(trust = outside_restricted)]
@@ -328,6 +351,36 @@ mod tests {
assert_eq!(port_to_wait_for((local, 51234), Some(64342)), None);
assert_eq!(port_to_wait_for((local, 64342), None), None);
}
#[tokio::test]
async fn mcp_server_tools_lists_core_tools_and_respects_restricted_mode() {
let tmp = tempfile::tempdir().unwrap();
let base = dunce::canonicalize(tmp.path()).unwrap();
let project_dir = base.join("sample");
std::fs::create_dir_all(&project_dir).unwrap();
let host = Arc::new(Host::new(crate::HostConfig::for_test(&base)));
// Without an open project (e.g. Welcome screen Settings), all built-in tools are listed.
let without_project = mcp_server_tools(&host, "welcome").unwrap();
assert!(without_project.ok);
assert_eq!(without_project.server_name.as_deref(), Some("OpenIDEA"));
assert!(without_project.tools.iter().any(|t| t.name == "search_text"));
assert!(without_project.tools.iter().any(|t| t.name == "run_command"));
// Opening an untrusted project filters out write/run tools, matching Registry::tools.
host.open_project("main", &project_dir).unwrap();
let restricted = mcp_server_tools(&host, "main").unwrap();
assert!(restricted.ok);
assert!(restricted.tools.iter().any(|t| t.name == "search_text"));
assert!(!restricted.tools.iter().any(|t| t.name == "run_command"));
assert!(restricted.tools.len() < without_project.tools.len());
// Trusting the project restores the full tool set.
host.set_project_trust(&project_dir, true, false).await.unwrap();
let trusted = mcp_server_tools(&host, "main").unwrap();
assert_eq!(trusted.tools.len(), without_project.tools.len());
assert!(trusted.tools.iter().any(|t| t.name == "run_command"));
}
}
ide_command::domain!(
@@ -338,6 +391,7 @@ ide_command::domain!(
mcp_respond,
mcp_respond_with,
mcp_server_status,
mcp_server_tools,
mcp_ui_ready,
mcp_unload_background_project,
);
+27 -4
Переглянути файл
@@ -173,6 +173,21 @@ pub const DYNAMIC_PLUGIN_TOOLS: &str = "pluginTools";
pub const DYNAMIC_FLUTTER_BUILD: &str = "flutterBuild";
/// Id (and `menu.` label key) of the Build › Flutter submenu.
pub const FLUTTER_BUILD_MENU: &str = "build.flutter";
/// Build › Xcode: Clean Build Folder and Delete DerivedData, filled only when the project has
/// Xcode schemes. A submenu after Build › Flutter when it has items, like it.
pub const DYNAMIC_XCODE_BUILD: &str = "xcodeBuild";
/// Id (and `menu.` label key) of the Build › Xcode submenu.
pub const XCODE_BUILD_MENU: &str = "build.xcode";
/// The submenu (id, English label) a dynamic slot is shown as when it has items, followed by a
/// separator; `None`: its items are listed in place.
pub fn dynamic_submenu(slot: &str) -> Option<(&'static str, &'static str)> {
match slot {
DYNAMIC_FLUTTER_BUILD => Some((FLUTTER_BUILD_MENU, "Flutter")),
DYNAMIC_XCODE_BUILD => Some((XCODE_BUILD_MENU, "Xcode")),
_ => None,
}
}
/// The menu bar for `os`. Labels are English defaults; the frontend replaces
/// them with `menu.<id>` strings from the active locale catalog.
@@ -262,6 +277,7 @@ pub fn spec(os: Os) -> Vec<Entry> {
act("file.exportSettings", "Export Settings…"),
act("file.importSettings", "Import Settings…"),
act("file.importJetBrainsSettings", "Import Settings from JetBrains IDE…"),
act("file.importJetBrainsRecentProjects", "Import Recent Projects from JetBrains IDE…"),
act("file.syncSettings", "Sync Settings Now"),
],
),
@@ -425,6 +441,11 @@ pub fn spec(os: Os) -> Vec<Entry> {
vec![
act("editor.toggleSoftWrap", "Soft-Wrap"),
act("editor.toggleRenderedDocs", "Render Documentation Comments"),
SEP,
act("editor.toggleLocalWhitespaces", "Show Whitespaces"),
act("editor.toggleLocalLineNumbers", "Show Line Numbers"),
act("editor.toggleLocalGutterIcons", "Show Gutter Icons"),
act("editor.toggleLocalIndentGuides", "Show Indent Guides"),
],
),
SEP,
@@ -464,6 +485,7 @@ pub fn spec(os: Os) -> Vec<Entry> {
act("navigate.declaration", "Declaration or Usages"),
act("navigate.implementation", "Implementation(s)"),
act("navigate.typeDeclaration", "Type Declaration"),
act("navigate.sourceDefinition", "Source Definition"),
act("navigate.superMethod", "Super Method"),
act("navigate.gotoTest", "Test"),
act("navigate.relatedSymbol", "Related Symbol…"),
@@ -617,6 +639,7 @@ pub fn spec(os: Os) -> Vec<Entry> {
"Build",
vec![
Entry::Dynamic(DYNAMIC_FLUTTER_BUILD),
Entry::Dynamic(DYNAMIC_XCODE_BUILD),
act("build.buildProject", "Build Project"),
act("build.buildModule", "Build Module"),
act("build.compileFile", "Recompile"),
@@ -1293,12 +1316,12 @@ pub fn model(spec: &[Entry], recent: &[RecentItem], config: &MenuConfig) -> Vec<
}
}));
}
Entry::Dynamic(DYNAMIC_FLUTTER_BUILD) => {
let items = config.dynamic_items(DYNAMIC_FLUTTER_BUILD);
Entry::Dynamic(slot) if let Some((id, label)) = dynamic_submenu(slot) => {
let items = config.dynamic_items(slot);
if !items.is_empty() {
out.push(MenuNode::Submenu {
id: FLUTTER_BUILD_MENU.into(),
label: "Flutter".into(),
id: id.into(),
label: label.into(),
current: None,
children: items.iter().map(DynamicItem::model).collect(),
});
+118 -30
Переглянути файл
@@ -544,38 +544,24 @@ async fn resolve_launch_without_jdtls(
let cancel = cancel.clone();
tokio::task::spawn_blocking(move || {
let (root, cache, settings) = (&scope.root, &scope.cache, &scope.settings);
match from_server {
// The IDE's Java build gave the whole classpath; the server adds its JDK.
Some(server) if by_service => {
info.project_root = server.classpath.project_root;
info.java_home = server.jdk_home.map(Into::into);
}
None if by_service => {}
Some(server) => {
info.project_root = server.classpath.project_root;
info.module_paths = server.classpath.module_paths;
info.java_home = server.jdk_home.map(Into::into);
append_unique_class_paths(&mut class_paths, server.classpath.class_paths);
}
None => {
if !is_maven_module(root, &model, &module) {
return Err(IdeError::unavailable(
"Cannot resolve the classpath: the Java language server does not report it \
(java-analyzer/projectClasspath), and the module is not a Maven project",
));
}
let is_maven = is_maven_module(root, &model, &module);
let delegated_maven = !by_service && settings.languages.java.maven.delegate_build && is_maven;
apply_without_jdtls_classpath(
&mut class_paths,
&mut info,
from_server,
by_service,
is_maven,
delegated_maven,
|| {
let local_repo = ide_sdk::apply::maven_local_repository(root, settings);
let classpath = if aggregator && policy == BuildPolicy::NoBuild {
compile::module_classpath_without_build(root, &model, &module, test, cache, &cancel)?
if aggregator && policy == BuildPolicy::NoBuild {
compile::module_classpath_without_build(root, &model, &module, test, cache, &cancel)
} else {
compile::module_classpath(root, &model, &module, test, local_repo, cache, &cancel)?
};
append_unique_class_paths(
&mut class_paths,
std::env::split_paths(&classpath).map(|p| p.to_string_lossy().into_owned()),
);
}
}
compile::module_classpath(root, &model, &module, test, local_repo, cache, &cancel)
}
},
)?;
info.class_paths = class_paths;
apply_library_classpath(&mut info, root, &settings.project_structure.libraries, test);
finish_launch(&mut info, root, &module, settings, &model, &data_dir);
@@ -825,6 +811,59 @@ fn same_entry(a: &str, b: &str, windows: bool) -> bool {
a == b || entry_key(a, windows) == entry_key(b, windows)
}
/// Resolves the runtime/test classpath for a launch without jdtls (e.g. `java-analyzer` or
/// no Java language server). When `delegated_maven` is true (`delegateBuild = true` on a Maven
/// module), delegates classpath resolution to Maven itself (falling back to the language server's
/// classpath on error, matching the jdtls path) so child POM `<exclusions>` and Maven dependency
/// mediation are respected (#5586).
fn apply_without_jdtls_classpath(
class_paths: &mut Vec<String>,
info: &mut JavaLaunchInfo,
from_server: Option<ide_lsp::java_project::ServerClasspath>,
by_service: bool,
is_maven: bool,
delegated_maven: bool,
probe_maven: impl FnOnce() -> IdeResult<String>,
) -> IdeResult<()> {
match from_server {
// The IDE's Java build gave the whole classpath; the server adds its JDK.
Some(server) if by_service => {
info.project_root = server.classpath.project_root;
info.java_home = server.jdk_home.map(Into::into);
Ok(())
}
None if by_service => Ok(()),
Some(server) if delegated_maven => {
info.project_root = server.classpath.project_root;
info.module_paths = server.classpath.module_paths;
info.java_home = server.jdk_home.map(Into::into);
info.class_paths = server.classpath.class_paths;
merge_maven_launch_classpath(class_paths, info, probe_maven(), &[])
}
Some(server) => {
info.project_root = server.classpath.project_root;
info.module_paths = server.classpath.module_paths;
info.java_home = server.jdk_home.map(Into::into);
append_unique_class_paths(class_paths, server.classpath.class_paths);
Ok(())
}
None => {
if !is_maven {
return Err(IdeError::unavailable(
"Cannot resolve the classpath: the Java language server does not report it \
(java-analyzer/projectClasspath), and the module is not a Maven project",
));
}
let classpath = probe_maven()?;
append_unique_class_paths(
class_paths,
std::env::split_paths(&classpath).map(|p| p.to_string_lossy().into_owned()),
);
Ok(())
}
}
}
/// Merge the Maven launch classpath without turning a recoverable probe failure into a
/// failed launch. Cancellation still propagates; ordinary failures keep jdtls' classpath
/// and leave the reason in the run console. Maven lists the module's and its reactor
@@ -1259,6 +1298,55 @@ mod tests {
);
}
#[test]
fn delegated_maven_without_jdtls_prefers_maven_classpath_over_server_classpath() {
let server = ide_lsp::java_project::ServerClasspath {
classpath: ide_lsp::jdtls::JavaClasspath {
project_root: Some(PathBuf::from("/work/child").into()),
// Static server resolver kept an excluded parent transitive jar (#5586).
class_paths: vec![
"/work/child/target/classes".into(),
"/m2/log4j-slf4j-impl-2.12.1.jar".into(),
"/m2/logback-classic.jar".into(),
],
module_paths: vec![],
},
jdk_home: Some(PathBuf::from("/jdk8")),
};
let maven = std::env::join_paths(["/work/child/target/classes", "/m2/logback-classic.jar"])
.unwrap()
.to_string_lossy()
.into_owned();
let mut class_paths = vec!["/work/child/target/classes".to_owned()];
let mut info = JavaLaunchInfo::default();
apply_without_jdtls_classpath(&mut class_paths, &mut info, Some(server), false, true, true, || Ok(maven))
.unwrap();
assert_eq!(class_paths, ["/work/child/target/classes", "/m2/logback-classic.jar"]);
assert_eq!(info.project_root, Some(PathBuf::from("/work/child").into()));
assert_eq!(info.java_home, Some(PathBuf::from("/jdk8").into()));
assert!(info.hints.is_empty(), "{:?}", info.hints);
}
#[test]
fn delegated_maven_without_jdtls_falls_back_to_server_classpath_on_probe_error() {
let server = ide_lsp::java_project::ServerClasspath {
classpath: ide_lsp::jdtls::JavaClasspath {
project_root: Some(PathBuf::from("/work/child").into()),
class_paths: vec!["/m2/server-fallback.jar".into()],
module_paths: vec![],
},
jdk_home: None,
};
let mut class_paths = vec!["/work/child/target/classes".to_owned()];
let mut info = JavaLaunchInfo::default();
apply_without_jdtls_classpath(&mut class_paths, &mut info, Some(server), false, true, true, || {
Err(IdeError::internal("maven offline"))
})
.unwrap();
assert_eq!(class_paths, ["/work/child/target/classes", "/m2/server-fallback.jar"]);
assert!(info.hints[0].contains("maven offline"), "{:?}", info.hints);
}
#[test]
fn cancelled_maven_classpath_probe_propagates_without_fallback() {
let mut class_paths = vec!["snapshot.jar".to_owned()];
+103 -3
Переглянути файл
@@ -336,20 +336,36 @@ pub async fn lsp_inline_completion(
let plugin = match plugin_providers(host, window, doc, ProviderKind::InlineCompletion) {
Some((plugins, d)) if !matches!(&result, Ok(items) if !items.is_empty()) => {
let cancel = cancel.clone();
plugin_call(move || plugins.provide_inline_completion(&d, pos, &cancel)).await.flatten()
plugin_call(move || {
let offered = plugins.offers_inline_completion(&d.language);
(offered, plugins.provide_inline_completion(&d, pos, &cancel).map(|(_, s)| s))
})
.await
}
_ => None,
};
host.end_request(request);
inline_items(result, plugin)
}
/// The plugin's suggestion, else the servers'. When a plugin offers ghost text
/// for the document, "no server supports inline completion" is not returned:
/// the editor would stop asking while typing for 30 s, and a plugin that had
/// nothing this time (cancelled by the next keystroke) may have some next time.
fn inline_items(
servers: IdeResult<Vec<InlineCompletionItem>>,
plugin: Option<(bool, Option<ide_plugin::InlineSuggestion>)>,
) -> IdeResult<Vec<InlineCompletionItem>> {
match plugin {
Some((_, s)) => Ok(vec![InlineCompletionItem {
Some((_, Some(s))) => Ok(vec![InlineCompletionItem {
insert_text: s.insert_text,
range: s.replace,
filter_text: None,
command: None,
server: PLUGIN_SERVER,
}]),
None => result,
Some((true, None)) => provider_server(servers),
_ => servers,
}
}
@@ -639,6 +655,73 @@ pub async fn lsp_file_references(
result
}
/// The header of the document's source file or the source of its header (C, C++,
/// Objective-C) as clangd finds it; `None` without clangd or an answer. Cancel with
/// `cancel_request(request)`.
#[command(trust = trusted)]
pub async fn lsp_switch_source_header(
host: &Host,
window: &str,
request: RequestId,
doc: DocId,
) -> IdeResult<Option<String>> {
let lsp = host.project(window)?.lsp.clone();
let cancel = host.begin_request(request);
let result = tokio::select! {
result = lsp.switch_source_header(doc, cancel.clone()) => result,
_ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()),
};
host.end_request(request);
Ok(result?.map(|path| path.to_string_lossy().into_owned()))
}
/// Go to Source Definition (vtsls): the JavaScript implementation of the symbol at `pos`
/// instead of its `.d.ts`. Cancel with `cancel_request(request)`.
#[command(trust = trusted)]
pub async fn lsp_source_definition(
host: &Host,
window: &str,
request: RequestId,
doc: DocId,
pos: Pos,
) -> IdeResult<Vec<Location>> {
let lsp = host.project(window)?.lsp.clone();
let cancel = host.begin_request(request);
let result = tokio::select! {
result = lsp.source_definition(doc, pos, cancel.clone()) => result,
_ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()),
};
host.end_request(request);
result
}
/// Has vtsls open the document's `tsconfig.json` / `jsconfig.json` or the TS Server log.
#[command(trust = trusted)]
pub async fn lsp_open_typescript_file(host: &Host, window: &str, doc: DocId, what: TypeScriptFile) -> IdeResult<()> {
let lsp = host.project(window)?.lsp.clone();
lsp.open_typescript_file(doc, what).await
}
/// The files tsserver suggests for vtsls' Move to File code action `command`. Cancel with
/// `cancel_request(request)`.
#[command(trust = trusted)]
pub async fn lsp_move_to_file_targets(
host: &Host,
window: &str,
request: RequestId,
doc: DocId,
command: Command,
) -> IdeResult<Vec<ide_core::IpcPath>> {
let lsp = host.project(window)?.lsp.clone();
let cancel = host.begin_request(request);
let result = tokio::select! {
result = lsp.move_to_file_targets(doc, command, cancel.clone()) => result,
_ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()),
};
host.end_request(request);
Ok(result?.into_iter().map(ide_core::IpcPath::from).collect())
}
/// Implementations of the symbols at `positions`, one list per position (the
/// editor's "is implemented / overridden" gutter markers). Cancel with
/// `cancel_request(request)`.
@@ -2409,6 +2492,19 @@ pub fn plugin_formatters() -> IdeResult<Vec<crate::plugins::language_features::F
#[cfg(test)]
mod tests {
#[test]
fn a_plugin_offering_ghost_text_keeps_the_editor_asking() {
use super::*;
let none = || Err(ide_core::IdeError::unavailable("No server supports inline completion"));
// Nothing this time (cancelled by the next keystroke): an empty answer, not "unavailable".
assert!(inline_items(none(), Some((true, None))).unwrap().is_empty());
// No plugin for this language: the servers' answer as it is.
assert!(inline_items(none(), Some((false, None))).is_err());
assert!(inline_items(none(), None).is_err());
let s = ide_plugin::InlineSuggestion { insert_text: "a + b".into(), replace: None };
assert_eq!(inline_items(none(), Some((true, Some(s)))).unwrap()[0].insert_text, "a + b");
}
#[test]
fn a_completion_word_is_its_line_and_what_precedes_it() {
use super::*;
@@ -3294,6 +3390,10 @@ ide_command::domain!(
lsp_hover,
lsp_implementation_locations,
lsp_file_references,
lsp_switch_source_header,
lsp_source_definition,
lsp_open_typescript_file,
lsp_move_to_file_targets,
lsp_implementations,
lsp_inlay_hints,
lsp_inline_completion,
+4
Переглянути файл
@@ -52,6 +52,8 @@ pub mod tools;
pub mod vcs;
pub mod web;
pub mod xcode_bsp;
pub mod xcode_clean;
pub mod xcode_files;
use crate::Host;
use ide_core::{IdeError, IdeResult};
@@ -140,6 +142,8 @@ ide_command::domains!(
vcs_commands: crate::ops::vcs::commands,
web: crate::ops::web,
xcode_bsp: crate::ops::xcode_bsp,
xcode_clean: crate::ops::xcode_clean,
xcode_files: crate::ops::xcode_files,
);
/// A blocking task that panicked or was cancelled, as the error a command returns.
+56 -18
Переглянути файл
@@ -8,12 +8,12 @@ use serde::{Deserialize, Serialize};
use specta::Type;
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
/// Files handed out at most, and bytes in total: a project's controllers fit well
/// inside these, and the UI indexes them once.
const MAX_FILES: usize = 1024;
const MAX_BYTES: usize = 48 << 20;
/// Files handed out at most, and bytes in total: the controllers and HTTP clients of a
/// large multi-project tree fit well inside these, and the UI indexes them once.
const MAX_FILES: usize = 8192;
const MAX_BYTES: usize = 128 << 20;
/// A single source bigger than this is not a controller.
const MAX_FILE_BYTES: u64 = 4 << 20;
@@ -24,18 +24,27 @@ pub struct RouteSource {
pub text: String,
}
/// Which files a framework's routes can live in, and words one of which such a file names.
/// Which files a framework's routes can live in: a file names one of `words`, and one of
/// `owners` when there are any.
#[derive(Clone, Copy)]
pub(crate) struct RouteFiles {
extensions: &'static [&'static str],
words: &'static [&'static str],
owners: &'static [&'static str],
}
/// Spring mappings: Java and Kotlin sources that name a mapping annotation.
pub(crate) const SPRING: RouteFiles = RouteFiles { extensions: &["java", "kt", "kts"], words: &["Mapping"] };
/// Spring mappings: Java and Kotlin sources that name a request mapping annotation and a
/// controller or Feign client, the only classes the UI reads them from. Other `…Mapping`
/// names (MapStruct's `@Mapping`, mappers, DTOs) would otherwise fill the file budget in a
/// large tree and push real controllers out.
pub(crate) const SPRING: RouteFiles = RouteFiles {
extensions: &["java", "kt", "kts"],
words: &["RequestMapping", "GetMapping", "PostMapping", "PutMapping", "DeleteMapping", "PatchMapping"],
owners: &["Controller", "FeignClient"],
};
/// Flask and FastAPI routes: Python sources that import either (blueprints, routers and the
/// modules registering them all do).
pub(crate) const PYTHON: RouteFiles = RouteFiles { extensions: &["py"], words: &["flask", "fastapi"] };
pub(crate) const PYTHON: RouteFiles = RouteFiles { extensions: &["py"], words: &["flask", "fastapi"], owners: &[] };
impl RouteFiles {
fn declares_routes(&self, path: &Path) -> bool {
@@ -50,8 +59,13 @@ impl RouteFiles {
pub(crate) fn sources_in(root: &Path, excludes: &[String], kind: RouteFiles) -> Vec<RouteSource> {
let found: Mutex<Vec<RouteSource>> = Mutex::new(Vec::new());
let bytes = AtomicUsize::new(0);
let truncated = AtomicBool::new(false);
ide_vfs::walk_files(root, excludes, |path| {
if !kind.declares_routes(path) || bytes.load(Ordering::Relaxed) >= MAX_BYTES {
if !kind.declares_routes(path) {
return;
}
if bytes.load(Ordering::Relaxed) >= MAX_BYTES {
truncated.store(true, Ordering::Relaxed);
return;
}
if std::fs::metadata(path).map_or(true, |m| m.len() > MAX_FILE_BYTES) {
@@ -59,17 +73,25 @@ pub(crate) fn sources_in(root: &Path, excludes: &[String], kind: RouteFiles) ->
}
let Ok(text) = std::fs::read_to_string(path) else { return };
// Only a file that names a mapping annotation (or imports the framework) is worth parsing.
if !kind.words.iter().any(|w| text.contains(w)) {
if !kind.words.iter().any(|w| text.contains(w))
|| !(kind.owners.is_empty() || kind.owners.iter().any(|w| text.contains(w)))
{
return;
}
let Ok(mut found) = found.lock() else { return };
if found.len() >= MAX_FILES {
truncated.store(true, Ordering::Relaxed);
return;
}
bytes.fetch_add(text.len(), Ordering::Relaxed);
found.push(RouteSource { path: path.to_path_buf().into(), text });
});
let mut files = found.into_inner().unwrap_or_default();
if truncated.into_inner() {
tracing::warn!(
"routes: more than {MAX_FILES} files or {MAX_BYTES} bytes of route sources under {root:?}; the rest is left out"
);
}
files.sort_by(|a, b| a.path.cmp(&b.path));
files
}
@@ -162,13 +184,29 @@ mod tests {
fn files_that_name_no_mapping_are_left_out() {
let tmp = tempfile::tempdir().unwrap();
std::fs::create_dir_all(tmp.path().join("src")).unwrap();
std::fs::write(tmp.path().join("src/Ctl.java"), "class Ctl { @GetMapping(\"/a\") void a() {} }").unwrap();
std::fs::write(
tmp.path().join("src/Ctl.java"),
"@RestController class Ctl { @GetMapping(\"/a\") void a() {} }",
)
.unwrap();
std::fs::write(
tmp.path().join("src/Client.java"),
"@FeignClient(\"b\") interface Client { @PostMapping(\"/b\") void b(); }",
)
.unwrap();
std::fs::write(tmp.path().join("src/Plain.java"), "class Plain { void a() {} }").unwrap();
std::fs::write(tmp.path().join("src/Notes.txt"), "@GetMapping(\"/a\")").unwrap();
std::fs::write(tmp.path().join("src/Notes.txt"), "@RestController @GetMapping(\"/a\")").unwrap();
// MapStruct mappers and other `…Mapping` names declare no route.
std::fs::write(
tmp.path().join("src/UserMapper.java"),
"@Mapper interface UserMapper { @Mapping(target = \"id\") Dto to(User u); }",
)
.unwrap();
std::fs::write(tmp.path().join("src/Dto.java"), "class Dto { RequestMapping meta; }").unwrap();
let files = sources_in(tmp.path(), &[], SPRING);
assert_eq!(files.len(), 1, "{:?}", files.iter().map(|f| &f.path).collect::<Vec<_>>());
assert!(files[0].path.ends_with("src/Ctl.java"), "{:?}", files[0].path);
assert!(files[0].text.contains("@GetMapping"));
let names: Vec<_> = files.iter().map(|f| f.path.file_name().unwrap().to_string_lossy().into_owned()).collect();
assert_eq!(names, ["Client.java", "Ctl.java"]);
assert!(files[1].text.contains("@GetMapping"));
}
#[test]
@@ -176,8 +214,8 @@ mod tests {
let tmp = tempfile::tempdir().unwrap();
std::fs::create_dir_all(tmp.path().join("module/src")).unwrap();
std::fs::create_dir_all(tmp.path().join("build")).unwrap();
std::fs::write(tmp.path().join("module/src/A.java"), "@RequestMapping(\"/a\")").unwrap();
std::fs::write(tmp.path().join("build/B.java"), "@RequestMapping(\"/b\")").unwrap();
std::fs::write(tmp.path().join("module/src/A.java"), "@Controller @RequestMapping(\"/a\")").unwrap();
std::fs::write(tmp.path().join("build/B.java"), "@Controller @RequestMapping(\"/b\")").unwrap();
let files = sources_in(tmp.path(), &["build/**".to_owned()], SPRING);
assert_eq!(files.len(), 1, "{:?}", files.iter().map(|f| &f.path).collect::<Vec<_>>());
assert!(files[0].path.ends_with("module/src/A.java"), "{:?}", files[0].path);
+13 -1
Переглянути файл
@@ -454,7 +454,10 @@ async fn start_inner(
if ide_run::is_python_kind(&config.kind) {
container_python_path(&mut config.env, &super::python::paths(&project), &project.root);
}
let config = container::prepare(host, &project.root, target, config).await?;
let (config, note) = container::prepare(host, &project.root, target, config).await?;
if let Some(note) = note {
on_output(OutputChunk::System { text: format!("{note}\n") });
}
let encoding = settings.console.encoding;
let options = StartOptions {
encoding: Some(encoding).filter(|e| !e.trim().is_empty()),
@@ -552,6 +555,15 @@ async fn start_inner(
})
.await?;
}
if config.kind == ide_run::xcode_clean::KIND {
let (dir, cache) = (run_dir.clone(), project.cache_dir.clone());
config = host
.blocking(move || {
ide_run::xcode_clean::prepare(&dir, &cache, &mut config)?;
Ok(config)
})
.await?;
}
if config.kind == "go" && config.extras.params.get("scope").is_some_and(|s| s == "file") {
let root = project.root.clone();
config = host
+16 -8
Переглянути файл
@@ -6,8 +6,8 @@ use ide_core::remote_settings::{RunTarget, RunTargetKind};
use ide_core::{IdeError, IdeResult};
use ide_docker::DockerEndpoint;
use ide_remote::docker::{
ComposeService, ContainerDebug, ContainerRun, DEBUG_BOOTSTRAP, DEBUG_BOOTSTRAP_NAME, compose_container_root,
compose_service, container_config, container_name, default_container_root,
ComposeService, ContainerDebug, ContainerRun, DEBUG_BOOTSTRAP, DEBUG_BOOTSTRAP_NAME, NODE_DEBUG_FOLDER,
compose_container_root, compose_service, container_config, container_name, default_container_root, node_debug,
};
use ide_remote::target::DEBUG_PARAM;
use ide_run::RunConfig;
@@ -16,15 +16,21 @@ use std::path::{Path, PathBuf};
use std::sync::{LazyLock, Mutex};
use std::time::SystemTime;
/// `config` rewritten to run in a new container of `target`'s image or service.
pub(super) async fn prepare(host: &Host, root: &Path, target: RunTarget, config: RunConfig) -> IdeResult<RunConfig> {
/// `config` rewritten to run in a new container of `target`'s image or service, and for a
/// Node.js debug run the line telling the debugger the project folder in the container.
pub(super) async fn prepare(
host: &Host,
root: &Path,
target: RunTarget,
config: RunConfig,
) -> IdeResult<(RunConfig, Option<String>)> {
if config.kind == "dotnet" || config.kind == "dotnet-test" {
return Err(IdeError::invalid(".NET Project requires the local machine"));
}
let debug = config.extras.params.get(DEBUG_PARAM).is_some_and(|v| v == "true");
if debug && config.debug_adapter.as_deref() != Some("debugpy") {
if debug && config.debug_adapter.as_deref() != Some("debugpy") && !node_debug(&config) {
return Err(IdeError::invalid(format!(
"'{}' can't be debugged in a container: only Python run configurations can",
"'{}' can't be debugged in a container: only Python and Node.js run configurations can",
config.name
)));
}
@@ -41,7 +47,8 @@ pub(super) async fn prepare(host: &Host, root: &Path, target: RunTarget, config:
let (service_env, service_ports) = server_context(&data_dir, &root, &target, &config);
let name = container_name(&config.id, &unique());
let debugging = if debug { Some(Debugging::prepare(&data_dir)?) } else { None };
container_config(
let note = (debug && node_debug(&config)).then(|| format!("{NODE_DEBUG_FOLDER}{container_root}"));
let config = container_config(
&config,
&ContainerRun {
target: &target,
@@ -60,7 +67,8 @@ pub(super) async fn prepare(host: &Host, root: &Path, target: RunTarget, config:
debugpy: d.debugpy.as_deref(),
}),
},
)
)?;
Ok((config, note))
})
.await
}
+52
Переглянути файл
@@ -0,0 +1,52 @@
//! Deleting an Xcode project's DerivedData (#6665 C6). Clean Build Folder is a run of
//! `ide_run::xcode_clean::KIND`; this is the part a run can't do: moving folders to the Trash.
use crate::Host;
use ide_command::command;
use ide_core::IdeResult;
use std::collections::BTreeMap;
use std::path::PathBuf;
async fn dirs(
host: &Host,
window: &str,
cwd: Option<String>,
params: BTreeMap<String, String>,
) -> IdeResult<Vec<PathBuf>> {
let project = host.project(window)?;
let dir = project.root.join(cwd.unwrap_or_default());
let cache = project.cache_dir.clone();
super::blocking(move || ide_run::xcode_clean::derived_data_dirs(&dir, &cache, &params)).await
}
/// The DerivedData folders [`xcode_delete_derived_data`] would delete for an `xcode`
/// configuration (its `cwd` and `params`), for the user to confirm.
#[command(trust = trusted)]
pub async fn xcode_derived_data(
host: &Host,
window: &str,
cwd: Option<String>,
params: BTreeMap<String, String>,
) -> IdeResult<Vec<String>> {
Ok(dirs(host, window, cwd, params).await?.iter().map(|d| d.to_string_lossy().into_owned()).collect())
}
/// Moves the configuration's DerivedData folders to the Trash, then restarts sourcekit-lsp: a
/// build server config (xcode-build-server's `build_root`) reads build logs and the index there.
#[command(trust = trusted)]
pub async fn xcode_delete_derived_data(
host: &Host,
window: &str,
cwd: Option<String>,
params: BTreeMap<String, String>,
) -> IdeResult<Vec<String>> {
let found = dirs(host, window, cwd, params).await?;
let deleted = found.clone();
super::blocking(move || found.iter().try_for_each(|d| ide_vfs::delete(d))).await?;
let project = host.project(window)?;
for server in project.lsp.servers().into_iter().filter(|s| s.name == "sourcekit-lsp") {
project.lsp.restart(server.id).await?;
}
Ok(deleted.iter().map(|d| d.to_string_lossy().into_owned()).collect())
}
ide_command::domain!(xcode_clean: xcode_derived_data, xcode_delete_derived_data);
+208
Переглянути файл
@@ -0,0 +1,208 @@
//! Source files created, renamed or deleted in an Xcode project (#6665 C7). `xcodebuild` compiles
//! only the files a target lists, so a new file in a classic `.xcodeproj` group is silently left
//! out. The IDE does not edit `project.pbxproj`: for XcodeGen / Tuist projects it offers to
//! regenerate the project, and for a classic project it says which new files the project doesn't
//! name, unless the project uses Xcode 16 synchronized folders, which pick new files up themselves.
use crate::Host;
use ide_command::command;
use ide_core::IdeResult;
use serde::Serialize;
use specta::Type;
use std::path::{Path, PathBuf};
/// Source files a target compiles; other files don't make `xcodebuild` miss code.
const SOURCE_EXTENSIONS: [&str; 9] = ["swift", "m", "mm", "h", "c", "cc", "cpp", "hpp", "metal"];
/// What the changed files need in their Xcode project.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Type)]
#[serde(tag = "kind", rename_all = "camelCase")]
pub enum XcodeFileSync {
/// The project is generated from `project.yml` (`xcodegen`) or `Project.swift` (`tuist`) in `dir`.
#[serde(rename_all = "camelCase")]
Generated { dir: PathBuf, tool: String },
/// `files` (file names) are not named in `project`, a classic `.xcodeproj`.
#[serde(rename_all = "camelCase")]
NotInProject { project: PathBuf, files: Vec<String> },
}
fn is_source(path: &Path) -> bool {
path.extension().and_then(|e| e.to_str()).is_some_and(|e| SOURCE_EXTENSIONS.contains(&e))
}
/// Hidden folders and the bundles themselves are not project sources.
fn is_project_file(path: &Path, root: &Path) -> bool {
path.strip_prefix(root).is_ok_and(|rel| {
rel.components().all(|c| {
let name = c.as_os_str().to_string_lossy();
!name.starts_with('.') && !name.ends_with(".xcodeproj") && !name.ends_with(".xcworkspace")
})
})
}
enum Owner {
Generated(PathBuf, &'static str),
Classic(Vec<PathBuf>),
}
/// The nearest folder from `path` up to `root` with a project spec or `.xcodeproj` bundles.
fn owner(path: &Path, root: &Path) -> Option<Owner> {
let mut dir = path.parent()?;
loop {
if dir.join("project.yml").is_file() {
return Some(Owner::Generated(dir.to_path_buf(), "xcodegen"));
}
if dir.join("Project.swift").is_file() {
return Some(Owner::Generated(dir.to_path_buf(), "tuist"));
}
// A local Swift package builds its files from the folder layout, not from a project.
if dir.join("Package.swift").is_file() {
return None;
}
let mut projects: Vec<PathBuf> = std::fs::read_dir(dir)
.into_iter()
.flatten()
.flatten()
.map(|e| e.path())
.filter(|p| p.extension().is_some_and(|e| e == "xcodeproj") && p.is_dir())
.collect();
if !projects.is_empty() {
projects.sort();
return Some(Owner::Classic(projects));
}
if dir == root {
return None;
}
dir = dir.parent()?;
}
}
/// Whether `text` names `file` as a whole name (`/* View.swift */`, `path = View.swift;`,
/// `"My View.swift"`), not as the end of another one (`AppView.swift`).
fn names(text: &str, file: &str) -> bool {
let part_of_name = |c: char| c.is_alphanumeric() || "_-.+".contains(c);
text.match_indices(file).any(|(at, _)| {
!text[..at].chars().next_back().is_some_and(part_of_name)
&& !text[at + file.len()..].chars().next().is_some_and(part_of_name)
})
}
/// What `created` (created or renamed to) and `removed` source files under `root` need; the
/// first Xcode project they belong to wins.
pub fn file_sync(root: &Path, created: &[PathBuf], removed: &[PathBuf]) -> Option<XcodeFileSync> {
let relevant = |p: &&PathBuf| is_source(p) && is_project_file(p, root);
let mut classic: Option<(Vec<PathBuf>, Vec<String>)> = None;
for (path, is_new) in
created.iter().filter(relevant).map(|p| (p, true)).chain(removed.iter().filter(relevant).map(|p| (p, false)))
{
match owner(path, root) {
Some(Owner::Generated(dir, tool)) => return Some(XcodeFileSync::Generated { dir, tool: tool.into() }),
// A deleted file is still named in the project; Xcode shows it in red.
Some(Owner::Classic(projects)) if is_new => {
let (owner_projects, files) = classic.get_or_insert_with(|| (projects.clone(), Vec::new()));
if *owner_projects == projects {
files.push(path.file_name()?.to_string_lossy().into_owned());
}
}
_ => {}
}
}
let (projects, files) = classic?;
// Plain string checks on project.pbxproj, no parsing; a project mixing groups and
// synchronized folders counts as synchronized, as does a name that's taken by another file.
let texts: Vec<String> =
projects.iter().filter_map(|p| std::fs::read_to_string(p.join("project.pbxproj")).ok()).collect();
if texts.is_empty() || texts.iter().any(|t| t.contains("PBXFileSystemSynchronizedRootGroup")) {
return None;
}
let mut files: Vec<String> = files.into_iter().filter(|f| !texts.iter().any(|t| names(t, f))).collect();
files.sort();
files.dedup();
(!files.is_empty()).then(|| XcodeFileSync::NotInProject { project: projects[0].clone(), files })
}
/// What source files created, renamed or deleted in the project need in their Xcode project;
/// `None` when they are in none, or it picks them up itself.
#[command(trust = trusted)]
pub async fn xcode_file_sync(
host: &Host,
window: &str,
created: Vec<PathBuf>,
removed: Vec<PathBuf>,
) -> IdeResult<Option<XcodeFileSync>> {
let root = host.project(window)?.root.clone();
host.blocking(move || Ok(file_sync(&root, &created, &removed))).await
}
ide_command::domain!(xcode_files: xcode_file_sync);
#[cfg(test)]
mod tests {
use super::*;
fn project(files: &[(&str, &str)]) -> tempfile::TempDir {
let dir = tempfile::tempdir().unwrap();
for (path, text) in files {
let path = dir.path().join(path);
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
std::fs::write(path, text).unwrap();
}
dir
}
const CLASSIC: &str = "/* Begin PBXFileReference section */ AppView.swift /* End */";
#[test]
fn names_new_sources_a_classic_project_does_not_mention() {
let dir = project(&[("App.xcodeproj/project.pbxproj", CLASSIC), ("App/AppView.swift", "")]);
let root = dir.path();
let created = [
root.join("App/AppView.swift"),
root.join("App/New.swift"),
root.join("App/View.swift"),
root.join("App/notes.md"),
];
assert_eq!(
file_sync(root, &created, &[]),
Some(XcodeFileSync::NotInProject {
project: root.join("App.xcodeproj"),
files: vec!["New.swift".into(), "View.swift".into()]
})
);
// Deleting a file needs nothing in a classic project.
assert_eq!(file_sync(root, &[], &[root.join("App/AppView.swift")]), None);
}
#[test]
fn trusts_synchronized_folders() {
let text = "/* Begin PBXFileSystemSynchronizedRootGroup section */";
let dir = project(&[("App.xcodeproj/project.pbxproj", text)]);
assert_eq!(file_sync(dir.path(), &[dir.path().join("App/New.swift")], &[]), None);
}
#[test]
fn offers_the_generator_of_the_nearest_spec() {
let dir =
project(&[("project.yml", ""), ("App.xcodeproj/project.pbxproj", CLASSIC), ("Mod/Project.swift", "")]);
let root = dir.path();
let generated = |dir: PathBuf, tool: &str| Some(XcodeFileSync::Generated { dir, tool: tool.into() });
assert_eq!(file_sync(root, &[], &[root.join("Sources/Old.swift")]), generated(root.into(), "xcodegen"));
assert_eq!(file_sync(root, &[root.join("Mod/A.m")], &[]), generated(root.join("Mod"), "tuist"));
}
#[test]
fn ignores_files_of_a_local_package_next_to_the_project() {
let dir = project(&[("App.xcodeproj/project.pbxproj", CLASSIC), ("Packages/Feature/Package.swift", "")]);
let root = dir.path();
assert_eq!(file_sync(root, &[root.join("Packages/Feature/Sources/Feature/New.swift")], &[]), None);
// Files of the app itself are still checked.
assert!(file_sync(root, &[root.join("App/New.swift")], &[]).is_some());
}
#[test]
fn ignores_files_outside_any_project() {
let dir = project(&[("App.xcodeproj/project.pbxproj", CLASSIC)]);
let root = dir.path();
assert_eq!(file_sync(&root.join("Sub"), &[root.join("Sub/A.swift")], &[]), None);
assert_eq!(file_sync(root, &[root.join(".build/A.swift"), PathBuf::from("/elsewhere/A.swift")], &[]), None);
}
}
+8 -2
Переглянути файл
@@ -2043,8 +2043,14 @@ impl HostApi for PluginApi {
fn open_editors(&self, client: &str) -> Result<Vec<ide_plugin::OpenEditor>, HostError> {
self.shared.workspace().ok_or_else(|| HostError::NotFound("window project".into()))?.open_editors(client)
}
fn editor_open(&self, client: &str, path: &Path, selection: Option<ide_core::Range>) -> Result<(), HostError> {
self.shared.sink.emit(Some(client), PluginEvent::EditorOpen { path: path.into(), selection });
fn editor_open(
&self,
client: &str,
path: &Path,
selection: Option<ide_core::Range>,
as_text: bool,
) -> Result<(), HostError> {
self.shared.sink.emit(Some(client), PluginEvent::EditorOpen { path: path.into(), selection, as_text });
Ok(())
}
fn editor_ranges(
+44 -6
Переглянути файл
@@ -9,6 +9,22 @@ pub struct NavigationFiles {
pub paths: Vec<ide_core::IpcPath>,
pub indexing: bool,
pub extensions: Vec<String>,
/// In-scope files matching `extensions`; `paths` holds the first
/// `MAX_NAVIGATION_FILES` of them.
pub total: u32,
pub truncated: bool,
}
/// Discovery offers at most this many files; larger projects get navigation
/// on the first ones instead of none.
const MAX_NAVIGATION_FILES: usize = 20_000;
/// The first `limit` files `in_scope` accepts, and how many it accepts in all.
fn first_in_scope(files: Vec<PathBuf>, in_scope: impl Fn(&PathBuf) -> bool, limit: usize) -> (Vec<PathBuf>, usize) {
let mut files: Vec<_> = files.into_iter().filter(in_scope).collect();
let total = files.len();
files.truncate(limit);
(files, total)
}
#[command(trust = trusted)]
@@ -24,19 +40,25 @@ pub async fn plugin_navigation_files(
blocking(move || {
let extensions = plugins.navigation_extensions(&project.root);
if extensions.is_empty() {
return Ok(NavigationFiles { paths: vec![], indexing: false, extensions: vec![] });
return Ok(NavigationFiles {
paths: vec![],
indexing: false,
extensions: vec![],
total: 0,
truncated: false,
});
}
let indexing = project.index.status().indexing;
let files = project.index.files_with_extensions(&extensions, 20_001);
if files.len() > 20_000 {
return Err(IdeError::unavailable("plugin navigation supports up to 20,000 matching files"));
}
let files = project.index.files_with_extensions(&extensions, usize::MAX);
// A project window group's members are project scope: their files are
// in the group's index (the group root holds none of them).
let members = crate::project::workspace_member_roots(&project.root);
let in_scope = |p: &PathBuf| p.starts_with(&project.root) || members.iter().any(|m| p.starts_with(m));
let (files, total) = first_in_scope(files, in_scope, MAX_NAVIGATION_FILES);
Ok(NavigationFiles {
paths: files.into_iter().filter(in_scope).map(Into::into).collect(),
truncated: total > files.len(),
total: u32::try_from(total).unwrap_or(u32::MAX),
paths: files.into_iter().map(Into::into).collect(),
indexing,
extensions,
})
@@ -210,3 +232,19 @@ ide_command::domain!(
plugin_navigation_invalidate,
plugin_navigation_markers,
);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn discovery_keeps_the_first_in_scope_files_and_counts_them_all() {
let files: Vec<PathBuf> = (0..7).map(|i| PathBuf::from(format!("/p/{}/f{i}.xml", i % 2))).collect();
let (kept, total) = first_in_scope(files, |p| p.starts_with("/p/0"), 3);
// Out-of-scope files neither take a slot nor count toward the total.
assert_eq!(total, 4);
assert_eq!(kept, ["/p/0/f0.xml", "/p/0/f2.xml", "/p/0/f4.xml"].map(PathBuf::from));
let (kept, total) = first_in_scope(kept, |_| true, 20_000);
assert_eq!((kept.len(), total), (3, 3));
}
}
+5
Переглянути файл
@@ -653,6 +653,11 @@ impl PluginHost {
.collect()
}
/// Whether a usable plugin offers ghost text for `language`.
pub fn offers_inline_completion(&self, language: &str) -> bool {
!self.provider_plugins(ProviderKind::InlineCompletion, language).is_empty()
}
/// Ghost text from the first plugin that has some. Not bound by the
/// edit-path soft deadline (it may need the network) but by `cancel`:
/// the editor cancels a request as soon as the user types on.
+3 -2
Переглянути файл
@@ -277,8 +277,9 @@ pub enum PluginEvent {
/// Complete replacement of one plugin's console highlight rules (empty: none).
#[serde(rename_all = "camelCase")]
ConsoleRulesChanged { plugin_id: String, rules: Vec<ide_plugin::ConsoleRule> },
/// Open a file in the invoking window.
EditorOpen { path: ide_core::IpcPath, selection: Option<ide_core::Range> },
/// Open a file in the invoking window; `as_text` in the text editor even when a custom editor claims it.
#[serde(rename_all = "camelCase")]
EditorOpen { path: ide_core::IpcPath, selection: Option<ide_core::Range>, as_text: bool },
/// Change selection or scrolling only in this window's already open editor.
EditorRanges { path: ide_core::IpcPath, ranges: Vec<ide_core::Range>, reveal: bool },
/// A bounded output channel snapshot, or withdrawal when the plugin stops.
+25 -2
Переглянути файл
@@ -6,7 +6,8 @@
//! ```toml
//! [[contributes.menus]]
//! menu = "editor.context" # projectView.context, editorTab.context, tools, viewItem.context, commit.message,
//! # services.context / services.toolbar (API 1.18: the Services tree's own nodes)
//! # services.context / services.toolbar (API 1.18: the Services tree's own nodes),
//! # openIn (API 1.19: the Open In › submenu of the editor, its tab and the project view)
//! command = "check"
//! when = "editorLang == java"
//! # view = "<view id>" # required for (only allowed on) viewItem.context
@@ -116,7 +117,9 @@ const COMMIT_MESSAGE_MENU: &str = "commit.message";
/// The Services tool window's context menu and toolbar for the IDE's own nodes (run
/// configurations, Docker containers…): the command gets the selected services.
const SERVICES_MENUS: [&str; 2] = ["services.context", "services.toolbar"];
const MENU_IDS: [&str; 12] = [
/// The Open In › submenu of the editor, editor tab and project view menus: the command gets the file.
const OPEN_IN_MENU: &str = "openIn";
const MENU_IDS: [&str; 13] = [
"editor.context",
"projectView.context",
"editorTab.context",
@@ -129,6 +132,7 @@ const MENU_IDS: [&str; 12] = [
"searchResults.context",
SERVICES_MENUS[0],
SERVICES_MENUS[1],
OPEN_IN_MENU,
];
const MAX_TITLE: usize = 256;
const MAX_SETTINGS: usize = 200;
@@ -196,6 +200,9 @@ pub(super) fn menu(pkg: &Package, decl: toml::Value) -> Result<UiDecl, String> {
if SERVICES_MENUS.contains(&d.menu.as_str()) {
pkg.manifest.needs_api(&format!("contributes.menus: {}", d.menu), 18)?;
}
if d.menu == OPEN_IN_MENU {
pkg.manifest.needs_api(&format!("contributes.menus: {OPEN_IN_MENU}"), 19)?;
}
if let Some(w) = &d.when {
validate_when(w).map_err(|e| format!("contributes.menus: {e}"))?;
}
@@ -1402,6 +1409,22 @@ mod tests {
assert!(menu(&pkg, toolbar).unwrap_err().contains("only for context menus"));
}
#[test]
fn open_in_menu_requires_api_1_19_and_takes_no_submenu() {
let pkg = |api: &str| {
let manifest = ide_extension::Manifest::parse(&format!(
"id='test'\nname='Test'\nversion='1.0.0'\nengines.openidea='{api}'\n[[contributes.commands]]\nid='show'\ntitle='Show'"
))
.unwrap();
Package::new(manifest, std::path::PathBuf::from("/unused"))
};
let decl = || toml::from_str("menu='openIn'\ncommand='show'\nwhen='editorLang == xml'").unwrap();
assert!(menu(&pkg("^1.18"), decl()).unwrap_err().contains("1.19"));
assert!(menu(&pkg("^1.19"), decl()).is_ok());
let grouped = toml::from_str("menu='openIn'\ncommand='show'\nsubmenu='BPMN'").unwrap();
assert!(menu(&pkg("^1.19"), grouped).unwrap_err().contains("only for context menus"));
}
#[test]
fn escape_bindings_need_api_1_10_and_a_when_clause() {
let pkg = |api: &str| {
+2
Переглянути файл
@@ -222,6 +222,8 @@ impl Host {
ide_sdk::apply::configure_path_aliases(cfg, server_root, &data_dir);
let css_modules = ide_tools::managed_npm_plugin(&data_dir, "css-modules-kit");
ide_sdk::apply::configure_css_modules(cfg, server_root, css_modules.as_deref());
let styled = ide_tools::managed_npm_plugin(&data_dir, "typescript-styled-plugin");
ide_sdk::apply::configure_styled(cfg, server_root, styled.as_deref());
// After the global plugins: they keep the IDE's copies.
ide_sdk::apply::configure_tsconfig_plugins(cfg, server_root, &data_dir);
let container_python = effective.languages.python.run_target().is_some();
+1
Переглянути файл
@@ -375,6 +375,7 @@ pub fn client_accepts(event: &IdeEvent, trusted: bool) -> bool {
| IdeEvent::DocDiskConflict { .. }
| IdeEvent::WorkspaceEditApplied { .. }
| IdeEvent::DocLanguage { .. }
| IdeEvent::DocEncoding { .. }
| IdeEvent::Diagnostics { .. }
| IdeEvent::Task { .. }
| IdeEvent::IndexState { .. }
+3 -3
Переглянути файл
@@ -370,7 +370,7 @@ pub fn register(dispatcher: &mut Dispatcher, shell: Arc<WebShellState>) {
("window_toggle_zoom", Always),
("window_start_drag", Always),
("window_drag_files", Always),
("file_dialog_needs_gtk", Trusted),
("file_dialog_needs_gtk", Always),
("clipboard_has_files", Always),
("clipboard_has_image", Always),
] {
@@ -387,7 +387,7 @@ pub fn register(dispatcher: &mut Dispatcher, shell: Arc<WebShellState>) {
for (empty_list, trust) in [
("window_group_current", Always),
("system_font_families", Always),
("system_probe_hotkeys", Trusted),
("system_probe_hotkeys", Always),
("wsl_distros", Always),
("web_browsers", Always),
("plugin_catalog", Always),
@@ -414,7 +414,7 @@ pub fn register(dispatcher: &mut Dispatcher, shell: Arc<WebShellState>) {
});
// Caches & LSP & Web & Workspace & HTTP helpers already available through ide-host dependencies.
dispatcher.add("caches_local_data_info", TrustClass::Trusted, |c| async move {
dispatcher.add("caches_local_data_info", TrustClass::Always, |c| async move {
let current = c.host.local_data_dir.to_string_lossy().into_owned();
Ok(LocalDataInfo {
default_dir: current.clone(),
+32
Переглянути файл
@@ -3027,6 +3027,38 @@ fn official_ai_completion_cancels_superseded_requests() {
assert!(times[9] < Duration::from_millis(500), "{times:?}");
}
/// Installed with the optional network permission refused (it is not ticked by
/// default), a suggestion request says so in the window instead of failing silently.
#[test]
fn official_ai_completion_explains_a_refused_network_permission() {
let f = fixture(Limits::default());
f.host.install_from_dir(&official("ai-completion"), &Consent::default()).unwrap();
let (port, seen) = http_server(r#"{"choices":[{"text":"a + b\n"}]}"#, |_| Duration::ZERO);
f.run("openidea.ai-completion", "set-endpoint", Some(&format!("http://localhost:{port}"))).unwrap();
f.take_events();
let doc = ide_plugin::ProviderDocument {
path: f.project.join("src/a.rs"),
language: "rust".into(),
version: 1,
text: "let x = ".into(),
};
for _ in 0..2 {
assert!(f.host.provide_inline_completion(&doc, ide_core::Pos::new(0, 8), &Default::default()).is_none());
}
assert!(seen.lock().is_empty(), "denied before connecting");
let notices: Vec<String> = f
.take_events()
.into_iter()
.filter_map(|(_, e)| match e {
PluginEvent::Notification { level: NotificationLevel::Warning, body, .. } => Some(body),
_ => None,
})
.collect();
assert_eq!(notices.len(), 1, "once: {notices:?}");
assert!(notices[0].contains("Settings › Plugins › AI Completion"), "{notices:?}");
assert_eq!(f.status("openidea.ai-completion"), PluginStatus::Active, "not a crash");
}
/// Checkstyle: a save runs the approved `checkstyle` and publishes
/// diagnostics; quick fixes come through the code-action provider; saving
/// again cancels the check still running.
+2
Переглянути файл
@@ -12,6 +12,8 @@ pub mod exec;
pub mod history;
#[cfg(target_os = "macos")]
mod pac;
#[cfg(target_os = "macos")]
pub use pac::system_pac_route;
pub mod parse;
pub mod tunnel;
+112 -3
Переглянути файл
@@ -50,15 +50,41 @@ fn with_pac_from(
no_proxy: &str,
slot_for: impl FnOnce(String) -> Arc<ScriptSlot>,
) -> reqwest::ClientBuilder {
let Some((settings, url)) =
(!has_env_proxy).then(read_settings).flatten().and_then(|s| configured_pac(&s).map(|u| (s, u)))
else {
let Some((settings, url)) = active_pac(has_env_proxy, read_settings) else {
return builder;
};
let resolver = PacResolver::new(slot_for(url), manual_matcher(&settings, no_proxy), no_proxy);
builder.proxy(reqwest::Proxy::custom(move |url| resolver.resolve(url)))
}
fn active_pac(
has_env_proxy: bool,
read_settings: impl FnOnce() -> Option<CFRetained<CFDictionary>>,
) -> Option<(CFRetained<CFDictionary>, String)> {
(!has_env_proxy).then(read_settings).flatten().and_then(|s| configured_pac(&s).map(|u| (s, u)))
}
/// The route `with_system_pac` would give `url`, for one-shot callers such as `curl`, or `None`
/// when no PAC applies. A script still loading or failed never waits: the resolver then answers
/// with the manual proxy, i.e. the route `Matcher::from_system` gives.
pub fn system_pac_route(url: &str) -> Option<ProxyRoute> {
pac_route_from(url, env_proxy_set(), system_settings, &env_no_proxy(), ScriptSlot::shared)
}
fn pac_route_from(
url: &str,
has_env_proxy: bool,
read_settings: impl FnOnce() -> Option<CFRetained<CFDictionary>>,
no_proxy: &str,
slot_for: impl FnOnce(String) -> Arc<ScriptSlot>,
) -> Option<ProxyRoute> {
let url = reqwest::Url::parse(url).ok()?;
let (settings, pac) = active_pac(has_env_proxy, read_settings)?;
let slot = slot_for(pac);
let resolver = PacResolver::new(slot, manual_matcher(&settings, no_proxy), no_proxy);
Some(resolver.resolve(&url).map_or(ProxyRoute::Direct, ProxyRoute::Via))
}
/// Fingerprint of the active macOS PAC URL, or `None`.
pub(crate) fn system_pac_fingerprint() -> Option<String> {
(!env_proxy_set()).then(system_settings).flatten().and_then(|s| pac_fingerprint(&s))
@@ -447,6 +473,89 @@ mod tests {
}
}
/// Like `serve_pac`, but holds the answer until `gate` is set, so the script stays pending.
fn serve_gated_pac(body: String, gate: Arc<AtomicBool>) -> u16 {
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
let port = listener.local_addr().unwrap().port();
std::thread::spawn(move || {
for stream in listener.incoming() {
let Ok(mut stream) = stream else { continue };
let mut reader = BufReader::new(stream.try_clone().unwrap());
loop {
let mut line = String::new();
if reader.read_line(&mut line).unwrap_or(0) == 0 || line == "\r\n" {
break;
}
}
while !gate.load(Ordering::SeqCst) {
std::thread::sleep(Duration::from_millis(5));
}
let head = format!("HTTP/1.1 200 OK\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", body.len());
let _ = stream.write_all(head.as_bytes());
let _ = stream.write_all(body.as_bytes());
}
});
port
}
#[test]
fn one_shot_route_keeps_the_manual_route_until_the_script_loads() {
let pac_proxy = "http://127.0.0.1:3128";
let pac_script = r#"function FindProxyForURL(url, host) {
if (host == "github.com") return "PROXY 127.0.0.1:3128";
return "DIRECT";
}"#
.to_owned();
let gate = Arc::new(AtomicBool::new(false));
let pac_url = format!("http://127.0.0.1:{}/proxy.pac", serve_gated_pac(pac_script, Arc::clone(&gate)));
let slot = ScriptSlot::new(pac_url.clone(), SCRIPT_TTL, RETRY_BACKOFF, ROUTE_TTL);
let route = |url: &str, env: bool, enabled: bool, manual: bool| {
let settings = || {
let mut entries = vec![
(
unsafe { cf::kCFNetworkProxiesProxyAutoConfigEnable },
as_cf_type(CFNumber::new_i32(i32::from(enabled))),
),
(
unsafe { cf::kCFNetworkProxiesProxyAutoConfigURLString },
as_cf_type(CFString::from_str(&pac_url)),
),
];
if manual {
entries.push((unsafe { cf::kCFNetworkProxiesHTTPSEnable }, as_cf_type(CFNumber::new_i32(1))));
entries.push((
unsafe { cf::kCFNetworkProxiesHTTPSProxy },
as_cf_type(CFString::from_str("127.0.0.1")),
));
entries.push((unsafe { cf::kCFNetworkProxiesHTTPSPort }, as_cf_type(CFNumber::new_i32(7890))));
}
Some(settings_dict(entries))
};
pac_route_from(url, env, settings, "", |_| Arc::clone(&slot))
};
let github = "https://github.com/o/r/releases/download/v1/x.zip";
let manual = Some(ProxyRoute::Via("http://127.0.0.1:7890/".into()));
// Pending: no waiting, the manual proxy main used is answered.
let started = Instant::now();
assert_eq!(route(github, false, true, true), manual);
assert!(started.elapsed() < Duration::from_secs(2), "must not wait for the script");
gate.store(true, Ordering::SeqCst);
let deadline = Instant::now() + Duration::from_secs(5);
while slot.script().is_none() {
assert!(Instant::now() < deadline, "PAC script did not finish loading in time");
std::thread::sleep(Duration::from_millis(5));
}
assert_eq!(route(github, false, true, true), Some(ProxyRoute::Via(pac_proxy.into())));
// A DIRECT answer falls through to the manual proxy as in the HTTP client, else goes direct.
assert_eq!(route("https://elsewhere.example/x", false, true, true), manual);
assert_eq!(route("https://elsewhere.example/x", false, true, false), Some(ProxyRoute::Direct));
// No PAC applies: the caller keeps its own lookup.
assert_eq!(route(github, false, false, true), None);
assert_eq!(route(github, true, true, true), None);
}
#[tokio::test]
async fn pac_file_urls_read_the_original_script() {
let dir = tempfile::tempdir().unwrap();
+121 -15
Переглянути файл
@@ -2,6 +2,7 @@
//! speak (a WebSocket): direct, or through an HTTP proxy's `CONNECT` tunnel.
use base64::Engine;
use hyper_util::client::proxy::matcher::Matcher;
use ide_core::proxy_settings::ProxyRoute;
use ide_core::{IdeError, IdeResult};
use std::time::Duration;
@@ -10,30 +11,68 @@ use tokio::net::TcpStream;
const CONNECT_TIMEOUT: Duration = Duration::from_secs(30);
/// The PAC lookup of the system proxy settings; none outside macOS.
#[cfg(target_os = "macos")]
const SYSTEM_PAC: fn(&str) -> Option<ProxyRoute> = crate::system_pac_route;
#[cfg(not(target_os = "macos"))]
const SYSTEM_PAC: fn(&str) -> Option<ProxyRoute> = |_| None;
/// A connection to `url`'s host and port, through the proxy System Settings › HTTP Proxy
/// (or, in Auto mode, the system) routes that host to.
pub async fn connect(url: &reqwest::Url) -> IdeResult<TcpStream> {
let route = ide_core::proxy_settings::proxy().route(url.host_str());
connect_with(url, route, SYSTEM_PAC, Matcher::from_system).await
}
/// The URI the system proxy settings are asked about: the scheme reqwest would use (`ws` → `http`).
fn system_uri(url: &reqwest::Url) -> IdeResult<http::Uri> {
let host = url.host_str().ok_or_else(|| IdeError::invalid("the URL has no host"))?;
let port = url.port_or_known_default().ok_or_else(|| IdeError::invalid("the URL has no port"))?;
let target = if host.contains(':') { format!("[{host}]:{port}") } else { format!("{host}:{port}") };
let proxy = match ide_core::proxy_settings::proxy().route(Some(host)) {
let scheme = if url.scheme() == "wss" || url.scheme() == "https" { "https" } else { "http" };
format!("{scheme}://{target}/").parse().map_err(|_| IdeError::invalid("invalid host"))
}
/// `connect` with the proxy settings' `route`, the PAC lookup and the system matcher injected.
async fn connect_with(
url: &reqwest::Url,
route: ProxyRoute,
pac: impl FnOnce(&str) -> Option<ProxyRoute> + Send + 'static,
matcher: impl FnOnce() -> Matcher,
) -> IdeResult<TcpStream> {
let host = url.host_str().ok_or_else(|| IdeError::invalid("the URL has no host"))?;
let port = url.port_or_known_default().ok_or_else(|| IdeError::invalid("the URL has no port"))?;
let target = if host.contains(':') { format!("[{host}]:{port}") } else { format!("{host}:{port}") };
let proxy = match route {
ProxyRoute::Direct => None,
ProxyRoute::Via(via) => Some(via),
ProxyRoute::System => {
// The system proxy of the scheme reqwest would use (`ws` → `http`).
let scheme = if url.scheme() == "wss" || url.scheme() == "https" { "https" } else { "http" };
let uri: http::Uri =
format!("{scheme}://{target}/").parse().map_err(|_| IdeError::invalid("invalid host"))?;
hyper_util::client::proxy::matcher::Matcher::from_system().intercept(&uri).map(|intercept| {
let auth =
intercept.raw_auth().map(|(user, password)| format!("{user}:{password}@")).unwrap_or_default();
let uri = intercept.uri();
format!(
"{}://{auth}{}",
uri.scheme_str().unwrap_or("http"),
uri.authority().map(|a| a.as_str()).unwrap_or_default()
)
})
let uri = system_uri(url)?;
// On macOS the resolver may run the PAC script (`dnsResolve`), so it stays off the async threads. A
// script still loading answers with the matcher's route.
let probe = uri.to_string();
#[cfg(target_os = "macos")]
let pac = tokio::task::spawn_blocking(move || pac(&probe))
.await
.map_err(|error| IdeError::unavailable(format!("proxy lookup failed: {error}")))?;
// Nothing to evaluate outside macOS: no hop to the blocking pool.
#[cfg(not(target_os = "macos"))]
let pac = pac(&probe);
match pac {
Some(ProxyRoute::Via(via)) if via.starts_with("http://") => Some(via),
Some(ProxyRoute::Direct) => None,
// No PAC applies, or it names a proxy this tunnel cannot speak to (SOCKS): the matcher's route.
_ => matcher().intercept(&uri).map(|intercept| {
let auth =
intercept.raw_auth().map(|(user, password)| format!("{user}:{password}@")).unwrap_or_default();
let uri = intercept.uri();
format!(
"{}://{auth}{}",
uri.scheme_str().unwrap_or("http"),
uri.authority().map(|a| a.as_str()).unwrap_or_default()
)
}),
}
}
};
let connecting = async {
@@ -157,6 +196,73 @@ mod tests {
assert!(error.message.contains("needs a login"), "{}", error.message);
}
use std::sync::{Arc, Mutex};
fn matcher_via(address: &str) -> impl FnOnce() -> Matcher {
let address = address.to_owned();
move || Matcher::builder().all(format!("http://{address}")).build()
}
/// The CONNECT line a proxy was asked for, or `None` when nothing connected within a moment.
async fn asked(task: tokio::task::JoinHandle<String>) -> Option<String> {
tokio::time::timeout(Duration::from_millis(300), task).await.ok().map(|head| head.unwrap())
}
#[tokio::test]
async fn the_pac_route_wins_over_the_matcher_and_ws_is_looked_up_as_http() {
let (pac_proxy, pac_asked) = proxy("HTTP/1.1 200 Connection established\r\n\r\n").await;
let (matcher_proxy, matcher_asked) = proxy("HTTP/1.1 200 Connection established\r\n\r\n").await;
let seen = Arc::new(Mutex::new(String::new()));
let recorded = Arc::clone(&seen);
let pac = move |probe: &str| {
*recorded.lock().unwrap() = probe.to_owned();
Some(ProxyRoute::Via(format!("http://{pac_proxy}")))
};
let url = reqwest::Url::parse("ws://pac-target.invalid:8080/s").unwrap();
connect_with(&url, ProxyRoute::System, pac, matcher_via(&matcher_proxy)).await.unwrap();
assert_eq!(*seen.lock().unwrap(), "http://pac-target.invalid:8080/");
assert!(asked(pac_asked).await.unwrap().starts_with("CONNECT pac-target.invalid:8080 HTTP/1.1\r\n"));
assert_eq!(asked(matcher_asked).await, None, "the matcher's proxy must not be used");
}
#[tokio::test]
async fn wss_is_looked_up_as_https() {
let (pac_proxy, _) = proxy("HTTP/1.1 200 Connection established\r\n\r\n").await;
let seen = Arc::new(Mutex::new(String::new()));
let recorded = Arc::clone(&seen);
let pac = move |probe: &str| {
*recorded.lock().unwrap() = probe.to_owned();
Some(ProxyRoute::Via(format!("http://{pac_proxy}")))
};
let url = reqwest::Url::parse("wss://pac-target.invalid/s").unwrap();
connect_with(&url, ProxyRoute::System, pac, || Matcher::builder().build()).await.unwrap();
assert_eq!(*seen.lock().unwrap(), "https://pac-target.invalid:443/");
}
#[tokio::test]
async fn a_resolved_direct_route_skips_the_matchers_proxy() {
let (matcher_proxy, matcher_asked) = proxy("HTTP/1.1 200 Connection established\r\n\r\n").await;
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let url = reqwest::Url::parse(&format!("ws://{}/s", listener.local_addr().unwrap())).unwrap();
connect_with(&url, ProxyRoute::System, |_| Some(ProxyRoute::Direct), matcher_via(&matcher_proxy))
.await
.unwrap();
tokio::time::timeout(Duration::from_millis(300), listener.accept())
.await
.expect("no direct connection")
.unwrap();
assert_eq!(asked(matcher_asked).await, None, "the matcher's proxy must not be used");
}
#[tokio::test]
async fn a_socks_pac_route_keeps_the_matchers_route() {
let (matcher_proxy, matcher_asked) = proxy("HTTP/1.1 200 Connection established\r\n\r\n").await;
let url = reqwest::Url::parse("ws://pac-target.invalid:8080/s").unwrap();
let pac = |_: &str| Some(ProxyRoute::Via("socks5h://127.0.0.1:1080".into()));
connect_with(&url, ProxyRoute::System, pac, matcher_via(&matcher_proxy)).await.unwrap();
assert!(asked(matcher_asked).await.unwrap().starts_with("CONNECT pac-target.invalid:8080 HTTP/1.1\r\n"));
}
#[test]
fn proxy_credentials_are_percent_decoded() {
assert_eq!(percent_decode("a%40b%3Ac"), "a@b:c");
+3 -1
Переглянути файл
@@ -258,7 +258,8 @@ impl ProjectIndex {
}
/// Bounded file inventory for background plugin indexers; honors the same
/// project/exclude scope as search and never walks the filesystem.
/// project/exclude scope as search, leaves VCS-ignored files out and never
/// walks the filesystem.
pub fn files_with_extensions(&self, extensions: &[String], limit: usize) -> Vec<PathBuf> {
self.shared
.data
@@ -266,6 +267,7 @@ impl ProjectIndex {
.files
.iter()
.flatten()
.filter(|f| !f.ignored)
.filter(|f| f.path.extension().and_then(|e| e.to_str()).is_some_and(|e| extensions.iter().any(|x| x == e)))
.take(limit)
.map(|f| f.path.clone())
+5 -1
Переглянути файл
@@ -895,15 +895,19 @@ fn workspace_scope_excludes_state_from_scans_updates_and_cached_results() {
}
#[test]
fn plugin_inventory_respects_excludes_and_symbols_require_matching_text() {
fn plugin_inventory_respects_excludes_and_ignores_and_symbols_require_matching_text() {
let java = "package demo; interface UserMapper { void find(); }";
let f = Fixture::new(&[
("src/UserMapper.java", java),
("src/mapper.xml", "<mapper/>"),
("target/Generated.java", "class Generated {}"),
("other.txt", "ignored"),
(".gitignore", "gen/\n"),
("gen/Ignored.java", "class Ignored {}"),
]);
let index = f.open();
// Go to File lists the git-ignored file; plugin navigation leaves it out.
assert_eq!(files(&index, "Ignored"), ["gen/Ignored.java"]);
let paths = index.files_with_extensions(&["java".into(), "xml".into()], 100);
assert_eq!(paths.len(), 2);
assert!(paths.iter().all(|p| p.starts_with(f.root.join("src"))));
+16 -1
Переглянути файл
@@ -9,7 +9,8 @@ use crate::LspManager;
use crate::server::{Running, Server};
use ide_core::error::{ErrorData, ErrorKind};
use ide_core::event::LspRefreshKind;
use ide_core::{CancellationToken, IdeError, IdeResult, LanguageId};
use ide_core::{CancellationToken, IdeError, IdeResult, LanguageId, Location, Pos};
use lsp_types as lsp;
use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
use specta::Type;
@@ -20,6 +21,7 @@ use std::time::{Duration, Instant};
pub(crate) const SERVER: &str = "jdtls";
const GENERATED_SOURCES: &str = "openidea.java.generatedSources";
const METHOD_REFERENCE_DEFINITION: &str = "openidea.java.methodReferenceDefinition";
pub(crate) mod configuration;
pub(crate) mod exception_breakpoints;
@@ -771,6 +773,19 @@ impl LspManager {
}
}
/// The declaration of a Java method named by `Type::method` / `expr::method` at `pos`.
/// JDT's selection-based definition can return the functional interface method when the
/// referenced method is inherited; the extension resolves the AST binding instead.
pub(crate) async fn java_method_reference_definition(&self, path: &Path, pos: Pos) -> IdeResult<Vec<Location>> {
let uri = crate::path_to_uri_string(path);
let value = self
.jdtls_command(path, METHOD_REFERENCE_DEFINITION, vec![json!(uri), json!(pos.line), json!(pos.col)])
.await?;
let locations: Vec<lsp::Location> = serde_json::from_value(value).unwrap_or_default();
let conv = self.conv(crate::text::Encoding::Utf16);
Ok(locations.iter().filter_map(|location| conv.location(location)).collect())
}
/// The jdtls instance serving `path` (a module directory or source file),
/// started if needed and waited for.
async fn jdtls(&self, path: &Path, cancel: &CancellationToken) -> IdeResult<(Arc<Server>, Running)> {
+148 -1
Переглянути файл
@@ -37,6 +37,7 @@ mod pull;
mod scope;
mod server;
mod source_actions;
mod switch_source_header;
mod tcp;
mod text;
mod ts_file_moves;
@@ -326,6 +327,25 @@ fn goto_is_empty(r: &Option<lsp::GotoDefinitionResponse>) -> bool {
}
}
/// Whether the caret is on the method name of a Java method reference (`Type::method`).
/// A method reference can name a functional interface's method through JDT's selection-based
/// definition when the referenced method is inherited, so ask the AST binding command instead.
fn java_method_reference_at(text: &DocText, pos: Pos) -> bool {
let line = text.line(pos.line as usize);
let mut utf16 = 0u32;
let mut at = line.len();
for (i, c) in line.char_indices() {
if utf16 >= pos.col {
at = i;
break;
}
utf16 += c.len_utf16() as u32;
}
let before = line[..at].trim_end();
let Some(colon) = before.rfind("::") else { return false };
before[colon + 2..].trim_start().chars().all(|c| c.is_alphanumeric() || c == '_' || c == '$')
}
fn rpc_err(server: &str, method: &str, e: RpcError) -> IdeError {
match e {
RpcError::Cancelled => IdeError::cancelled(),
@@ -1792,7 +1812,31 @@ impl LspManager {
}
let (method, cap, feature) = goto_method(kind);
let (snap, targets) = self.doc_targets(doc, feature, |c| c.has(cap)).await?;
self.goto_in(&snap, &targets, method, pos, None, None).await
let result = self.goto_in(&snap, &targets, method, pos, None, None).await;
// JDT's selection-based definition can name the functional interface method for an
// inherited method reference. Ask the Java binding command when that is what came back,
// when the caret is on a method reference, or when the server found no target at all.
let method_reference = snap.language.as_str() == "java" && java_method_reference_at(&snap.text, pos);
if kind == GotoKind::Definition
&& snap.language.as_str() == "java"
&& (method_reference
|| result.as_ref().is_ok_and(|locs| {
locs.is_empty()
|| locs.iter().any(|l| {
let path = l.path.to_string_lossy().replace('\\', "/");
let uri = l.uri.as_deref().unwrap_or_default();
path.contains("java/util/function")
|| path.contains("java.util.function")
|| uri.contains("java/util/function")
|| uri.contains("java.util.function")
})
}))
&& let Ok(found) = self.java_method_reference_definition(&snap.path, pos).await
&& !found.is_empty()
{
return Ok(found);
}
result
}
/// Go to Implementation, with the implementations found first passed to `partial` while
@@ -2767,6 +2811,79 @@ impl LspManager {
Ok(ts_file_moves::file_references(&result))
}
/// Runs vtsls' own `command` for `doc`. typescript-language-server, TypeScript 7 and the
/// Vue / Astro servers have none of these commands: they need vtsls.
async fn vtsls_command(
&self,
doc: DocId,
command: &str,
arguments: impl FnOnce(&DocSnap, &Target) -> Option<Value>,
cancel: Option<&CancellationToken>,
) -> IdeResult<(Target, Value)> {
let snap = self.snapshot(doc)?;
let t = self
.ready_targets(&snap.servers, |c| c.commands().iter().any(|c| c == command))
.await
.into_iter()
.find(|t| t.server.name == "vtsls")
.ok_or_else(|| IdeError::unavailable("This needs the vtsls TypeScript language server"))?;
let arguments =
arguments(&snap, &t).ok_or_else(|| IdeError::invalid(format!("invalid `{command}` arguments")))?;
let params = json!({ "command": command, "arguments": arguments });
let result = self.call(&t, "workspace/executeCommand", params, cancel, LONG_TIMEOUT).await?;
Ok((t, result))
}
/// Go to Source Definition: the JavaScript implementation of what `pos` refers to, not its
/// `.d.ts` declaration (vtsls' `typescript.goToSourceDefinition`).
pub async fn source_definition(&self, doc: DocId, pos: Pos, cancel: CancellationToken) -> IdeResult<Vec<Location>> {
let (t, result) = self
.vtsls_command(
doc,
"typescript.goToSourceDefinition",
|snap, t| Some(json!([snap.uri, snap.position(t, pos)])),
Some(&cancel),
)
.await?;
let locs: Vec<lsp::Location> = serde_json::from_value::<Option<_>>(result)
.map_err(|e| IdeError::internal(format!("typescript.goToSourceDefinition: {e}")))?
.unwrap_or_default();
let conv = self.conv(t.enc());
Ok(locs.iter().filter_map(|l| conv.location(l)).collect())
}
/// Opens the `tsconfig.json` / `jsconfig.json` of `doc`'s project, or the TS Server log:
/// vtsls answers with `window/showDocument` (or a message when there is none).
pub async fn open_typescript_file(&self, doc: DocId, what: TypeScriptFile) -> IdeResult<()> {
let (command, with_uri) = match what {
TypeScriptFile::ProjectConfig => {
let snap = self.snapshot(doc)?;
let js = snap.language.as_str().starts_with("javascript");
(if js { "javascript.goToProjectConfig" } else { "typescript.goToProjectConfig" }, true)
}
TypeScriptFile::ServerLog => ("typescript.openTsServerLog", false),
};
self.vtsls_command(doc, command, |snap, _| Some(if with_uri { json!([snap.uri]) } else { json!([]) }), None)
.await?;
Ok(())
}
/// The files tsserver suggests for vtsls' Move to File `command` (from a code action).
pub async fn move_to_file_targets(
&self,
doc: DocId,
command: Command,
cancel: CancellationToken,
) -> IdeResult<Vec<PathBuf>> {
let snap = self.snapshot(doc)?;
let request = ts_file_moves::move_to_file_suggestions_request(&snap.path, &command.arguments)
.ok_or_else(|| IdeError::invalid("invalid Move to File command"))?;
let (_, result) = self
.vtsls_command(doc, ts_file_moves::COMMAND, |_, _| request.get("arguments").cloned(), Some(&cancel))
.await?;
Ok(ts_file_moves::move_to_file_suggestions(&result))
}
/// Whether a server of `doc` (`server`, when given) provides the command `name`. Code actions
/// can carry commands other editors' extensions run themselves after the edit (vtsls'
/// `_typescript.didOrganizeImports`): no server provides those.
@@ -4676,6 +4793,36 @@ mod code_action_tests {
}
}
#[cfg(test)]
mod java_method_reference_tests {
use super::java_method_reference_at;
use crate::text::DocText;
use ide_core::Pos;
#[test]
fn finds_the_method_name_of_a_method_reference() {
let text = DocText::new("wrapper.set(XbkBtbOutNotice::getUpdateTime, now);");
let col = "wrapper.set(XbkBtbOutNotice::get".len() as u32;
assert!(java_method_reference_at(&text, Pos::new(0, col)));
}
#[test]
fn allows_whitespace_around_the_method_reference_operator() {
let text = DocText::new("wrapper.set(XbkBtbOutNotice :: getUpdateTime, now);");
let col = "wrapper.set(XbkBtbOutNotice :: get".len() as u32;
assert!(java_method_reference_at(&text, Pos::new(0, col)));
}
#[test]
fn ignores_regular_calls_and_the_referenced_type() {
let text = DocText::new("wrapper.set(XbkBtbOutNotice::getUpdateTime, now);");
let type_col = "wrapper.set(XbkBtbOutNotice".len() as u32;
assert!(!java_method_reference_at(&text, Pos::new(0, type_col)));
let call = DocText::new("wrapper.set(getUpdateTime(), now);");
assert!(!java_method_reference_at(&call, Pos::new(0, "wrapper.set(get".len() as u32)));
}
}
#[cfg(test)]
mod did_change_content_tests {
use super::*;
+23
Переглянути файл
@@ -0,0 +1,23 @@
//! Switch Header/Source for C, C++ and Objective-C through clangd's
//! `textDocument/switchSourceHeader` extension. The editor falls back to a file with the
//! same name when clangd does not serve the document or finds nothing.
use crate::{DEFAULT_TIMEOUT, LspManager, uri};
use ide_core::{CancellationToken, DocId, IdeResult};
use serde_json::Value;
use std::path::PathBuf;
const SERVER: &str = "clangd";
const METHOD: &str = "textDocument/switchSourceHeader";
impl LspManager {
/// clangd's header for the document's source file, or source for its header; `None`
/// when clangd finds none or does not serve the document.
pub async fn switch_source_header(&self, doc: DocId, cancel: CancellationToken) -> IdeResult<Option<PathBuf>> {
let snap = self.snapshot(doc)?;
let clangd: Vec<_> = snap.servers.iter().filter(|s| s.name == SERVER).cloned().collect();
let Some(t) = self.ready_targets(&clangd, |_| true).await.into_iter().next() else { return Ok(None) };
let found: Value = self.call(&t, METHOD, snap.ident(), Some(&cancel), DEFAULT_TIMEOUT).await?;
Ok(found.as_str().and_then(uri::uri_to_path))
}
}
+46
Переглянути файл
@@ -87,10 +87,56 @@ pub(crate) fn file_references(result: &Value) -> Vec<ide_core::Location> {
.collect()
}
/// The `typescript.tsserverRequest` arguments asking where the selection of vtsls' Move to File
/// command (`_typescript.moveToFileRefactoring` with `[action, uri, range]`, run with the target
/// file appended) can go.
pub(crate) fn move_to_file_suggestions_request(file: &std::path::Path, arguments: &[Value]) -> Option<Value> {
let range: lsp_types::Range = serde_json::from_value(arguments.get(2)?.clone()).ok()?;
// tsserver: 1-based lines and UTF-16 offsets; vtsls speaks UTF-16.
Some(json!({
"command": COMMAND,
"arguments": ["getMoveToRefactoringFileSuggestions", {
"file": file,
"startLine": range.start.line + 1,
"startOffset": range.start.character + 1,
"endLine": range.end.line + 1,
"endOffset": range.end.character + 1,
}],
}))
}
/// The files tsserver suggests in its `getMoveToRefactoringFileSuggestions` answer.
pub(crate) fn move_to_file_suggestions(result: &Value) -> Vec<PathBuf> {
let body = result.get("body").unwrap_or(result);
serde_json::from_value(body.get("files").cloned().unwrap_or_default()).unwrap_or_default()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn asks_tsserver_where_the_move_to_file_selection_can_go() {
let action = json!({ "name": "Move to file", "kind": "refactor.move.file" });
let range = json!({ "start": { "line": 6, "character": 16 }, "end": { "line": 8, "character": 1 } });
let request = move_to_file_suggestions_request(
std::path::Path::new("/p/src/util.ts"),
&[action.clone(), json!("file:///p/src/util.ts"), range],
)
.unwrap();
assert_eq!(
request["arguments"],
json!(["getMoveToRefactoringFileSuggestions", {
"file": "/p/src/util.ts", "startLine": 7, "startOffset": 17, "endLine": 9, "endOffset": 2,
}])
);
assert!(move_to_file_suggestions_request(std::path::Path::new("/p/a.ts"), &[action]).is_none());
let answer =
json!({ "success": true, "body": { "newFileName": "/p/src/greet.ts", "files": ["/p/src/app.ts"] } });
assert_eq!(move_to_file_suggestions(&answer), vec![PathBuf::from("/p/src/app.ts")]);
assert!(move_to_file_suggestions(&json!({ "success": false })).is_empty());
}
#[test]
fn converts_tsserver_file_references() {
let result = json!({ "success": true, "body": { "symbolName": "\"./Hello.vue\"", "refs": [
+8
Переглянути файл
@@ -109,6 +109,14 @@ pub struct Signature {
pub parameters: Vec<(u32, u32)>,
}
/// A file vtsls opens for a document: its project's configuration or the TS Server log.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub enum TypeScriptFile {
ProjectConfig,
ServerLog,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub enum GotoKind {
+24
Переглянути файл
@@ -8800,3 +8800,27 @@ async fn hierarchy_refactorings_use_phoxites_requests_when_the_server_advertises
assert_eq!(e.kind, ide_core::error::ErrorKind::Protocol);
assert_eq!(e.message, "any-name: index out of bounds");
}
#[tokio::test(flavor = "multi_thread")]
async fn switch_source_header_asks_clangd_and_only_clangd() {
let h = harness_for("objective-c", "m", &[("clangd", incremental_caps())], &[]);
let (doc, path) = h.open("Foo.m", "#import \"Foo.h\"\n");
h.wait_status("clangd", ServerStatus::Ready).await;
let s = h.launcher.state("clangd");
let header = h.root.join("Foo.h");
s.respond("textDocument/switchSourceHeader", json!(uri_of(&header)));
assert_eq!(h.mgr.switch_source_header(doc, CancellationToken::new()).await.unwrap(), Some(header));
assert_eq!(s.requested("textDocument/switchSourceHeader"), vec![json!({ "uri": uri_of(&path) })]);
// clangd found nothing: the editor falls back to a file of the same name.
s.respond("textDocument/switchSourceHeader", Value::Null);
assert_eq!(h.mgr.switch_source_header(doc, CancellationToken::new()).await.unwrap(), None);
h.mgr.shutdown_all().await;
// Another server is never sent clangd's extension.
let h = harness_for("objective-c", "m", &[("mock", incremental_caps())], &[]);
let (doc, _) = h.open("Foo.m", "");
h.wait_status("mock", ServerStatus::Ready).await;
assert_eq!(h.mgr.switch_source_header(doc, CancellationToken::new()).await.unwrap(), None);
assert!(h.launcher.state("mock").requested("textDocument/switchSourceHeader").is_empty());
h.mgr.shutdown_all().await;
}
+206
Переглянути файл
@@ -969,6 +969,135 @@ async fn bundler_path_aliases_resolve_below_tsconfig_paths() {
tokio::time::timeout(Duration::from_secs(10), mgr.shutdown_all()).await.unwrap();
}
/// vtsls' own commands (#6922): Go to Source Definition opens a library's JavaScript instead
/// of its `.d.ts`, Go to Project Configuration and Open TS Server Log answer with
/// `window/showDocument`, JSDoc `{@link}` in hovers is a `file://…#L1,1` link, and Move to File
/// suggests the project's files and moves a function with its imports in one applied edit. Set
/// `OPENIDEA_TEST_NPM_TOOLS` to a dir with `npm i @vtsls/[email protected] typescript@6`.
#[tokio::test(flavor = "multi_thread")]
#[ignore = "requires @vtsls/language-server and typescript@6 (OPENIDEA_TEST_NPM_TOOLS)"]
async fn vtsls_commands_open_sources_configs_logs_and_move_to_file() {
let tools = std::path::PathBuf::from(std::env::var("OPENIDEA_TEST_NPM_TOOLS").expect("OPENIDEA_TEST_NPM_TOOLS"));
let dir = tempfile::tempdir().unwrap();
let root = dunce::canonicalize(dir.path()).unwrap();
for dir in ["src", "node_modules/greeting"] {
std::fs::create_dir_all(root.join(dir)).unwrap();
}
let files = [
("package.json", "{\"name\":\"app\",\"private\":true}"),
("tsconfig.json", "{\"files\":[],\"references\":[{\"path\":\"./src/tsconfig.app.json\"}]}"),
(
"src/tsconfig.app.json",
"{\"compilerOptions\":{\"strict\":true,\"composite\":true,\"module\":\"ESNext\",\"moduleResolution\":\"Bundler\"},\"include\":[\"./**/*.ts\"]}",
),
(
"node_modules/greeting/package.json",
"{\"name\":\"greeting\",\"main\":\"index.js\",\"types\":\"index.d.ts\"}",
),
("node_modules/greeting/index.d.ts", "export declare function shout(s: string): string;\n"),
("node_modules/greeting/index.js", "export function shout(s) {\n return s.toUpperCase();\n}\n"),
(
"src/main.ts",
"import { shout } from \"greeting\";\nimport { greet, Greeter } from \"./util\";\n\n/** Uses {@link Greeter} to say hello. */\nexport function hello(name: string) {\n return shout(greet(name));\n}\n\nexport const g = new Greeter();\n",
),
(
"src/util.ts",
"export class Greeter {\n greet(name: string) {\n return `Hello, ${name}`;\n }\n}\n\nexport function greet(name: string) {\n return new Greeter().greet(name);\n}\n",
),
("src/strings.ts", "export const upper = (s: string) => s.toUpperCase();\n"),
("src/app.ts", "import { greet } from \"./util\";\n\nconsole.log(greet(\"app\"));\n"),
];
for (path, text) in files {
std::fs::write(root.join(path), text).unwrap();
}
// The IDE's settings hook: Move to File on, a TypeScript 6 lib, the log on.
let init = serde_json::json!({
"vtsls": { "enableMoveToFileCodeAction": true, "autoUseWorkspaceTsdk": true },
"typescript": {
"tsdk": tools.join("node_modules/typescript/lib").to_string_lossy(),
"tsserver": { "log": "verbose" },
},
});
let ts = lang("typescript", "ts", npm_server(&tools, "vtsls", "vtsls", Some(init)));
let (mgr, events) = manager(&root, LanguageRegistry::from_configs(vec![ts]));
let applied: Arc<Mutex<Vec<ide_core::WorkspaceEdit>>> = Arc::default();
mgr.set_apply_edit_hook(Box::new({
let applied = applied.clone();
move |edit| {
applied.lock().push(edit);
true
}
}));
let open = |path: &str| {
let doc = DocId::next();
let file = root.join(path);
mgr.did_open(doc, &file, &LanguageId::new("typescript"), 1, &std::fs::read_to_string(&file).unwrap());
doc
};
let (main, util) = (open("src/main.ts"), open("src/util.ts"));
// `shout`: Go to Declaration is the `.d.ts`, Go to Source Definition the `.js`.
let at = Pos::new(0, 10);
// The syntax server answers with the import itself until the project is loaded.
let dts = |d: &ide_core::Location| d.path.to_string_lossy().ends_with("greeting/index.d.ts");
let declaration = retry("declaration", Duration::from_secs(90), || {
let mgr = mgr.clone();
async move { mgr.goto(main, at, GotoKind::Definition).await.ok().filter(|d| d.iter().any(dts)) }
})
.await;
assert!(declaration.iter().all(dts), "{declaration:?}");
let source = mgr.source_definition(main, at, Default::default()).await.unwrap();
assert_eq!(source.len(), 1, "{source:?}");
assert_eq!(*source[0].path, *root.join("node_modules/greeting/index.js"));
assert_eq!(source[0].range.start, Pos::new(0, 16));
let shown = |events: &Events, suffix: &str| {
events
.lock()
.iter()
.any(|e| matches!(e, IdeEvent::LspShowDocument { path: Some(path), .. } if path.to_string_lossy().ends_with(suffix)))
};
mgr.open_typescript_file(main, ide_lsp::types::TypeScriptFile::ProjectConfig).await.unwrap();
retry("tsconfig.app.json shown", Duration::from_secs(10), || {
let found = shown(&events, "src/tsconfig.app.json").then_some(());
async move { found }
})
.await;
mgr.open_typescript_file(main, ide_lsp::types::TypeScriptFile::ServerLog).await.unwrap();
retry("tsserver.log shown", Duration::from_secs(10), || {
let found = shown(&events, "tsserver.log").then_some(());
async move { found }
})
.await;
let hover = mgr.hover(main, Pos::new(4, 17), Default::default()).await.unwrap();
let hover = format!("{hover:?}");
assert!(hover.contains("src/util.ts#L1%2C1"), "{hover}");
// Move to File on `greet`: tsserver suggests the other files, the move updates the importers.
let caret = Pos::new(6, 16);
let actions = mgr.code_actions(util, Range::new(caret, caret), vec!["refactor.move".into()]).await.unwrap();
let command = actions
.iter()
.find_map(|a| a.command.clone().filter(|c| c.command == "_typescript.moveToFileRefactoring"))
.unwrap_or_else(|| panic!("no Move to File: {actions:?}"));
let targets = mgr.move_to_file_targets(util, command.clone(), Default::default()).await.unwrap();
let strings = root.join("src/strings.ts");
assert!(targets.contains(&strings) && targets.contains(&root.join("src/app.ts")), "{targets:?}");
let mut moving = command;
moving.arguments.push(serde_json::json!(strings));
mgr.execute_command(util, moving).await.unwrap();
let edits = applied.lock().clone();
assert_eq!(edits.len(), 1, "{edits:?}");
let edit = format!("{:?}", edits[0]);
for file in ["src/util.ts", "src/strings.ts", "src/app.ts", "src/main.ts"] {
assert!(edit.contains(&*root.join(file).to_string_lossy()), "{file}: {edit}");
}
assert!(edit.contains("export function greet(name: string)"), "{edit}");
assert!(edit.contains("import { greet } from \\\"./strings\\\""), "{edit}");
tokio::time::timeout(Duration::from_secs(10), mgr.shutdown_all()).await.unwrap();
}
/// CSS Modules Kit (`@css-modules-kit/ts-plugin`) on vtsls, which serves the `.module.css`
/// files too (`languages: ["css"]`): definition and completion from TSX, references and rename
/// from the stylesheet (#6071), with the settings hook's own plugin configuration. Exactly the
@@ -1082,6 +1211,83 @@ async fn css_modules_kit_navigates_between_tsx_and_module_css() {
}
}
/// `@styled/typescript-styled-plugin` on vtsls: CSS diagnostics, completion and hover inside
/// styled-components and emotion templates (#6900), with the settings hook's own plugin
/// configuration. A tsconfig that declares the plugin too still gets one copy: each
/// diagnostic shows once. Set `OPENIDEA_TEST_NPM_TOOLS` to a dir with
/// `npm i @vtsls/language-server typescript@6 @styled/[email protected]`.
#[tokio::test(flavor = "multi_thread")]
#[ignore = "requires @vtsls/language-server and @styled/typescript-styled-plugin (OPENIDEA_TEST_NPM_TOOLS)"]
async fn styled_plugin_checks_and_completes_css_in_templates() {
let tools = std::path::PathBuf::from(std::env::var("OPENIDEA_TEST_NPM_TOOLS").expect("OPENIDEA_TEST_NPM_TOOLS"));
// (library, its import and tag, the tsconfig declares the plugin)
let cases = [
("styled-components", "import styled from 'styled-components';", "styled.div", false),
("@emotion/styled", "import styled from '@emotion/styled';", "styled.div", true),
("@emotion/react", "import { css } from '@emotion/react';", "css", false),
];
for (library, import, tag, declared) in cases {
let dir = tempfile::tempdir().unwrap();
let root = dunce::canonicalize(dir.path()).unwrap();
std::fs::create_dir_all(root.join("src")).unwrap();
std::fs::write(root.join("package.json"), format!(r#"{{"name":"app","dependencies":{{"{library}":"*"}}}}"#))
.unwrap();
let plugins = if declared { r#", "plugins": [{ "name": "@styled/typescript-styled-plugin" }]"# } else { "" };
std::fs::write(
root.join("tsconfig.json"),
format!(r#"{{ "compilerOptions": {{ "strict": true, "module": "ESNext", "moduleResolution": "Bundler"{plugins} }}, "include": ["src"] }}"#),
)
.unwrap();
// The library itself isn't installed: the plugin goes by the tag name.
let types = "declare module 'styled-components' { const styled: any; export default styled; }\n\
declare module '@emotion/styled' { const styled: any; export default styled; }\n\
declare module '@emotion/react' { export const css: any; }\n";
std::fs::write(root.join("src/libs.d.ts"), types).unwrap();
let path = root.join("src/box.ts");
let text = format!("{import}\nexport const box = {tag}`\n color: blue;\n colr: red;\n justify-con\n`;\n");
std::fs::write(&path, &text).unwrap();
let mut vtsls = npm_server(&tools, "vtsls", "vtsls", None);
vtsls.tsserver_project = true;
assert!(ide_sdk::apply::configure_styled(&mut vtsls, &root, Some(&tools)));
let data = tempfile::tempdir().unwrap();
assert!(!ide_sdk::apply::configure_tsconfig_plugins(&mut vtsls, &root, data.path()));
let registry = LanguageRegistry::from_configs(vec![lang("typescript", "ts", vtsls)]);
let (mgr, events) = manager(&root, registry);
let doc = DocId::next();
mgr.did_open(doc, &path, &LanguageId::new("typescript"), 1, &text);
let case = format!("{library}, declared: {declared}");
let unknown = retry("unknown property diagnostic", Duration::from_secs(90), || {
let found = events.lock().iter().rev().find_map(|e| match e {
IdeEvent::Diagnostics { path: p, items, .. } if p == &path => Some(
items.iter().filter(|d| d.message.contains("Unknown property: 'colr'")).map(|d| d.range).collect(),
),
_ => None,
});
async move { found.filter(|v: &Vec<_>| !v.is_empty()) }
})
.await;
assert_eq!(unknown.len(), 1, "{case}: one copy of the plugin, {unknown:?}");
assert_eq!(unknown[0].start.line, 3, "{case}");
let list = retry("CSS property completion", Duration::from_secs(30), || {
let mgr = mgr.clone();
async move {
let list = mgr.completion(doc, Pos::new(4, 13), None, Default::default()).await.ok()?;
list.items.iter().any(|i| i.label == "justify-content").then_some(list)
}
})
.await;
assert!(list.items.iter().any(|i| i.label == "justify-items"), "{case}");
let hover = retry("CSS property hover", Duration::from_secs(30), || {
let mgr = mgr.clone();
async move { mgr.hover(doc, Pos::new(2, 4), Default::default()).await.ok().flatten() }
})
.await;
assert!(hover.contents.value.to_lowercase().contains("color"), "{case}: {}", hover.contents.value);
tokio::time::timeout(Duration::from_secs(10), mgr.shutdown_all()).await.unwrap();
}
}
const MDX_BUTTON: &str =
"export function Button(props: { label: string }) {\n return <button>{props.label}</button>;\n}\n";
const MDX_DOC: &str = "import { Button } from \"./Button\"\n\nexport const count = 2\n\n# Hello\n\n<Button label=\"hi\" />\n\n<Button label={count} />\n\n{count.toFixed()}\n";
+3
Переглянути файл
@@ -28,6 +28,9 @@ pub use discovery::{Discovery, discovery_path, kept_token, token_path};
pub use server::{McpServer, ServerOptions, local_address};
pub use tokio_util::sync::CancellationToken;
/// The latest MCP protocol version advertised by the built-in IDE server.
pub const PROTOCOL_VERSION: &str = protocol::LATEST;
use std::path::{Path, PathBuf};
/// The header naming the project a request is about (an absolute path).
+33 -4
Переглянути файл
@@ -184,8 +184,14 @@ pub trait HostApi: Send + Sync {
fn reply_content_tab(&self, client: &str, request: &str, reply: crate::ContentTabReply) -> Result<(), HostError>;
/// The invoking window's editors.
fn open_editors(&self, client: &str) -> Result<Vec<crate::OpenEditor>, HostError>;
/// Opens a validated file and optionally selects a range.
fn editor_open(&self, client: &str, path: &Path, selection: Option<ide_core::Range>) -> Result<(), HostError>;
/// Opens a validated file and optionally selects a range; `as_text` skips custom editors.
fn editor_open(
&self,
client: &str,
path: &Path,
selection: Option<ide_core::Range>,
as_text: bool,
) -> Result<(), HostError>;
/// Changes the selections, or reveals a range, only in an editor of this window.
fn editor_ranges(
&self,
@@ -607,11 +613,14 @@ impl PluginEngine {
pub fn compile_cached(&self, wasm: &Path, cache_dir: &Path) -> Result<Component, String> {
let bytes = std::fs::read(wasm).map_err(|e| format!("{}: {e}", wasm.display()))?;
let file = cache_dir.join(format!("{}.cwasm", self.cache_key(&bytes)));
if file.is_file() {
// Read into memory rather than `deserialize_file`: that maps the file and makes its pages
// executable, which the hardened runtime of the signed macOS app refuses ("failed to make
// memory executable"), so the cache never hit and every activation compiled again.
if let Ok(precompiled) = std::fs::read(&file) {
// SAFETY: the cache directory belongs to the IDE (inside its plugins
// directory) and is written only by `store_precompiled` below from
// components this engine compiled; a corrupt file fails validation.
match unsafe { Component::deserialize_file(&self.engine, &file) } {
match unsafe { Component::deserialize(&self.engine, &precompiled) } {
Ok(component) => return Ok(component),
Err(e) => {
tracing::info!("discarding precompiled {}: {e}", file.display());
@@ -3029,6 +3038,26 @@ impl Runtime {
mod tests {
use super::*;
/// The second compile of the same component loads the cached one instead of compiling and
/// writing it again (a failed load deletes and rewrites the file).
#[test]
fn a_precompiled_component_is_loaded_from_the_cache() {
let engine = PluginEngine::new().unwrap();
let wasm = Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/hello/dist/plugin.wasm");
let cache = tempfile::tempdir().unwrap();
engine.compile_cached(&wasm, cache.path()).unwrap();
let cached = || {
let entries: Vec<_> = std::fs::read_dir(cache.path()).unwrap().flatten().map(|e| e.path()).collect();
assert_eq!(entries.len(), 1, "{entries:?}");
let file = entries[0].clone();
(std::fs::metadata(&file).unwrap().modified().unwrap(), file)
};
let before = cached();
std::thread::sleep(std::time::Duration::from_millis(20));
engine.compile_cached(&wasm, cache.path()).unwrap();
assert_eq!(cached(), before, "loaded, not compiled and stored again");
}
#[test]
fn readonly_field_extensions_are_parsed_and_unknown_or_malformed_fields_are_skipped() {
let fields = [
+14 -8
Переглянути файл
@@ -1211,14 +1211,10 @@ impl editor::Host for StoreData {
.map_err(to_wit))
}
fn open(&mut self, path: String, selection: Option<wit::Range>) -> Fallible<()> {
if let Err(e) = self.require_window() {
return Ok(Err(e));
}
let real = match self.openable_path(&path) {
Ok(p) => p,
Err(e) => return Ok(Err(e)),
};
Ok(self.host.editor_open(self.client().unwrap(), &real, selection.map(core_range)).map_err(to_wit))
self.open_editor(path, selection, false)
}
fn open_as_text(&mut self, path: String, selection: Option<wit::Range>) -> Fallible<()> {
self.open_editor(path, selection, true)
}
}
@@ -1227,6 +1223,16 @@ fn core_range(r: wit::Range) -> ide_core::Range {
}
impl StoreData {
fn open_editor(&mut self, path: String, selection: Option<wit::Range>, as_text: bool) -> Fallible<()> {
if let Err(e) = self.require_window() {
return Ok(Err(e));
}
let real = match self.openable_path(&path) {
Ok(p) => p,
Err(e) => return Ok(Err(e)),
};
Ok(self.host.editor_open(self.client().unwrap(), &real, selection.map(core_range), as_text).map_err(to_wit))
}
/// A `project` resource's path: inside the resource's root, or — for a
/// project window group — inside any of its member roots (as the editor and
/// LSP resolve them). When no root accepts the path, the resource root's own
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
8a08e92c30faaa683e531fd91c8a69392d75165cff62153e216008f7abbcb1ea
8da08e3230812e4f7cf875362c095ac4885c3262636e51b111e95f2fd962e08a
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
de08e41d78da65ee3de2c709112e8d8905b50432bd59af1701dd633f674fa121
9ebd066471e76d6261ab1b4b1e057a85bfdd9abb9f596149798d573336a6d1af
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
455c833fc7d02c083a1ae67d1df507f29581f77d7f8624ff562f1ce982efc730
cb058e76b7f4d12ea56b157481874f076fd7d549ae15b11cf914e9af56417331
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
a891db4b18f175648ec47a6c1e20edde0ff266d38b37a1fd2acc8f95ddf0d5b4
58b531185ceaefbfcd78c62663717d0875aefc20b7f63bcd9cd2f412defbf9a9
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
30f99018d1c6e518fbc179b2090a7f65856e10b9bed4bb76e605d88acec86393
89e515fce0e0cd4029a46c066a2b65592a22178ea77907c520beba447b6bb502
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
39e361f892aa0944bc3eac5a2a9f5a7133deced54ca28193f8d789eaccc1a326
4e9714318c72fd137fb71234b00f48378256a7558328414aee1911f9eca640bf
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
f36cf494eb56ebb9d6459a0b84b854ce413eed79e563074bc850de3ee4a4bb2d
37f6ac9b07a333793798fd909fec9940fdffadd305a0ae1f15d50a918a6e738b
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
ea314de1d7cdf468b69603bda1766c7361497c9a50fc3e43ab508592d1861fe7
46b9a5d0dd6670ae30c5c35909c02bc583e6ce4368aaa0df9aaaf917f141ccbe
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
218dbcd47abeb8ef4b06e13cbbfdd7e24790c11f27c352ce95cfbb6cba61a062
c029e8c5d44bd10bfc962747643033ad661406a4e71266060b83b479528ac62f
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
78bad0a6062a0131527a700e0b75ca24fd96162e8fe326b45b5a96c8da8723b4
df74de6fd1067530b30e32dc9955d2540cc11a84ab366c1d55286b1f666171d3
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
f90db44c3df10b60fca9e337eba1d3269d8299ca06f5e60cbd9ab7dd65d32fba
010115b90cf7c62b304a419a85d2bf1e87a08cf8b71a22b83db7228c74fc879c
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
72aac6f440205694028e52df9932340131f6f30d89fbe3e9363a97110c912336
4d64d801f5b861964a90907eb2d35fcfaac0fd5bba32f6fa739d419370ad34bb
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
366172ef7c2d4d2d218d3a653763852983b0af21e7e79ee644c4c216b64b2665
91dbf215e6388c1c4c8f09a8194d66888b0060bb44ee590b63a25aa3f8b1cdf8
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
3eac3cab007df8f12e89b044f02348f564a5ec53376743ffccaacc6df383fd37
b83536a1c2620edaddc9712ebfcc284d83fd59054f17b4e10c99f3d55fe0a8bf
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
3dab8c8f0177ab0de22a6daccc374c7aaa7e37f6959815edee5641d45bffa3ab
2af8aa827092f59d6faa02d4084f79a66bda9ef5211a1450542361702d04e7ae
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
834b90f241c89b7f24217f4ea579810de703da23806b7e21113df5a43ea20dbb
93c276cf31b807543d700c2010a128741b269d897993882ff378061b1ed0b56d
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
dbff03557f56e4483e8770c1dcca455c78f4331265613a93475ee28a8c581d79
ed76d43bce1e0801aac9010ccbb6d6e5cb680283df6467961156d3ae7a6c3177
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
e674c90857e859a6a7684f9d7899dbdf05f9fe5d310ed809def6bf5403877bda
c2c601d62f588a9618844e46e62998e26389a4eaaba1f3be90d0c70c6c19050a
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
0e856198f5839dc675afcc883b43aa9c950c4f73807fe0b1145d976e00bbf2f4
10eeb474973e8dea250698a0322ce19705ec86beef29730500ebe611d3f796fa
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
b693136d64688418665ef010b5cb83b86fc4b0adc052b7783530cc53d863085e
3d65392e8a6723b33061b243deace1e6ede4d6d258c4c16719ed7533a2b1e3b1
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
cb07913a6a7a1f61521818ffada5b59b8b30e08bc5ef3ed21a9d3a1924ac4445
33396b01be200316e5922b6db22e0bd498aad4c77a52254b24134c31c1f7a256
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
47642c0e293829c19528d85d6058b0ea08d68d3380032c4e04937322c88178a2
7a98500c653f18188570c91cadc4fc3c7e2bed2fcdd2ba8945a98bc13b7c5af4
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
61cc8a30b6db4a50502b014e4849365cd25b86cc197305d570241186bb1bdbaf
7ac9e871f691e989cdef0d4ac3baf8fa338114ad906befd229a124e50897898d
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
72c8ce5f05dd3425fad3e9d8928a06f79f258beaaabcde7f14d5c1c65d3c2d97
e6bfa4a44f635fafd16103235424e40b8cd6849ed83f582af84fc9baac800882
+1 -1
Переглянути файл
@@ -1 +1 @@
667102db97617a5149e1a4fb1f81bb57a25cf0265cf08b37f76a976b42bd54a8
7eccc42692e9d289e15fe131195ed67ebe9102f387cef02da19a581f37d729dc
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
70b2bd11475b9cafb21ebe8cd2dfc888e442c9de0220d93c85fb3a25b45e96da
a09c1f93e121b27d71bb6ac717a1222e240799f2bc0a6def8805ab4a62bed1a6
Loaded 100 of 490 files, more files were not shown because too many files have changed in this diff. Show more