Skip to content

Commit

Permalink
Scaffold a VS extension project based on the new VS extensibility model.
Browse files Browse the repository at this point in the history
Part of #63.
  • Loading branch information
alexrp committed Dec 15, 2023
1 parent 92c5b75 commit 875b281
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 93 deletions.
4 changes: 4 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
Version="4.7.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk"
Version="17.8.0" />
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.Build"
Version="17.9.2080" />
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.Sdk"
Version="17.9.2080" />
<PackageVersion Include="NuGet.Versioning"
Version="6.7.0" />
<PackageVersion Include="OmniSharp.Extensions.LanguageServer"
Expand Down
190 changes: 100 additions & 90 deletions celerity.sln

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/extensions/vs/CelerityExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Vezel.Celerity.VisualStudio;

[SuppressMessage("", "CA1812")]
[VisualStudioContribution]
internal sealed class CelerityExtension : Extension
{
public override ExtensionConfiguration ExtensionConfiguration { get; } =
new()
{
Metadata = new(
"vs-celerity",
Version.Parse(ThisAssembly.AssemblyFileVersion),
"Vezel",
"Celerity",
"Celerity programming language support for Visual Studio."),
};
}
16 changes: 16 additions & 0 deletions src/extensions/vs/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- TODO: Remove this file when the packages are available on NuGet. -->
<configuration>
<packageSources>
<add key="vside" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/index.json" />
</packageSources>

<packageSourceMapping>
<packageSource key="vside">
<package pattern="Microsoft.NET.StringTools" />
<package pattern="Microsoft.ServiceHub.*" />
<package pattern="Microsoft.VisualStudio.*" />
<package pattern="Microsoft.VSSDK.*" />
<package pattern="StreamJsonRpc" />
</packageSource>
</packageSourceMapping>
</configuration>
2 changes: 2 additions & 0 deletions src/extensions/vs/vs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[assembly: DisableRuntimeMarshalling]
[module: SkipLocalsInit]
57 changes: 57 additions & 0 deletions src/extensions/vs/vs.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Vezel.Celerity.VisualStudio</AssemblyName>
<BeforePack>_PackVsixContainer</BeforePack>
<CopyDebugSymbolFilesFromPackages Condition="'$(DebugSymbols)' == 'true'">true</CopyDebugSymbolFilesFromPackages>
<CreateVsixContainer>false</CreateVsixContainer>
<RootNamespace>Vezel.Celerity.VisualStudio</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Using Include="Microsoft.VisualStudio.Extensibility" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../../language/library/library.csproj" />
<ProjectReference Include="../../language/service/service.csproj" />
</ItemGroup>

<ItemGroup>
<!-- TODO: Remove this hack when the packages are available on NuGet. -->
<GlobalPackageReference Remove="Microsoft.VisualStudio.Threading.Analyzers" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Extensibility.Build" />
<PackageReference Include="Microsoft.VisualStudio.Extensibility.Sdk" />
</ItemGroup>

<!--
Ordinarily, the VS SDK will produce the VSIX as part of a regular build. We
use this hack to ensure that it is only produced as part of a pack
operation. Also, we need more precise control over the output path and file
name.
We only run this target on Windows; the VSIX tools in the VS SDK do not
appear to work on Unix platforms.
-->
<Target Name="_PackVsixContainer"
DependsOnTargets="GetBuildVersion"
Condition="$([System.OperatingSystem]::IsWindows())">
<PropertyGroup>
<_VsixOutputPath>$(ArtifactsPath)/pkg/vs/$(Configuration.ToLowerInvariant())</_VsixOutputPath>
</PropertyGroup>

<MakeDir Directories="$(_VsixOutputPath)" />

<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="CreateVsixContainer"
Properties="CreateVsixContainer=true; TargetVsixContainer=$(_VsixOutputPath)/vs-celerity-$(Version).vsix"
BuildInParallel="$(BuildInParallel)" />
</Target>

<Import Project="../../language/core/core.targets" />
<Import Project="../../language/library/library.targets" />
<Import Project="../../language/service/service.targets" />
<Import Project="../../language/tooling/tooling.targets" />
</Project>
4 changes: 2 additions & 2 deletions src/extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/extensions/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "celerity",
"name": "vscode-celerity",
"displayName": "Celerity",
"description": "Celerity programming language support for Visual Studio Code.",
"publisher": "vezel",
Expand Down

0 comments on commit 875b281

Please sign in to comment.