зеркало из https://github.com/dotnet/razor.git
Merge branch 'main' into features/the-merge
This commit is contained in:
Коммит
15c2cba70e
|
@ -246,7 +246,7 @@
|
|||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -255,7 +255,7 @@
|
|||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "NTaylorMullen"
|
||||
"user": "DustinCampbell"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -303,6 +303,17 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"operator": "not",
|
||||
"operands": [
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "arkalyanms"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -386,7 +397,7 @@
|
|||
{
|
||||
"name": "removedFromMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -1655,16 +1666,27 @@
|
|||
"operator": "and",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
"user": "arkalyanms"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "NTaylorMullen"
|
||||
}
|
||||
"operator": "or",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isInMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1673,13 +1695,13 @@
|
|||
"issues",
|
||||
"project_card"
|
||||
],
|
||||
"taskName": "**UPDATE EACH SPRINT** [Issues] Add current milestone's issues to tracking project (Taylor)",
|
||||
"taskName": "**UPDATE EACH SPRINT** [Issues] Add current milestone's issues to tracking project (Arun)",
|
||||
"actions": [
|
||||
{
|
||||
"name": "addToProject",
|
||||
"parameters": {
|
||||
"projectName": "17.4 P1 Current Sprint",
|
||||
"columnName": "Taylor"
|
||||
"projectName": "17.4 Current Sprint",
|
||||
"columnName": "Arun"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -1694,17 +1716,28 @@
|
|||
"conditions": {
|
||||
"operator": "and",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "allisonchou"
|
||||
}
|
||||
},
|
||||
{
|
||||
"operator": "or",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isInMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1718,7 +1751,7 @@
|
|||
{
|
||||
"name": "addToProject",
|
||||
"parameters": {
|
||||
"projectName": "17.4 P1 Current Sprint",
|
||||
"projectName": "17.4 Current Sprint",
|
||||
"columnName": "Allison"
|
||||
}
|
||||
}
|
||||
|
@ -1734,17 +1767,28 @@
|
|||
"conditions": {
|
||||
"operator": "and",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "ryzngard"
|
||||
}
|
||||
},
|
||||
{
|
||||
"operator": "or",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isInMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1757,7 +1801,7 @@
|
|||
{
|
||||
"name": "addToProject",
|
||||
"parameters": {
|
||||
"projectName": "17.4 P1 Current Sprint",
|
||||
"projectName": "17.4 Current Sprint",
|
||||
"columnName": "Andrew"
|
||||
}
|
||||
}
|
||||
|
@ -1774,17 +1818,28 @@
|
|||
"conditions": {
|
||||
"operator": "and",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "davidwengier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"operator": "or",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isInMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1798,7 +1853,7 @@
|
|||
{
|
||||
"name": "addToProject",
|
||||
"parameters": {
|
||||
"projectName": "17.4 P1 Current Sprint",
|
||||
"projectName": "17.4 Current Sprint",
|
||||
"columnName": "David"
|
||||
}
|
||||
}
|
||||
|
@ -1814,17 +1869,28 @@
|
|||
"conditions": {
|
||||
"operator": "and",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "ryanbrandenburg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"operator": "or",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isInMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1857,7 +1923,7 @@
|
|||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview2 CC:~8/29"
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1922,6 +1988,58 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskType": "trigger",
|
||||
"capabilityId": "IssueResponder",
|
||||
"subCapability": "IssuesOnlyResponder",
|
||||
"version": "1.0",
|
||||
"config": {
|
||||
"conditions": {
|
||||
"operator": "and",
|
||||
"operands": [
|
||||
{
|
||||
"name": "isAssignedToUser",
|
||||
"parameters": {
|
||||
"user": "DustinCampbell"
|
||||
}
|
||||
},
|
||||
{
|
||||
"operator": "or",
|
||||
"operands": [
|
||||
{
|
||||
"name": "addedToMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isInMilestone",
|
||||
"parameters": {
|
||||
"milestoneName": "17.4-Preview3 CC:~9/29"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"eventType": "issue",
|
||||
"eventNames": [
|
||||
"issues",
|
||||
"project_card"
|
||||
],
|
||||
"taskName": "**UPDATE EACH SPRINT** [Issues] Add current milestone's issues to tracking project (Dustin)",
|
||||
"actions": [
|
||||
{
|
||||
"name": "addToProject",
|
||||
"parameters": {
|
||||
"isOrgProject": false,
|
||||
"projectName": "17.4 Current Sprint",
|
||||
"columnName": "Dustin"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"userGroups": []
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)eng\BannedSymbols.txt" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)\src\Shared\LanguageSupport\*.cs" Link="LanguageSupport\%(Filename).%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Label="Package and Assembly Metadata">
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
|
||||
<!-- Used for BenchmarkDotNet prerelease packages -->
|
||||
<add key="benchmark-dotnet-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/benchmark-dotnet-prerelease/nuget/v3/index.json" />
|
||||
<add key="general-testing" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/general-testing/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
<!--
|
||||
****************************** AUTOGENERATED ***********************************
|
||||
|
@ -40,6 +41,9 @@
|
|||
-->
|
||||
<packageSourceMapping>
|
||||
<clear />
|
||||
<packageSource key="general-testing">
|
||||
<package pattern="microsoft.commonlanguageserverProtocol.*" />
|
||||
</packageSource>
|
||||
<packageSource key="dotnet-core-internal-tooling">
|
||||
<package pattern="microsoft.*" />
|
||||
</packageSource>
|
||||
|
@ -99,6 +103,9 @@
|
|||
<package pattern="nuget.solutionrestoremanager.interop" />
|
||||
<package pattern="nuget.versioning" />
|
||||
<package pattern="omnisharp.abstractions" />
|
||||
<!-- The following are all needed because of a single reference to DocumentUri in
|
||||
FormattingLanguageServerClient for testing. We should remove them -->
|
||||
<package pattern="omnisharp.abstractions" />
|
||||
<package pattern="omnisharp.extensions.jsonrpc" />
|
||||
<package pattern="omnisharp.extensions.jsonrpc.generators" />
|
||||
<package pattern="omnisharp.extensions.languageprotocol" />
|
||||
|
@ -125,6 +132,7 @@
|
|||
<packageSource key="vs-impl">
|
||||
<package pattern="microbuild.core.sentinel" />
|
||||
<package pattern="microsoft.*" />
|
||||
<package pattern="microsoft.commonlanguageserverProtocol.*" />
|
||||
</packageSource>
|
||||
<packageSource key="myget-legacy">
|
||||
<package pattern="microsoft.*" />
|
||||
|
|
|
@ -15,7 +15,7 @@ resources:
|
|||
- repository: DartLabTemplates
|
||||
type: git
|
||||
name: DartLab.Templates
|
||||
ref: refs/heads/dev/bradwhit/RemoveCheckoutNone
|
||||
ref: main
|
||||
- repository: RazorMirror
|
||||
endpoint: dnceng/internal dotnet-razor-tooling
|
||||
type: git
|
||||
|
|
|
@ -31,8 +31,8 @@ stages:
|
|||
jobs:
|
||||
- job: Windows
|
||||
pool:
|
||||
name: NetCore1ESPool-Public
|
||||
demands: ImageOverride -equals build.windows.10.amd64.vs2019.pre.open
|
||||
name: NetCore-Public
|
||||
demands: ImageOverride -equals windows.vs2019.amd64.open
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
|
|
|
@ -64,11 +64,11 @@ stages:
|
|||
displayName: Code check
|
||||
pool:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
name: NetCore1ESPool-Public
|
||||
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
|
||||
name: NetCore-Public
|
||||
demands: ImageOverride -equals windows.vs2022preview.amd64.open
|
||||
${{ if ne(variables['System.TeamProject'], 'public') }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Main
|
||||
demands: ImageOverride -equals windows.vs2022preview.amd64
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
displayName: Install Node 10.x
|
||||
|
@ -110,11 +110,11 @@ stages:
|
|||
timeoutInMinutes: 120
|
||||
pool:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
name: NetCore1ESPool-Public
|
||||
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
|
||||
name: NetCore-Public
|
||||
demands: ImageOverride -equals windows.vs2022preview.amd64.open
|
||||
${{ if ne(variables['System.TeamProject'], 'public') }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre
|
||||
demands: ImageOverride -equals windows.vs2022preview.amd64
|
||||
strategy:
|
||||
matrix:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
|
@ -363,7 +363,7 @@ stages:
|
|||
options: --init # This ensures all the stray defunct processes are reaped.
|
||||
pool:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
vmImage: ubuntu-18.04
|
||||
vmImage: ubuntu-latest
|
||||
${{ if eq(variables['System.TeamProject'], 'internal') }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@echo off
|
||||
setlocal
|
||||
|
||||
set _args=%*
|
||||
set _args=-restore -build %*
|
||||
if "%~1"=="-?" set _args=-help
|
||||
|
||||
powershell -ExecutionPolicy ByPass -NoProfile -Command "& '%~dp0eng\common\build.ps1'" %_args%
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Creating a C# Language Server Framework
|
||||
|
||||
## Background
|
||||
|
||||
The [language server protocol](https://microsoft.github.io/language-server-protocol/specification) is a standard that IDE's can implement in order to provide language service functionality for any number of languages. Because of this, on the official LSP specification site there exists a [list of implementations](https://microsoft.github.io/language-server-protocol/implementors/servers/) for each language. This list contains the list of language servers for languages while simultaneously indicating their "implementation language". The implementation language is where things get interesting (was it written in C#, JS, C++ etc.). Each implementation language typically has a standard framework / library to make writing language servers easy. For instance there's a [JavaScript framework](https://github.com/microsoft/vscode-languageserver-node) and even a [C# framework](https://github.com/omniSharp/csharp-language-server-protocol/) to ease in the writing of language servers. Having a framework is appealing because language servers don't exist for there to be only a single language server for a single language; they exist so that many can be created to provide ever-extending language services for features and are language agnostic (fun fact: Python language server used to be written in C#).
|
||||
|
||||
## Problem
|
||||
|
||||
As mentioned in the [Background](#background) section there exists many language server frameworks, one of which is C# which we'll call from here on out the **C# LSP framework**. The C# LSP framework was written by the creators of [OmniSharp](http://www.omnisharp.net/), is open source and today maintained by a single individual (David Driscoll). The framework originated with the intent to make writing C# language servers easy and quickly became a catch-all for every problem in the language server ecosystem. Effectively it saw all the problems that could possible exist and tried to solve them. While attempting to solve every problem was a noble cause it became its biggest weakness. Solving every problem for every C# language server has led to heaps of dependencies, fragile request handling, arcane service resolution, lengthy startup times, awkward end-user APIs and a highly coupled internal system that's difficult to reason about. In addition to the above given the lack of investment in modernizing the O# framework from the community it has also collected significant technical debt preventing those who depend on it to evolve with the times.
|
||||
|
||||
As it stands today the Razor language server currently depends on the C# LSP framework and because of this it encounters the following problems:
|
||||
|
||||
- Slower startup time
|
||||
- High dependency count
|
||||
- Unstructured logging / tracing
|
||||
- Race conditions in request handling
|
||||
- Replication of Visual Studio LSP++ concepts
|
||||
|
||||
## Proposal
|
||||
|
||||
Being the creators of the Razor, Roslyn, and WebTools language servers we can take what we've learned and build a simplistic C# framework that Razor, C#, HTML, CSS and any other partner can sit ontop of to simplify language server development. Future improvements to the framework would translate across server boundaries, implementations would be consistent and any LSP++ implementations would be readily available for all to consume. Similarly I could envision a world where IntelliCode and other third parties may be able to use this tech to better extend Visual Studio in a reasonable way.
|
||||
|
||||
The new framework would opt-for simplicity. This means we wouldn't add bells and whistles to automatically understand configuration or automatically include various services in handlers. In a lot of ways we'd modernize what the Roslyn C# server has already done and lift or add bits of functionality that is unequivocally required.
|
||||
|
||||
This simplistic approach would mean building a core piece of infrastructure that could consume and respond to requests in an LSP centric way. Some of the things we can tackle:
|
||||
|
||||
- Build request handling that is `textDocument/didX` aware (things that typically mutate state) and optimize when certain requests are run to prevent races while allowing high parallelizability
|
||||
- Create LSP++ APIs / handler abstractions to ease in implementation
|
||||
- Do less work on startup to allow for instantaneous startup
|
||||
- Structurally log specific bits of information to ease in diagnosability
|
||||
- Reduce the number of dependencies we have / include in all platforms
|
||||
- Couple to the Visual Studio language server protocol binaries
|
||||
|
||||
And lastly it goes without saying that building a server framework internally would enable us to iterate quicker on core-platform issues without waiting for the C# LSP frameworks reaction.
|
|
@ -32,9 +32,9 @@
|
|||
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
|
||||
<Sha>3a25a7f1cc446b60678ed25c9d829420d6321eba</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22411.2">
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22473.1">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>6a638cd0c13962ab2a1943cb1c878be5a41dd82e</Sha>
|
||||
<Sha>ba4d2568dd2e3e7538feeaba60215f7bcb99e89c</Sha>
|
||||
</Dependency>
|
||||
</ToolsetDependencies>
|
||||
</Dependencies>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- Opt-in arcade features -->
|
||||
<PropertyGroup>
|
||||
<UsingToolVSSDK>true</UsingToolVSSDK>
|
||||
<MicrosoftVSSDKBuildToolsVersion>17.0.5232</MicrosoftVSSDKBuildToolsVersion>
|
||||
<MicrosoftVSSDKBuildToolsVersion>17.3.2094</MicrosoftVSSDKBuildToolsVersion>
|
||||
<MicroBuildPluginsSwixBuildVersion>1.1.33</MicroBuildPluginsSwixBuildVersion>
|
||||
<!-- Use .NET Framework reference assemblies from a nuget package so machine-global targeting packs do not need to be installed. -->
|
||||
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
|
||||
|
@ -79,8 +79,9 @@
|
|||
<MicrosoftVisualStudioShellPackagesVersion>17.2.32330.158</MicrosoftVisualStudioShellPackagesVersion>
|
||||
<MicrosoftVisualStudioPackagesVersion>17.3.133-preview</MicrosoftVisualStudioPackagesVersion>
|
||||
<RoslynPackageVersion>4.4.0-2.22424.2</RoslynPackageVersion>
|
||||
<VisualStudioLanguageServerProtocolVersion>17.4.1004-preview</VisualStudioLanguageServerProtocolVersion>
|
||||
<VisualStudioLanguageServerProtocolVersion>17.4.1008-preview</VisualStudioLanguageServerProtocolVersion>
|
||||
<MicrosoftNetCompilersToolsetVersion>4.4.0-1.final</MicrosoftNetCompilersToolsetVersion>
|
||||
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.4.0-3.22463.10</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Manual">
|
||||
<!-- dotnet/runtime packages -->
|
||||
|
@ -88,6 +89,7 @@
|
|||
<SystemDiagnosticsDiagnosticSourcePackageVersion>6.0.0</SystemDiagnosticsDiagnosticSourcePackageVersion>
|
||||
<SystemResourcesExtensionsPackageVersion>6.0.0</SystemResourcesExtensionsPackageVersion>
|
||||
<SystemTextEncodingsWebPackageVersion>6.0.0</SystemTextEncodingsWebPackageVersion>
|
||||
<SystemPrivateUriPackageVersion>4.3.2</SystemPrivateUriPackageVersion>
|
||||
<MicrosoftExtensionsNonCapturingTimerSourcesPackageVersion>5.0.0-preview.4.20205.1</MicrosoftExtensionsNonCapturingTimerSourcesPackageVersion>
|
||||
<BenchmarkDotNetPackageVersion>0.12.1.1466</BenchmarkDotNetPackageVersion>
|
||||
<MicrosoftBuildLocatorPackageVersion>1.2.6</MicrosoftBuildLocatorPackageVersion>
|
||||
|
@ -97,7 +99,7 @@
|
|||
<MicrosoftCodeAnalysisAnalyzerTestingPackageVersion>$(Tooling_MicrosoftCodeAnalysisTestingVersion)</MicrosoftCodeAnalysisAnalyzerTestingPackageVersion>
|
||||
<MicrosoftCodeAnalysisTestingVerifiersXunitPackageVersion>$(Tooling_MicrosoftCodeAnalysisTestingVersion)</MicrosoftCodeAnalysisTestingVerifiersXunitPackageVersion>
|
||||
<MicrosoftVisualStudioEditorPackageVersion>$(MicrosoftVisualStudioPackagesVersion)</MicrosoftVisualStudioEditorPackageVersion>
|
||||
<MicrosoftVisualStudioExtensibilityTestingXunitVersion>0.1.137-beta</MicrosoftVisualStudioExtensibilityTestingXunitVersion>
|
||||
<MicrosoftVisualStudioExtensibilityTestingXunitVersion>0.1.145-beta</MicrosoftVisualStudioExtensibilityTestingXunitVersion>
|
||||
<MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>$(MicrosoftVisualStudioExtensibilityTestingXunitVersion)</MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>
|
||||
<MicrosoftVisualStudioLanguagePackageVersion>$(MicrosoftVisualStudioPackagesVersion)</MicrosoftVisualStudioLanguagePackageVersion>
|
||||
<MicrosoftVisualStudioLanguageIntellisensePackageVersion>$(MicrosoftVisualStudioPackagesVersion)</MicrosoftVisualStudioLanguageIntellisensePackageVersion>
|
||||
|
@ -111,6 +113,7 @@
|
|||
<MicrosoftVisualStudioInteropPackageVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioInteropPackageVersion>
|
||||
<MicrosoftInternalVisualStudioInteropPackageVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftInternalVisualStudioInteropPackageVersion>
|
||||
<MicrosoftVisualStudioRpcContractsPackageVersion>17.3.3-alpha</MicrosoftVisualStudioRpcContractsPackageVersion>
|
||||
<MicrosoftVisualStudioTelemetryVersion>16.4.137</MicrosoftVisualStudioTelemetryVersion>
|
||||
<MicrosoftVisualStudioTextDataPackageVersion>$(MicrosoftVisualStudioPackagesVersion)</MicrosoftVisualStudioTextDataPackageVersion>
|
||||
<MicrosoftVisualStudioTextImplementationPackageVersion>$(MicrosoftVisualStudioPackagesVersion)</MicrosoftVisualStudioTextImplementationPackageVersion>
|
||||
<MicrosoftVisualStudioTextLogicPackageVersion>$(MicrosoftVisualStudioPackagesVersion)</MicrosoftVisualStudioTextLogicPackageVersion>
|
||||
|
@ -128,6 +131,7 @@
|
|||
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
|
||||
<NerdbankStreamsPackageVersion>2.8.57</NerdbankStreamsPackageVersion>
|
||||
<NuGetSolutionRestoreManagerInteropVersion>4.8.0</NuGetSolutionRestoreManagerInteropVersion>
|
||||
|
||||
<OmniSharpExtensionsLanguageServerPackageVersion>0.19.5</OmniSharpExtensionsLanguageServerPackageVersion>
|
||||
<OmniSharpExtensionsLanguageProtocolPackageVersion>$(OmniSharpExtensionsLanguageServerPackageVersion)</OmniSharpExtensionsLanguageProtocolPackageVersion>
|
||||
<OmniSharpMSBuildPackageVersion>1.39.1</OmniSharpMSBuildPackageVersion>
|
||||
|
|
|
@ -26,6 +26,7 @@ Param(
|
|||
[string] $runtimeSourceFeed = '',
|
||||
[string] $runtimeSourceFeedKey = '',
|
||||
[switch] $excludePrereleaseVS,
|
||||
[switch] $nativeToolsOnMachine,
|
||||
[switch] $help,
|
||||
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
|
||||
)
|
||||
|
@ -67,6 +68,7 @@ function Print-Usage() {
|
|||
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
|
||||
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
|
||||
Write-Host " -excludePrereleaseVS Set to exclude build engines in prerelease versions of Visual Studio"
|
||||
Write-Host " -nativeToolsOnMachine Sets the native tools on machine environment variable (indicating that the script should use native tools on machine)"
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "Command line arguments not listed above are passed thru to msbuild."
|
||||
|
@ -146,6 +148,9 @@ try {
|
|||
$nodeReuse = $false
|
||||
}
|
||||
|
||||
if ($nativeToolsOnMachine) {
|
||||
$env:NativeToolsOnMachine = $true
|
||||
}
|
||||
if ($restore) {
|
||||
InitializeNativeTools
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
|
|
@ -0,0 +1,11 @@
|
|||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
|
|
@ -0,0 +1,11 @@
|
|||
deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
|
|
@ -0,0 +1,11 @@
|
|||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted
|
||||
|
||||
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
|
||||
deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
|
|
@ -76,10 +76,10 @@ __FreeBSDPackages+=" openssl"
|
|||
__FreeBSDPackages+=" krb5"
|
||||
__FreeBSDPackages+=" terminfo-db"
|
||||
|
||||
__IllumosPackages="icu-64.2nb2"
|
||||
__IllumosPackages+=" mit-krb5-1.16.2nb4"
|
||||
__IllumosPackages+=" openssl-1.1.1e"
|
||||
__IllumosPackages+=" zlib-1.2.11"
|
||||
__IllumosPackages="icu"
|
||||
__IllumosPackages+=" mit-krb5"
|
||||
__IllumosPackages+=" openssl"
|
||||
__IllumosPackages+=" zlib"
|
||||
|
||||
__HaikuPackages="gmp"
|
||||
__HaikuPackages+=" gmp_devel"
|
||||
|
@ -186,32 +186,27 @@ while :; do
|
|||
__UbuntuArch=i386
|
||||
__UbuntuRepo="http://archive.ubuntu.com/ubuntu/"
|
||||
;;
|
||||
lldb3.6)
|
||||
__LLDB_Package="lldb-3.6-dev"
|
||||
;;
|
||||
lldb3.8)
|
||||
__LLDB_Package="lldb-3.8-dev"
|
||||
;;
|
||||
lldb3.9)
|
||||
__LLDB_Package="liblldb-3.9-dev"
|
||||
;;
|
||||
lldb4.0)
|
||||
__LLDB_Package="liblldb-4.0-dev"
|
||||
;;
|
||||
lldb5.0)
|
||||
__LLDB_Package="liblldb-5.0-dev"
|
||||
;;
|
||||
lldb6.0)
|
||||
__LLDB_Package="liblldb-6.0-dev"
|
||||
lldb*)
|
||||
version="${lowerI/lldb/}"
|
||||
parts=(${version//./ })
|
||||
|
||||
# for versions > 6.0, lldb has dropped the minor version
|
||||
if [[ "${parts[0]}" -gt 6 ]]; then
|
||||
version="${parts[0]}"
|
||||
fi
|
||||
|
||||
__LLDB_Package="liblldb-${version}-dev"
|
||||
;;
|
||||
no-lldb)
|
||||
unset __LLDB_Package
|
||||
;;
|
||||
llvm*)
|
||||
version="$(echo "$lowerI" | tr -d '[:alpha:]-=')"
|
||||
version="${lowerI/llvm/}"
|
||||
parts=(${version//./ })
|
||||
__LLVM_MajorVersion="${parts[0]}"
|
||||
__LLVM_MinorVersion="${parts[1]}"
|
||||
|
||||
# for versions > 6.0, llvm has dropped the minor version
|
||||
if [[ -z "$__LLVM_MinorVersion" && "$__LLVM_MajorVersion" -le 6 ]]; then
|
||||
__LLVM_MinorVersion=0;
|
||||
fi
|
||||
|
@ -231,6 +226,16 @@ while :; do
|
|||
__CodeName=bionic
|
||||
fi
|
||||
;;
|
||||
focal) # Ubuntu 20.04
|
||||
if [[ "$__CodeName" != "jessie" ]]; then
|
||||
__CodeName=focal
|
||||
fi
|
||||
;;
|
||||
jammy) # Ubuntu 22.04
|
||||
if [[ "$__CodeName" != "jessie" ]]; then
|
||||
__CodeName=jammy
|
||||
fi
|
||||
;;
|
||||
jessie) # Debian 8
|
||||
__CodeName=jessie
|
||||
__UbuntuRepo="http://ftp.debian.org/debian/"
|
||||
|
@ -390,14 +395,18 @@ elif [[ "$__CodeName" == "illumos" ]]; then
|
|||
if [[ "$__UseMirror" == 1 ]]; then
|
||||
BaseUrl=http://pkgsrc.smartos.skylime.net
|
||||
fi
|
||||
BaseUrl="$BaseUrl/packages/SmartOS/2020Q1/${__illumosArch}/All"
|
||||
BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All"
|
||||
echo "Downloading manifest"
|
||||
wget "$BaseUrl"
|
||||
echo "Downloading dependencies."
|
||||
read -ra array <<<"$__IllumosPackages"
|
||||
for package in "${array[@]}"; do
|
||||
echo "Installing $package..."
|
||||
echo "Installing '$package'"
|
||||
package="$(grep ">$package-[0-9]" All | sed -En 's/.*href="(.*)\.tgz".*/\1/p')"
|
||||
echo "Resolved name '$package'"
|
||||
wget "$BaseUrl"/"$package".tgz
|
||||
ar -x "$package".tgz
|
||||
tar --skip-old-files -xzf "$package".tmp.tgz -C "$__RootfsDir" 2>/dev/null
|
||||
tar --skip-old-files -xzf "$package".tmp.tg* -C "$__RootfsDir" 2>/dev/null
|
||||
done
|
||||
echo "Cleaning up temporary files."
|
||||
popd
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
|
|
@ -0,0 +1,11 @@
|
|||
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
|
|
@ -33,6 +33,8 @@ $jsonTemplateFiles | ForEach-Object {
|
|||
|
||||
$jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern
|
||||
|
||||
$wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them
|
||||
|
||||
$xlfFiles = @()
|
||||
|
||||
$allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf"
|
||||
|
@ -60,7 +62,7 @@ $locJson = @{
|
|||
$outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")"
|
||||
$continue = $true
|
||||
foreach ($exclusion in $exclusions.Exclusions) {
|
||||
if ($outputPath.Contains($exclusion))
|
||||
if ($_.FullName.Contains($exclusion))
|
||||
{
|
||||
$continue = $false
|
||||
}
|
||||
|
@ -77,8 +79,7 @@ $locJson = @{
|
|||
CopyOption = "LangIDOnPath"
|
||||
OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\"
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return @{
|
||||
SourceFile = $sourceFile
|
||||
CopyOption = "LangIDOnName"
|
||||
|
@ -88,6 +89,32 @@ $locJson = @{
|
|||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
@{
|
||||
LanguageSet = $LanguageSet
|
||||
CloneLanguageSet = "WiX_CloneLanguages"
|
||||
LssFiles = @( "wxl_loc.lss" )
|
||||
LocItems = @(
|
||||
$wxlFiles | ForEach-Object {
|
||||
$outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\"
|
||||
$continue = $true
|
||||
foreach ($exclusion in $exclusions.Exclusions) {
|
||||
if ($_.FullName.Contains($exclusion))
|
||||
{
|
||||
$continue = $false
|
||||
}
|
||||
}
|
||||
$sourceFile = ($_.FullName | Resolve-Path -Relative)
|
||||
if ($continue)
|
||||
{
|
||||
return @{
|
||||
SourceFile = $sourceFile
|
||||
CopyOption = "LangIDOnPath"
|
||||
OutputPath = $outputPath
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -98,11 +98,12 @@ try {
|
|||
Write-Error "Arcade tools directory '$ArcadeToolsDirectory' was not found; artifacts were not properly installed."
|
||||
exit 1
|
||||
}
|
||||
$ToolDirectory = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending)[0]
|
||||
if ([string]::IsNullOrWhiteSpace($ToolDirectory)) {
|
||||
$ToolDirectories = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending)
|
||||
if ($ToolDirectories -eq $null) {
|
||||
Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image."
|
||||
exit 1
|
||||
}
|
||||
$ToolDirectory = $ToolDirectories[0]
|
||||
$BinPathFile = "$($ToolDirectory.FullName)\binpath.txt"
|
||||
if (-not (Test-Path -Path "$BinPathFile")) {
|
||||
Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool."
|
||||
|
|
|
@ -64,7 +64,7 @@ try {
|
|||
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
|
||||
}
|
||||
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
|
||||
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.1.0" -MemberType NoteProperty
|
||||
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.2.1" -MemberType NoteProperty
|
||||
}
|
||||
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
|
||||
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
<clear />
|
||||
<add key="guardian" value="https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
<packageSourceMapping>
|
||||
<packageSource key="guardian">
|
||||
<package pattern="microsoft.guardian.cli" />
|
||||
</packageSource>
|
||||
</packageSourceMapping>
|
||||
<disabledPackageSources>
|
||||
<clear />
|
||||
</disabledPackageSources>
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
function Install-Gdn {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Path,
|
||||
|
||||
# If omitted, install the latest version of Guardian, otherwise install that specific version.
|
||||
[string]$Version
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version 2.0
|
||||
$disableConfigureToolsetImport = $true
|
||||
$global:LASTEXITCODE = 0
|
||||
|
||||
# `tools.ps1` checks $ci to perform some actions. Since the SDL
|
||||
# scripts don't necessarily execute in the same agent that run the
|
||||
# build.ps1/sh script this variable isn't automatically set.
|
||||
$ci = $true
|
||||
. $PSScriptRoot\..\tools.ps1
|
||||
|
||||
$argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache")
|
||||
|
||||
if ($Version) {
|
||||
$argumentList += "-Version $Version"
|
||||
}
|
||||
|
||||
Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait
|
||||
|
||||
$gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path
|
||||
|
||||
if (!$gdnCliPath)
|
||||
{
|
||||
Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian'
|
||||
}
|
||||
|
||||
return $gdnCliPath.FullName
|
||||
}
|
|
@ -59,7 +59,9 @@ jobs:
|
|||
- checkout: self
|
||||
clean: true
|
||||
|
||||
- template: /eng/common/templates/post-build/setup-maestro-vars.yml
|
||||
# If the template caller didn't provide an AzDO parameter, set them all up as Maestro vars.
|
||||
- ${{ if not(and(parameters.AzDOProjectName, parameters.AzDOPipelineId, parameters.AzDOBuildId)) }}:
|
||||
- template: /eng/common/templates/post-build/setup-maestro-vars.yml
|
||||
|
||||
- ${{ if ne(parameters.downloadArtifacts, 'false')}}:
|
||||
- ${{ if ne(parameters.artifactNames, '') }}:
|
||||
|
|
|
@ -140,6 +140,7 @@ jobs:
|
|||
languages: ${{ coalesce(parameters.richCodeNavigationLanguage, 'csharp') }}
|
||||
environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'production') }}
|
||||
richNavLogOutputDirectory: $(Build.SourcesDirectory)/artifacts/bin
|
||||
uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }}
|
||||
continueOnError: true
|
||||
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(parameters.disableComponentGovernance, 'true')) }}:
|
||||
|
@ -183,24 +184,6 @@ jobs:
|
|||
displayName: Publish logs
|
||||
continueOnError: true
|
||||
condition: always()
|
||||
- ${{ if or(eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}:
|
||||
- ${{ if and(ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Gather Asset Manifests
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest'
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/AssetManifests'
|
||||
continueOnError: ${{ parameters.continueOnError }}
|
||||
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Push Asset Manifests
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)/AssetManifests'
|
||||
PublishLocation: Container
|
||||
ArtifactName: AssetManifests
|
||||
continueOnError: ${{ parameters.continueOnError }}
|
||||
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
|
||||
|
||||
- ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}:
|
||||
- task: PublishBuildArtifacts@1
|
||||
|
@ -234,24 +217,6 @@ jobs:
|
|||
mergeTestResults: ${{ parameters.mergeTestResults }}
|
||||
continueOnError: true
|
||||
condition: always()
|
||||
|
||||
- ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Gather Asset Manifests
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest'
|
||||
TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
|
||||
continueOnError: ${{ parameters.continueOnError }}
|
||||
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Push Asset Manifests
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
|
||||
PublishLocation: Container
|
||||
ArtifactName: AssetManifests
|
||||
continueOnError: ${{ parameters.continueOnError }}
|
||||
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
|
||||
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
|
||||
- template: /eng/common/templates/steps/generate-sbom.yml
|
||||
|
|
|
@ -46,7 +46,7 @@ jobs:
|
|||
# source-build builds run in Docker, including the default managed platform.
|
||||
pool:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
name: NetCore1ESPool-Public
|
||||
name: NetCore-Public
|
||||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
|
||||
${{ if eq(variables['System.TeamProject'], 'internal') }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
|
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
${{ if eq(parameters.pool, '') }}:
|
||||
pool:
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
name: NetCore1ESPool-Public
|
||||
name: NetCore-Public
|
||||
demands: ImageOverride -equals windows.vs2019.amd64.open
|
||||
${{ if eq(variables['System.TeamProject'], 'internal') }}:
|
||||
name: NetCore1ESPool-Internal
|
||||
|
|
|
@ -14,7 +14,7 @@ parameters:
|
|||
# This is the default platform provided by Arcade, intended for use by a managed-only repo.
|
||||
defaultManagedPlatform:
|
||||
name: 'Managed'
|
||||
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
|
||||
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-20220809204800-17a4aab'
|
||||
|
||||
# Defines the platforms on which to run build jobs. One job is created for each platform, and the
|
||||
# object in this array is sent to the job template as 'platform'. If no platforms are specified,
|
||||
|
|
|
@ -8,29 +8,28 @@ parameters:
|
|||
condition: ''
|
||||
|
||||
steps:
|
||||
- ${{ if ne(parameters.overrideGuardianVersion, '') }}:
|
||||
- powershell: |
|
||||
$content = Get-Content $(GuardianPackagesConfigFile)
|
||||
|
||||
Write-Host "packages.config content was:`n$content"
|
||||
|
||||
$content = $content.Replace('$(DefaultGuardianVersion)', '$(GuardianVersion)')
|
||||
$content | Set-Content $(GuardianPackagesConfigFile)
|
||||
|
||||
Write-Host "packages.config content updated to:`n$content"
|
||||
displayName: Use overridden Guardian version ${{ parameters.overrideGuardianVersion }}
|
||||
- task: NuGetAuthenticate@1
|
||||
inputs:
|
||||
nuGetServiceConnections: GuardianConnect
|
||||
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: 'Install NuGet.exe'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Install Guardian'
|
||||
inputs:
|
||||
restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config
|
||||
feedsToUse: config
|
||||
nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config
|
||||
externalFeedCredentials: GuardianConnect
|
||||
restoreDirectory: $(Build.SourcesDirectory)\.packages
|
||||
- ${{ if ne(parameters.overrideGuardianVersion, '') }}:
|
||||
- pwsh: |
|
||||
Set-Location -Path $(Build.SourcesDirectory)\eng\common\sdl
|
||||
. .\sdl.ps1
|
||||
$guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts -Version ${{ parameters.overrideGuardianVersion }}
|
||||
Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation"
|
||||
displayName: Install Guardian (Overridden)
|
||||
|
||||
- ${{ if eq(parameters.overrideGuardianVersion, '') }}:
|
||||
- pwsh: |
|
||||
Set-Location -Path $(Build.SourcesDirectory)\eng\common\sdl
|
||||
. .\sdl.ps1
|
||||
$guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts
|
||||
Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation"
|
||||
displayName: Install Guardian
|
||||
|
||||
- ${{ if ne(parameters.overrideParameters, '') }}:
|
||||
- powershell: ${{ parameters.executeAllSdlToolsScript }} ${{ parameters.overrideParameters }}
|
||||
|
@ -40,7 +39,7 @@ steps:
|
|||
|
||||
- ${{ if eq(parameters.overrideParameters, '') }}:
|
||||
- powershell: ${{ parameters.executeAllSdlToolsScript }}
|
||||
-GuardianPackageName Microsoft.Guardian.Cli.$(GuardianVersion)
|
||||
-GuardianCliLocation $(GuardianCliLocation)
|
||||
-NugetPackageDirectory $(Build.SourcesDirectory)\.packages
|
||||
-AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw)
|
||||
${{ parameters.additionalParameters }}
|
||||
|
|
|
@ -68,6 +68,11 @@ steps:
|
|||
publishArgs='--publish'
|
||||
fi
|
||||
|
||||
assetManifestFileName=SourceBuild_RidSpecific.xml
|
||||
if [ '${{ parameters.platform.name }}' != '' ]; then
|
||||
assetManifestFileName=SourceBuild_${{ parameters.platform.name }}.xml
|
||||
fi
|
||||
|
||||
${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \
|
||||
--configuration $buildConfig \
|
||||
--restore --build --pack $publishArgs -bl \
|
||||
|
@ -76,7 +81,8 @@ steps:
|
|||
$internalRestoreArgs \
|
||||
$targetRidArgs \
|
||||
/p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \
|
||||
/p:ArcadeBuildFromSource=true
|
||||
/p:ArcadeBuildFromSource=true \
|
||||
/p:AssetManifestFileName=$assetManifestFileName
|
||||
displayName: Build
|
||||
|
||||
# Upload build logs for diagnosis.
|
||||
|
|
|
@ -365,8 +365,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
|
|||
|
||||
# If the version of msbuild is going to be xcopied,
|
||||
# use this version. Version matches a package here:
|
||||
# https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.1.0&view=overview
|
||||
$defaultXCopyMSBuildVersion = '17.1.0'
|
||||
# https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.2.1&view=overview
|
||||
$defaultXCopyMSBuildVersion = '17.2.1'
|
||||
|
||||
if (!$vsRequirements) {
|
||||
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
|
||||
|
|
|
@ -4,8 +4,7 @@ steps:
|
|||
nuGetServiceConnections: 'devdiv/dotnet-core-internal-tooling'
|
||||
forceReinstallCredentialProvider: true
|
||||
|
||||
- script: $(Build.SourcesDirectory)\build.cmd
|
||||
-ci
|
||||
- script: $(Build.SourcesDirectory)/eng/CIBuild.cmd
|
||||
-restore
|
||||
-projects $(Build.SourcesDirectory)/eng/common/internal/Tools.csproj
|
||||
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/RestoreInternal.binlog
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"tools": {
|
||||
"dotnet": "7.0.100-preview.5.22307.18",
|
||||
"dotnet": "7.0.100-rc.1.22431.12",
|
||||
"runtimes": {
|
||||
"dotnet": [
|
||||
"2.1.11",
|
||||
|
@ -16,10 +16,10 @@
|
|||
}
|
||||
},
|
||||
"sdk": {
|
||||
"version": "7.0.100-preview.5.22307.18"
|
||||
"version": "7.0.100-rc.1.22431.12"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22411.2",
|
||||
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22473.1",
|
||||
"Yarn.MSBuild": "1.22.10"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorDeployment", "src\Razo
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.LanguageServer.Protocol", "src\Microsoft.AspNetCore.Razor.LanguageServer.Protocol\Microsoft.AspNetCore.Razor.LanguageServer.Protocol.csproj", "{093B790B-1283-4EB3-B77E-4F9C4FB2A895}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Razor.Common", "src\Microsoft.AspNetCore.Razor.Common\Microsoft.AspNetCore.Razor.Common.csproj", "{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{5B60F564-4AD7-4B70-A887-7D91496799A2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Language", "..\Compiler\Microsoft.AspNetCore.Razor.Language\src\Microsoft.AspNetCore.Razor.Language.csproj", "{A1939F46-C07D-48E4-A4C2-0A8993986653}"
|
||||
|
@ -459,6 +461,14 @@ Global
|
|||
{093B790B-1283-4EB3-B77E-4F9C4FB2A895}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{093B790B-1283-4EB3-B77E-4F9C4FB2A895}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{093B790B-1283-4EB3-B77E-4F9C4FB2A895}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
|
||||
{A1939F46-C07D-48E4-A4C2-0A8993986653}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A1939F46-C07D-48E4-A4C2-0A8993986653}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A1939F46-C07D-48E4-A4C2-0A8993986653}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
@ -554,6 +564,7 @@ Global
|
|||
{87D808DC-5C9D-4D72-A9B7-C828A8DC09FA} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
|
||||
{0C7CB1C1-6CA3-42A1-AE3A-71A4DF581AC3} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
|
||||
{093B790B-1283-4EB3-B77E-4F9C4FB2A895} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
|
||||
{95ED6267-9A02-4B52-9EF5-C0BBE183C8FF} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
|
||||
{A1939F46-C07D-48E4-A4C2-0A8993986653} = {5B60F564-4AD7-4B70-A887-7D91496799A2}
|
||||
{F2FAEEE4-D830-4803-AE25-E5C7A816D19A} = {5B60F564-4AD7-4B70-A887-7D91496799A2}
|
||||
{375B71A8-DCAC-408B-A6A4-4DB842A57C01} = {5B60F564-4AD7-4B70-A887-7D91496799A2}
|
||||
|
|
|
@ -9,7 +9,6 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Extensions;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Formatting;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
@ -30,8 +29,6 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
{
|
||||
private string _filePath;
|
||||
|
||||
private RazorLanguageServer RazorLanguageServer { get; set; }
|
||||
|
||||
private RazorFormattingService RazorFormattingService { get; set; }
|
||||
|
||||
private Uri DocumentUri { get; set; }
|
||||
|
@ -52,7 +49,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
[GlobalSetup(Target = nameof(RazorCSharpFormattingAsync))]
|
||||
public async Task InitializeRazorCSharpFormattingAsync()
|
||||
{
|
||||
await EnsureServicesInitializedAsync();
|
||||
EnsureServicesInitialized();
|
||||
|
||||
var projectRoot = Path.Combine(RepoRoot, "src", "Razor", "test", "testapps", "ComponentApp");
|
||||
var projectFilePath = Path.Combine(projectRoot, "ComponentApp.csproj");
|
||||
|
@ -130,23 +127,17 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
}
|
||||
|
||||
[GlobalCleanup]
|
||||
public void CleanupServer()
|
||||
public async Task CleanupServerAsync()
|
||||
{
|
||||
File.Delete(_filePath);
|
||||
|
||||
RazorLanguageServer?.Dispose();
|
||||
await RazorLanguageServer.DisposeAsync();
|
||||
}
|
||||
|
||||
private async Task EnsureServicesInitializedAsync()
|
||||
private void EnsureServicesInitialized()
|
||||
{
|
||||
if (RazorLanguageServer != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RazorLanguageServer = await RazorLanguageServerTask;
|
||||
var languageServer = RazorLanguageServer.GetInnerLanguageServerForTesting();
|
||||
RazorFormattingService = languageServer.GetService(typeof(RazorFormattingService)) as RazorFormattingService;
|
||||
RazorFormattingService = languageServer.GetRequiredService<RazorFormattingService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,10 +12,10 @@ using Microsoft.AspNetCore.Razor.LanguageServer;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using Microsoft.CommonLanguageServerProtocol.Framework;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using OmniSharp.Extensions.JsonRpc;
|
||||
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
|
||||
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
||||
{
|
||||
|
@ -32,20 +32,20 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
RepoRoot = current.FullName;
|
||||
|
||||
using var memoryStream = new MemoryStream();
|
||||
RazorLanguageServerTask = RazorLanguageServer.CreateAsync(memoryStream, memoryStream, Trace.Off, configure: builder =>
|
||||
{
|
||||
builder.Services.AddSingleton<ClientNotifierServiceBase, NoopClientNotifierService>();
|
||||
Builder(builder);
|
||||
var logger = new NoopLogger();
|
||||
RazorLanguageServer = RazorLanguageServerWrapper.Create(memoryStream, memoryStream, logger, configure: (collection) => {
|
||||
collection.AddSingleton<ClientNotifierServiceBase, NoopClientNotifierService>();
|
||||
Builder(collection);
|
||||
});
|
||||
}
|
||||
|
||||
protected internal virtual void Builder(RazorLanguageServerBuilder builder)
|
||||
protected internal virtual void Builder(IServiceCollection collection)
|
||||
{
|
||||
}
|
||||
|
||||
protected string RepoRoot { get; }
|
||||
|
||||
private protected Task<RazorLanguageServer> RazorLanguageServerTask { get; }
|
||||
private protected RazorLanguageServerWrapper RazorLanguageServer { get; }
|
||||
|
||||
internal DocumentSnapshot GetDocumentSnapshot(string projectFilePath, string filePath, string targetPath)
|
||||
{
|
||||
|
@ -66,34 +66,65 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
|
||||
private class NoopClientNotifierService : ClientNotifierServiceBase
|
||||
{
|
||||
public override InitializeParams ClientSettings => new InitializeParams();
|
||||
|
||||
public override Task OnStarted(ILanguageServer server, CancellationToken cancellationToken)
|
||||
public override Task OnInitializedAsync(VSInternalClientCapabilities clientCapabilities, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task<IResponseRouterReturns> SendRequestAsync(string method)
|
||||
public override Task SendNotificationAsync<TParams>(string method, TParams @params, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult<IResponseRouterReturns>(new NoopResponse());
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task<IResponseRouterReturns> SendRequestAsync<T>(string method, T @params)
|
||||
public override Task SendNotificationAsync(string method, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult<IResponseRouterReturns>(new NoopResponse());
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
class NoopResponse : IResponseRouterReturns
|
||||
public override Task<TResponse> SendRequestAsync<TParams, TResponse>(string method, TParams @params, CancellationToken cancellationToken)
|
||||
{
|
||||
public Task<TResponse> Returning<TResponse>(CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(Activator.CreateInstance<TResponse>());
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public Task ReturningVoid(CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
private class NoopLogger : ILspLogger, ILogger
|
||||
{
|
||||
public IDisposable BeginScope<TState>(TState state)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogEndContext(string message, params object[] @params)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogError(string message, params object[] @params)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogException(Exception exception, string message = null, params object[] @params)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogInformation(string message, params object[] @params)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogStartContext(string message, params object[] @params)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogWarning(string message, params object[] @params)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,14 +17,11 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
||||
{
|
||||
public class RazorSemanticTokensBenchmark : RazorLanguageServerBenchmarkBase
|
||||
{
|
||||
private RazorLanguageServer RazorLanguageServer { get; set; }
|
||||
|
||||
private DefaultRazorSemanticTokensInfoService RazorSemanticTokenService { get; set; }
|
||||
|
||||
private DocumentVersionCache VersionCache { get; set; }
|
||||
|
@ -48,7 +45,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
[GlobalSetup(Target = nameof(RazorSemanticTokensRangeAsync))]
|
||||
public async Task InitializeRazorSemanticAsync()
|
||||
{
|
||||
await EnsureServicesInitializedAsync();
|
||||
EnsureServicesInitialized();
|
||||
|
||||
var projectRoot = Path.Combine(RepoRoot, "src", "Razor", "test", "testapps", "ComponentApp");
|
||||
ProjectFilePath = Path.Combine(projectRoot, "ComponentApp.csproj");
|
||||
|
@ -92,6 +89,11 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
textDocumentIdentifier, Range, DocumentContext, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private static LspServices GetLspServices()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private async Task UpdateDocumentAsync(int newVersion, DocumentSnapshot documentSnapshot, CancellationToken cancellationToken)
|
||||
{
|
||||
await ProjectSnapshotManagerDispatcher.RunOnDispatcherThreadAsync(
|
||||
|
@ -99,38 +101,28 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
}
|
||||
|
||||
[GlobalCleanup]
|
||||
public void CleanupServer()
|
||||
public async Task CleanupServerAsync()
|
||||
{
|
||||
RazorLanguageServer?.Dispose();
|
||||
await RazorLanguageServer.DisposeAsync();
|
||||
}
|
||||
|
||||
protected internal override void Builder(RazorLanguageServerBuilder builder)
|
||||
protected internal override void Builder(IServiceCollection collection)
|
||||
{
|
||||
builder.Services.AddSingleton<RazorSemanticTokensInfoService, TestRazorSemanticTokensInfoService>();
|
||||
collection.AddSingleton<RazorSemanticTokensInfoService, TestRazorSemanticTokensInfoService>();
|
||||
}
|
||||
|
||||
private async Task EnsureServicesInitializedAsync()
|
||||
private void EnsureServicesInitialized()
|
||||
{
|
||||
if (RazorLanguageServer != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RazorLanguageServer = await RazorLanguageServerTask.ConfigureAwait(false);
|
||||
var languageServer = RazorLanguageServer.GetInnerLanguageServerForTesting();
|
||||
RazorSemanticTokenService = languageServer.GetService(typeof(RazorSemanticTokensInfoService)) as TestRazorSemanticTokensInfoService;
|
||||
VersionCache = languageServer.GetService(typeof(DocumentVersionCache)) as DocumentVersionCache;
|
||||
ProjectSnapshotManagerDispatcher = languageServer.GetService(typeof(ProjectSnapshotManagerDispatcher)) as ProjectSnapshotManagerDispatcher;
|
||||
RazorSemanticTokenService = languageServer.GetRequiredService<RazorSemanticTokensInfoService>() as TestRazorSemanticTokensInfoService;
|
||||
VersionCache = languageServer.GetRequiredService<DocumentVersionCache>();
|
||||
ProjectSnapshotManagerDispatcher = languageServer.GetRequiredService<ProjectSnapshotManagerDispatcher>();
|
||||
}
|
||||
|
||||
internal class TestRazorSemanticTokensInfoService : DefaultRazorSemanticTokensInfoService
|
||||
{
|
||||
public TestRazorSemanticTokensInfoService(
|
||||
ClientNotifierServiceBase languageServer,
|
||||
RazorDocumentMappingService documentMappingService,
|
||||
DocumentContextFactory documentContextFactory,
|
||||
LoggerFactory loggerFactory)
|
||||
: base(languageServer, documentMappingService, documentContextFactory, loggerFactory)
|
||||
public TestRazorSemanticTokensInfoService(ClientNotifierServiceBase languageServer, RazorDocumentMappingService documentMappingService, LoggerFactory loggerFactory)
|
||||
: base(languageServer, documentMappingService, loggerFactory)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -138,7 +130,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
|||
internal override Task<SemanticRange[]> GetCSharpSemanticRangesAsync(
|
||||
RazorCodeDocument codeDocument,
|
||||
TextDocumentIdentifier textDocumentIdentifier,
|
||||
Range range,
|
||||
Range razorRange,
|
||||
long documentVersion,
|
||||
CancellationToken cancellationToken,
|
||||
string previousResultId = null)
|
||||
|
|
|
@ -15,129 +15,120 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
using static Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer.RazorSemanticTokensBenchmark;
|
||||
using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer
|
||||
{
|
||||
public class RazorSemanticTokensScrollingBenchmark : RazorLanguageServerBenchmarkBase
|
||||
{
|
||||
private RazorLanguageServer RazorLanguageServer { get; set; }
|
||||
public class RazorSemanticTokensScrollingBenchmark : RazorLanguageServerBenchmarkBase
|
||||
{
|
||||
private DefaultRazorSemanticTokensInfoService RazorSemanticTokenService { get; set; }
|
||||
|
||||
private DefaultRazorSemanticTokensInfoService RazorSemanticTokenService { get; set; }
|
||||
private DocumentVersionCache VersionCache { get; set; }
|
||||
|
||||
private DocumentVersionCache VersionCache { get; set; }
|
||||
private DocumentContext DocumentContext { get; set; }
|
||||
|
||||
private DocumentContext DocumentContext { get; set; }
|
||||
private Uri DocumentUri => DocumentContext.Uri;
|
||||
|
||||
private Uri DocumentUri => DocumentContext.Uri;
|
||||
private DocumentSnapshot DocumentSnapshot => DocumentContext.Snapshot;
|
||||
|
||||
private DocumentSnapshot DocumentSnapshot => DocumentContext.Snapshot;
|
||||
private Range Range { get; set; }
|
||||
|
||||
private Range Range { get; set; }
|
||||
private ProjectSnapshotManagerDispatcher ProjectSnapshotManagerDispatcher { get; set; }
|
||||
|
||||
private ProjectSnapshotManagerDispatcher ProjectSnapshotManagerDispatcher { get; set; }
|
||||
private string PagesDirectory { get; set; }
|
||||
|
||||
private string PagesDirectory { get; set; }
|
||||
private string ProjectFilePath { get; set; }
|
||||
|
||||
private string ProjectFilePath { get; set; }
|
||||
private string TargetPath { get; set; }
|
||||
|
||||
private string TargetPath { get; set; }
|
||||
[GlobalSetup(Target = nameof(RazorSemanticTokensRangeScrollingAsync))]
|
||||
public async Task InitializeRazorSemanticAsync()
|
||||
{
|
||||
EnsureServicesInitialized();
|
||||
|
||||
[GlobalSetup(Target = nameof(RazorSemanticTokensRangeScrollingAsync))]
|
||||
public async Task InitializeRazorSemanticAsync()
|
||||
{
|
||||
await EnsureServicesInitializedAsync();
|
||||
var projectRoot = Path.Combine(RepoRoot, "src", "Razor", "test", "testapps", "ComponentApp");
|
||||
ProjectFilePath = Path.Combine(projectRoot, "ComponentApp.csproj");
|
||||
PagesDirectory = Path.Combine(projectRoot, "Components", "Pages");
|
||||
var filePath = Path.Combine(PagesDirectory, $"FormattingTest.razor");
|
||||
TargetPath = "/Components/Pages/FormattingTest.razor";
|
||||
|
||||
var projectRoot = Path.Combine(RepoRoot, "src", "Razor", "test", "testapps", "ComponentApp");
|
||||
ProjectFilePath = Path.Combine(projectRoot, "ComponentApp.csproj");
|
||||
PagesDirectory = Path.Combine(projectRoot, "Components", "Pages");
|
||||
var filePath = Path.Combine(PagesDirectory, $"FormattingTest.razor");
|
||||
TargetPath = "/Components/Pages/FormattingTest.razor";
|
||||
var documentUri = new Uri(filePath);
|
||||
var documentSnapshot = GetDocumentSnapshot(ProjectFilePath, filePath, TargetPath);
|
||||
DocumentContext = new DocumentContext(documentUri, documentSnapshot, version: 1);
|
||||
|
||||
var documentUri = new Uri(filePath);
|
||||
var documentSnapshot = GetDocumentSnapshot(ProjectFilePath, filePath, TargetPath);
|
||||
DocumentContext = new DocumentContext(documentUri, documentSnapshot, version: 1);
|
||||
var text = await DocumentSnapshot.GetTextAsync().ConfigureAwait(false);
|
||||
Range = new Range
|
||||
{
|
||||
Start = new Position
|
||||
{
|
||||
Line = 0,
|
||||
Character = 0
|
||||
},
|
||||
End = new Position
|
||||
{
|
||||
Line = text.Lines.Count - 1,
|
||||
Character = 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var text = await DocumentSnapshot.GetTextAsync().ConfigureAwait(false);
|
||||
Range = new Range
|
||||
{
|
||||
Start = new Position
|
||||
{
|
||||
Line = 0,
|
||||
Character = 0
|
||||
},
|
||||
End = new Position
|
||||
{
|
||||
Line = text.Lines.Count - 1,
|
||||
Character = 0
|
||||
}
|
||||
};
|
||||
}
|
||||
private const int WindowSize = 10;
|
||||
|
||||
private const int WindowSize = 10;
|
||||
[Benchmark(Description = "Razor Semantic Tokens Range Scrolling")]
|
||||
public async Task RazorSemanticTokensRangeScrollingAsync()
|
||||
{
|
||||
var textDocumentIdentifier = new TextDocumentIdentifier()
|
||||
{
|
||||
Uri = DocumentUri
|
||||
};
|
||||
var cancellationToken = CancellationToken.None;
|
||||
var documentVersion = 1;
|
||||
|
||||
[Benchmark(Description = "Razor Semantic Tokens Range Scrolling")]
|
||||
public async Task RazorSemanticTokensRangeScrollingAsync()
|
||||
{
|
||||
var textDocumentIdentifier = new TextDocumentIdentifier()
|
||||
{
|
||||
Uri = DocumentUri
|
||||
};
|
||||
var cancellationToken = CancellationToken.None;
|
||||
var documentVersion = 1;
|
||||
await UpdateDocumentAsync(documentVersion, DocumentSnapshot).ConfigureAwait(false);
|
||||
|
||||
await UpdateDocumentAsync(documentVersion, DocumentSnapshot).ConfigureAwait(false);
|
||||
var documentLineCount = Range.End.Line;
|
||||
|
||||
var documentLineCount = Range.End.Line;
|
||||
var lineCount = 0;
|
||||
while (lineCount != documentLineCount)
|
||||
{
|
||||
var newLineCount = Math.Min(lineCount + WindowSize, documentLineCount);
|
||||
var range = new Range
|
||||
{
|
||||
Start = new Position(lineCount, 0),
|
||||
End = new Position(newLineCount, 0)
|
||||
};
|
||||
await RazorSemanticTokenService!.GetSemanticTokensAsync(
|
||||
textDocumentIdentifier,
|
||||
range,
|
||||
DocumentContext,
|
||||
cancellationToken);
|
||||
|
||||
var lineCount = 0;
|
||||
while (lineCount != documentLineCount)
|
||||
{
|
||||
var newLineCount = Math.Min(lineCount + WindowSize, documentLineCount);
|
||||
var range = new Range
|
||||
{
|
||||
Start = new Position(lineCount, 0),
|
||||
End = new Position(newLineCount, 0)
|
||||
};
|
||||
await RazorSemanticTokenService!.GetSemanticTokensAsync(
|
||||
textDocumentIdentifier,
|
||||
range,
|
||||
DocumentContext,
|
||||
cancellationToken);
|
||||
lineCount = newLineCount;
|
||||
}
|
||||
}
|
||||
|
||||
lineCount = newLineCount;
|
||||
}
|
||||
}
|
||||
private async Task UpdateDocumentAsync(int newVersion, DocumentSnapshot documentSnapshot)
|
||||
{
|
||||
await ProjectSnapshotManagerDispatcher!.RunOnDispatcherThreadAsync(
|
||||
() => VersionCache!.TrackDocumentVersion(documentSnapshot, newVersion), CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task UpdateDocumentAsync(int newVersion, DocumentSnapshot documentSnapshot)
|
||||
{
|
||||
await ProjectSnapshotManagerDispatcher!.RunOnDispatcherThreadAsync(
|
||||
() => VersionCache!.TrackDocumentVersion(documentSnapshot, newVersion), CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
[GlobalCleanup]
|
||||
public async Task CleanupServerAsync()
|
||||
{
|
||||
await RazorLanguageServer.DisposeAsync();
|
||||
}
|
||||
|
||||
[GlobalCleanup]
|
||||
public void CleanupServer()
|
||||
{
|
||||
RazorLanguageServer?.Dispose();
|
||||
}
|
||||
protected internal override void Builder(IServiceCollection collection)
|
||||
{
|
||||
collection.AddSingleton<RazorSemanticTokensInfoService, TestRazorSemanticTokensInfoService>();
|
||||
}
|
||||
|
||||
protected internal override void Builder(RazorLanguageServerBuilder builder)
|
||||
{
|
||||
builder.Services.AddSingleton<RazorSemanticTokensInfoService, TestRazorSemanticTokensInfoService>();
|
||||
}
|
||||
|
||||
private async Task EnsureServicesInitializedAsync()
|
||||
{
|
||||
if (RazorLanguageServer != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RazorLanguageServer = await RazorLanguageServerTask.ConfigureAwait(false);
|
||||
var languageServer = RazorLanguageServer.GetInnerLanguageServerForTesting();
|
||||
RazorSemanticTokenService = languageServer.GetService(typeof(RazorSemanticTokensInfoService)) as TestRazorSemanticTokensInfoService;
|
||||
VersionCache = languageServer.GetService(typeof(DocumentVersionCache)) as DocumentVersionCache;
|
||||
ProjectSnapshotManagerDispatcher = languageServer.GetService(typeof(ProjectSnapshotManagerDispatcher)) as ProjectSnapshotManagerDispatcher;
|
||||
}
|
||||
}
|
||||
private void EnsureServicesInitialized()
|
||||
{
|
||||
var languageServer = RazorLanguageServer.GetInnerLanguageServerForTesting();
|
||||
RazorSemanticTokenService = (languageServer.GetRequiredService<RazorSemanticTokensInfoService>() as TestRazorSemanticTokensInfoService)!;
|
||||
VersionCache = languageServer.GetRequiredService<DocumentVersionCache>();
|
||||
ProjectSnapshotManagerDispatcher = languageServer.GetRequiredService<ProjectSnapshotManagerDispatcher>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
<IsShipping>false</IsShipping>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Alias="Range" Include="Microsoft.VisualStudio.LanguageServer.Protocol.Range" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Compiler\Microsoft.AspNetCore.Mvc.Razor.Extensions\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" />
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.LanguageServer\Microsoft.AspNetCore.Razor.LanguageServer.csproj" />
|
||||
|
@ -41,10 +45,9 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPackageVersion)" />
|
||||
<PackageReference Include="OmniSharp.Extensions.LanguageProtocol" Version="$(OmniSharpExtensionsLanguageProtocolPackageVersion)" />
|
||||
<PackageReference Include="OmniSharp.Extensions.LanguageServer" Version="$(OmniSharpExtensionsLanguageServerPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageReference Include="System.Private.Uri" Version="$(SystemPrivateUriPackageVersion)" ExcludeAssets="true" PrivateAssets="true" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -3,18 +3,16 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.Legacy;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Completion;
|
||||
using Microsoft.CodeAnalysis.Razor.Completion;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Serialization;
|
||||
using Microsoft.VisualStudio.Editor.Razor;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
||||
{
|
||||
|
@ -34,12 +32,10 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
|||
CompletionList = GenerateCompletionList(documentContent, queryIndex, tagHelperCompletionProvider);
|
||||
_completionListBuffer = GenerateBuffer(CompletionList);
|
||||
|
||||
Serializer = new LspSerializer();
|
||||
Serializer.RegisterRazorConverters();
|
||||
Serializer.RegisterVSInternalExtensionConverters();
|
||||
Serializer = JsonSerializer.Create();
|
||||
}
|
||||
|
||||
private LspSerializer Serializer { get; }
|
||||
private JsonSerializer Serializer { get; }
|
||||
|
||||
private CompletionList CompletionList { get; }
|
||||
|
||||
|
@ -51,7 +47,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
|||
using (originalStream = new MemoryStream())
|
||||
using (var writer = new StreamWriter(originalStream, Encoding.UTF8, bufferSize: 4096))
|
||||
{
|
||||
Serializer.JsonSerializer.Serialize(writer, CompletionList);
|
||||
Serializer.Serialize(writer, CompletionList);
|
||||
}
|
||||
|
||||
CompletionList deserializedCompletions;
|
||||
|
@ -59,7 +55,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
|||
using (stream)
|
||||
using (var reader = new JsonTextReader(new StreamReader(stream)))
|
||||
{
|
||||
deserializedCompletions = Serializer.JsonSerializer.Deserialize<CompletionList>(reader);
|
||||
deserializedCompletions = Serializer.Deserialize<CompletionList>(reader);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +64,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
|||
{
|
||||
using var stream = new MemoryStream();
|
||||
using var writer = new StreamWriter(stream, Encoding.UTF8, bufferSize: 4096);
|
||||
Serializer.JsonSerializer.Serialize(writer, CompletionList);
|
||||
Serializer.Serialize(writer, CompletionList);
|
||||
}
|
||||
|
||||
[Benchmark(Description = "Component Completion List Deserialization")]
|
||||
|
@ -78,7 +74,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
|||
using var stream = new MemoryStream(_completionListBuffer);
|
||||
using var reader = new JsonTextReader(new StreamReader(stream));
|
||||
CompletionList deserializedCompletions;
|
||||
deserializedCompletions = Serializer.JsonSerializer.Deserialize<CompletionList>(reader);
|
||||
deserializedCompletions = Serializer.Deserialize<CompletionList>(reader);
|
||||
}
|
||||
|
||||
private CompletionList GenerateCompletionList(string documentContent, int queryIndex, TagHelperCompletionProvider componentCompletionProvider)
|
||||
|
@ -119,7 +115,7 @@ namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization
|
|||
{
|
||||
using var stream = new MemoryStream();
|
||||
using var writer = new StreamWriter(stream, Encoding.UTF8, bufferSize: 4096);
|
||||
Serializer.JsonSerializer.Serialize(writer, completionList);
|
||||
Serializer.Serialize(writer, completionList);
|
||||
var buffer = stream.GetBuffer();
|
||||
|
||||
return buffer;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Common;
|
||||
|
||||
internal static class Hash
|
||||
{
|
||||
public static int Combine(int newKey, int currentKey)
|
||||
=> unchecked((currentKey * (int)0xA5555529) + newKey);
|
||||
|
||||
public static int Combine(bool newKeyPart, int currentKey)
|
||||
=> Combine(currentKey, newKeyPart ? 1 : 0);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
#if !NETCOREAPP3_0_OR_GREATER
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
|
||||
internal sealed class CallerArgumentExpressionAttribute : Attribute
|
||||
{
|
||||
public CallerArgumentExpressionAttribute(string parameterName)
|
||||
{
|
||||
ParameterName = parameterName;
|
||||
}
|
||||
|
||||
public string ParameterName { get; }
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
|
||||
internal sealed class CompilerFeatureRequiredAttribute : Attribute
|
||||
{
|
||||
public CompilerFeatureRequiredAttribute(string featureName)
|
||||
{
|
||||
FeatureName = featureName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the compiler feature.
|
||||
/// </summary>
|
||||
public string FeatureName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand <see cref="FeatureName"/>.
|
||||
/// </summary>
|
||||
public bool IsOptional { get; init; }
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,152 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
#if !NETCOREAPP3_0_OR_GREATER
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System;
|
||||
|
||||
/// <summary>Represent a type can be used to index a collection either from the start or the end.</summary>
|
||||
/// <remarks>
|
||||
/// Index is used by the C# compiler to support the new index syntax
|
||||
/// <code>
|
||||
/// int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ;
|
||||
/// int lastElement = someArray[^1]; // lastElement = 5
|
||||
/// </code>
|
||||
/// </remarks>
|
||||
internal readonly struct Index : IEquatable<Index>
|
||||
{
|
||||
private readonly int _value;
|
||||
|
||||
/// <summary>Construct an Index using a value and indicating if the index is from the start or from the end.</summary>
|
||||
/// <param name="value">The index value. it has to be zero or positive number.</param>
|
||||
/// <param name="fromEnd">Indicating if the index is from the start or from the end.</param>
|
||||
/// <remarks>
|
||||
/// If the Index constructed from the end, index value 1 means pointing at the last element and index value 0 means pointing at beyond last element.
|
||||
/// </remarks>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Index(int value, bool fromEnd = false)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
ThrowValueArgumentOutOfRange_NeedNonNegNumException();
|
||||
}
|
||||
|
||||
_value = fromEnd
|
||||
? ~value
|
||||
: value;
|
||||
}
|
||||
|
||||
// The following private constructors mainly created for perf reason to avoid the checks
|
||||
private Index(int value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
/// <summary>Create an Index pointing at first element.</summary>
|
||||
public static Index Start => new(0);
|
||||
|
||||
/// <summary>Create an Index pointing at beyond last element.</summary>
|
||||
public static Index End => new(~0);
|
||||
|
||||
/// <summary>Create an Index from the start at the position indicated by the value.</summary>
|
||||
/// <param name="value">The index value from the start.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Index FromStart(int value)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
ThrowValueArgumentOutOfRange_NeedNonNegNumException();
|
||||
}
|
||||
|
||||
return new Index(value);
|
||||
}
|
||||
|
||||
/// <summary>Create an Index from the end at the position indicated by the value.</summary>
|
||||
/// <param name="value">The index value from the end.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Index FromEnd(int value)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
ThrowValueArgumentOutOfRange_NeedNonNegNumException();
|
||||
}
|
||||
|
||||
return new Index(~value);
|
||||
}
|
||||
|
||||
/// <summary>Returns the index value.</summary>
|
||||
public int Value
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_value < 0)
|
||||
return ~_value;
|
||||
else
|
||||
return _value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the index is from the start or the end.</summary>
|
||||
public bool IsFromEnd => _value < 0;
|
||||
|
||||
/// <summary>Calculate the offset from the start using the giving collection length.</summary>
|
||||
/// <param name="length">The length of the collection that the Index will be used with. length has to be a positive value</param>
|
||||
/// <remarks>
|
||||
/// For performance reason, we don't validate the input length parameter and the returned offset value against negative values.
|
||||
/// we don't validate either the returned offset is greater than the input length.
|
||||
/// It is expected Index will be used with collections which always have non negative length/count. If the returned offset is negative and
|
||||
/// then used to index a collection will get out of range exception which will be same affect as the validation.
|
||||
/// </remarks>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int GetOffset(int length)
|
||||
{
|
||||
var offset = _value;
|
||||
|
||||
if (IsFromEnd)
|
||||
{
|
||||
// offset = length - (~value)
|
||||
// offset = length + (~(~value) + 1)
|
||||
// offset = length + value + 1
|
||||
|
||||
offset += length + 1;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the current Index object is equal to another object of the same type.</summary>
|
||||
/// <param name="value">An object to compare with this object</param>
|
||||
public override bool Equals([NotNullWhen(true)] object? value) => value is Index index && _value == index._value;
|
||||
|
||||
/// <summary>Indicates whether the current Index object is equal to another Index object.</summary>
|
||||
/// <param name="other">An object to compare with this object</param>
|
||||
public bool Equals(Index other) => _value == other._value;
|
||||
|
||||
/// <summary>Returns the hash code for this instance.</summary>
|
||||
public override int GetHashCode() => _value;
|
||||
|
||||
/// <summary>Converts integer number to an Index.</summary>
|
||||
public static implicit operator Index(int value) => FromStart(value);
|
||||
|
||||
/// <summary>Converts the value of the current Index object to its equivalent string representation.</summary>
|
||||
public override string ToString()
|
||||
{
|
||||
if (IsFromEnd)
|
||||
return ToStringFromEnd();
|
||||
|
||||
return ((uint)Value).ToString();
|
||||
}
|
||||
|
||||
private string ToStringFromEnd() => '^' + Value.ToString();
|
||||
|
||||
[DoesNotReturn]
|
||||
private static void ThrowValueArgumentOutOfRange_NeedNonNegNumException()
|
||||
=> throw new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_NeedNonNegNum);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,150 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
// Note: These attributes were introduced in .NET Core 3.0 and .NET 5.
|
||||
|
||||
#if !NETCOREAPP3_0_OR_GREATER
|
||||
|
||||
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
|
||||
internal sealed class AllowNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
|
||||
internal sealed class DisallowNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
internal sealed class MaybeNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
internal sealed class NotNullAttribute : Attribute { }
|
||||
|
||||
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
||||
internal sealed class MaybeNullWhenAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified return value condition.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter may be null.
|
||||
/// </param>
|
||||
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
|
||||
|
||||
/// <summary>Gets the return value condition.</summary>
|
||||
public bool ReturnValue { get; }
|
||||
}
|
||||
|
||||
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
||||
internal sealed class NotNullWhenAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified return value condition.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
||||
/// </param>
|
||||
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
|
||||
|
||||
/// <summary>Gets the return value condition.</summary>
|
||||
public bool ReturnValue { get; }
|
||||
}
|
||||
|
||||
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
|
||||
internal sealed class NotNullIfNotNullAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the associated parameter name.</summary>
|
||||
/// <param name="parameterName">
|
||||
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
|
||||
/// </param>
|
||||
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName;
|
||||
|
||||
/// <summary>Gets the associated parameter name.</summary>
|
||||
public string ParameterName { get; }
|
||||
}
|
||||
|
||||
/// <summary>Applied to a method that will never return under any circumstance.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
internal sealed class DoesNotReturnAttribute : Attribute { }
|
||||
|
||||
/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
||||
internal sealed class DoesNotReturnIfAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified parameter value.</summary>
|
||||
/// <param name="parameterValue">
|
||||
/// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
|
||||
/// the associated parameter matches this value.
|
||||
/// </param>
|
||||
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
|
||||
|
||||
/// <summary>Gets the condition parameter value.</summary>
|
||||
public bool ParameterValue { get; }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !NET5_0_OR_GREATER
|
||||
|
||||
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
|
||||
internal sealed class MemberNotNullAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with a field or property member.</summary>
|
||||
/// <param name="member">
|
||||
/// The field or property member that is promised to be not-null.
|
||||
/// </param>
|
||||
public MemberNotNullAttribute(string member) => Members = new[] { member };
|
||||
|
||||
/// <summary>Initializes the attribute with the list of field and property members.</summary>
|
||||
/// <param name="members">
|
||||
/// The list of field and property members that are promised to be not-null.
|
||||
/// </param>
|
||||
public MemberNotNullAttribute(params string[] members) => Members = members;
|
||||
|
||||
/// <summary>Gets field or property member names.</summary>
|
||||
public string[] Members { get; }
|
||||
}
|
||||
|
||||
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
|
||||
internal sealed class MemberNotNullWhenAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
||||
/// </param>
|
||||
/// <param name="member">
|
||||
/// The field or property member that is promised to be not-null.
|
||||
/// </param>
|
||||
public MemberNotNullWhenAttribute(bool returnValue, string member)
|
||||
{
|
||||
ReturnValue = returnValue;
|
||||
Members = new[] { member };
|
||||
}
|
||||
|
||||
/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
||||
/// </param>
|
||||
/// <param name="members">
|
||||
/// The list of field and property members that are promised to be not-null.
|
||||
/// </param>
|
||||
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
|
||||
{
|
||||
ReturnValue = returnValue;
|
||||
Members = members;
|
||||
}
|
||||
|
||||
/// <summary>Gets the return value condition.</summary>
|
||||
public bool ReturnValue { get; }
|
||||
|
||||
/// <summary>Gets field or property member names.</summary>
|
||||
public string[] Members { get; }
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,99 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
// Note: This type was introduced in .NET Core 3.0.
|
||||
|
||||
#if !NETCOREAPP3_0_OR_GREATER
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.AspNetCore.Razor.Common;
|
||||
|
||||
namespace System;
|
||||
|
||||
/// <summary>Represent a range has start and end indexes.</summary>
|
||||
/// <remarks>
|
||||
/// Range is used by the C# compiler to support the range syntax.
|
||||
/// <code>
|
||||
/// int[] someArray = new int[5] { 1, 2, 3, 4, 5 };
|
||||
/// int[] subArray1 = someArray[0..2]; // { 1, 2 }
|
||||
/// int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 }
|
||||
/// </code>
|
||||
/// </remarks>
|
||||
internal readonly struct Range : IEquatable<Range>
|
||||
{
|
||||
/// <summary>Represent the inclusive start index of the Range.</summary>
|
||||
public Index Start { get; }
|
||||
|
||||
/// <summary>Represent the exclusive end index of the Range.</summary>
|
||||
public Index End { get; }
|
||||
|
||||
/// <summary>Construct a Range object using the start and end indexes.</summary>
|
||||
/// <param name="start">Represent the inclusive start index of the range.</param>
|
||||
/// <param name="end">Represent the exclusive end index of the range.</param>
|
||||
public Range(Index start, Index end)
|
||||
{
|
||||
Start = start;
|
||||
End = end;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the current Range object is equal to another object of the same type.</summary>
|
||||
/// <param name="value">An object to compare with this object</param>
|
||||
public override bool Equals([NotNullWhen(true)] object? value)
|
||||
=> value is Range r
|
||||
&& r.Start.Equals(Start)
|
||||
&& r.End.Equals(End);
|
||||
|
||||
/// <summary>Indicates whether the current Range object is equal to another Range object.</summary>
|
||||
/// <param name="other">An object to compare with this object</param>
|
||||
public bool Equals(Range other) => other.Start.Equals(Start) && other.End.Equals(End);
|
||||
|
||||
/// <summary>Returns the hash code for this instance.</summary>
|
||||
public override int GetHashCode()
|
||||
=> Hash.Combine(Start.GetHashCode(), End.GetHashCode());
|
||||
|
||||
/// <summary>Converts the value of the current Range object to its equivalent string representation.</summary>
|
||||
public override string ToString()
|
||||
=> Start.ToString() + ".." + End.ToString();
|
||||
|
||||
/// <summary>Create a Range object starting from start index to the end of the collection.</summary>
|
||||
public static Range StartAt(Index start) => new(start, Index.End);
|
||||
|
||||
/// <summary>Create a Range object starting from first element in the collection to the end Index.</summary>
|
||||
public static Range EndAt(Index end) => new(Index.Start, end);
|
||||
|
||||
/// <summary>Create a Range object starting from first element to the end.</summary>
|
||||
public static Range All => new(Index.Start, Index.End);
|
||||
|
||||
/// <summary>Calculate the start offset and length of range object using a collection length.</summary>
|
||||
/// <param name="length">The length of the collection that the range will be used with. length has to be a positive value.</param>
|
||||
/// <remarks>
|
||||
/// For performance reason, we don't validate the input length parameter against negative values.
|
||||
/// It is expected Range will be used with collections which always have non negative length/count.
|
||||
/// We validate the range is inside the length scope though.
|
||||
/// </remarks>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public (int Offset, int Length) GetOffsetAndLength(int length)
|
||||
{
|
||||
var startIndex = Start;
|
||||
var start = startIndex.IsFromEnd ? length - startIndex.Value : startIndex.Value;
|
||||
|
||||
var endIndex = End;
|
||||
var end = endIndex.IsFromEnd ? length - endIndex.Value : endIndex.Value;
|
||||
|
||||
if ((uint)end > (uint)length || (uint)start > (uint)end)
|
||||
{
|
||||
ThrowArgumentOutOfRange(nameof(length));
|
||||
}
|
||||
|
||||
return (start, end - start);
|
||||
}
|
||||
|
||||
[DoesNotReturn]
|
||||
private static void ThrowArgumentOutOfRange(string? paramName)
|
||||
=> throw new ArgumentOutOfRangeException(paramName);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>Specifies that a type has required members or that a member is required.</summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
|
||||
internal sealed class RequiredMemberAttribute : Attribute { }
|
||||
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
// Copied from https://github/dotnet/runtime
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that this constructor sets all required members for the current type, and callers
|
||||
/// do not need to set any required members themselves.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
|
||||
internal sealed class SetsRequiredMembersAttribute : Attribute { }
|
||||
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the language server library assets.</Description>
|
||||
<EnableApiCheck>false</EnableApiCheck>
|
||||
<IsShippingPackage>false</IsShippingPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="String Resources">
|
||||
<EmbeddedResource Update="Resources\SR.resx">
|
||||
<GenerateSource>true</GenerateSource>
|
||||
<Namespace>Microsoft.AspNetCore.Razor.Common.Resources</Namespace>
|
||||
</EmbeddedResource>
|
||||
|
||||
<Using Include="Microsoft.AspNetCore.Razor.Common.Resources" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Common.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Protocol, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Microbenchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.OmniSharpPlugin, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.OmniSharpPlugin.StrongNamed, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.OmniSharpPlugin.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.ComponentShim, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.MvcShim, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Workspaces, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Workspaces.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Workspaces.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Remote.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Remote.Razor.CoreComponents, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Remote.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Editor.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Editor.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Editor.Razor.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServer.ContainedLanguage, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServer.ContainedLanguage.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServer.ContainedLanguage.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServerClient.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServerClient.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServices.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LanguageServices.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LiveShare.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.LiveShare.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Mac.LanguageServices.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Mac.LanguageServices.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Mac.RazorAddin, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.Razor.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.RazorExtension, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.RazorExtension.Dependencies, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("RazorDeployment, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("rzls, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ArgumentOutOfRange_NeedNonNegNum" xml:space="preserve">
|
||||
<value>Non-negative number required.</value>
|
||||
</data>
|
||||
</root>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.cs.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.cs.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="cs" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Vyžaduje se nezáporné číslo.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.de.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.de.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="de" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Nicht negative Zahl erforderlich.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.es.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.es.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="es" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Número no negativo requerido.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.fr.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.fr.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="fr" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Nombre non négatif obligatoire.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.it.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.it.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="it" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">È richiesto un numero non negativo.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.ja.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.ja.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="ja" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">負でない数値が必要です。</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.ko.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.ko.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="ko" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">음수가 아닌 수가 필요합니다.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.pl.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.pl.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="pl" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Wymagana jest liczba nieujemna.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.pt-BR.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.pt-BR.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="pt-BR" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">É necessário um número não negativo.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.ru.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.ru.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="ru" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Требуется неотрицательное число.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.tr.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.tr.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="tr" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">Negatif olmayan sayı gerekiyor.</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.zh-Hans.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.zh-Hans.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">需要提供非负数。</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.zh-Hant.xlf
сгенерированный
Normal file
12
src/Razor/src/Microsoft.AspNetCore.Razor.Common/Resources/xlf/SR.zh-Hant.xlf
сгенерированный
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../SR.resx">
|
||||
<body>
|
||||
<trans-unit id="ArgumentOutOfRange_NeedNonNegNum">
|
||||
<source>Non-negative number required.</source>
|
||||
<target state="translated">需要非負數。</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -63,7 +61,8 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Common
|
|||
|
||||
public override Workspace Workspace => _workspace;
|
||||
|
||||
public override TWorkspaceService GetService<TWorkspaceService>()
|
||||
public override TWorkspaceService? GetService<TWorkspaceService>()
|
||||
where TWorkspaceService : default
|
||||
{
|
||||
var service = _workspaceServices.OfType<TWorkspaceService>().FirstOrDefault();
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
|
@ -22,4 +20,4 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Common
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.CodeAnalysis.Razor.Serialization;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
|
||||
|
@ -10,3 +8,4 @@ using System.Runtime.CompilerServices;
|
|||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.OmniSharpPlugin.StrongNamed, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Common.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.LanguageServer.Test.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
|
|
|
@ -19,8 +19,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Common
|
|||
|
||||
public const string RazorProvideHtmlDocumentColorEndpoint = "razor/provideHtmlDocumentColor";
|
||||
|
||||
public const string RazorServerReadyEndpoint = "razor/serverReady";
|
||||
|
||||
public const string RazorInlineCompletionEndpoint = "razor/inlineCompletion";
|
||||
|
||||
public const string RazorFoldingRangeEndpoint = "razor/foldingRange";
|
||||
|
@ -42,5 +40,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Common
|
|||
public const string RazorSignatureHelpEndpointName = "razor/signatureHelp";
|
||||
|
||||
public const string RazorImplementationEndpointName = "razor/implementation";
|
||||
|
||||
public const string RazorOnAutoInsertEndpointName = "razor/onAutoInsert";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Common
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.VisualStudio.Telemetry;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Common.Telemetry
|
||||
{
|
||||
internal interface ITelemetryReporter
|
||||
{
|
||||
void ReportEvent(string name, TelemetrySeverity severity);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common.Extensions;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
|
||||
|
|
|
@ -14,6 +14,13 @@ internal record DelegatedPositionParams(
|
|||
Position ProjectedPosition,
|
||||
RazorLanguageKind ProjectedKind) : IDelegatedParams;
|
||||
|
||||
internal record DelegatedOnAutoInsertParams(
|
||||
VersionedTextDocumentIdentifier HostDocument,
|
||||
Position ProjectedPosition,
|
||||
RazorLanguageKind ProjectedKind,
|
||||
string Character,
|
||||
FormattingOptions Options) : IDelegatedParams;
|
||||
|
||||
internal record DelegatedRenameParams(
|
||||
VersionedTextDocumentIdentifier HostDocument,
|
||||
Position ProjectedPosition,
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
namespace System.Runtime.CompilerServices
|
||||
{
|
||||
// Used to compile against C# 9 in a net472 app.
|
||||
internal class IsExternalInit
|
||||
{
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol;
|
|||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Protocol;
|
||||
|
||||
internal abstract class RazorBreakpointSpanParams
|
||||
internal class RazorBreakpointSpanParams
|
||||
{
|
||||
public Uri Uri { get; set; }
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol;
|
|||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Protocol;
|
||||
|
||||
internal abstract class RazorProximityExpressionsParams
|
||||
internal class RazorProximityExpressionsParams
|
||||
{
|
||||
public Uri Uri { get; set; }
|
||||
|
||||
|
|
|
@ -4,33 +4,29 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Protocol;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
using OmniSharp.Extensions.JsonRpc;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer
|
||||
{
|
||||
internal abstract class AbstractRazorDelegatingEndpoint<TRequest, TResponse> : IJsonRpcRequestHandler<TRequest, TResponse?>
|
||||
where TRequest : TextDocumentPositionParams, IRequest<TResponse?>
|
||||
internal abstract class AbstractRazorDelegatingEndpoint<TRequest, TResponse> : IRazorRequestHandler<TRequest, TResponse?>
|
||||
where TRequest : ITextDocumentPositionParams
|
||||
{
|
||||
private readonly DocumentContextFactory _documentContextFactory;
|
||||
private readonly LanguageServerFeatureOptions _languageServerFeatureOptions;
|
||||
private readonly RazorDocumentMappingService _documentMappingService;
|
||||
private readonly ClientNotifierServiceBase _languageServer;
|
||||
protected readonly ILogger Logger;
|
||||
|
||||
protected AbstractRazorDelegatingEndpoint(
|
||||
DocumentContextFactory documentContextFactory,
|
||||
LanguageServerFeatureOptions languageServerFeatureOptions,
|
||||
RazorDocumentMappingService documentMappingService,
|
||||
ClientNotifierServiceBase languageServer,
|
||||
ILogger logger)
|
||||
{
|
||||
_documentContextFactory = documentContextFactory ?? throw new ArgumentNullException(nameof(documentContextFactory));
|
||||
_languageServerFeatureOptions = languageServerFeatureOptions ?? throw new ArgumentNullException(nameof(languageServerFeatureOptions));
|
||||
_documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService));
|
||||
_languageServer = languageServer ?? throw new ArgumentNullException(nameof(languageServer));
|
||||
|
@ -41,7 +37,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer
|
|||
/// <summary>
|
||||
/// The delegated object to send to the <see cref="CustomMessageTarget"/>
|
||||
/// </summary>
|
||||
protected abstract IDelegatedParams CreateDelegatedParams(TRequest request, DocumentContext documentContext, Projection projection, CancellationToken cancellationToken);
|
||||
protected abstract IDelegatedParams? CreateDelegatedParams(TRequest request, RazorRequestContext razorRequestContext, Projection projection, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// The name of the endpoint to delegate to, from <see cref="RazorLanguageServerCustomMessageTargets"/>. This is the
|
||||
|
@ -53,18 +49,20 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer
|
|||
/// </remarks>
|
||||
protected abstract string CustomMessageTarget { get; }
|
||||
|
||||
public bool MutatesSolutionState { get; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// If the response needs to be handled, such as for remapping positions back, override and handle here
|
||||
/// </summary>
|
||||
protected virtual Task<TResponse?> HandleDelegatedResponseAsync(TResponse? delegatedResponse, DocumentContext documentContext, CancellationToken cancellationToken)
|
||||
protected virtual Task<TResponse> HandleDelegatedResponseAsync(TResponse delegatedResponse, TRequest originalRequest, RazorRequestContext requestContext, Projection projection, CancellationToken cancellationToken)
|
||||
=> Task.FromResult(delegatedResponse);
|
||||
|
||||
/// <summary>
|
||||
/// If the request can be handled without delegation, override this to provide a response. If a null
|
||||
/// value is returned the request will be delegated to C#/HTML servers, otherwise the response
|
||||
/// will be used in <see cref="Handle(TRequest, CancellationToken)"/>
|
||||
/// will be used in <see cref="HandleRequestAsync(TRequest, RazorRequestContext, CancellationToken)"/>
|
||||
/// </summary>
|
||||
protected virtual Task<TResponse?> TryHandleAsync(TRequest request, DocumentContext documentContext, Projection projection, CancellationToken cancellationToken)
|
||||
protected virtual Task<TResponse?> TryHandleAsync(TRequest request, RazorRequestContext requestContext, Projection projection, CancellationToken cancellationToken)
|
||||
=> Task.FromResult<TResponse?>(default);
|
||||
|
||||
/// <summary>
|
||||
|
@ -75,9 +73,9 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer
|
|||
protected virtual bool IsSupported() => true;
|
||||
|
||||
/// <summary>
|
||||
/// Implementation for <see cref="IRequest{TResponse}"/>
|
||||
/// Implementation for <see cref="HandleRequestAsync(TRequest, RazorRequestContext, CancellationToken)"/>
|
||||
/// </summary>
|
||||
public async Task<TResponse?> Handle(TRequest request, CancellationToken cancellationToken)
|
||||
public async Task<TResponse?> HandleRequestAsync(TRequest request, RazorRequestContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request is null)
|
||||
{
|
||||
|
@ -89,21 +87,19 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer
|
|||
return default;
|
||||
}
|
||||
|
||||
var documentContext = await _documentContextFactory.TryCreateAsync(request.TextDocument.Uri, cancellationToken).ConfigureAwait(false);
|
||||
var documentContext = context.DocumentContext;
|
||||
if (documentContext is null)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
var projection = await _documentMappingService.TryGetProjectionAsync(documentContext, request.Position, Logger, cancellationToken).ConfigureAwait(false);
|
||||
var projection = await _documentMappingService.TryGetProjectionAsync(documentContext, request.Position, context.Logger, cancellationToken).ConfigureAwait(false);
|
||||
if (projection is null)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
var response = await TryHandleAsync(request, documentContext, projection, cancellationToken).ConfigureAwait(false);
|
||||
// If TResponse is a SumType<T1,T2,...> then it might be non-null, but the value within it could be, so we have to check
|
||||
// for that too.
|
||||
var response = await TryHandleAsync(request, context, projection, cancellationToken).ConfigureAwait(false);
|
||||
if (response is not null && response is not ISumType { Value: null })
|
||||
{
|
||||
return response;
|
||||
|
@ -121,18 +117,27 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer
|
|||
return default;
|
||||
}
|
||||
|
||||
var delegatedParams = CreateDelegatedParams(request, documentContext, projection, cancellationToken);
|
||||
var delegatedParams = CreateDelegatedParams(request, context, projection, cancellationToken);
|
||||
if (delegatedParams is null)
|
||||
{
|
||||
// I guess they don't want to delegate... fine then!
|
||||
return default;
|
||||
}
|
||||
|
||||
var delegatedRequest = await _languageServer.SendRequestAsync(CustomMessageTarget, delegatedParams).ConfigureAwait(false);
|
||||
var delegatedResponse = await delegatedRequest.Returning<TResponse?>(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (delegatedResponse is null)
|
||||
var delegatedRequest = await _languageServer.SendRequestAsync<IDelegatedParams, TResponse>(CustomMessageTarget, delegatedParams, cancellationToken).ConfigureAwait(false);
|
||||
if (delegatedRequest is null)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
var remappedResponse = await HandleDelegatedResponseAsync(delegatedResponse, documentContext, cancellationToken).ConfigureAwait(false);
|
||||
var remappedResponse = await HandleDelegatedResponseAsync(delegatedRequest, request, context, projection, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return remappedResponse;
|
||||
}
|
||||
|
||||
public TextDocumentIdentifier GetTextDocumentIdentifier(TRequest request)
|
||||
{
|
||||
return request.TextDocument;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.Legacy;
|
||||
using Microsoft.AspNetCore.Razor.Language.Syntax;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Extensions;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Formatting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert
|
||||
|
|
|
@ -3,72 +3,66 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common.Extensions;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Extensions;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Formatting;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Protocol;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert
|
||||
{
|
||||
internal class OnAutoInsertEndpoint : IVSOnAutoInsertEndpoint
|
||||
internal class OnAutoInsertEndpoint : AbstractRazorDelegatingEndpoint<OnAutoInsertParamsBridge, VSInternalDocumentOnAutoInsertResponseItem?>, IVSOnAutoInsertEndpoint
|
||||
{
|
||||
private readonly AdhocWorkspaceFactory _workspaceFactory;
|
||||
private static readonly HashSet<string> s_htmlAllowedTriggerCharacters = new(StringComparer.Ordinal) { "=", };
|
||||
private static readonly HashSet<string> s_cSharpAllowedTriggerCharacters = new(StringComparer.Ordinal) { "'", "/", "\n" };
|
||||
|
||||
private readonly LanguageServerFeatureOptions _languageServerFeatureOptions;
|
||||
private readonly IReadOnlyList<RazorOnAutoInsertProvider> _onAutoInsertProviders;
|
||||
private readonly ImmutableHashSet<string> _onAutoInsertTriggerCharacters;
|
||||
private readonly DocumentContextFactory _documentContextFactory;
|
||||
|
||||
public OnAutoInsertEndpoint(
|
||||
DocumentContextFactory documentContextFactory,
|
||||
LanguageServerFeatureOptions languageServerFeatureOptions,
|
||||
RazorDocumentMappingService documentMappingService,
|
||||
ClientNotifierServiceBase languageServer,
|
||||
IEnumerable<RazorOnAutoInsertProvider> onAutoInsertProvider,
|
||||
AdhocWorkspaceFactory workspaceFactory)
|
||||
ILoggerFactory loggerFactory)
|
||||
: base(languageServerFeatureOptions, documentMappingService, languageServer, loggerFactory.CreateLogger<OnAutoInsertEndpoint>())
|
||||
{
|
||||
if (documentContextFactory is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(documentContextFactory));
|
||||
}
|
||||
|
||||
if (onAutoInsertProvider is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(onAutoInsertProvider));
|
||||
}
|
||||
|
||||
if (workspaceFactory is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(workspaceFactory));
|
||||
}
|
||||
|
||||
_documentContextFactory = documentContextFactory;
|
||||
_workspaceFactory = workspaceFactory;
|
||||
_onAutoInsertProviders = onAutoInsertProvider.ToList();
|
||||
_onAutoInsertTriggerCharacters = _onAutoInsertProviders.Select(provider => provider.TriggerCharacter).ToImmutableHashSet();
|
||||
_languageServerFeatureOptions = languageServerFeatureOptions ?? throw new ArgumentNullException(nameof(languageServerFeatureOptions));
|
||||
_onAutoInsertProviders = onAutoInsertProvider?.ToList() ?? throw new ArgumentNullException(nameof(onAutoInsertProvider));
|
||||
}
|
||||
|
||||
protected override string CustomMessageTarget => RazorLanguageServerCustomMessageTargets.RazorOnAutoInsertEndpointName;
|
||||
|
||||
public RegistrationExtensionResult GetRegistration(VSInternalClientCapabilities clientCapabilities)
|
||||
{
|
||||
const string AssociatedServerCapability = "_vs_onAutoInsertProvider";
|
||||
|
||||
var triggerCharacters = _onAutoInsertProviders.Select(provider => provider.TriggerCharacter);
|
||||
|
||||
if (_languageServerFeatureOptions.SingleServerSupport)
|
||||
{
|
||||
triggerCharacters = triggerCharacters.Concat(s_htmlAllowedTriggerCharacters).Concat(s_cSharpAllowedTriggerCharacters);
|
||||
}
|
||||
|
||||
var registrationOptions = new VSInternalDocumentOnAutoInsertOptions()
|
||||
{
|
||||
TriggerCharacters = _onAutoInsertTriggerCharacters.ToArray(),
|
||||
TriggerCharacters = triggerCharacters.Distinct().ToArray()
|
||||
};
|
||||
|
||||
return new RegistrationExtensionResult(AssociatedServerCapability, registrationOptions);
|
||||
}
|
||||
|
||||
public async Task<VSInternalDocumentOnAutoInsertResponseItem?> Handle(OnAutoInsertParamsBridge request, CancellationToken cancellationToken)
|
||||
protected override async Task<VSInternalDocumentOnAutoInsertResponseItem?> TryHandleAsync(OnAutoInsertParamsBridge request, RazorRequestContext requestContext, Projection projection, CancellationToken cancellationToken)
|
||||
{
|
||||
var documentContext = await _documentContextFactory.TryCreateAsync(request.TextDocument.Uri, cancellationToken).ConfigureAwait(false);
|
||||
if (documentContext is null || cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken);
|
||||
var documentContext = requestContext.GetRequiredDocumentContext();
|
||||
var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (codeDocument.IsUnsupported())
|
||||
{
|
||||
return null;
|
||||
|
@ -98,7 +92,8 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert
|
|||
var uri = request.TextDocument.Uri;
|
||||
var position = request.Position;
|
||||
|
||||
using (var formattingContext = FormattingContext.Create(uri, documentContext.Snapshot, codeDocument, request.Options, _workspaceFactory))
|
||||
var workspaceFactory = requestContext.GetRequiredService<AdhocWorkspaceFactory>();
|
||||
using (var formattingContext = FormattingContext.Create(uri, documentContext.Snapshot, codeDocument, request.Options, workspaceFactory))
|
||||
{
|
||||
for (var i = 0; i < applicableProviders.Count; i++)
|
||||
{
|
||||
|
@ -116,5 +111,75 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert
|
|||
// No provider could handle the text edit.
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override IDelegatedParams? CreateDelegatedParams(OnAutoInsertParamsBridge request, RazorRequestContext requestContext, Projection projection, CancellationToken cancellationToken)
|
||||
{
|
||||
var documentContext = requestContext.GetRequiredDocumentContext();
|
||||
if (projection.LanguageKind == RazorLanguageKind.Html &&
|
||||
!s_htmlAllowedTriggerCharacters.Contains(request.Character))
|
||||
{
|
||||
Logger.LogInformation("Inapplicable HTML trigger char {request.Character}.", request.Character);
|
||||
return null;
|
||||
}
|
||||
else if (projection.LanguageKind == RazorLanguageKind.CSharp &&
|
||||
!s_cSharpAllowedTriggerCharacters.Contains(request.Character))
|
||||
{
|
||||
Logger.LogInformation("Inapplicable C# trigger char {request.Character}.", request.Character);
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DelegatedOnAutoInsertParams(
|
||||
documentContext.Identifier,
|
||||
projection.Position,
|
||||
projection.LanguageKind,
|
||||
request.Character,
|
||||
request.Options);
|
||||
}
|
||||
|
||||
protected override async Task<VSInternalDocumentOnAutoInsertResponseItem?> HandleDelegatedResponseAsync(
|
||||
VSInternalDocumentOnAutoInsertResponseItem? delegatedResponse,
|
||||
OnAutoInsertParamsBridge originalRequest,
|
||||
RazorRequestContext requestContext,
|
||||
Projection projection,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (delegatedResponse is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var documentContext = requestContext.GetRequiredDocumentContext();
|
||||
|
||||
// For Html we just return the edit as is
|
||||
if (projection.LanguageKind == RazorLanguageKind.Html)
|
||||
{
|
||||
return delegatedResponse;
|
||||
}
|
||||
|
||||
// For C# we run the edit through our formatting engine
|
||||
var edits = new[] { delegatedResponse.TextEdit };
|
||||
|
||||
var razorFormattingService = requestContext.GetRequiredService<RazorFormattingService>();
|
||||
TextEdit[] mappedEdits;
|
||||
if (delegatedResponse.TextEditFormat == InsertTextFormat.Snippet)
|
||||
{
|
||||
mappedEdits = await razorFormattingService.FormatSnippetAsync(documentContext.Identifier.Uri, documentContext.Snapshot, projection.LanguageKind, edits, originalRequest.Options, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
mappedEdits = await razorFormattingService.FormatOnTypeAsync(documentContext.Identifier.Uri, documentContext.Snapshot, projection.LanguageKind, edits, originalRequest.Options, hostDocumentIndex: 0, triggerCharacter: '\0', cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (mappedEdits.Length != 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new VSInternalDocumentOnAutoInsertResponseItem()
|
||||
{
|
||||
TextEdit = mappedEdits[0],
|
||||
TextEditFormat = delegatedResponse.TextEditFormat,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.CommonLanguageServerProtocol.Framework;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Extensions;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer;
|
||||
|
||||
internal class CapabilitiesManager : IInitializeManager<InitializeParams, InitializeResult>
|
||||
{
|
||||
private InitializeParams? _initializeParams;
|
||||
private readonly ILspServices _lspServices;
|
||||
|
||||
public CapabilitiesManager(ILspServices lspServices)
|
||||
{
|
||||
_lspServices = lspServices;
|
||||
}
|
||||
|
||||
public InitializeParams GetInitializeParams()
|
||||
{
|
||||
if (_initializeParams is null)
|
||||
{
|
||||
throw new InvalidOperationException($"{nameof(GetInitializeParams)} was called before '{Methods.InitializeName}'");
|
||||
}
|
||||
|
||||
return _initializeParams;
|
||||
}
|
||||
|
||||
public InitializeResult GetInitializeResult()
|
||||
{
|
||||
var initializeParams = GetInitializeParams();
|
||||
var clientCapabilities = initializeParams.Capabilities;
|
||||
var vsClientCapabilities = clientCapabilities.ToVSInternalClientCapabilities();
|
||||
|
||||
var serverCapabilities = new VSInternalServerCapabilities();
|
||||
|
||||
var registrationExtensions = _lspServices.GetRequiredServices<IRegistrationExtension>();
|
||||
foreach (var registrationExtension in registrationExtensions)
|
||||
{
|
||||
var registrationResult = registrationExtension.GetRegistration(vsClientCapabilities);
|
||||
if (registrationResult is not null)
|
||||
{
|
||||
serverCapabilities.ApplyRegistrationResult(registrationResult);
|
||||
}
|
||||
}
|
||||
|
||||
var initializeResult = new InitializeResult
|
||||
{
|
||||
Capabilities = serverCapabilities,
|
||||
};
|
||||
|
||||
return initializeResult;
|
||||
}
|
||||
|
||||
public void SetInitializeParams(InitializeParams request)
|
||||
{
|
||||
_initializeParams = request;
|
||||
}
|
||||
}
|
|
@ -3,24 +3,22 @@
|
|||
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using OmniSharp.Extensions.JsonRpc;
|
||||
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
|
||||
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer
|
||||
{
|
||||
// The VSCode OmniSharp client starts the RazorServer before all of its handlers are registered
|
||||
// because of this we need to wait until everthing is initialized to make some client requests like
|
||||
// razor\serverReady. This class takes a TCS which will complete when everything is initialized
|
||||
// because of this we need to wait until everthing is initialized to make some client requests.
|
||||
// This class takes a TCS which will complete when everything is initialized
|
||||
// ensuring that no requests are sent before the client is ready.
|
||||
internal abstract class ClientNotifierServiceBase: IOnLanguageServerStarted
|
||||
internal abstract class ClientNotifierServiceBase : IOnInitialized
|
||||
{
|
||||
public abstract Task<IResponseRouterReturns> SendRequestAsync(string method);
|
||||
public abstract Task<TResponse> SendRequestAsync<TParams, TResponse>(string method, TParams @params, CancellationToken cancellationToken);
|
||||
|
||||
public abstract Task<IResponseRouterReturns> SendRequestAsync<T>(string method, T @params);
|
||||
public abstract Task SendNotificationAsync<TParams>(string method, TParams @params, CancellationToken cancellationToken);
|
||||
|
||||
public abstract Task OnStarted(ILanguageServer server, CancellationToken cancellationToken);
|
||||
public abstract Task SendNotificationAsync(string method, CancellationToken cancellationToken);
|
||||
|
||||
public abstract InitializeParams ClientSettings { get; }
|
||||
public abstract Task OnInitializedAsync(VSInternalClientCapabilities clientCapabilities, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,72 @@
|
|||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
||||
{
|
||||
internal static class AddUsingsCodeActionProviderHelper
|
||||
{
|
||||
public static async Task<TextEdit[]> GetUsingStatementEditsAsync(RazorCodeDocument codeDocument, SourceText originalCSharpText, SourceText changedCSharpText, CancellationToken cancellationToken)
|
||||
{
|
||||
// Now that we're done with everything, lets see if there are any using statements to fix up
|
||||
// We do this by comparing the original generated C# code, and the changed C# code, and look for a difference
|
||||
// in using statements. We can't use edits for this for two main reasons:
|
||||
//
|
||||
// 1. Using statements in the generated code might come from _Imports.razor, or from this file, and C# will shove them anywhere
|
||||
// 2. The edit might not be clean. eg given:
|
||||
// using System;
|
||||
// using System.Text;
|
||||
// Adding "using System.Linq;" could result in an insert of "Linq;\r\nusing System." on line 2
|
||||
//
|
||||
// So because of the above, we look for a difference in C# using directive nodes directly from the C# syntax tree, and apply them manually
|
||||
// to the Razor document.
|
||||
|
||||
var oldUsings = await FindUsingDirectiveStringsAsync(originalCSharpText, cancellationToken);
|
||||
var newUsings = await FindUsingDirectiveStringsAsync(changedCSharpText, cancellationToken);
|
||||
|
||||
var edits = new List<TextEdit>();
|
||||
foreach (var usingStatement in newUsings.Except(oldUsings))
|
||||
{
|
||||
// This identifier will be eventually thrown away.
|
||||
var identifier = new OptionalVersionedTextDocumentIdentifier { Uri = new Uri(codeDocument.Source.FilePath, UriKind.Relative) };
|
||||
var workspaceEdit = AddUsingsCodeActionResolver.CreateAddUsingWorkspaceEdit(usingStatement, codeDocument, codeDocumentIdentifier: identifier);
|
||||
edits.AddRange(workspaceEdit.DocumentChanges!.Value.First.First().Edits);
|
||||
}
|
||||
|
||||
return edits.ToArray();
|
||||
}
|
||||
|
||||
private static async Task<IEnumerable<string>> FindUsingDirectiveStringsAsync(SourceText originalCSharpText, CancellationToken cancellationToken)
|
||||
{
|
||||
var syntaxTree = CSharpSyntaxTree.ParseText(originalCSharpText, cancellationToken: cancellationToken);
|
||||
var syntaxRoot = await syntaxTree.GetRootAsync(cancellationToken);
|
||||
|
||||
// We descend any compilation unit (ie, the file) or and namespaces because the compiler puts all usings inside
|
||||
// the namespace node.
|
||||
var usings = syntaxRoot.DescendantNodes(n => n is BaseNamespaceDeclarationSyntax or CompilationUnitSyntax)
|
||||
// Filter to using directives
|
||||
.OfType<UsingDirectiveSyntax>()
|
||||
// Select everything after the initial "using " part of the statement. This is slightly lazy, for sure, but has
|
||||
// the advantage of us not caring about chagnes to C# syntax, we just grab whatever Roslyn wanted to put in, so
|
||||
// we should still work in C# v26
|
||||
.Select(u => u.ToString().Substring("using ".Length));
|
||||
|
||||
return usings;
|
||||
}
|
||||
|
||||
internal static readonly Regex AddUsingVSCodeAction = new Regex("^@?using ([^;]+);?$", RegexOptions.Compiled, TimeSpan.FromSeconds(1));
|
||||
|
||||
// Internal for testing
|
||||
|
|
|
@ -2,11 +2,15 @@
|
|||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Common.Extensions;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Extensions;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces.Extensions;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
||||
|
@ -46,9 +50,20 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
if (!AddUsingsCodeActionProviderHelper.TryExtractNamespace(codeAction.Title, out var @namespace))
|
||||
var resolvedCodeAction = await ResolveCodeActionWithServerAsync(csharpParams.RazorFileUri, codeAction, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// TODO: Move this higher, so it happens on any code action.
|
||||
// For that though, we need a deeper understanding of applying workspace edits to documents, rather than
|
||||
// just picking out the first one because we assume thats where it will be.
|
||||
// Tracked by https://github.com/dotnet/razor-tooling/issues/6159
|
||||
if (resolvedCodeAction?.Edit?.TryGetDocumentChanges(out var documentChanges) != true)
|
||||
{
|
||||
// Invalid text edit, missing namespace
|
||||
return codeAction;
|
||||
}
|
||||
|
||||
if (documentChanges!.Length != 1)
|
||||
{
|
||||
Debug.Fail("We don't yet support multi-document code actions! If you're seeing this, something about Roslyn changed and we should react.");
|
||||
return codeAction;
|
||||
}
|
||||
|
||||
|
@ -64,14 +79,28 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
return codeAction;
|
||||
}
|
||||
|
||||
var codeDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier()
|
||||
{
|
||||
Uri = csharpParams.RazorFileUri,
|
||||
Version = documentContext.Version
|
||||
};
|
||||
var csharpText = codeDocument.GetCSharpSourceText();
|
||||
var edits = documentChanges[0].Edits;
|
||||
var changes = edits.Select(e => e.AsTextChange(csharpText));
|
||||
var changedText = csharpText.WithChanges(changes);
|
||||
|
||||
var edit = AddUsingsCodeActionResolver.CreateAddUsingWorkspaceEdit(@namespace, codeDocument, codeDocumentIdentifier);
|
||||
codeAction.Edit = edit;
|
||||
edits = await AddUsingsCodeActionProviderHelper.GetUsingStatementEditsAsync(codeDocument, csharpText, changedText, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
codeAction.Edit = new WorkspaceEdit
|
||||
{
|
||||
DocumentChanges = new TextDocumentEdit[]
|
||||
{
|
||||
new TextDocumentEdit
|
||||
{
|
||||
TextDocument = new OptionalVersionedTextDocumentIdentifier()
|
||||
{
|
||||
Uri = csharpParams.RazorFileUri,
|
||||
Version = documentContext.Version
|
||||
},
|
||||
Edits = edits
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return codeAction;
|
||||
}
|
||||
|
|
|
@ -32,8 +32,11 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
protected async Task<CodeAction?> ResolveCodeActionWithServerAsync(Uri uri, CodeAction codeAction, CancellationToken cancellationToken)
|
||||
{
|
||||
var resolveCodeActionParams = new RazorResolveCodeActionParams(uri, codeAction);
|
||||
var response = await LanguageServer.SendRequestAsync(RazorLanguageServerCustomMessageTargets.RazorResolveCodeActionsEndpoint, resolveCodeActionParams).ConfigureAwait(false);
|
||||
var resolvedCodeAction = await response.Returning<CodeAction?>(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var resolvedCodeAction = await LanguageServer.SendRequestAsync<RazorResolveCodeActionParams, CodeAction?>(
|
||||
RazorLanguageServerCustomMessageTargets.RazorResolveCodeActionsEndpoint,
|
||||
resolveCodeActionParams,
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return resolvedCodeAction;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.Syntax;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.Extensions;
|
||||
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
||||
|
@ -29,6 +33,15 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
RazorPredefinedCodeFixProviderNames.RemoveUnusedVariable,
|
||||
};
|
||||
|
||||
// We don't support any code actions in implicit expressions at the moment, but rather than simply returning early
|
||||
// I thought it best to create an allow list, empty, so that we can easily add them later if we identify any big
|
||||
// hitters that we want to enable.
|
||||
// The one example commented out here should not be taken as an opinion as to what that allow list should look like.
|
||||
internal static readonly HashSet<string> SupportedImplicitExpressionCodeActionNames = new HashSet<string>()
|
||||
{
|
||||
// RazorPredefinedCodeFixProviderNames.RemoveUnusedVariable,
|
||||
};
|
||||
|
||||
public override Task<IReadOnlyList<RazorVSInternalCodeAction>?> ProvideAsync(
|
||||
RazorCodeActionContext context,
|
||||
IEnumerable<RazorVSInternalCodeAction> codeActions,
|
||||
|
@ -51,11 +64,19 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
return EmptyResult;
|
||||
}
|
||||
|
||||
var tree = context.CodeDocument.GetSyntaxTree();
|
||||
var node = tree.GetOwner(context.Location.AbsoluteIndex);
|
||||
var isInImplicitExpression = node?.AncestorsAndSelf().Any(n => n is CSharpImplicitExpressionSyntax) ?? false;
|
||||
|
||||
var allowList = isInImplicitExpression
|
||||
? SupportedImplicitExpressionCodeActionNames
|
||||
: SupportedDefaultCodeActionNames;
|
||||
|
||||
var results = new List<RazorVSInternalCodeAction>();
|
||||
|
||||
foreach (var codeAction in codeActions)
|
||||
{
|
||||
if (codeAction.Name is not null && SupportedDefaultCodeActionNames.Contains(codeAction.Name))
|
||||
if (codeAction.Name is not null && allowList.Contains(codeAction.Name))
|
||||
{
|
||||
results.Add(codeAction.WrapResolvableCSharpCodeAction(context));
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
private readonly RazorDocumentMappingService _documentMappingService;
|
||||
private readonly IEnumerable<RazorCodeActionProvider> _razorCodeActionProviders;
|
||||
private readonly IEnumerable<CSharpCodeActionProvider> _csharpCodeActionProviders;
|
||||
private readonly DocumentContextFactory _documentContextFactory;
|
||||
private readonly LanguageServerFeatureOptions _languageServerFeatureOptions;
|
||||
private readonly ClientNotifierServiceBase _languageServer;
|
||||
|
||||
|
@ -35,31 +34,31 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
|
||||
private readonly ImmutableHashSet<string> _allAvailableCodeActionNames;
|
||||
|
||||
public bool MutatesSolutionState { get; } = false;
|
||||
|
||||
public CodeActionEndpoint(
|
||||
RazorDocumentMappingService documentMappingService,
|
||||
IEnumerable<RazorCodeActionProvider> razorCodeActionProviders,
|
||||
IEnumerable<CSharpCodeActionProvider> csharpCodeActionProviders,
|
||||
DocumentContextFactory documentContextFactory,
|
||||
ClientNotifierServiceBase languageServer,
|
||||
LanguageServerFeatureOptions languageServerFeatureOptions)
|
||||
{
|
||||
_documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService));
|
||||
_razorCodeActionProviders = razorCodeActionProviders ?? throw new ArgumentNullException(nameof(razorCodeActionProviders));
|
||||
_csharpCodeActionProviders = csharpCodeActionProviders ?? throw new ArgumentNullException(nameof(csharpCodeActionProviders));
|
||||
_documentContextFactory = documentContextFactory ?? throw new ArgumentNullException(nameof(documentContextFactory));
|
||||
_languageServer = languageServer ?? throw new ArgumentNullException(nameof(languageServer));
|
||||
_languageServerFeatureOptions = languageServerFeatureOptions ?? throw new ArgumentNullException(nameof(languageServerFeatureOptions));
|
||||
|
||||
_allAvailableCodeActionNames = GetAllAvailableCodeActionNames();
|
||||
}
|
||||
public async Task<SumType<Command, CodeAction>[]?> Handle(CodeActionParamsBridge request, CancellationToken cancellationToken)
|
||||
public async Task<SumType<Command, CodeAction>[]?> HandleRequestAsync(CodeActionParams request, RazorRequestContext requestContext, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(request));
|
||||
}
|
||||
|
||||
var razorCodeActionContext = await GenerateRazorCodeActionContextAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
var razorCodeActionContext = await GenerateRazorCodeActionContextAsync(request, requestContext.DocumentContext).ConfigureAwait(false);
|
||||
if (razorCodeActionContext is null)
|
||||
{
|
||||
return null;
|
||||
|
@ -93,7 +92,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
return commandsOrCodeActions.ToArray();
|
||||
}
|
||||
|
||||
public RegistrationExtensionResult? GetRegistration(VSInternalClientCapabilities clientCapabilities)
|
||||
public RegistrationExtensionResult GetRegistration(VSInternalClientCapabilities clientCapabilities)
|
||||
{
|
||||
_supportsCodeActionResolve = clientCapabilities.TextDocument?.CodeAction?.ResolveSupport != null;
|
||||
|
||||
|
@ -108,13 +107,12 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
},
|
||||
ResolveProvider = true,
|
||||
};
|
||||
return new RegistrationExtensionResult(ServerCapability, options);
|
||||
return new RegistrationExtensionResult(ServerCapability, new SumType<bool, CodeActionOptions>(options));
|
||||
}
|
||||
|
||||
// internal for testing
|
||||
internal async Task<RazorCodeActionContext?> GenerateRazorCodeActionContextAsync(CodeActionParamsBridge request, CancellationToken cancellationToken)
|
||||
internal async Task<RazorCodeActionContext?> GenerateRazorCodeActionContextAsync(CodeActionParams request, DocumentContext? documentContext)
|
||||
{
|
||||
var documentContext = await _documentContextFactory.TryCreateAsync(request.TextDocument.Uri, cancellationToken).ConfigureAwait(false);
|
||||
if(documentContext is null)
|
||||
{
|
||||
return null;
|
||||
|
@ -256,8 +254,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var response = await _languageServer.SendRequestAsync(RazorLanguageServerCustomMessageTargets.RazorProvideCodeActionsEndpoint, context.Request);
|
||||
return await response.Returning<RazorVSInternalCodeAction[]>(cancellationToken);
|
||||
return await _languageServer.SendRequestAsync<CodeActionParams, RazorVSInternalCodeAction[]>(RazorLanguageServerCustomMessageTargets.RazorProvideCodeActionsEndpoint, context.Request, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<RazorVSInternalCodeAction>?> GetRazorCodeActionsAsync(RazorCodeActionContext context, CancellationToken cancellationToken)
|
||||
|
@ -321,5 +318,10 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
|
||||
return availableCodeActionNames.ToImmutableHashSet();
|
||||
}
|
||||
|
||||
public TextDocumentIdentifier GetTextDocumentIdentifier(CodeActionParams request)
|
||||
{
|
||||
return request.TextDocument;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
private readonly IReadOnlyDictionary<string, CSharpCodeActionResolver> _csharpCodeActionResolvers;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public bool MutatesSolutionState => false;
|
||||
|
||||
public CodeActionResolutionEndpoint(
|
||||
IEnumerable<RazorCodeActionResolver> razorCodeActionResolvers,
|
||||
IEnumerable<CSharpCodeActionResolver> csharpCodeActionResolvers,
|
||||
|
@ -47,7 +49,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions
|
|||
_csharpCodeActionResolvers = CreateResolverMap(csharpCodeActionResolvers);
|
||||
}
|
||||
|
||||
public async Task<CodeAction> Handle(CodeActionBridge request, CancellationToken cancellationToken)
|
||||
public async Task<CodeAction> HandleRequestAsync(CodeAction request, RazorRequestContext requestContext, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request is null)
|
||||
{
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче