Skip to content

Commit a04cd20

Browse files
Fix possbile deadlock caused by not reading stdout. (#63)
* Fix possible deadlock caused by not reading stdout. Redirecting and not reading from stdout can cause a deadlock when the stdout pipe buffer is too small. * Introduce GetDotnetArguments - Fixes #64 's issue of no obj/bin files being created with #63 * Update version --------- Co-authored-by: Abdul-Kadir Coskun <[email protected]>
1 parent bd14ea8 commit a04cd20

File tree

3 files changed

+76
-50
lines changed

3 files changed

+76
-50
lines changed

CHANGELOG.md

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,94 @@
11
# Code Editor Package for Visual Studio Code
22

3+
## [1.4.3] - 2023-07-29
4+
5+
- Fix possible deadlock caused by not reading stdout
6+
37
## [1.4.2] - 2023-06-13
48

5-
- Restrict Shell Compatibility for Project Generation's Dotnet Build (Mac/Linux)
9+
- Restrict Shell Compatibility for Project Generation's Dotnet Build (Mac/Linux)
610

711
## [1.4.1] - 2023-06-05
812

9-
- Added .jslib to default extensions for VSCode.
10-
- Refactored configuration defaults and removed redundant options from omnisharp.json. - Thanks @ershn
11-
- Added support for renaming methods and classes using Omnisharp.
12-
- Updated settings.json to correctly utilize useModernNet, sdkIncludePrereleases, and organizeImportsOnFormat.
13+
- Added .jslib to default extensions for VSCode.
14+
- Refactored configuration defaults and removed redundant options from omnisharp.json. - Thanks @ershn
15+
- Added support for renaming methods and classes using Omnisharp.
16+
- Updated settings.json to correctly utilize useModernNet, sdkIncludePrereleases, and organizeImportsOnFormat.
1317

1418
## [1.4.0] - 2023-06-04
1519

16-
- Refactored code to improve platform compatibility
20+
- Refactored code to improve platform compatibility
1721

1822
## [1.3.9] - 2023-05-18
1923

20-
- .csproj files are separated into their own folders within a main folder called "CSProjFolders" - Thanks @frarees
21-
- The ProjectReference element now includes a direct path to the file.
22-
- Project element added
23-
- Name element added
24-
- Compile element now includes a direct path to the file.
25-
- GenerateAssemblyInfo property set to false
26-
- Start of `dotnet build` support
24+
- .csproj files are separated into their own folders within a main folder called "CSProjFolders" - Thanks @frarees
25+
- The ProjectReference element now includes a direct path to the file.
26+
- Project element added
27+
- Name element added
28+
- Compile element now includes a direct path to the file.
29+
- GenerateAssemblyInfo property set to false
30+
- Start of `dotnet build` support
2731

2832
## [1.3.7] - 2023-05-16
2933

30-
- Added the option to disable adding Analyzers to all packages
31-
- This means that it will only be added to .csproj files originating from the Assets Folder.
34+
- Added the option to disable adding Analyzers to all packages
35+
- This means that it will only be added to .csproj files originating from the Assets Folder.
3236

3337
## [1.3.6] - 2023-05-10
3438

35-
- [Added config section to Externals Tools](https://github.com/Chizaruu/com.tsk.ide.vscode/commit/8da03f5885c268eaecdfd904e6a324be9bf9b82a)
36-
- [Added Foldouts to remove visual clutter](https://github.com/Chizaruu/com.tsk.ide.vscode/commit/ba73359980ad49f8eca6d485eda6f54e76a2bbff)
37-
- A "TSKDoNotDelete" text file is generated when the package is first added. This was done to counter the constant auto-generation that occurred when you would delete the config files.
38-
- [Added Configurable Config Settings](https://github.com/Chizaruu/com.tsk.ide.vscode/commit/d7a33951346235a91606e258cb206cc68e65e723)
39+
- [Added config section to Externals Tools](https://github.com/Chizaruu/com.tsk.ide.vscode/commit/8da03f5885c268eaecdfd904e6a324be9bf9b82a)
40+
- [Added Foldouts to remove visual clutter](https://github.com/Chizaruu/com.tsk.ide.vscode/commit/ba73359980ad49f8eca6d485eda6f54e76a2bbff)
41+
- A "TSKDoNotDelete" text file is generated when the package is first added. This was done to counter the constant auto-generation that occurred when you would delete the config files.
42+
- [Added Configurable Config Settings](https://github.com/Chizaruu/com.tsk.ide.vscode/commit/d7a33951346235a91606e258cb206cc68e65e723)
3943

4044
## [1.3.4] - 2023-04-07
4145

42-
- Minimum Unity version is now 2021.3
43-
- Added support for 2021/2022 NetStandard Editor Assemblies Compatibility Level (Not really, it's just a workaround until users start using 2023)
44-
- Added toggle for preferred default arguments for opening VSCode (You can choose between user or workspace)
45-
- Restructured the repository to be more in line with Unity's architecture (See <https://github.com/Unity-Technologies/com.unity.cinemachine> for more info)
46+
- Minimum Unity version is now 2021.3
47+
- Added support for 2021/2022 NetStandard Editor Assemblies Compatibility Level (Not really, it's just a workaround until users start using 2023)
48+
- Added toggle for preferred default arguments for opening VSCode (You can choose between user or workspace)
49+
- Restructured the repository to be more in line with Unity's architecture (See <https://github.com/Unity-Technologies/com.unity.cinemachine> for more info)
4650

4751
## [1.3.2] - 2023-04-05
4852

49-
- Removed koalafied Microsoft.Unity.Analyzers dll
50-
- Removed LocationPaths option from omnisharp.json
51-
- Added support for Nuget package Microsoft.Unity.Analyzers (See ProjectGeneration.cs for more info)
53+
- Removed koalafied Microsoft.Unity.Analyzers dll
54+
- Removed LocationPaths option from omnisharp.json
55+
- Added support for Nuget package Microsoft.Unity.Analyzers (See ProjectGeneration.cs for more info)
5256

5357
## [1.3.1] - 2023-04-01
5458

55-
- Moved .omnisharp, .editorconfig, and analyzer generation to ProjectGeneration.cs to be in line with the rest of the project
56-
- Simplified XElement creation in ProjectGeneration.cs to be more readable
59+
- Moved .omnisharp, .editorconfig, and analyzer generation to ProjectGeneration.cs to be in line with the rest of the project
60+
- Simplified XElement creation in ProjectGeneration.cs to be more readable
5761

5862
## [1.3.0] - 2023-04-01
5963

60-
- Added complete SDK support, this allows you to use Omnisharp's useModernNet in your project (Special thanks to Andrew Spiering @wackoisgod)
61-
- Added more predefined variables for the omnisharp.json file
62-
- Going forward, 2021.3 and below will only be able to use .Net Framework API compatibility level
63-
- Added support for .Net 4.8 API compatibility level for 2022.1 and above
64-
- Fixed failure while loading the analyzer reference 'Unity.SourceGenerators'
64+
- Added complete SDK support, this allows you to use Omnisharp's useModernNet in your project (Special thanks to Andrew Spiering @wackoisgod)
65+
- Added more predefined variables for the omnisharp.json file
66+
- Going forward, 2021.3 and below will only be able to use .Net Framework API compatibility level
67+
- Added support for .Net 4.8 API compatibility level for 2022.1 and above
68+
- Fixed failure while loading the analyzer reference 'Unity.SourceGenerators'
6569

6670
## [1.2.7] - 2023-03-19
6771

68-
- Added Unity Roslyn analyzers support (See <https://code.visualstudio.com/docs/other/unity#_enabling-unity-warnings>)
69-
- Added Formatting support (See CreateOmniSharpConfig() in VSCodeScriptEditor.cs)
70-
- Removed Rider Package (Spits)
71-
- Updated Text-Framework to 1.3.3
72-
- Start of Community Support
72+
- Added Unity Roslyn analyzers support (See <https://code.visualstudio.com/docs/other/unity#_enabling-unity-warnings>)
73+
- Added Formatting support (See CreateOmniSharpConfig() in VSCodeScriptEditor.cs)
74+
- Removed Rider Package (Spits)
75+
- Updated Text-Framework to 1.3.3
76+
- Start of Community Support
7377

7478
## [1.2.6] - 2023-03-10
7579

76-
- Added workspace file generation
77-
- End of Unity Support
80+
- Added workspace file generation
81+
- End of Unity Support
7882

7983
## [1.2.5] - 2022-02-07
8084

81-
- Introduce OnGeneratedCSProjectFiles, OnGeneratedCSProject and OnGeneratedSlnSolution callbacks.
82-
- Always use forward slash in source paths
83-
- Analyzers use absolute paths
84-
- Ruleset files for roslyn analyzers
85-
- Extra snap search paths on Ubuntu
86-
- Specific c# language version for specific unity versions
87-
- No longer hide .gitignore in VSCode file explorer
85+
- Introduce OnGeneratedCSProjectFiles, OnGeneratedCSProject and OnGeneratedSlnSolution callbacks.
86+
- Always use forward slash in source paths
87+
- Analyzers use absolute paths
88+
- Ruleset files for roslyn analyzers
89+
- Extra snap search paths on Ubuntu
90+
- Specific c# language version for specific unity versions
91+
- No longer hide .gitignore in VSCode file explorer
8892

8993
## [1.2.3] - 2020-10-23
9094

Editor/ProjectGeneration/ProjectGeneration.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,12 +1026,21 @@ void GenerateNugetJsonSourceFiles()
10261026
return;
10271027
}
10281028

1029+
string dotnetArguments = GetDotnetArguments();
1030+
1031+
if (dotnetArguments == null)
1032+
{
1033+
Debug.Log(
1034+
"Could not find a compatible dotnet arguments. Aborting Nuget Json generation."
1035+
);
1036+
return;
1037+
}
1038+
10291039
using var process = new System.Diagnostics.Process();
10301040
var processStartInfo = new System.Diagnostics.ProcessStartInfo
10311041
{
10321042
FileName = dotnetCommand,
1033-
Arguments = "-c \"dotnet build\"",
1034-
RedirectStandardOutput = true,
1043+
Arguments = dotnetArguments,
10351044
UseShellExecute = false,
10361045
CreateNoWindow = true
10371046
};
@@ -1049,6 +1058,19 @@ string GetDotnetCommand()
10491058
return "/bin/bash";
10501059
#elif UNITY_EDITOR_OSX
10511060
return "/bin/zsh";
1061+
#else
1062+
return null;
1063+
#endif
1064+
}
1065+
1066+
string GetDotnetArguments()
1067+
{
1068+
#if UNITY_EDITOR_WIN
1069+
return "build";
1070+
#elif UNITY_EDITOR_LINUX || UNITY_EDITOR_OSX
1071+
return "-c \"dotnet build\"";
1072+
#else
1073+
return null;
10521074
#endif
10531075
}
10541076
}

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.2",
5+
"version": "1.4.3",
66
"unity": "2021.3",
77
"dependencies": {},
88
"author": {

0 commit comments

Comments
 (0)