Skip to content

Commit

Permalink
fix(Codeforces, OJBetter_Bridge): 修复一些问题,重命名Bridge
Browse files Browse the repository at this point in the history
- 修复当编辑器固定到右侧时,代码建议组件错误的向上溢出窗口

- 增加编辑器固定选项的记忆

- 调整代码建议为 不默认选中第一个建议项

- 一些其他调整和改进

- 重命名 CFBetter_LSPBridge 为 OJBetter_Bridge
  • Loading branch information
beijixiaohu committed Nov 19, 2023
1 parent 207abcc commit 0f16a0e
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 110 deletions.
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CFBetter_LSPBridge/cpp_workspace/*.cpp
CFBetter_LSPBridge/java_workspace/hello/src/*.java
CFBetter_LSPBridge/java_workspace/.metadata
CFBetter_LSPBridge/jdt-language-server
CFBetter_LSPBridge/python_workspace/*.py
CFBetter_LSPBridge/pylsp_jsonrpc
CFBetter_LSPBridge/server_gui.*
OJBetter_Bridge/cpp_workspace/*.cpp
OJBetter_Bridge/java_workspace/hello/src/*.java
OJBetter_Bridge/java_workspace/.metadata
OJBetter_Bridge/jdt-language-server
OJBetter_Bridge/python_workspace/*.py
OJBetter_Bridge/pylsp_jsonrpc
OJBetter_Bridge/server_gui.exe
tools
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ AlignOperands: true
# 允许函数声明的所有参数在放在下一行
AllowAllParametersOfDeclarationOnNextLine: true
# 允许短的块放在同一行
AllowShortBlocksOnASingleLine : false
AllowShortBlocksOnASingleLine : true
# 允许短的case标签放在同一行
AllowShortCaseLabelsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
# 允许短的循环保持在同一行
AllowShortLoopsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
# 总是在定义返回类型后换行(deprecated)
AlwaysBreakAfterDefinitionReturnType: None
# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
Expand All @@ -48,7 +48,7 @@ ObjCSpaceAfterProperty: true
# OC block后面的缩进
ObjCBlockIndentWidth: 4
# 是否允许短方法单行
AllowShortFunctionsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
# 换行的时候对齐操作符
AlignOperands: true
# 中括号两边空格 []
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import shutil
print("\033[1;34m" + """
╔══════════════════════════════════════════════════════════╗
║ Welcome to CFBetter_MonacoLSPBridge
Welcome to OJBetter_Bridge
║ Enjoy Coding !>_< ║
╚══════════════════════════════════════════════════════════╝
""".center(80) + "\033[0m")
Expand Down Expand Up @@ -231,11 +231,11 @@ def check_origin(self, origin):
else:
if lang == "cpp":
print("""\033[1;31m[CHECK] The command for C++ is invalid.
Please download clangd-windows-xxx.zip from https://github.com/clangd/clangd/releases/,
If you used on Windows, Please download clangd-windows-xxx.zip from https://github.com/clangd/clangd/releases/,
extract it to your preferred location, and add the xxx/clangd_xxx/bin path to the system environment variable path.\033[0m""")
elif lang == "python":
print("""\033[1;31m[CHECK] The command for Python is invalid.
Please run the command 'pip install "python-lsp-server[all]"' in the terminal
If you used on Windows, Please run the command 'pip install "python-lsp-server[all]"' in the terminal
(you need to have a Python environment installed), which will automatically configure the environment variables.\033[0m""")
else:
print(f"""\033[1;31m[CHECK] {lang} command is invalid \u2718\033[0m""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def check_startup_run():
Check the startup.
"""
QSetting = QSettings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings.NativeFormat)
if QSetting.value("CFBetter_LSPBridge") == None:
if QSetting.value("OJBetter_Bridge") == None:
return False
else:
return True
Expand All @@ -159,15 +159,15 @@ def set_startup_run():
Set the startup.
"""
QSetting = QSettings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings.NativeFormat)
QSetting.setValue("CFBetter_LSPBridge", '"{}" /background'.format(os.path.join(rootUri,"server_gui.exe")))
QSetting.setValue("OJBetter_Bridge", '"{}" /background'.format(os.path.join(rootUri,"server_gui.exe")))

@staticmethod
def cancel_startup_run():
"""
Cancel the startup.
"""
QSetting = QSettings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings.NativeFormat)
QSetting.remove("CFBetter_LSPBridge")
QSetting.remove("OJBetter_Bridge")

@staticmethod
def change_startup_run():
Expand Down Expand Up @@ -501,7 +501,7 @@ def __init__(self, parent=None):
super().__init__(parent)
self.update_log_signal.connect(self.update_log) # connect the signal to the slot
self.infoBar_signal.connect(self.createInfoBar) # connect the signal to the slot
self.setWindowTitle("CFBetter_LSPBridge")
self.setWindowTitle("OJBetter_Bridge")
self.setStyleSheet("background-color: #f7f9fc;")
self.resize(800, 600)

Expand Down Expand Up @@ -537,7 +537,7 @@ def __init__(self, parent=None):
# Create the tray icon
self.tray_icon = QSystemTrayIcon(self)
self.tray_icon.setIcon(QIcon(os.path.join(rootUri, "src", "icon.svg")))
self.tray_icon.setToolTip("CFBetter_LSPBridge")
self.tray_icon.setToolTip("OJBetter_Bridge")
self.tray_icon.show()

self.init_ui()
Expand All @@ -558,11 +558,11 @@ def toggle_auto_run(self):
"""
if self.auto_run_button.isChecked():
StartupRun().set_startup_run()
self.createInfoBar('success', 'Startup run enabled', f"CFBetter_LSPBridge will run on system startup.")
self.createInfoBar('success', 'Startup run enabled', f"OJBetter_Bridge will run on system startup.")
self.auto_run_button.setText('On')
else:
StartupRun().cancel_startup_run()
self.createInfoBar('success', 'Startup run disabled', f"CFBetter_LSPBridge will not run on system startup.")
self.createInfoBar('success', 'Startup run disabled', f"OJBetter_Bridge will not run on system startup.")
self.auto_run_button.setText('Off')


Expand Down
File renamed without changes
File renamed without changes
Loading

0 comments on commit 0f16a0e

Please sign in to comment.