Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
289 changes: 141 additions & 148 deletions CLAUDE.md

Large diffs are not rendered by default.

414 changes: 255 additions & 159 deletions README.md

Large diffs are not rendered by default.

511 changes: 511 additions & 0 deletions architecture_explore.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ requires-python = ">=3.10"
license-files = ["LICENSE"]
dependencies = [
"PySide6==6.11.0", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi",
"qtconsole", "langchain_openai==1.2.0", "langchain==1.2.15", "pydantic", "watchdog", "ruff", "gitpython"
"qtconsole", "langchain_openai==1.2.0", "langchain_core", "pydantic", "watchdog", "ruff", "gitpython"
]
classifiers = [
"Programming Language :: Python :: 3.10",
Expand Down
34 changes: 17 additions & 17 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
PySide6==6.11.0
langchain_openai==1.2.0
langchain==1.2.15
ruff
sphinx
twine
build
yapf
wheel
gitpython
qtconsole
pycodestyle
pydantic
jedi
pytest
pytest-qt
auto-py-to-exe
PySide6==6.11.0
langchain_openai==1.2.0
langchain_core
ruff
sphinx
twine
build
yapf
wheel
gitpython
qtconsole
pycodestyle
pydantic
jedi
pytest
pytest-qt
auto-py-to-exe
2 changes: 1 addition & 1 deletion docs/source/docs/Eng/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ JEditor will automatically install the following dependencies:
- Fast Python linter
* - gitpython
- Git operations
* - langchain / langchain_openai
* - langchain_openai / langchain_core
- AI assistant (LLM integration)
* - watchdog
- File system monitoring
Expand Down
2 changes: 1 addition & 1 deletion docs/source/docs/Zh/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ JEditor 會自動安裝以下依賴套件:
- 快速 Python 靜態分析工具
* - gitpython
- Git 操作
* - langchain / langchain_openai
* - langchain_openai / langchain_core
- AI 助手(LLM 整合)
* - watchdog
- 檔案系統監控
Expand Down
Binary file added image/screenshot-browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-command-palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-diff-side-by-side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-git-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-light-theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-lint-inline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-main-window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-minimap-split-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-outline-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-problems-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-quick-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-run-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-search-replace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-shortcut-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-snippet-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-terminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-test-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/screenshot-todo-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion je_editor/plugins/plugin_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _collect_plugin_entries(directory: Path, entries: list[tuple[str, Path]]) ->
return

for item in sorted(directory.iterdir()):
if item.name.startswith("_") or item.name.startswith("."):
if item.name.startswith(("_", ".")):
continue

if item.is_file() and item.suffix == ".py":
Expand Down
14 changes: 7 additions & 7 deletions je_editor/pyside_ui/code/auto_save/auto_save_thread.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import time
from pathlib import Path
from threading import Thread, Event
from typing import Callable, Union
from typing import Callable

from PySide6.QtCore import QObject, Qt, Signal, Slot

Expand All @@ -22,7 +22,7 @@ class _TextFetcher(QObject):
def __init__(self, editor: CodeEditor, parent: QObject | None = None) -> None:
super().__init__(parent)
self._editor = editor
self._pending_text: Union[str, None] = None
self._pending_text: str | None = None
self._ready = Event()
self.fetch_requested.connect(self._do_fetch, type=Qt.ConnectionType.QueuedConnection)

Expand All @@ -38,7 +38,7 @@ def _do_fetch(self) -> None:
finally:
self._ready.set()

def fetch(self) -> Union[str, None]:
def fetch(self) -> str | None:
"""從背景執行緒呼叫,安全取得文字 / Call from background thread to safely get text"""
self._pending_text = None
self._ready.clear()
Expand All @@ -55,14 +55,14 @@ class CodeEditSaveThread(Thread):
"""

def __init__(
self, file_to_save: Union[str, None] = None, editor: Union[None, CodeEditor] = None,
self, file_to_save: str | None = None, editor: CodeEditor | None = None,
before_write_callback: Callable | None = None) -> None:
jeditor_logger.info(f"Init CodeEditSaveThread "
f"file_to_save: {file_to_save} "
f"editor: {editor}")
super().__init__()
self.file: str = file_to_save
self.editor: Union[None, CodeEditor] = editor
self.editor: CodeEditor | None = editor
self.still_run: bool = True
self.daemon = True
self.skip_this_round: bool = False
Expand All @@ -73,11 +73,11 @@ def __init__(
self.encoding: str = DEFAULT_ENCODING
self.line_ending: str = LINE_ENDING_LF
# 建立主執行緒上的文字提取器 / Create text fetcher on main thread
self._text_fetcher: Union[_TextFetcher, None] = None
self._text_fetcher: _TextFetcher | None = None
if editor is not None:
self._text_fetcher = _TextFetcher(editor)

def _get_editor_text(self) -> Union[str, None]:
def _get_editor_text(self) -> str | None:
"""
透過 Qt 主執行緒安全取得編輯器文字
Safely get editor text via Qt main thread
Expand Down
13 changes: 6 additions & 7 deletions je_editor/pyside_ui/code/base_process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import queue
import subprocess # nosec B404 - 管理器僅持有外部子程序物件,呼叫端以引數清單啟動
from threading import Thread
from typing import Union

from PySide6.QtCore import QTimer
from PySide6.QtGui import QTextCharFormat
Expand All @@ -22,17 +21,17 @@ class BaseProcessManager:

def __init__(
self,
main_window: Union[QWidget, None] = None,
main_window: QWidget | None = None,
encoding: str = "utf-8",
buffer_size: int = 1024,
) -> None:
self.read_program_error_output_from_thread: Union[Thread, None] = None
self.read_program_output_from_thread: Union[Thread, None] = None
self.read_program_error_output_from_thread: Thread | None = None
self.read_program_output_from_thread: Thread | None = None
self.main_window = main_window
self.code_result: Union[QTextEdit, None] = None
self.timer: Union[QTimer, None] = None
self.code_result: QTextEdit | None = None
self.timer: QTimer | None = None
self._still_running: bool = True
self.process: Union[subprocess.Popen, None] = None
self.process: subprocess.Popen | None = None
self.run_output_queue: queue.Queue = queue.Queue()
self.run_error_queue: queue.Queue = queue.Queue()
self.program_encoding: str = encoding
Expand Down
9 changes: 5 additions & 4 deletions je_editor/pyside_ui/code/breakpoint/breakpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ def toggle(self, line: int) -> bool:
:param line: 以 0 起算的行號 / the 0-based line number
:return: 切換後是否有中斷點 / whether the line now has one
"""
for cursor in list(self._cursors):
if cursor.blockNumber() == line:
self._cursors.remove(cursor)
return False
existing = next(
(cursor for cursor in self._cursors if cursor.blockNumber() == line), None)
if existing is not None:
self._cursors.remove(existing)
return False
block = self._code_edit.document().findBlockByNumber(line)
if not block.isValid():
return False
Expand Down
7 changes: 3 additions & 4 deletions je_editor/pyside_ui/code/code_process/code_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import subprocess # nosec B404 - 以引數清單呼叫編譯器/直譯器,shell=False
import sys
from pathlib import Path
from typing import Union

from PySide6.QtCore import QTimer
from PySide6.QtGui import QTextCharFormat
Expand All @@ -27,7 +26,7 @@ class ExecManager(BaseProcessManager):

def __init__(
self,
main_window: Union[EditorWidget, None] = None,
main_window: EditorWidget | None = None,
program_language: str = "python",
program_encoding: str = "utf-8",
program_buffer: int = 1024,
Expand All @@ -43,7 +42,7 @@ def __init__(
buffer_size=program_buffer,
)
self.compiler_path = None
self.code_result_cursor: Union[QTextEdit.textCursor, None] = None
self.code_result_cursor: QTextEdit.textCursor | None = None
self.program_language = program_language
self.renew_path()

Expand Down Expand Up @@ -72,7 +71,7 @@ def later_init(self) -> None:
else:
raise JEditorException(je_editor_init_error)

def exec_code(self, exec_file_name: str, exec_prefix: Union[str, list] = None) -> None:
def exec_code(self, exec_file_name: str, exec_prefix: str | list = None) -> None:
"""
執行指定檔案
Execute given file
Expand Down
Loading
Loading