Skip to content

Commit 2759ebc

Browse files
committed
refactor(vscode配置): 更新工作区路径和优化编辑器设置
- 修改前端项目路径为独立目录 - 移除重复的搜索排除配置,使用gitignore替代 - 禁用不必要的TypeScript服务器功能和自动类型获取 - 添加文件关联配置避免大文件解析 - 清理注释掉的配置项
1 parent d9eb804 commit 2759ebc

1 file changed

Lines changed: 28 additions & 19 deletions

File tree

‎config/vscode/example.code-workspace‎

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
},
1111
{
1212
"name": "🖥️web-front",
13-
"path":"front"
13+
"path":"front1"
1414
} ,{
1515
"name": "⚙️web-admin",
16-
"path":"front"
16+
"path":"front2"
1717
} , {
1818
"name": "📱sweb-mobile",
19-
"path":"front"
19+
"path":"front3"
2020
}
2121
],
2222
"settings": {
@@ -38,33 +38,37 @@
3838
// 搜索性能优化
3939
"search.useIgnoreFiles": true,
4040
"search.useGlobalIgnoreFiles": true,
41-
"search.exclude": {
42-
"**/node_modules": true,
43-
"**/dist": true,
44-
"**/.next": true,
45-
"**/coverage": true,
46-
"**/yarn.lock": true,
47-
"**/pnpm-lock.yaml": true,
48-
"**/package-lock.json": true,
49-
"**/.git": true,
50-
"**/.DS_Store": true,
51-
"**/*.log": true,
52-
"**/.idea": true,
53-
"**/.vscode": true
54-
},
41+
// 搜索使用gitignore就不用再列出了
42+
// "search.exclude": {
43+
// "**/node_modules": true,
44+
// "**/dist": true,
45+
// "**/.next": true,
46+
// "**/coverage": true,
47+
// "**/yarn.lock": true,
48+
// "**/pnpm-lock.yaml": true,
49+
// "**/package-lock.json": true,
50+
// "**/.git": true,
51+
// "**/.DS_Store": true,
52+
// "**/*.log": true,
53+
// "**/.idea": true,
54+
// "**/.vscode": true
55+
// },
5556
// 禁用遥测 ,减少cpu后台任务
5657
"telemetry.telemetryLevel": "off",
5758

5859
//优化ts server
5960
// 默认最大内存可能不够,防止频繁gc可以调大,特别是多个ts项目可能需要更大的内存
60-
"typescript.tsserver.maxTsServerMemory": 4096,
61+
// "typescript.tsserver.maxTsServerMemory": 4096,
6162
// 禁用项目诊断,减少内存占用,因为项目中rsbuild已经包含了type check插件了
6263
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
6364
// 即使 VS Code 已经忽略 node_modules,TS Server(语言服务器)仍然会扫描和 watch 这些目录
6465
// 为了避免性能问题,建议在 tsconfig.json 中配置 "exclude" 来排除 node_modules
6566
"typescript.tsserver.watchOptions": {
6667
"excludeDirectories": ["node_modules", "dist", "build"]
6768
},
69+
// 禁止自动获取 @types 包,对于已经配置好 package.json 的项目,这通常是多余的网络请求和索引
70+
"typescript.disableAutomaticTypeAcquisition": true,
71+
6872
// git 优化
6973
"git.autofetch": false,
7074
"git.ignoreSubmodules": true,
@@ -79,7 +83,12 @@
7983
"typescript",
8084
"typescriptreact"
8185
],
82-
86+
87+
// 避免把大文件当成代码解析
88+
"files.associations": {
89+
"*.log": "plaintext", // 强制把日志文件当纯文本,不进行语法高亮分析
90+
"*.csv": "plaintext"
91+
},
8392
// peacock改变颜色,便于区分不同项目
8493
// "workbench.colorCustomizations": {
8594
// "activityBar.activeBackground": "#2ecef9",

0 commit comments

Comments
 (0)