Skip to content

Commit 48c53ed

Browse files
committed
Remove omnisharp config generation
1 parent 12e397c commit 48c53ed

File tree

5 files changed

+9
-141
lines changed

5 files changed

+9
-141
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Code Editor Package for Visual Studio Code
22

3+
## [1.4.7] - 2023-08-06
4+
5+
- Remove omnisharp config generation from package
6+
- Clean up code and remove unused directives
7+
- Update .gitignore to remove .omnisharp.json ignore
8+
39
## [1.4.6] - 2023-08-06
410

511
- Added ignore IDE0051 to .editorconfig default configuration

Editor/ConfigGeneration/ConfigGeneration.cs

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.IO;
4-
using System.Linq;
5-
using System.Security;
6-
using System.Security.Cryptography;
7-
using System.Text;
8-
using System.Xml.Linq;
92
using UnityEditor;
10-
using UnityEditor.Compilation;
11-
using UnityEngine;
12-
using UnityEngine.Profiling;
13-
using SR = System.Reflection;
143

154
namespace VSCodeEditor
165
{
176
public interface IConfigGenerator
187
{
198
string VSCodeSettings { get; set; }
209
string WorkspaceSettings { get; set; }
21-
string OmniSharpSettings { get; set; }
2210
string EditorConfigSettings { get; set; }
2311
string ProjectDirectory { get; }
2412
IFlagHandler FlagHandler { get; }
@@ -82,10 +70,7 @@ public class ConfigGeneration : IConfigGenerator
8270
""ProjectSettings/"":true,
8371
""temp/"":true,
8472
""Temp/"":true
85-
},
86-
""omnisharp.useModernNet"": true,
87-
""omnisharp.sdkIncludePrereleases"": false,
88-
""omnisharp.organizeImportsOnFormat"": true
73+
}
8974
}";
9075

9176
const string k_DefaultWorkspaceJson =
@@ -98,24 +83,6 @@ public class ConfigGeneration : IConfigGenerator
9883
]
9984
}";
10085

101-
const string k_DefaultOmniSharpJson =
102-
/*lang=json,strict*/
103-
@"{
104-
""RoslynExtensionsOptions"": {
105-
""EnableAnalyzersSupport"": true,
106-
""AnalyzeOpenDocumentsOnly"": true,
107-
""DocumentAnalysisTimeoutMs"": 600000
108-
},
109-
""FormattingOptions"": {
110-
""enableEditorConfigSupport"": true
111-
},
112-
""RenameOptions"": {
113-
""RenameInComments"": true,
114-
""RenameOverloads"": true,
115-
""RenameInStrings"": true
116-
}
117-
}";
118-
11986
const string k_DefaultEditorConfig =
12087
@"# EditorConfig is awesome: http://EditorConfig.org
12188
@@ -139,7 +106,6 @@ public class ConfigGeneration : IConfigGenerator
139106

140107
string m_VSCodeSettings;
141108
string m_WorkspaceSettings;
142-
string m_OmniSharpSettings;
143109
string m_EditorConfigSettings;
144110

145111
public string VSCodeSettings
@@ -176,23 +142,6 @@ public string WorkspaceSettings
176142
}
177143
}
178144

179-
public string OmniSharpSettings
180-
{
181-
get =>
182-
m_OmniSharpSettings ??= EditorPrefs.GetString(
183-
"vscode_omnisharpSettings",
184-
k_DefaultOmniSharpJson
185-
);
186-
set
187-
{
188-
if (value == "")
189-
value = k_DefaultOmniSharpJson;
190-
191-
m_OmniSharpSettings = value;
192-
EditorPrefs.SetString("vscode_omnisharpSettings", value);
193-
}
194-
}
195-
196145
public string EditorConfigSettings
197146
{
198147
get =>
@@ -232,7 +181,6 @@ public void Sync()
232181
{
233182
WriteVSCodeSettingsFiles();
234183
WriteWorkspaceFile();
235-
WriteOmniSharpConfigFile();
236184
WriteEditorConfigFile();
237185
}
238186

@@ -264,16 +212,6 @@ void WriteWorkspaceFile()
264212
}
265213
}
266214

267-
void WriteOmniSharpConfigFile()
268-
{
269-
if (m_FlagHandler.ConfigFlag.HasFlag(ConfigFlag.OmniSharp))
270-
{
271-
var omniSharpConfig = Path.Combine(ProjectDirectory, "omnisharp.json");
272-
273-
m_FileIOProvider.WriteAllText(omniSharpConfig, OmniSharpSettings);
274-
}
275-
}
276-
277215
void WriteEditorConfigFile()
278216
{
279217
if (m_FlagHandler.ConfigFlag.HasFlag(ConfigFlag.EditorConfig))

Editor/Utils/FlagHandler.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
42
using UnityEditor;
5-
using UnityEditor.Compilation;
6-
using UnityEditor.PackageManager;
73

84
namespace VSCodeEditor
95
{
@@ -20,8 +16,7 @@ public enum ConfigFlag
2016
None = 0,
2117
VSCode = 1,
2218
Workspace = 2,
23-
OmniSharp = 4,
24-
EditorConfig = 8,
19+
EditorConfig = 4,
2520
}
2621

2722
[Flags]

Editor/VSCodeScriptEditor.cs

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Linq;
55
using Unity.CodeEditor;
66
using UnityEditor;
7-
using UnityEditor.PackageManager;
87
using UnityEngine;
98

109
namespace VSCodeEditor
@@ -23,12 +22,10 @@ public class VSCodeScriptEditor : IExternalCodeEditor
2322
bool m_ShowProjectSection = true;
2423
bool m_ShowVSCodeSettingsSection = false;
2524
bool m_ShowWorkspaceSection = false;
26-
bool m_ShowOmniSharpSection = false;
2725
bool m_ShowEditorConfigSection = false;
2826

2927
Vector2 m_VSCodeScrollPosition;
3028
Vector2 m_WorkspaceScrollPosition;
31-
Vector2 m_OmniSharpScrollPosition;
3229
Vector2 m_EditorConfigScrollPosition;
3330

3431
readonly IDiscovery m_Discoverability;
@@ -114,52 +111,6 @@ bool ShowProjectSection
114111
}
115112
}
116113

117-
bool ShowVSCodeSettingsSection
118-
{
119-
get =>
120-
m_ShowVSCodeSettingsSection
121-
|| EditorPrefs.GetBool("vscode_showVSCodeSettingsSection", false);
122-
set
123-
{
124-
m_ShowVSCodeSettingsSection = value;
125-
EditorPrefs.SetBool("vscode_showVSCodeSettingsSection", value);
126-
}
127-
}
128-
129-
bool ShowWorkspaceSection
130-
{
131-
get =>
132-
m_ShowWorkspaceSection || EditorPrefs.GetBool("vscode_showWorkspaceSection", false);
133-
set
134-
{
135-
m_ShowWorkspaceSection = value;
136-
EditorPrefs.SetBool("vscode_showWorkspaceSection", value);
137-
}
138-
}
139-
140-
bool ShowOmniSharpSection
141-
{
142-
get =>
143-
m_ShowOmniSharpSection || EditorPrefs.GetBool("vscode_showOmniSharpSection", false);
144-
set
145-
{
146-
m_ShowOmniSharpSection = value;
147-
EditorPrefs.SetBool("vscode_showOmniSharpSection", value);
148-
}
149-
}
150-
151-
bool ShowEditorConfigSection
152-
{
153-
get =>
154-
m_ShowEditorConfigSection
155-
|| EditorPrefs.GetBool("vscode_showEditorConfigSection", false);
156-
set
157-
{
158-
m_ShowEditorConfigSection = value;
159-
EditorPrefs.SetBool("vscode_showEditorConfigSection", value);
160-
}
161-
}
162-
163114
static string[] DefaultExtensions
164115
{
165116
get
@@ -337,22 +288,6 @@ ref m_VSCodeScrollPosition
337288
ref m_WorkspaceScrollPosition
338289
);
339290

340-
FlagButton(
341-
ConfigFlag.OmniSharp,
342-
"OmniSharp",
343-
"",
344-
(handler, flag) => handler.ConfigFlag.HasFlag(flag),
345-
(handler, flag) => handler.ToggleConfig(flag)
346-
);
347-
348-
if (m_ConfigGeneration.FlagHandler.ConfigFlag.HasFlag(ConfigFlag.OmniSharp))
349-
RenderSettingsSection(
350-
ref m_ShowOmniSharpSection,
351-
m_ConfigGeneration.OmniSharpSettings,
352-
"OmniSharp",
353-
ref m_OmniSharpScrollPosition
354-
);
355-
356291
FlagButton(
357292
ConfigFlag.EditorConfig,
358293
"EditorConfig",
@@ -408,9 +343,6 @@ ref Vector2 scrollPosition
408343
case "Workspace":
409344
m_ConfigGeneration.WorkspaceSettings = settings;
410345
break;
411-
case "OmniSharp":
412-
m_ConfigGeneration.OmniSharpSettings = settings;
413-
break;
414346
case "editorconfig":
415347
m_ConfigGeneration.EditorConfigSettings = settings;
416348
break;
@@ -556,9 +488,6 @@ void RegenerateButton(string guiMessage, string command = "")
556488
case "Reset Workspace settings":
557489
m_ConfigGeneration.WorkspaceSettings = "";
558490
break;
559-
case "Reset OmniSharp settings":
560-
m_ConfigGeneration.OmniSharpSettings = "";
561-
break;
562491
case "Reset editorconfig settings":
563492
m_ConfigGeneration.EditorConfigSettings = "";
564493
break;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.tsk.ide.vscode",
33
"displayName": "TSK VSCode Editor",
44
"description": "Unofficial code editor integration for supporting Visual Studio Code as code editor for Unity. Adds support for generating csproj files for intellisense purposes, auto discovery of installations, etc.",
5-
"version": "1.4.6",
5+
"version": "1.4.7",
66
"unity": "2021.3",
77
"dependencies": {},
88
"author": {

0 commit comments

Comments
 (0)