Commit Graph
3370 Commits
Author SHA1 Message Date
l0ng-ai f8ec222a0d fix(run): integrate the Run Anything command field into the popup (#5111)
The Run Anything command field now sits directly on the popup surface. A single inset divider shows keyboard focus. The command row is 14 px shorter, giving the scrollable results the extra space in short windows.
2026-11-22 11:29:49 +08:00
l0ng-ai aad0573fb9 fix(refactor): introduce a Go variable where gopls offers only a constant (#5110)
⌥⌘V on `1 + 2` in `println(1 + 2)` (Go) answered "Selected block should represent an expression". gopls 0.24 offers only **Extract constant** (`refactor.extract.constant`) for a constant expression — checked with a small LSP script against the installed gopls: both `only: ["refactor"]` and `["refactor.extract"]` return just that action. No action mapped to Introduce Variable, and the syntax-based fallback deliberately stands back when a running server answers nothing (`reason: "empty"`).

When the server's answer contains another introduce-kind extraction for the selection, the server evidently takes it for an expression, so `runRefactoring` now calls the fallback with a new reason `otherKind`, which builds the variable from the syntax tree (`value := 1 + 2`, as GoLand does). An empty answer otherwise still means no fallback.
2026-11-22 11:28:17 +08:00
l0ng-ai 8ea0052a7f fix(editor): continuation indent after a Kotlin when arrow or assignment (#5109)
In Kotlin, Enter after `1 ->` in a `when` (with the body still to come) or after `val answer =` kept the line's indentation (8 and 4 spaces) instead of continuing one level deeper (12 and 8), as IDEA does. Kotlin uses CodeMirror's legacy C-like mode, whose indentation does not know either construct.

An indent service for the Kotlin mode (`EXTRA_SUPPORT` in `languages.ts`) adds one level after a line ending in `->` or in an assignment `=` (not `==`, `!=`, `<=`, `>=`), with nothing after the caret and no bracket left open.
2026-11-22 11:25:27 +08:00
l0ng-ai b20e0b0902 fix(editor): continue Rust /// documentation comments on Enter (#5107)
Enter after `/// Summary` above a Rust function gave a blank line: `enterInLineComment` only splits a comment when text follows the caret, so at the end of the line nothing continued the documentation. RustRover (and Rider for C#) continue documentation line comments.

`enterAfterDocLineComment` handles Enter at the end of a `///` line (Rust, C#, Dart, Swift, F#) or a Rust `//!` line: the next line gets the same indentation and prefix, caret after `/// `. Plain `//` comments and `////` banners are unchanged, as is Enter in the middle of a comment (still split by `enterInLineComment`).
2026-11-22 11:21:28 +08:00
l0ng-ai e3fca1bb6f fix(editor): keep the caret where the comment commands put it (#5106)
Two caret problems with the comment commands, seen in Go, Rust and Kotlin:

- **⌘/, Undo, Redo**: the comment came back but the caret went to the line above (L2 instead of L3). As with Delete Line and Move Statement, CodeMirror's history maps the pre-command caret through the change on Redo unless a selection was recorded after it; `commentLine` now records its resulting caret (and keeps its repeated-⌘/ detection on the state after that).
- **⌥⌘/ on a blank line without a selection** inserted `/*  */` with the caret before it. It now inserts the language's empty block comment with the caret between the delimiters (`/* | */`); lines with code keep the existing behaviour.
2026-11-22 11:18:58 +08:00
l0ng-ai bfea07a30e fix(editor): keep a Rust lifetime's apostrophe single (#5105)
With quote pairing on, typing `'a` between `<>` in `fn borrow<>() {}` gave `fn borrow<'a'>() {}`, and `&'a` got a stray quote too: `closeBrackets()` pairs `'` wherever no word character precedes it, and Rust's apostrophe also starts lifetimes.

`rustLifetimeQuote` (an input handler for Rust, under the Insert pair quote option) inserts a single `'` where a lifetime goes: after `<`, `&` or `+`, and after `,` or `:` inside angle brackets (`<'a, 'b>`, `<T: 'static>`). Lifetimes earlier on the line are ignored when counting brackets. A char literal (`let c = '`, `f('a', '`) still pairs.
2026-11-22 11:17:13 +08:00
l0ng-ai 4d5648c38d fix(editor): add the parameter list when completing a bare function header (#5104)
Complete Current Statement (⌘⇧↵) after `func f` (Go), `fn f` (Rust) or `fun f` (Kotlin) produced `func f {` / `|` / `}`: a body without a parameter list, which does not compile. A header that names a function (after any modifiers such as `pub async`, `private suspend`, and optional type parameters) but has no `(` yet now gets `()` before the body; the caret goes into the body as before. `pub async fn …` is now recognised as a block head too.
2026-11-22 11:15:17 +08:00
l0ng-ai fbcbfb648c fix(vcs): align Git Log commit message typography (#5103)
Git Log now uses the editor's configured font, size, and weights for commit subjects and descriptions. Authors, dates, branches, and signatures use smaller UI text and tighter spacing. Long metadata can wrap inside the details pane.
2026-11-22 11:14:45 +08:00
Charlie.Weiandcharli117 bf2478934e feat(plugins): deliver caret-moved events (API 1.15) (#5119)
Plugin API 1.15 adds a caret-moved event through the existing events.other channel (no WIT interface or signature change): {path, line, col, settled} with 0-based UTF-16 positions for the focused editor. The frontend batches caret moves after 120 ms (only the latest position per file) and sends one settled event 600 ms after the caret rests; queued and delayed events are dropped when the editor, document, path or project changes. editor-focused now carries the focused editor (path, language, selections) through an optional argument on plugin_set_active_file, which the remote adapter forwards. Requires the events capability; components and fixtures are rebuilt for 1.15.

Co-authored-by: charli117 <24435100+charli117@users.noreply.github.com>
2026-11-22 10:43:27 +08:00
l0ng-ai 8f252398fe fix(debugger): adapt frames and variables to side docks (#5102)
The Debug tool window puts the call stack above Variables when docked on either side, giving both panes the full dock width; in the bottom dock the panes sit side by side. Each orientation remembers its divider position.
2026-11-22 10:35:18 +08:00
l0ng-ai 54c7cbc3b0 fix(problems): adapt the preview to the dock position (#5099)
In a side dock, Problems puts the severity and navigation toolbar above the list and the source preview below it, both at the full dock width; in the bottom dock the list and preview sit side by side. Each orientation remembers its divider position.
2026-11-22 10:08:12 +08:00
l0ng-ai 1fd9246ccc fix(structure): put tree controls in the tool window header (#5097)
The docked Structure tree starts directly below the tool window header, gaining 32 px of vertical space. The header's View Options menu groups sorting and member filters, and the existing Options menu holds Expand All, Collapse All and the two source-following commands.
2026-11-22 09:45:38 +08:00
l0ng-ai 7b6ac0d5a8 fix(run): keep session tab controls visible in narrow panels (#5096)
Run session tabs fit the available space in the tool window header. Long names shorten to keep the close or pin button visible, and hovering shows the full name and, for completed runs, the duration and exit code.
2026-11-22 09:24:47 +08:00
l0ng-ai d764f9cae1 fix(search): keep distinguishing folders visible in search results (#5095)
Search Everywhere shortens long directory paths before the last folder in Files and Classes, so same-named results stay distinguishable; hovering shows the full directory. File names keep their extensions visible when the name fits on the row.
2026-11-22 08:59:37 +08:00
Muuandmuutot 3908b70b61 fix(ui): match JetBrains compact Tree.border insets (#5100)
Compact Mode reduced tree row height and the island gap, but the tree's horizontal inset stayed at 6px, leaving compact trees 2px wider on each side than JetBrains' compact Tree.border (2,8,2,8). The --tree-inset token now steps 6px → 4px in Compact Mode, so island gap plus inset is 12px normally and 8px compact.

Co-authored-by: muutot <92625353+muutot@users.noreply.github.com>
2026-11-22 08:50:19 +08:00
l0ng-ai c1f0a85718 fix(diff): keep status and viewer tools together (#5094)
The single-file diff toolbar keeps the comparison status beside Settings and the other viewer tools, in a group that can wrap to a second row so longer comparison messages stay readable. At toolbar widths of 520 px and below, the viewer layout, collapse and synchronized scrolling commands are available from Settings.
2026-11-22 08:37:37 +08:00
l0ng-ai acdd88f0f7 fix(debugger): group variable and watch context menu actions (#5093)
The debugger variable menu groups Set Value with Copy Value and Copy Name, and watch creation and field watchpoints get their own group when available. The watch menu puts Remove Watch and Remove All Watches first, above value and source commands.
2026-11-22 08:15:54 +08:00
l0ng-ai 1f8c869293 fix(vcs): group Commit changes menu actions by workflow (#5092)
The Commit changes menu leads with Commit, Rollback and Move to Another Changelist in the change-list workflow, and with Stage and Unstage in staging mode. Diff, source and path-copy commands are grouped together, and the two patch commands sit next to each other.
2026-11-22 07:53:31 +08:00
l0ng-ai f3928b3553 fix(terminal): organize the output context menu (#5091)
The terminal output menu puts Find and session commands first, then groups Copy, Paste and Select All above Clear Buffer and the split commands. Find opens the search bar with the selected text as the query.
2026-11-22 07:31:15 +08:00
l0ng-ai 5161d266ab fix(console): give the search field more room in narrow panes (#5088)
The console search field no longer shares a row with its matching options in a narrow dock: below 224 px the clear and matching controls move below the query. The match count uses the small UI font with tabular digits and sits beside the previous and next buttons.
2026-11-22 07:11:38 +08:00
l0ng-ai b30b30311f fix(workbench): keep toolbar controls readable in narrow windows (#5087)
The main toolbar shares the available text width between labels, so long project and run configuration names give up space before short branch names. At the minimum window width, dropdowns with leading icons show just those icons with their tooltips, while Run, Debug and the window buttons keep their hit targets.
2026-11-22 06:47:40 +08:00
l0ng-ai c9c6d87a14 fix(vcs): group Git Log commit context menu actions (#5086)
The Git Log commit menu puts revision copying and patch creation at the top, then separates comparison from operations that change the repository. Cherry-pick sits with the other commit operations, parent and child navigation sit together, and both bookmark actions share a group.
2026-11-22 06:17:56 +08:00
l0ng-ai 97ffd9aae9 fix(project): group Project view context menu actions (#5084)
The Project view puts Rename beside Refactor and Delete, with a separate group for Reformat Code and Optimize Imports. Jump to Source follows the clipboard actions; Local History, Git and Reload from Disk share a group, and comparison is separated from directory roles and file colors.
2026-11-22 05:58:37 +08:00
l0ng-ai 5e39650886 fix(editor): organize the editor tab context menu (#5081)
The editor tab context menu puts Close All Tabs beside Close Other Tabs, followed by the more specific close commands. Copy Path/Reference gets its own group above the splits, each split sits beside its split-and-move action, and pinning, opening a new window and configuring tabs share a group.
2026-11-22 05:42:00 +08:00
l0ng-ai 444c315d57 fix(platform): paste the primary selection only over editable content on Linux (#5089)
WebKitGTK pastes the primary selection on a middle-button release into the focused editable, wherever the release lands, so closing a tab with a middle click pasted into the active editor (and a middle click on a tree, tool window or the terminal did the same). Middle-button releases outside editable content now cancel that paste; a middle click in the editor or a text field still pastes.

Fixes #5079
2026-11-22 05:23:22 +08:00
l0ng-ai a4bea25ae3 fix(editor): group clipboard, search and open actions in the context menu (#5080)
The editor context menu keeps Cut, Copy, Paste and Copy / Paste Special together, with clipboard shortcut labels that follow the host platform. With a selection, Find in Files sits with the other search and navigation actions, and Split Right sits next to Open In, above Local History and Git.
2026-11-22 05:23:10 +08:00
Emir 84b1770da4 feat(i18n): detect the system language on first launch (#5082)
When the global settings.toml is missing, OpenIDEA now saves the OS's preferred UI language (NSLocale on macOS, GetUserPreferredUILanguages on Windows, LC_ALL/LC_MESSAGES/LANG elsewhere) as appearance.locale, mapped to one of the shipped UI languages with English as the fallback, and loads that catalog before the workbench renders. An existing settings file keeps its saved language. The mapping lives in ide-workspace next to the settings store, and a test keeps its locale list in step with the frontend's.

Co-authored-by: laot7490 <70145288+laot7490@users.noreply.github.com>
2026-11-22 05:23:06 +08:00
arookieofc-ai 88295ecca8 fix(e2e): track tightened status bar height in compactMode sizes (#5083)
#5037 tightened the standard status bar to 30 px; the Compact Mode e2e still expected 34 px for the normal density.
2026-11-22 05:17:47 +08:00
l0ng-ai e87aee5969 fix(editor): make the Expressions chooser compact and readable (#5077)
The Expressions chooser uses one compact column for both the refactoring action and the syntax fallback. Multiline candidates show their first source line followed by an ellipsis, while selecting a row still highlights and uses the full expression; the highlight clears when filtering leaves no active row.
2026-11-22 05:02:33 +08:00
l0ng-ai 84d8be1181 fix(window): show minimize and maximize on Linux without a desktop session (#5085)
With no desktop session (WSLg, a bare compositor) GTK reports its built-in decoration layout, close only, so the frameless title bar had no way to minimize or maximize the window. The desktop's gtk-decoration-layout is now used only when a desktop session is running (XDG_CURRENT_DESKTOP, XDG_SESSION_DESKTOP or DESKTOP_SESSION); otherwise the title bar shows minimize, maximize and close.

Fixes #4421
2026-11-22 04:42:35 +08:00
l0ng-ai 27cbdb1ba6 fix(editor): preview changes in the Unwrap or Remove chooser (#5075)
The Unwrap/Remove chooser uses a compact list of action names. The selected action previews the kept and removed code in the editor; switching rows leaves the caret and scroll position in place, and Escape dismisses the chooser and clears the preview.
2026-11-22 04:42:22 +08:00
l0ng-ai 1005dc1363 fix(editor): lay out inline refactoring names as a lookup list (#5072)
Inline refactoring name suggestions align with the identifier being edited. Rows follow the editor font and zoom, with a separate footer for the shortcut; the list fits inside the editor and scrolls to keep the active suggestion visible.
2026-11-22 04:25:59 +08:00
l0ng-ai 3f3cdeba0d fix(editor): make the Generate chooser compact and scannable (#5069)
Generate now uses the compact, caret-anchored action chooser. Constructors, accessors, overrides and tests get distinct icons at the standard action-list size, and the chooser keeps its width while typing to filter.
2026-11-22 04:03:48 +08:00
l0ng-ai 9b8c88e1ee fix(editor): show the opening line of offscreen scopes (#5068)
When the caret reaches a closing delimiter whose opener is above the viewport, the opening line of that scope (with the declaration above a brace on its own line) is shown at the top of the editor after a short pause, in the editor's font, line numbers and colours. Caret and scroll stay put; it follows the brace highlighting setting, closes on Escape, and stays hidden when Sticky Lines already shows the opener.
2026-11-22 03:42:22 +08:00
l0ng-ai 392574fe2a fix(ui): don't show a scrollbar over content that fits after a resize (#5016)
A scroll range of one pixel or less is WebKit rounding after a resize (a splitter drag leaves scrollHeight 319 over clientHeight 318), not content: the overlay scrollbar and the editor scrollbar thumb no longer show for it.
2026-11-22 03:40:25 +08:00
l0ng-ai 41829e74db fix(editor): keep inline hints aligned with source text (#5066)
Inline hints use a size one pixel under the editor font, sit on the text baseline with even padding, and stay a single label when lines wrap, so they no longer shift or split around the source text.
2026-11-22 03:16:31 +08:00
l0ng-ai aee21233fb test(lsp): pass a lazy action's resolve data as a string (#5078)
CodeAction.data is serialized JSON on the IPC boundary; the test added in #5074 gave it an object, which pnpm typecheck rejects.
2026-11-22 03:04:29 +08:00
l0ng-ai 17f5889037 fix(diff): make collapsed unchanged lines easier to find and expand (#5065)
Collapsed unchanged lines in the diff viewer are now a full-width button: a chevron, the line count in UI type and a hatched rule in the separator colour, with hover and focus states. Clicking it or pressing Enter expands the range in both panes and returns focus to the editor.
2026-11-22 02:57:36 +08:00
l0ng-ai ff6c6eb13f fix(editor): restore the caret of Move Statement on Redo (#5063)
Redo of Move Statement Up / Down left the caret where the move started: CodeMirror's history maps the selection from before the edit through it unless the command records the selection after. Both the structural and the line-based move now record the caret they set, so Undo / Redo put it back.
2026-11-22 02:50:09 +08:00
l0ng-ai ac015847a3 fix(editor): remove unused imports in Optimize Imports for TypeScript (#5062)
Optimize Imports in JavaScript / TypeScript now removes unused imports first: typescript-language-server's organize imports only sorts and merges them, and removing the unused ones is its own source.removeUnusedImports action. Optimize-imports-on-save does the same.
2026-11-22 02:46:43 +08:00
l0ng-ai 4c774d2e8e fix(refactor): find TypeScript extractions for Introduce Variable and Extract Method (#5061)
typescript-language-server answers code actions with refactorings only when `only` contains a kind that contains `refactor`; asked for `refactor.extract` it returned nothing, so Introduce Variable and Extract Method refused the selection. JavaScript / TypeScript now ask for `refactor`; the actions are still mapped by their own kind, and other servers keep the narrow kind.
2026-11-22 02:43:04 +08:00
l0ng-ai 8adbbd1b05 fix(lsp): apply refactorings that resolve their edit lazily (#5074)
TypeScript Introduce Variable, Extract Constant and Extract Method did nothing with vtsls: its refactoring actions carry resolve data and a follow-up command but no edit, and an action was only resolved when it had no command either. The resolved edit then failed on a create of the edited file marked ignoreIfExists, which the conversion dropped.

- Resolve an action without an edit whenever it carries resolve data (interactive path and lsp_apply_code_action).
- Leave out create / rename operations their ignoreIfExists makes no-ops, and deletes their ignoreIfNotExists does.
2026-11-22 02:41:50 +08:00
l0ng-ai c207e57686 fix(editor): preview folded code on hover (#5060)
Hovering a folded region's placeholder shows the folded lines in a tooltip: highlighted as in the editor, with line numbers when the gutter shows them, up to 80 lines, aligned to the pane edge. It closes on Escape, scroll or a fold change. The sticky-lines renderer shares the line rendering.
2026-11-22 02:36:02 +08:00
l0ng-ai ac0a56d1ec fix(editor): show font size feedback when zooming (#5059)
Wheel or keyboard zoom now shows the current font size at the bottom of the editor pane that changed, with Reset Font Size and a link to Editor > General. It stays while hovered or focused and dismisses after five seconds; LightEdit gets the same reset.
2026-11-22 02:32:38 +08:00
l0ng-ai 07cbb560df fix(agents): give agents every root of a multi-project workspace (#5071)
A task's agent only learned its own directory, so in a workspace with attached projects it missed the other projects and left their part of a change undone.

- Sessions pass the workspace's other roots (the project and the trusted attached projects, minus the task's own directory and project) as ACP additionalDirectories to agents that advertise the capability.
- The Codex shim turns them into runtimeWorkspaceRoots on thread start, resume and fork, so workspace-write covers them and the model is told about them; the Claude Code shim passes each as --add-dir.
- New read-only MCP tool get_workspace_roots lists the roots, and the server instructions point to it for workspace questions and changes that span projects.

Fixes #5058
2026-11-22 02:17:09 +08:00
l0ng-ai 88936106ab feat(editor): documentation stub tags for TypeScript and Python docstrings (#5057)
Insert documentation comment stub filled tags in for PHP only.

- **JavaScript / TypeScript**: `/**` + Enter above a function declaration, method, constructor or arrow function assigned to a `const` now lists `@param name` for each parameter (parameter properties, rest and defaulted parameters included) and `@returns` when a non-void result type is declared. Calls and statements get no tags.
- **Python**: Enter between the quotes of a `"""` (or `'''`) opened on the first line under a `def` expands it into a docstring, as PyCharm does with its default reStructuredText format: the summary line, `:param name:` per parameter (`self` / `cls` skipped, `*args` / `**kw` by name) and `:return:` (not for `__init__` or `-> None`), then the closing quotes.

Both follow the existing Smart Keys › Insert documentation comment stub option.
2026-11-22 01:56:46 +08:00
l0ng-ai 78041f3745 fix(editor): complete arrow functions, open brackets and Python headers (#5056)
Complete Current Statement (⌘⇧↵) in TypeScript and Python (both use the text rules in `completeStatementSpec`):

- `const f = (x: number) =>` became `=>;`. An arrow function now gets a block body, followed by the brackets still open and a `;` where the statement needs one: `=> {` / `|` / `};`, `items.map((x) => {` / `|` / `});`.
- `const obj = { name: "Ada"` became `{ name: "Ada";`. Brackets the line opened and left open are now closed before the `;` (`{ name: "Ada" };`, `foo(a, bar(2));`); a line ending in `,` or `{` is left to continue.
- Python `async def …`, `with …`, `except …`, `case …`, `match …`, `async for …` got no `:`. Every compound statement header now gets one; `match = 5` and `case.x` stay statements.
2026-11-22 01:56:40 +08:00
l0ng-ai d0eeb5e8c3 fix(editor): type over a closing bracket that already closes a pair (#5054)
`closeBrackets()` steps over a closer only when it inserted that closer itself during the session. So with `value = (1 + 2|)` in a reopened file (or code pasted / written earlier), typing `)` gave `(1 + 2)|)`; same for `]` and `}`. IDEA types over a closing bracket that already closes a pair.

`skipClosingBracket` (an input handler next to `skipClosingQuote`, under the Insert pair bracket option) steps over the bracket at the caret when the syntax tree matches it to an opener and the line has no more openers than closers of that kind outside strings; otherwise the bracket is inserted (`f(g(x|)` still gets its missing `)`). Multi-line pairs (`foo(` … `)` on a later line) are stepped over too.
2026-11-22 01:52:21 +08:00
l0ng-ai 5a9783dbf0 fix(workbench): keep tool window header actions in view (#5053)
Tool window titles and tabs give up width before the header actions, so Options and Hide stay at the right edge of a narrow pane. A shortened title keeps its full text on hover. When the contributed controls need more room, their strip scrolls independently while Options and Hide stay in place.
2026-11-22 01:51:01 +08:00
l0ng-ai 74c2757a7a fix(editor): dedent after return and realign bare except: in Python (#5052)
Two Python indentation gaps against PyCharm:

- Enter after `return 1`, `pass`, `raise …`, `break` or `continue` kept the block's indentation. The dedent rule existed only in `fallbackIndent`, which steps aside when a language mode is loaded (Python has `@codemirror/lang-python`). An indent service for Python now applies it: one level out, unless a bracket is still open (`return foo(`) or text follows the caret.
- Typing a bare `except:` inside a `try` body left it indented: the stock `indentOnInput` pattern and `Body` rule only know `except ` with a space. `except:` now triggers reindentation and aligns with its `try:` (or a previous `except`).

Both are added through `EXTRA_SUPPORT` for the Python mode (`src/editor/core/cm/languages.ts`).
2026-11-22 01:50:44 +08:00