mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
* #15247 Powertoys Run | VSCodeWorkspaces- add support for vscode 1.64 new workspace.json file * Get previous open workspaces for sqlite file * check-spelling-bot Report fix * add dlls to installer and set SqliteConnection to readonly
This commit is contained in:
committed by
GitHub
parent
167ec5a3a8
commit
758a21a22f
3
.github/actions/spell-check/expect.txt
vendored
3
.github/actions/spell-check/expect.txt
vendored
@@ -359,6 +359,7 @@ dacl
|
|||||||
DARKPURPLE
|
DARKPURPLE
|
||||||
DARKTEAL
|
DARKTEAL
|
||||||
DARKYELLOW
|
DARKYELLOW
|
||||||
|
datareader
|
||||||
Datavalue
|
Datavalue
|
||||||
DATAW
|
DATAW
|
||||||
davidegiacometti
|
davidegiacometti
|
||||||
@@ -1815,6 +1816,7 @@ spsi
|
|||||||
spsia
|
spsia
|
||||||
spsrm
|
spsrm
|
||||||
spsv
|
spsv
|
||||||
|
sqlite
|
||||||
SRCCOPY
|
SRCCOPY
|
||||||
sre
|
sre
|
||||||
sregex
|
sregex
|
||||||
@@ -2114,6 +2116,7 @@ Vpn
|
|||||||
VREDRAW
|
VREDRAW
|
||||||
VSC
|
VSC
|
||||||
VSCBD
|
VSCBD
|
||||||
|
vscdb
|
||||||
vscode
|
vscode
|
||||||
VSCROLL
|
VSCROLL
|
||||||
vsonline
|
vsonline
|
||||||
|
|||||||
@@ -1330,7 +1330,7 @@
|
|||||||
|
|
||||||
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
|
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
|
||||||
<File Source="$(var.BinX64Dir)modules\Launcher\PowerToys.Launcher.dll" />
|
<File Source="$(var.BinX64Dir)modules\Launcher\PowerToys.Launcher.dll" />
|
||||||
<?foreach File in concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;NLog.dll;NLog.Extensions.Logging.dll;PowerToys.PowerLauncher.deps.json;PowerToys.PowerLauncher.dll;PowerToys.PowerLauncher.exe;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;PowerToys.PowerLauncher.runtimeconfig.json;System.Data.OleDb.dll;UnitsNet.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToys.Interop.dll;PowerToys.ManagedTelemetry.dll;PowerToys.PowerLauncher.Telemetry.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;PowerToys.ManagedCommon.dll;System.IO.Abstractions.dll;PowerToys.Common.UI.dll;System.ServiceProcess.ServiceController.dll;Microsoft.Toolkit.Uwp.Notifications.dll;ModernWpf.Controls.dll;ModernWpf.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Text.Encodings.Web.dll?>
|
<?foreach File in concrt140_app.dll;e_sqlite3.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;NLog.dll;NLog.Extensions.Logging.dll;PowerToys.PowerLauncher.deps.json;PowerToys.PowerLauncher.dll;PowerToys.PowerLauncher.exe;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;PowerToys.PowerLauncher.runtimeconfig.json;System.Data.OleDb.dll;UnitsNet.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToys.Interop.dll;PowerToys.ManagedTelemetry.dll;PowerToys.PowerLauncher.Telemetry.dll;Microsoft.Data.Sqlite.dll;SQLitePCLRaw.batteries_v2.dll;SQLitePCLRaw.core.dll;SQLitePCLRaw.provider.e_sqlite3.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;PowerToys.ManagedCommon.dll;System.IO.Abstractions.dll;PowerToys.Common.UI.dll;System.ServiceProcess.ServiceController.dll;Microsoft.Toolkit.Uwp.Notifications.dll;ModernWpf.Controls.dll;ModernWpf.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Text.Encodings.Web.dll?>
|
||||||
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\$(var.File)" />
|
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\$(var.File)" />
|
||||||
<?endforeach?>
|
<?endforeach?>
|
||||||
<File Source="$(var.BinX64Dir)Settings\PowerToys.Settings.UI.Lib.dll" />
|
<File Source="$(var.BinX64Dir)Settings\PowerToys.Settings.UI.Lib.dll" />
|
||||||
|
|||||||
@@ -1,108 +1,109 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||||
<Import Project="..\..\..\..\Version.props" />
|
<Import Project="..\..\..\..\Version.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<ProjectGuid>{4D971245-7A70-41D5-BAA0-DDB5684CAF51}</ProjectGuid>
|
<ProjectGuid>{4D971245-7A70-41D5-BAA0-DDB5684CAF51}</ProjectGuid>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Community.PowerToys.Run.Plugin.VSCodeWorkspaces</RootNamespace>
|
<RootNamespace>Community.PowerToys.Run.Plugin.VSCodeWorkspaces</RootNamespace>
|
||||||
<AssemblyName>Community.PowerToys.Run.Plugin.VSCodeWorkspaces</AssemblyName>
|
<AssemblyName>Community.PowerToys.Run.Plugin.VSCodeWorkspaces</AssemblyName>
|
||||||
<Version>$(Version).0</Version>
|
<Version>$(Version).0</Version>
|
||||||
<useWPF>true</useWPF>
|
<useWPF>true</useWPF>
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\..\..\..\..\x64\Debug\modules\launcher\Plugins\VSCodeWorkspaces\</OutputPath>
|
<OutputPath>..\..\..\..\..\x64\Debug\modules\launcher\Plugins\VSCodeWorkspaces\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<OutputPath>..\..\..\..\..\x64\Release\modules\launcher\Plugins\VSCodeWorkspaces\</OutputPath>
|
<OutputPath>..\..\..\..\..\x64\Release\modules\launcher\Plugins\VSCodeWorkspaces\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="plugin.json">
|
<None Include="plugin.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" />
|
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" />
|
||||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj" />
|
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\..\..\..\codeAnalysis\GlobalSuppressions.cs">
|
<Compile Include="..\..\..\..\codeAnalysis\GlobalSuppressions.cs">
|
||||||
<Link>GlobalSuppressions.cs</Link>
|
<Link>GlobalSuppressions.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<AdditionalFiles Include="..\..\..\..\codeAnalysis\StyleCop.json">
|
<AdditionalFiles Include="..\..\..\..\codeAnalysis\StyleCop.json">
|
||||||
<Link>StyleCop.json</Link>
|
<Link>StyleCop.json</Link>
|
||||||
</AdditionalFiles>
|
</AdditionalFiles>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PackageReference Include="System.Runtime" Version="4.3.1" />
|
</PackageReference>
|
||||||
</ItemGroup>
|
<PackageReference Include="System.Runtime" Version="4.3.1" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Windows.Foundation.UniversalApiContract">
|
<ItemGroup>
|
||||||
<HintPath>C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Windows.Foundation.UniversalApiContract\8.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
|
<Reference Include="Windows.Foundation.UniversalApiContract">
|
||||||
</Reference>
|
<HintPath>C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Windows.Foundation.UniversalApiContract\8.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
|
||||||
</ItemGroup>
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="Properties\Resources.Designer.cs">
|
<ItemGroup>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<AutoGen>True</AutoGen>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
<AutoGen>True</AutoGen>
|
||||||
</ItemGroup>
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Update="Properties\Resources.resx">
|
<ItemGroup>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
</ItemGroup>
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<None Update="Images\folder.png">
|
<ItemGroup>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<None Update="Images\folder.png">
|
||||||
</None>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<None Update="Images\monitor.png">
|
</None>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<None Update="Images\monitor.png">
|
||||||
</None>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<None Update="Images\code-dark.png">
|
</None>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<None Update="Images\code-dark.png">
|
||||||
</None>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
<None Update="Images\code-light.png">
|
</None>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<None Update="Images\code-light.png">
|
||||||
</None>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</ItemGroup>
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
||||||
|
{
|
||||||
|
// v1.64 uses AppData\Roaming\Code\User\globalStorage\state.vscdb - history.recentlyOpenedPathsList
|
||||||
|
public class VSCodeStorageEntries
|
||||||
|
{
|
||||||
|
[JsonPropertyName("entries")]
|
||||||
|
public List<VSCodeWorkspaceEntry> Entries { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,9 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
[JsonPropertyName("label")]
|
[JsonPropertyName("label")]
|
||||||
public string Label { get; set; }
|
public string Label { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("remoteAuthority")]
|
||||||
|
public string RemoteAuthority { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("workspace")]
|
[JsonPropertyName("workspace")]
|
||||||
public VSCodeWorkspaceProperty Workspace { get; set; }
|
public VSCodeWorkspaceProperty Workspace { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper;
|
using Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper;
|
||||||
|
using Microsoft.Data.Sqlite;
|
||||||
using Wox.Plugin.Logger;
|
using Wox.Plugin.Logger;
|
||||||
|
|
||||||
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
||||||
@@ -18,7 +19,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private VSCodeWorkspace ParseVSCodeUri(string uri, VSCodeInstance vscodeInstance, bool isWorkspaceFile = false)
|
private VSCodeWorkspace ParseVSCodeUri(string uri, VSCodeInstance vscodeInstance, bool isWorkspace = false)
|
||||||
{
|
{
|
||||||
if (uri != null && uri is string)
|
if (uri != null && uri is string)
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
return new VSCodeWorkspace()
|
return new VSCodeWorkspace()
|
||||||
{
|
{
|
||||||
Path = uri,
|
Path = uri,
|
||||||
WorkspaceType = isWorkspaceFile ? WorkspaceType.WorkspaceFile : WorkspaceType.ProjectFolder,
|
WorkspaceType = isWorkspace ? WorkspaceType.WorkspaceFile : WorkspaceType.ProjectFolder,
|
||||||
RelativePath = typeWorkspace.Path,
|
RelativePath = typeWorkspace.Path,
|
||||||
FolderName = folderName,
|
FolderName = folderName,
|
||||||
ExtraInfo = typeWorkspace.MachineName,
|
ExtraInfo = typeWorkspace.MachineName,
|
||||||
@@ -62,6 +63,9 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
// storage.json contains opened Workspaces
|
// storage.json contains opened Workspaces
|
||||||
var vscode_storage = Path.Combine(vscodeInstance.AppData, "storage.json");
|
var vscode_storage = Path.Combine(vscodeInstance.AppData, "storage.json");
|
||||||
|
|
||||||
|
// User/globalStorage/state.vscdb - history.recentlyOpenedPathsList - vscode v1.64 or later
|
||||||
|
var vscode_storage_db = Path.Combine(vscodeInstance.AppData, "User/globalStorage/state.vscdb");
|
||||||
|
|
||||||
if (File.Exists(vscode_storage))
|
if (File.Exists(vscode_storage))
|
||||||
{
|
{
|
||||||
var fileContent = File.ReadAllText(vscode_storage);
|
var fileContent = File.ReadAllText(vscode_storage);
|
||||||
@@ -70,7 +74,7 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
{
|
{
|
||||||
VSCodeStorageFile vscodeStorageFile = JsonSerializer.Deserialize<VSCodeStorageFile>(fileContent);
|
VSCodeStorageFile vscodeStorageFile = JsonSerializer.Deserialize<VSCodeStorageFile>(fileContent);
|
||||||
|
|
||||||
if (vscodeStorageFile != null)
|
if (vscodeStorageFile != null && vscodeStorageFile.OpenedPathsList != null)
|
||||||
{
|
{
|
||||||
// for previous versions of vscode
|
// for previous versions of vscode
|
||||||
if (vscodeStorageFile.OpenedPathsList.Workspaces3 != null)
|
if (vscodeStorageFile.OpenedPathsList.Workspaces3 != null)
|
||||||
@@ -106,6 +110,50 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (File.Exists(vscode_storage_db))
|
||||||
|
{
|
||||||
|
var sqliteConnection = new SqliteConnection($"Data Source={vscode_storage_db};Mode=ReadOnly;");
|
||||||
|
sqliteConnection.Open();
|
||||||
|
|
||||||
|
if (sqliteConnection.State == System.Data.ConnectionState.Open)
|
||||||
|
{
|
||||||
|
var sqlite_cmd = sqliteConnection.CreateCommand();
|
||||||
|
sqlite_cmd.CommandText = "SELECT value FROM ItemTable WHERE key LIKE 'history.recentlyOpenedPathsList'";
|
||||||
|
|
||||||
|
var sqlite_datareader = sqlite_cmd.ExecuteReader();
|
||||||
|
|
||||||
|
if (sqlite_datareader.Read())
|
||||||
|
{
|
||||||
|
string entries = sqlite_datareader.GetString(0);
|
||||||
|
if (!string.IsNullOrEmpty(entries))
|
||||||
|
{
|
||||||
|
VSCodeStorageEntries vscodeStorageEntries = JsonSerializer.Deserialize<VSCodeStorageEntries>(entries);
|
||||||
|
if (vscodeStorageEntries.Entries != null)
|
||||||
|
{
|
||||||
|
vscodeStorageEntries.Entries = vscodeStorageEntries.Entries.Where(x => x != null).ToList();
|
||||||
|
foreach (var entry in vscodeStorageEntries.Entries)
|
||||||
|
{
|
||||||
|
bool isWorkspaceFile = false;
|
||||||
|
var uri = entry.FolderUri;
|
||||||
|
if (entry.Workspace != null && entry.Workspace.ConfigPath != null)
|
||||||
|
{
|
||||||
|
isWorkspaceFile = true;
|
||||||
|
uri = entry.Workspace.ConfigPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
var workspace = ParseVSCodeUri(uri, vscodeInstance, isWorkspaceFile);
|
||||||
|
if (workspace != null)
|
||||||
|
{
|
||||||
|
results.Add(workspace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sqliteConnection.Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,6 +99,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
|
||||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="6.1.1" />
|
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="6.1.1" />
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
||||||
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
|
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
|
||||||
|
|||||||
Reference in New Issue
Block a user