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.

IDEState

Single source of truth for IDE-wide state.

API

class simvx.ide.state.Diagnostic

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.IDEState(*, 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)

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
property active_file: str
property cursor_line: int
property cursor_col: int
set_cursor(line: int, col: int)
set_diagnostics(path: str, diagnostics: list[simvx.ide.state.Diagnostic])
get_diagnostics(path: str) list[simvx.ide.state.Diagnostic]
get_all_diagnostics() dict[str, list[simvx.ide.state.Diagnostic]]
toggle_breakpoint(path: str, line: int)
get_breakpoints(path: str) set[int]
get_all_breakpoints() dict[str, set[int]]
toggle_bookmark(path: str, line: int)
get_bookmarks(path: str) set[int]
get_all_bookmarks() dict[str, set[int]]
push_cursor_history(path: str, line: int, col: int = 0)

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

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

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

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

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

goto(path: str, line: int, col: int = 0)
relative_path(path: str) str