simvx.ide.state

IDE state management – central signal bus for cross-component communication.

All IDE components connect to these signals rather than referencing each other. Uses simvx.core.Signal (not Qt signals).

Module Contents

Classes

Diagnostic

Single diagnostic (error/warning) from LSP or linter.

State

Single source of truth for IDE-wide state.

Data

log

API

simvx.ide.state.log

‘getLogger(…)’

class simvx.ide.state.Diagnostic[source]

Single diagnostic (error/warning) from LSP or linter.

path: str

None

line: int

None

col_start: int

None

col_end: int

None

severity: int

None

message: str

None

source: str = <Multiline-String>
code: str = <Multiline-String>
class simvx.ide.state.State(*, file_opened: simvx.core.Signal | None = None, file_closed: simvx.core.Signal | None = None, file_saved: simvx.core.Signal | None = None, active_file_changed: simvx.core.Signal | None = None)[source]

Bases: simvx.core.file_state.FileStateMixin

Single source of truth for IDE-wide state.

Signals: file_opened(path: str) file_closed(path: str) file_saved(path: str) active_file_changed(path: str) cursor_moved(line: int, col: int) diagnostics_updated(path: str, diagnostics: list[Diagnostic]) goto_requested(path: str, line: int, col: int) status_message(message: str) sidebar_toggled(visible: bool) bottom_panel_toggled(visible: bool) run_requested(path: str) debug_started() debug_stopped() breakpoint_toggled(path: str, line: int) completion_requested(path: str, line: int, col: int) completion_received(items: list) hover_received(text: str, line: int, col: int) format_requested(path: str)

Initialization

property project_root: str[source]
property active_file: str[source]
property cursor_line: int[source]
property cursor_col: int[source]
set_cursor(line: int, col: int)[source]
set_diagnostics(path: str, diagnostics: list[simvx.ide.state.Diagnostic])[source]
get_diagnostics(path: str) list[simvx.ide.state.Diagnostic][source]
property all_diagnostics: dict[str, list[simvx.ide.state.Diagnostic]][source]
toggle_breakpoint(path: str, line: int)[source]
get_breakpoints(path: str) set[int][source]
property all_breakpoints: dict[str, set[int]][source]
toggle_bookmark(path: str, line: int)[source]
get_bookmarks(path: str) set[int][source]
property all_bookmarks: dict[str, set[int]][source]
push_cursor_history(path: str, line: int, col: int = 0)[source]

Push current location onto history stack (for Alt+Left/Right navigation).

history_back() tuple[str, int, int] | None[source]

Navigate backward in cursor history. Returns (path, line, col) or None.

history_forward() tuple[str, int, int] | None[source]

Navigate forward in cursor history. Returns (path, line, col) or None.

goto(path: str, line: int, col: int = 0)[source]
dirty_paths() set[pathlib.Path][source]

Return resolved paths of open buffers with unsaved changes.

Routes through dirty_paths_provider (wired by the IDE app to CodeEditorPanel.modified_files). Wrapped in try/except: this runs in the GitStatusProvider polling thread; an exception there would kill the poller, so we swallow and log instead.

relative_path(path: str) str[source]