Skip to content

Commit

Permalink
Merge pull request #2 from xWTF/main
Browse files Browse the repository at this point in the history
Fix crashes when settings.json contains comments or trailing commas
  • Loading branch information
taooceros authored Nov 3, 2022
2 parents 527e210 + 9abfab8 commit e395d31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Flow.Plugin.VSCodeWorkspaces.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<LangVersion>latest</LangVersion>
<Nullable>warnings</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand Down
6 changes: 5 additions & 1 deletion RemoteMachinesHelper/VSCodeRemoteMachinesApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ public List<VSCodeRemoteMachine> Machines

try
{
JsonElement vscodeSettingsFile = JsonSerializer.Deserialize<JsonElement>(fileContent);
JsonElement vscodeSettingsFile = JsonSerializer.Deserialize<JsonElement>(fileContent, new JsonSerializerOptions
{
AllowTrailingCommas = true,
ReadCommentHandling = JsonCommentHandling.Skip,
});
if (vscodeSettingsFile.TryGetProperty("remote.SSH.configFile", out var pathElement))
{
var path = pathElement.GetString();
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ActionKeyword": "{",
"Name": "VS Code Workspaces",
"Author": "ricardosantos9521",
"Version": "1.1.1",
"Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/ricardosantos9521/PowerToys/",
"ExecuteFileName": "Flow.Plugin.VSCodeWorkspaces.dll",
Expand Down

0 comments on commit e395d31

Please sign in to comment.