In the TODO and Find in Files previews (also Search Everywhere, Bookmarks and Show Usages) and on a diff's editable side, shortcuts of editor actions fell through to CodeMirror's defaultKeymap: with the macOS IntelliJ keymap, Option+Up (Extend Selection) moved the line and changed the file, Option+Shift+Up copied it, and Cmd+D ran Show Diff in the TODO preview; on Windows/Linux Alt+Up/Down moved lines.
Previews now publish embeddedEditorFocus while focused, so text actions that need only the view run on them as in a diff pane, and Show Diff no longer takes Cmd+D there. Previews and diff panes use the editor's base keymap, and embeddedEditorKeys drops CodeMirror's own edit for any key the IDE keymap gives to an editor action (history keys included), so where that action needs the file editor the key does nothing. The Find preview's ad-hoc key claim is replaced by the same rule.
Co-authored-by: ntbang0901 <[email protected]>
Load Changes from Disk and File > Reload from Disk replaced the text but kept the buffer's old line separator, so after another program rewrote a CRLF file as LF the next save converted every line back; only the watcher's reload re-detected it. The read-only state was read once on open, so a file made read-only outside the IDE still accepted edits and autosave wrote it.
The watcher reload, Load Changes from Disk and Reload with Encoding now share take_disk_text, which takes the separator found in the new text (.editorconfig's when set; text without a line break keeps the buffer's) and the file's write permission. The watcher and focus check also follow a permission-only change, and a new IdeEvent::DocReadOnly updates the status bar lock, the read-only banner and the editor (library sources stay read-only).
Co-authored-by: ntbang0901 <[email protected]>
The TODO preview, Problems preview, notebook cells, HTTP response bodies and database text views drew file text in JetBrains Mono 13 px whatever Settings › Editor › Font said, and the Find in Files, Search Everywhere and Bookmarks previews kept the font they were opened with: each CodeMirror view set the editor font on itself, so a view that built its own editor or plain text never got it. The family, size and line height are now set on the root next to the weights, editor themes take ligatures from the root's switch, and those views read them, so all of them follow the setting and its changes. Previews and diff panes draw tabs at the file's tab size (its open document's, else its Code Style) instead of a fixed 4 or 8. In Tools › Terminal, "Use editor font" also disables Size, and disabled font fields show the font actually in use (likewise Agents › Chat's "Use interface font").
Closes#8168
Co-authored-by: ntbang0901 <[email protected]>
Join Lines on a line ending in a `//`, `#` or `--` comment turned the next line's code into comment text. Like IntelliJ's JoinLinesHandler, a line comment that code would follow now becomes a block comment (`int a = 1; /* first */ int b = 2;`); where the language has no usable block comment there (Python, Ruby, Lua), the comment moves to the end of the joined line.
Move Statement Up/Down in JSON swapped whole lines with their commas, leaving a missing or trailing comma. Moved members and array elements now take the commas of their new places, also when moving into or out of a nested object or array, and nothing moves out of the top-level value.
Co-authored-by: ntbang0901 <[email protected]>
#8172 recorded a cross-file Markdown preview link's origin by moving the source editor's caret before opening the destination. In Split mode that selection pulled focus back into the source editor while the open was still in progress, so the new destination tab was deactivated at once. In Split mode the clicked line is now recorded in navigation history directly, without touching the caret; Preview Only keeps using the hidden editor's caret, which is the reader's position.
Co-authored-by: arookieofc-ai <[email protected]>
Main's Frontend and E2E jobs failed on stale expectations and one costly selector. The Visual Studio and ReSharper keymap presets (#8106) intentionally bind the caret-selection actions and, on Windows, use Ctrl+Alt+Click to add carets, but the tests still expected every preset to keep the old defaults. `github.issue.refresh` now has a shortcut (#8147), so the menu item's accessible name includes it. `.bannerStack > * + *` (#8167) restyles sibling subtrees on insertion and trips the selector-cost test; `:not(:first-child)` selects the same rows.
Co-authored-by: arookieofc-ai <[email protected]>
Back/Forward now walk through positions in Markdown previews. In Preview Only mode a click records the clicked source line (the preview keeps its scroll) and Back/Forward scroll to the remembered line with a short highlight (none under reduced motion). Same-file #anchor links record their origin and destination in both Preview Only and Split mode; a link to another file records the link line first. In Split mode a plain click in the preview leaves the source editor's caret alone. A clicked position is no longer overwritten by the passive shown-line update, and the Live MDX preview forwards the Back/Forward shortcuts from its iframe.
Co-authored-by: dengliu <[email protected]>
Language servers always received "locale": "en" in initialize. The UI locale (appearance.locale, mapped to a BCP 47 tag such as zh-CN) is now sent, and running servers restart when it changes, so servers with localized messages follow the UI language.
Adds Settings > Editor > Code Editing > Error Highlighting > "Show diagnostic source and code on hover" (on by default) to hide the source/code line under each problem in editor tooltips; the Problems tool window still shows it.
Closes#8156
Co-authored-by: wildcatDownstairs <[email protected]>
Clicking Previous/Next Occurrence in the editor's Find bar moved keyboard focus onto the button, so Ctrl+V did nothing afterwards. The arrow buttons no longer take focus: focus stays in the search field or the editor, whichever had it. Ctrl/Cmd+Enter in the search field now moves focus to the editor with the current match selected (or closes the bar when the query is empty), so a paste replaces that match and the arrows or F3 continue from there.
Refs #8139
Co-authored-by: waht41 <[email protected]>
A Java intention copies the text a string concatenation at the caret builds, with ? for each operand that isn't a literal and a line break where the operands continue on a new line; on a lone string literal or text block it copies the literal's value (escapes interpreted, text block indentation removed). It reads the syntax tree, so it is offered before jdtls is ready.
Plugin language visuals, plugin colours, server code lenses and plugin line markers restarted a 300-400 ms debounce on every trigger and threw away the request in flight. While a project indexes, plugin navigation notifies about every 250 ms, so the request was never sent or its answer was always dropped: a new editor never got its gutter actions. A shared CoalescedRefresh now runs at the latest after a maximum wait and only drops a result older than one already shown.
Fixes#8056
With Fill indent levels on, each stripe started two pixels left of the
indent step it marks: the offset that keeps a 1px guide off the glyph
edge was applied to the step-wide stripes too, so a stripe ended short
of the code and the first one ran into the line's left padding.
The stripes were also painted on the guide layer above the text, which
is right for a thin line but tints a selection and the caret row across
the indentation. As a row background they belong below the selection
layer, where the theme comment already says they are.
Each stop selected the top frame through openFile with a selection, which always scrolled the line to the centre of the editor, so stepping through visible code moved the text on every step. OpenOptions gains scroll: "visible" (leave an on-screen selection where it is, centre an off-screen one); the debugger uses it for the top frame on each stop and for Show Execution Point. Selecting another frame and Jump to Source still centre the line.
Fixes#7963
csharp-ls sends interface, enum, struct and typeParameter as their own semantic token types, but the generic mapping folded them all into the class-name colour, and predefined types (int, string, bool…) also showed in the class colour. The C# Colour Scheme page gains Interface name, Enum name, Struct name and Type parameter (inheriting Class name) and Predefined type (inheriting Keyword); a new C# semantic module tags the tokens, recognising predefined types by their text. The preview shows each new attribute.
Co-authored-by: Inf1mum <[email protected]>
A file opened while csharp-ls was still loading the solution never got semantic colours: its only semantic tokens request timed out (a protocol error the plugin ignores), and csharp-ls sends no workspace/semanticTokens/refresh when the load ends. The semantic plugin now also re-requests when a server's long busy spell settles, the recovery signal inlay hints and code lens already use. Server-initiated refreshes and the unavailable backoff are unchanged.
Closes#8052
Co-authored-by: Inf1mum <[email protected]>
ParseContext.changes() in @codemirror/language handed the parent context's skipped array to the child whenever there was nothing to remap, so a speculative state.update() (paste reindent, Shift+Enter, Move Line, Complete Statement) let StreamLanguage's skipUntilInView push a range past the live document's end into the live state's array. Applying the real transaction then threw RangeError in ChangeSet.mapPos and broke the editor for .properties and other StreamLanguage files longer than the viewport. The patch gives every child context its own skipped array.
Closes#7989
Co-authored-by: wildcatDownstairs <[email protected]>
Adds Editor > General > Appearance > Rainbow indent guides > Fill indent levels (off by default). With it on, each indent level's whitespace is tinted in its rainbow colour at low strength, including code lens rows and blank lines; the caret's and matched-brace levels are highlighted the same way. The setting is declared in the backend settings schema so it can be saved.
Closes#7883
Co-authored-by: Inf1mum <[email protected]>
Find selects the current match, and the selection is repainted inside the match's own mark. The selected text kept the match's foreground, meant for the yellow match fill, so on a dark theme the current match was dark text on the blue selection. Selected text inside a find match now takes the scheme's selection foreground, or the editor's when the scheme sets none.
The All tab of Search Everywhere showed 6 results per group before "more"; it now shows 15, as many as each "more" adds.
Fixes#7972
Reformat applied its edits with scrollIntoView: false and CodeMirror kept scrollTop, so when the formatter added or removed lines above the caret, the caret slid up or down on screen. The edit now measures the caret's viewport row before the transaction and compensates scrollTop after it, falling back to the caret's line block when its row is no longer drawn. Explicit Reformat Code, format on save and the external formatters all go through this path.
Co-authored-by: Greenker <[email protected]>
Go to Implementation(s), Go to Declaration or Usages, Go to Type Declaration and Super Method required an active text editor tab, so they did nothing while a diff had focus. They now run on the focused diff pane when it shows a file's document; revision panes have no document and keep them disabled. Option+Command-click focuses the clicked pane before checking whether the action is enabled.
Closes#7960
Co-authored-by: Pecnikas <[email protected]>
Right after the `(` of a call followed by blanks or a line break, jdtls answers signature help for the enclosing call, so `outer(inner(⏎ args))` showed outer's signatures. The request now asks past those blanks.
Parameter info rows show the parameter list alone, without the method name and return type, and `<no parameters>` for an overload without any.
Fixes#7927
When a commit leaves a file with no local changes, its HEAD/index vs working copy diff tab closes. Pinned tabs, files with changes left after a partial commit, and other diffs (Log, Compare with Branch) stay open.
Closes#7914
Reformat File gains a Rearrange entries option (Python, TypeScript, JavaScript; whole-file scope only, remembered with the other options), and Tools > Actions on Save gains Rearrange code (actionsOnSave.rearrange, off by default), run after Optimize imports and before cleanup and reformatting. Rearranging from either place is quiet when nothing moves.
Refs #7783
Java fields get their own colour scheme attributes under Java > Class Fields: instance field, instance final field, static field and constant (static final field), each falling back through the field kind it refines to Language Defaults > Identifiers > Static field / Instance field. Interface fields count as constants. The resolver and settings preview follow the whole inherit chain; .icls import maps the matching attributes.
Fixes#7643
clangd reports inactive #if/#ifdef branches as comment semantic tokens, which the editor greys out. Projects without a compilation database (such as U-Boot without a board .config) end up with most of a file grey. A new editor.dimInactiveCode setting (default on, so existing settings keep the grey) adds a Dim inactive preprocessor code checkbox under Settings > Editor > Color Scheme > Language Defaults; turning it off keeps the syntax colours of inactive regions and re-decorates open editors immediately.
Co-authored-by: sonnartliao <[email protected]>
Move Caret Up / Down / Left / Right / to Line Start / to Line End and their With Selection variants only acted in text editors. Where no text editor takes such a key, it now acts as the arrow / Home / End key on the focused list, tree, popup or text field, ahead of other actions on the same key; with the completion popup open, Move Caret Up / Down move its selection. Presets are unchanged.
Closes#7714
Semantic highlighting coloured locals only from server tokens, and Intelephense sends none, so PHP variables kept one colour with the option on. PHP now colours variables and parameters from the parse tree with the same name-to-colour rule; property declarations, static property access, $this and the superglobals are left out, and server tokens still win where they arrive.
Closes#7884
In a focused tool window, Select Next Tab and Select Previous Tab select its next or previous content tab (terminal sessions, Run and Find tabs), wrapping around; with fewer than two tabs the key is left to the component. The terminal lets these actions through except on Alt+Left / Alt+Right, which a shell uses to move by a word.
Closes#7890
jdtls resolves nothing for a Java call whose arguments fit no method (an argument being typed, a stray comma), so Go to Declaration reported no declaration. An unqualified call now goes to the current file's method of that name, or offers its overloads; a qualified call still needs its receiver's type and is left alone. The Cmd-hover link probe follows the same rule.
Fixes#7803
Tool windows that borrowed coloured file, status, action or vendor icons (Documentation, Find Usages, GitHub Actions, Logcat, Python Console, NuGet, Python Packages, Jupyter Variables, Ports, the Flutter DevTools windows, Coverage) get dedicated monochrome icons at 16 and 20 px; the coloured originals stay where trees, badges and VCS use them. Database Consoles and Query Workspace get a console icon instead of the table grid, and data source entries use the database cylinder.
Icons in the project view, trees, tabs, menus and several popups take --fg-icon instead of --fg-muted / --fg-subtle, so monochrome icons have the same contrast in dark themes.
Add Configure Current File Analysis… (editor.highlightingLevel, IDEA's PopupHector, Cmd+Alt+Shift+H / Ctrl+Alt+Shift+H) with the three levels None, Syntax and All Problems:
- All Problems (default): everything as before.
- Syntax: syntax and semantic colouring stay; diagnostics and their scrollbar marks leave the editor (Problems still lists them).
- None: plain text; the lezer highlighter is reconfigured out and semantic tokens are dropped.
The level lives in the editor state next to the other per-editor display overrides (cm/localAppearance.ts) and is not saved.
Co-authored-by: muutot <[email protected]>
Add editor.textStart / editor.textEnd and their With Selection variants, mapped to EditorTextStart / EditorTextEnd / EditorTextStartWithSelection / EditorTextEndWithSelection for IdeaVim and imported keymaps.
The plain moves leave a single caret at the document boundary; the With Selection variants extend each selection from its anchor. The actions stay unbound in the default keymaps like the other plain caret moves, so the editor's own Ctrl+Home/End (Cmd+Home/End, Cmd+Up/Down on macOS) keep handling the keys and Navigation Bar, Jump to Source and Move Statement keep their macOS shortcuts.
Co-authored-by: muutot <[email protected]>
After a file or folder was renamed or moved in the IDE, its breakpoints stayed stored under the old path and disappeared from the editor; nothing in the debugger listened to the IDE's file moves. Line breakpoints now follow with their id, properties and status, as do the source lines of method breakpoints and field watchpoints and an open properties popover; Undo moves them back. Where the new path already had a breakpoint on the same line, the moved file's stays. movedPath moves to platform/fileOps so the debugger can use it without importing the editor.
Co-authored-by: ntbang0901 <[email protected]>
Main toolbar items get a 10px pitch and the dropdowns 10/6px insets with a 16px chevron; stripe buttons get 5px padding on both sides; the status bar is 34px with 4px widget hover insets, its breadcrumbs lifted 5px, and the islands keep a 3px inset above it. Language Services moves after the caret position in the status bar. Compact mode keeps its previous metrics.
Fixed-viewport e2e layouts (commit checks, project tree second click, main toolbar label compression next to the New Agent Task button) get room for the wider gaps and the taller status bar.
Co-authored-by: wildcatDownstairs <[email protected]>
A problem whose range is empty (an error at the end of a file ending in a blank line) or covers only a line break was listed in Problems and on the marker bar but not drawn in the editor, because the theme hid CodeMirror's lint point. It now draws one column of the severity's usual underline as a zero-width inline block, so WebKit paints it on empty lines too; hints stay hidden and the reported range is unchanged.
Closes#7784
Co-authored-by: og-orca <[email protected]>
Go to Declaration / Cmd-click on a dependency entry of package.json had nothing to answer it. The reference fallback now resolves dependency entries of dependencies, devDependencies, peerDependencies and optionalDependencies: a name opens the installed package's package.json, a version reveals the package folder in the Project view, and an uninstalled package reports a missing reference. node_modules is looked up from the manifest upwards (hoisted installs, scoped packages); alias, workspace, path and URL ranges are skipped.
Closes#7665Closes#7734
Co-authored-by: Inf1mum <[email protected]>
Java files in Spring projects get gutter icons between beans and the places they are injected: an injection point (field, constructor or @Bean method parameter) navigates to the beans it receives, and a bean declaration to its injection points. One target jumps straight there; several open the inheritance chooser, with candidates marked. The editor asks once per file for a server-independent SpringBeanMarker shape, cancels stale requests and asks again after edits, when the server reports changed markers, or when a server settles or stops. java-analyzer is the first source (java-analyzer/springBeanMarkers, declared in its experimental capabilities); without such a server nothing is requested. Icons follow Gutter Icons, excluded folders and the server's features.
Refs #7140
Co-authored-by: audichuang <[email protected]>
Library sources opened from a language server or from the External Libraries showed a "Library source (read-only)" banner above the editor. They now open read-only without a notice, as the status bar's lock already shows the state; the banner stays for decompiled classes, Git revisions, generated C# sources and whenever there is something to act on (sources to download or choose).
Fixes#7735
Move Statement Up did nothing when the line above ended a function, method or class: the lookup of the statement ending on that line stopped at the closing brace, and the guard against moving code into a function refused the move. Where a function or class body ends, the lookup now takes the whole declaration; if, for and try blocks are unchanged, so Up still moves a statement into them.
Closes#7765
Co-authored-by: og-orca <[email protected]>
Copy or Save As of an open file onto a taken name in a folder the tree had not loaded replaced that file without asking, because the Copy dialog only knew loaded folders and copy_as overwrote its target. The dialog now reads the folder, and copy_as refuses any existing target. Pasting a file from the OS clipboard into its own folder (or dropping it there through another path) and choosing Overwrite trashed the source itself; such a file now gets a copy next to it, checked with a new fs_same_file command, and an overwrite whose import fails or is cancelled restores the old file.
Co-authored-by: ntbang0901 <[email protected]>
With Regex on, Replace in Files read $1_new as a group named 1_new, which does not exist, so matches were replaced with nothing in every file. $1 now takes further digits only while the pattern has that group, and a template naming a group the pattern lacks is reported at the replacement field and changes no file. The editor's Replace now expands the same template, so $0, ${1}, $name and \$1 work there too and an optional group that did not match no longer writes undefined.
Co-authored-by: ntbang0901 <[email protected]>
Roslyn sends records, delegates, extension methods, fields and constants with its own semantic token types (recordClass, recordStruct, delegate, extensionMethod, field, constant), which had no highlight class, so they showed as plain text. Each now maps to the standard type it extends.
Closes#7749
Co-authored-by: ignacyszreter <[email protected]>
Refactor > Move (F6) in a .py file moves top-level functions, classes and variables to another module. The dialog has From file, To file (a .py path in the project, new or existing) and Elements to Move. An embedded ast-based helper, run with the pylsp-rope environment's Python, moves the code with its decorators and attached comments, places it by import-time dependencies, writes the imports both modules need and rewrites module.name uses; from ... import statements across the project go through the existing module-move rewriter. Unsaved buffers are read, a file changed meanwhile is refused, and every changed file is parsed again before the edit is returned. A name already defined at the destination is refused; risky cases are confirmed first. The tests needing pylsp are ignored by default.
Refs #901
Co-authored-by: wildcatDownstairs <[email protected]>
Refactor > Change Signature works on Python functions, methods and classes (their __init__). pylsp-rope has no such command, so the IDE runs an embedded helper with the pylsp-rope environment's Python: rope finds the function, its overrides and calls and renames parameters scope-aware; the parameter list and arguments are rewritten from the ast so annotations, defaults, the * and / markers and keyword arguments survive. Unsaved buffers are read through an overlay, calls rope can't resolve come from the type checker's references, and calls that can't be rewritten or likely mistakes are listed in a confirmation first. The result is a normal workspace edit (Preview, Refactor, one undo). The dialog is the Java one reduced to Name and Default value. The rope tests are ignored by default.
Refs #901
Co-authored-by: wildcatDownstairs <[email protected]>
The Python Rename dialog offers Search in comments and strings (off by default, remembered; in-place rename follows it). Whole-word, case-sensitive matches in comments and string text are merged into the language server's workspace edit, so they preview, apply and undo with it; a rename that gains text matches is always previewed with the matches under Non-code usages, and applying fails if a matched file changed after the preview. Locals and parameters are searched in their function, other symbols in the project's .py / .pyi files including unsaved buffers; symlinks leading out of the project are skipped.
Refs #4968
Co-authored-by: wildcatDownstairs <[email protected]>
.html files under a templates folder open as Jinja2 HTML when the nearest folder above that declares anything declares flask, quart, fastapi, starlette or jinja2 (pyproject.toml, requirements*.txt, Pipfile, setup.cfg, setup.py). A Django project (django declared or manage.py), package.json, angular.json, .git and the home folder end the search; File Types associations and Override File Type win; .htm is untouched; dependency files edited in place are detected again. Template names complete and navigate in extends / include / import / from and in render_template, stream_template, get_template, select_template and TemplateResponse.
Closes#7656
Co-authored-by: wildcatDownstairs <[email protected]>