Skip to content

Commit 8737227

Browse files
committed
build: enhance VS Code performance with optimized settings and exclusions
1 parent b71e2ce commit 8737227

File tree

5 files changed

+494
-6
lines changed

5 files changed

+494
-6
lines changed

.editorconfig

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,66 @@
1+
# EditorConfig for X4 LogWatcher - Optimized for VS Code Performance
2+
# top-most EditorConfig file
3+
root = true
4+
5+
# All files
6+
[*]
7+
indent_style = space
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
112
[*.{cs,csx}]
213
# Non-configurable behaviors
314
charset = utf-8
415
insert_final_newline = true
516
trim_trailing_whitespace = true
6-
dotnet_sort_system_directives_first = true
17+
18+
# Performance optimizations - disable resource-intensive sorting
19+
dotnet_sort_system_directives_first = false
720
dotnet_separate_import_directive_groups = false
821

922
# Configurable behaviors
1023
# end_of_line = lf - there is no 'auto' with an .editorconfig
1124
indent_style = space
25+
indent_size = 4
26+
max_line_length = 140
27+
28+
# C# specific formatting (optimized for performance)
29+
# Keep C# analyzer rules minimal to improve VS Code responsiveness
30+
dotnet_analyzer_diagnostic.category-performance.severity = warning
31+
dotnet_analyzer_diagnostic.category-reliability.severity = warning
32+
33+
# Disable resource-intensive rules that can slow down VS Code
34+
dotnet_diagnostic.IDE0005.severity = none # Remove unnecessary using directives
35+
dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary pragma
36+
dotnet_diagnostic.IDE0060.severity = none # Remove unused parameters
37+
38+
# Core formatting rules (lightweight)
39+
csharp_new_line_before_open_brace = all
40+
csharp_new_line_before_else = true
41+
csharp_new_line_before_catch = true
42+
csharp_new_line_before_finally = true
43+
csharp_indent_case_contents = true
44+
csharp_indent_switch_labels = true
45+
46+
# Space preferences (minimal impact on performance)
47+
csharp_space_after_cast = false
48+
csharp_space_after_keywords_in_control_flow_statements = true
49+
csharp_space_around_binary_operators = before_and_after
50+
csharp_space_between_method_declaration_parameter_list_parentheses = false
51+
52+
# XAML files
53+
[*.{xaml,axaml}]
54+
indent_size = 4
55+
56+
# XML project files and configuration files
57+
[*.{csproj,vbproj,vcxproj,proj,projitems,shproj,fsproj,targets,props,nuspec,resx,ruleset,vsixmanifest,vsct}]
58+
indent_size = 2
59+
60+
# JSON files
61+
[*.json]
1262
indent_size = 2
13-
max_line_length = 140
63+
64+
# PowerShell files
65+
[*.ps1]
66+
indent_size = 4

.gitignore

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,30 @@ TestResult.xml
5454
nunit-*.xml
5555

5656
# Local
57-
dist
57+
dist
58+
59+
# VS Code Performance Optimization - Exclude WPF temporary files
60+
*_wpftmp*
61+
**/*_wpftmp*
62+
*.tmp
63+
*.temp
64+
temp/
65+
tmp/
66+
67+
# Additional VS Code optimization exclusions
68+
.vscode/.ropeproject
69+
.ionide/
70+
71+
# NuGet packages and package restore
72+
packages/
73+
**/packages/**
74+
!packages/build/
75+
*.nupkg
76+
*.snupkg
77+
project.lock.json
78+
project.fragment.lock.json
79+
artifacts/
80+
81+
# MSBuild temporary files that cause VS Code freezing
82+
*.binlog
83+
*.tmp_proj

.vscode/settings.json

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,57 @@
44
"csharp.format.enable": true,
55
"dotnet.preferCSharpExtension": true,
66
"editor.formatOnSave": false,
7+
78
// Enable per-language
89
"[csharp]": {
9-
"editor.formatOnSave": true,
10-
"editor.defaultFormatter": "csharpier.csharpier-vscode"
11-
}
10+
"editor.formatOnSave": true,
11+
"editor.defaultFormatter": "csharpier.csharpier-vscode"
12+
},
13+
14+
// Performance optimizations to prevent VS Code freezing
15+
"files.watcherExclude": {
16+
"**/obj/**": true,
17+
"**/bin/**": true,
18+
"**/.git/objects/**": true,
19+
"**/.git/subtree-cache/**": true,
20+
"**/node_modules/**": true,
21+
"**/*_wpftmp*": true,
22+
"**/temp/**": true,
23+
"**/tmp/**": true
24+
},
25+
26+
"search.exclude": {
27+
"**/obj/**": true,
28+
"**/bin/**": true,
29+
"**/.git/**": true,
30+
"**/node_modules/**": true,
31+
"**/*_wpftmp*": true,
32+
"**/temp/**": true,
33+
"**/tmp/**": true
34+
},
35+
36+
"files.exclude": {
37+
"**/obj/Debug/**": true,
38+
"**/obj/Release/**": true,
39+
"**/bin/Debug/**": true,
40+
"**/bin/Release/**": true,
41+
"**/*_wpftmp*": true
42+
},
43+
44+
// Limit file watching and indexing
45+
"typescript.preferences.includePackageJsonAutoImports": "off",
46+
"files.watcherInclude": ["**/*.cs", "**/*.csproj", "**/*.sln", "**/*.xaml"],
47+
"omnisharp.enableRoslynAnalyzers": true,
48+
"omnisharp.enableEditorConfigSupport": true,
49+
"omnisharp.enableAsyncCompletion": true,
50+
51+
// Memory and performance settings
52+
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": false,
53+
"omnisharp.maxProjectResults": 250,
54+
"extensions.autoUpdate": false,
55+
56+
// Disable features that might cause performance issues
57+
"telemetry.telemetryLevel": "off",
58+
"workbench.enableExperiments": false,
59+
"workbench.settings.enableNaturalLanguageSearch": false
1260
}

0 commit comments

Comments
 (0)