From aa7cd360ee3ea6c4f6b4a5720588af4505091b58 Mon Sep 17 00:00:00 2001 From: taynpg Date: Wed, 24 Dec 2025 23:47:26 +0800 Subject: [PATCH] =?UTF-8?q?Env=EF=BC=9Azed=E9=85=8D=E7=BD=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .clangd | 12 ++++++++++ .zed/keymap.json | 15 +++++++++++++ .zed/settings.json | 53 +++++++++++++++++++++++++++++++++++++++++++++ .zed/tasks.json | 29 +++++++++++++++++++++++++ CMakeLists.txt | 5 +++-- Protocol/Protocol.h | 2 +- 6 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 .clangd create mode 100644 .zed/keymap.json create mode 100644 .zed/settings.json create mode 100644 .zed/tasks.json diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..40557fb --- /dev/null +++ b/.clangd @@ -0,0 +1,12 @@ +Hover: + ShowAKA: Yes +Diagnostics: + UnusedIncludes: None # 禁用未使用头文件提示 + Suppress: [ + anon_type_definition, # 禁用匿名的typedef提示 + unused-variable, # 禁用未使用变量提示 + unused-function, # 禁用未使用函数提示 + unused-includes, + ] + ClangTidy: + Remove: misc-unused-alias-decls diff --git a/.zed/keymap.json b/.zed/keymap.json new file mode 100644 index 0000000..cb91520 --- /dev/null +++ b/.zed/keymap.json @@ -0,0 +1,15 @@ +// Zed keymap +// +// For information on binding keys, see the Zed +// documentation: https://zed.dev/docs/key-bindings +// +// To see the default key bindings run `zed: open default keymap` +// from the command palette. +[ + { + "context": "Editor", + "bindings": { + "alt-g": "editor::GoToDefinition", + }, + }, +] diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..431c442 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,53 @@ +// Zed settings +// +// For information on how to configure Zed, see the Zed +// documentation: https://zed.dev/docs/configuring-zed +// +// To see all of Zed's default settings without changing your +// custom settings, run `zed: open default settings` from the +// command palette (cmd-shift-p / ctrl-shift-p) +// +// 需要安装的依赖有 +// 1.Nodejs +// 2.jsonnet-language-server +// 3.clangd +{ + "tab_size": 4, + "vim_mode": false, + "buffer_font_family": "Maple Mono NF CN", + "ui_font_size": 15.0, + "buffer_font_size": 13.0, + "theme": { + "mode": "system", + "light": "One Light", + "dark": "One Dark", + }, + "file_types": { + "Jsonnet": ["cfg"], + }, + "lsp": { + "clangd": { + "binary": { + "arguments": [ + "--header-insertion=never", + "--all-scopes-completion", + "--completion-style=detailed", + "--clang-tidy", + "-j=4", + "--pch-storage=memory", + "--compile-commands-dir=build", + "--background-index", + "--ranking-model=heuristics", + "--function-arg-placeholders=false", + ], + }, + }, + "jsonnet-language-server": { + "settings": { + "formatting": { + "indent": 4, + }, + }, + }, + }, +} diff --git a/.zed/tasks.json b/.zed/tasks.json new file mode 100644 index 0000000..ec90e15 --- /dev/null +++ b/.zed/tasks.json @@ -0,0 +1,29 @@ +[ + { + "label": "CmakeConfig", + "command": "cmd", + "env": { + "VS2026ENV": "\"C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"", + }, + "args": [ + "/c", + "$VS2026ENV && cmake -Bbuild -G Ninja -S . -DCOMPILE_GUI=ON -DCMAKE_BUILD_TYPE=Debug", + ], + "cwd": "$ZED_WORKTREE_ROOT", + "use_new_terminal": false, + "show_command": true, + "show_summary": true, + }, + { + "label": "CmakeBuild", + "command": "cmd", + "env": { + "VS2026ENV": "\"C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"", + }, + "args": ["/c", "$VS2026ENV && cmake --build build --config Debug"], + "cwd": "$ZED_WORKTREE_ROOT", + "use_new_terminal": false, + "show_command": true, + "show_summary": true, + }, +] diff --git a/CMakeLists.txt b/CMakeLists.txt index 53b7d87..feea44d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(frelay VERSION 0.2.4 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(PROJECT_URL "https://github.com/taynpg/frelay") if(DEFINED RELEASE_MARK) @@ -71,7 +72,7 @@ set(QT_DEP_FILES "${CMAKE_PREFIX_PATH}/bin/Qt${QT_DEFAULT_MAJOR_VERSION}Network.dll" ) set(QT_DEP_PLATFORM "${CMAKE_PREFIX_PATH}/plugins/platforms/qwindows.dll") -set(QT_DEP_STYLES +set(QT_DEP_STYLES "${CMAKE_PREFIX_PATH}/plugins/styles/qmodernwindowsstyle.dll" "${CMAKE_PREFIX_PATH}/plugins/styles/qwindowsvistastyle.dll" ) @@ -80,7 +81,7 @@ endif() set(CMAKE_DEBUG_POSTFIX "d") include_directories(${CMAKE_SOURCE_DIR}/Gui/Control) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/) include_directories(${PROJECT_BINARY_DIR}) add_definitions(-DFMT_HEADER_ONLY) diff --git a/Protocol/Protocol.h b/Protocol/Protocol.h index 9265ead..5f76b53 100644 --- a/Protocol/Protocol.h +++ b/Protocol/Protocol.h @@ -111,4 +111,4 @@ enum FileCheckState { #define STR_DIR "Dir" #define STR_NONE "None" -#endif // PROTOCOL_H \ No newline at end of file +#endif // PROTOCOL_H