提交 f41255f3 编写于 作者: M Manish Vasani

Merge remote-tracking branch 'upstream/master' into RunCodeAnalysisDuringLiveAnalysis

......@@ -188,6 +188,34 @@ public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(Solution solutio
return SpecializedTasks.EmptyImmutableArray<DiagnosticData>();
}
public async Task ForceAnalyzeAsync(Solution solution, ProjectId projectId = null, CancellationToken cancellationToken = default)
{
if (_map.TryGetValue(solution.Workspace, out var analyzer))
{
if (projectId != null)
{
var project = solution.GetProject(projectId);
if (project != null)
{
await analyzer.ForceAnalyzeProjectAsync(project, cancellationToken).ConfigureAwait(false);
}
}
else
{
var tasks = new Task[solution.ProjectIds.Count];
var index = 0;
foreach (var project in solution.Projects)
{
var localProject = project;
tasks[index++] = Task.Run(
() => analyzer.ForceAnalyzeProjectAsync(project, cancellationToken));
}
await Task.WhenAll(tasks).ConfigureAwait(false);
}
}
}
public Task<ImmutableArray<DiagnosticData>> GetSpecificDiagnosticsAsync(Solution solution, object id, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default)
{
if (_map.TryGetValue(solution.Workspace, out var analyzer))
......
......@@ -374,7 +374,7 @@ public Executor(DiagnosticIncrementalAnalyzer owner)
}
}
private static bool FullAnalysisEnabled(Project project, bool forceAnalyzerRun)
internal static bool FullAnalysisEnabled(Project project, bool forceAnalyzerRun)
{
if (forceAnalyzerRun)
{
......
......@@ -74,6 +74,20 @@ private async Task AnalyzeDocumentForKindAsync(Document document, AnalysisKind k
}
public async Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken)
{
// Perf optimization. check whether we want to analyze this project or not.
if (!Executor.FullAnalysisEnabled(project, forceAnalyzerRun: false))
{
return;
}
await AnalyzeProjectAsync(project, forceAnalyzerRun: false, cancellationToken).ConfigureAwait(false);
}
public Task ForceAnalyzeProjectAsync(Project project, CancellationToken cancellationToken)
=> AnalyzeProjectAsync(project, forceAnalyzerRun: true, cancellationToken);
private async Task AnalyzeProjectAsync(Project project, bool forceAnalyzerRun, CancellationToken cancellationToken)
{
try
{
......@@ -91,7 +105,6 @@ public async Task AnalyzeProjectAsync(Project project, bool semanticsChanged, In
var includeSuppressedDiagnostics = true;
var analyzerDriverOpt = await _compilationManager.CreateAnalyzerDriverAsync(project, activeAnalyzers, includeSuppressedDiagnostics, cancellationToken).ConfigureAwait(false);
var forceAnalyzerRun = false;
var result = await _executor.GetProjectAnalysisDataAsync(analyzerDriverOpt, project, stateSets, forceAnalyzerRun, cancellationToken).ConfigureAwait(false);
if (result.FromCache)
{
......
......@@ -11,61 +11,66 @@ namespace Microsoft.CodeAnalysis.Diagnostics
internal interface IDiagnosticAnalyzerService
{
/// <summary>
/// re-analyze given projects and documents
/// Re-analyze given projects and documents
/// </summary>
void Reanalyze(Workspace workspace, IEnumerable<ProjectId> projectIds = null, IEnumerable<DocumentId> documentIds = null, bool highPriority = false);
/// <summary>
/// get specific diagnostics currently stored in the source. returned diagnostic might be out-of-date if solution has changed but analyzer hasn't run for the new solution.
/// Get specific diagnostics currently stored in the source. returned diagnostic might be out-of-date if solution has changed but analyzer hasn't run for the new solution.
/// </summary>
Task<ImmutableArray<DiagnosticData>> GetSpecificCachedDiagnosticsAsync(Workspace workspace, object id, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// get diagnostics currently stored in the source. returned diagnostic might be out-of-date if solution has changed but analyzer hasn't run for the new solution.
/// Get diagnostics currently stored in the source. returned diagnostic might be out-of-date if solution has changed but analyzer hasn't run for the new solution.
/// </summary>
Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId projectId = null, DocumentId documentId = null, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// get specific diagnostics for the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Get specific diagnostics for the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// </summary>
Task<ImmutableArray<DiagnosticData>> GetSpecificDiagnosticsAsync(Solution solution, object id, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// get diagnostics for the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Get diagnostics for the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// </summary>
Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(Solution solution, ProjectId projectId = null, DocumentId documentId = null, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// true if given project has any diagnostics
/// Force computes diagnostics and raises diagnostic events for the given project or solution. all diagnostics returned should be up-to-date with respect to the given project or solution.
/// </summary>
Task ForceAnalyzeAsync(Solution solution, ProjectId projectId = null, CancellationToken cancellationToken = default);
/// <summary>
/// True if given project has any diagnostics
/// </summary>
bool ContainsDiagnostics(Workspace workspace, ProjectId projectId);
/// <summary>
/// get diagnostics of the given diagnostic ids from the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Get diagnostics of the given diagnostic ids from the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Note that for project case, this method returns diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution, ProjectId, ImmutableHashSet{string}, bool, CancellationToken)"/>
/// if you want to fetch only project diagnostics without source locations.
/// </summary>
Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId projectId = null, DocumentId documentId = null, ImmutableHashSet<string> diagnosticIds = null, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// get project diagnostics (diagnostics with no source location) of the given diagnostic ids from the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Get project diagnostics (diagnostics with no source location) of the given diagnostic ids from the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Note that this method doesn't return any document diagnostics. Use <see cref="GetDiagnosticsForIdsAsync(Solution, ProjectId, DocumentId, ImmutableHashSet{string}, bool, CancellationToken)"/> to also fetch those.
/// </summary>
Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId projectId = null, ImmutableHashSet<string> diagnosticIds = null, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// try to return up to date diagnostics for the given span for the document.
/// Try to return up to date diagnostics for the given span for the document.
///
/// it will return true if it was able to return all up-to-date diagnostics.
/// It will return true if it was able to return all up-to-date diagnostics.
/// otherwise, false indicating there are some missing diagnostics in the diagnostic list
/// </summary>
Task<bool> TryAppendDiagnosticsForSpanAsync(Document document, TextSpan range, List<DiagnosticData> diagnostics, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
/// <summary>
/// return up to date diagnostics for the given span for the document
/// Return up to date diagnostics for the given span for the document
///
/// this can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
/// if diagnosticIdOpt is not null, it gets diagnostics only for this given diagnosticIdOpt value
/// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
/// If diagnosticIdOpt is not null, it gets diagnostics only for this given diagnosticIdOpt value
/// </summary>
Task<IEnumerable<DiagnosticData>> GetDiagnosticsForSpanAsync(Document document, TextSpan range, string diagnosticIdOpt = null, bool includeSuppressedDiagnostics = false, CancellationToken cancellationToken = default);
......
......@@ -371,6 +371,33 @@
<LocCanonicalName>ResetVisualBasicInteractiveFromProject</LocCanonicalName>
</Strings>
</Button>
<!-- Run code analysis commands -->
<!-- "Run Code Analysis on <%ProjectName%>" command for Top level "Build" and "Analyze" menus.
"ECMD_RUNFXCOPSEL" is actually defined in stdidcmd.h, we're just referencing it here -->
<Button guid="guidVSStd2K" id="ECMD_RUNFXCOPSEL" priority="0x0000" type="Button">
<CommandFlag>TextChanges</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>DefaultDisabled</CommandFlag>
<Strings>
<ButtonText>Run Code &amp;Analysis on Selection</ButtonText>
</Strings>
</Button>
<!-- "Run Code Analysis" command for Solution Explorer "Analyze and Code Cleanup" context menu for project node -->
<Button guid="guidRoslynGrpId" id="cmdidRunCodeAnalysisForProject" priority="0x0000" type="Button">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ANALYZE_GENERAL"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Run C&amp;ode Analysis</ButtonText>
<CanonicalName>RunCodeAnalysisForProject</CanonicalName>
<LocCanonicalName>RunCodeAnalysisForProject</LocCanonicalName>
<CommandName>RunCodeAnalysisForProject</CommandName>
</Strings>
</Button>
</Buttons>
<Menus>
......@@ -482,6 +509,7 @@
<UsedCommands>
<UsedCommand guid="guidVSStd2K" id="ECMD_INSERTCOMMENT" />
<UsedCommand guid="guidVSStd2K" id="ECMD_RUNFXCOPSEL"/>
</UsedCommands>
<Symbols>
......@@ -548,6 +576,8 @@
<IDSymbol name="grpErrorListDiagnosticSeverityItems" value="0x012a" />
<IDSymbol name="cmdidGoToImplementation" value="0x0200" />
<IDSymbol name="cmdidRunCodeAnalysisForProject" value="0x0201" />
</GuidSymbol>
<GuidSymbol name="guidCSharpInteractiveCommandSet" value="{1492db0a-85a2-4e43-bf0d-ce55b89a8cc6}">
......
......@@ -7,6 +7,24 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LegacyCodeAnalysis.Api
{
internal interface ILegacyCodeAnalysisVisualStudioDiagnosticAnalyzerServiceAccessor
{
/// <summary>
/// Gets a list of the diagnostics that are provided by this service.
/// If the given <paramref name="hierarchyOpt"/> is non-null and corresponds to an existing project in the workspace, then gets the diagnostics for the project.
/// Otherwise, returns the global set of diagnostics enabled for the workspace.
/// </summary>
/// <returns>A mapping from analyzer name to the diagnostics produced by that analyzer</returns>
/// <remarks>
/// This is used by the Ruleset Editor from ManagedSourceCodeAnalysis.dll in VisualStudio.
/// </remarks>
IReadOnlyDictionary<string, IEnumerable<DiagnosticDescriptor>> GetAllDiagnosticDescriptors(IVsHierarchy hierarchyOpt);
/// <summary>
/// Runs all the applicable NuGet and VSIX diagnostic analyzers for the given project OR current solution in background and updates the error list.
/// </summary>
/// <param name="hierarchyOpt">
/// If non-null hierarchy for a project, then analyzers are run on the project.
/// Otherwise, analyzers are run on the current solution.
/// </param>
void RunAnalyzers(IVsHierarchy hierarchyOpt);
}
}
......@@ -26,5 +26,8 @@ public LegacyCodeAnalysisVisualStudioDiagnosticAnalyzerServiceAccessor(IVisualSt
public IReadOnlyDictionary<string, IEnumerable<DiagnosticDescriptor>> GetAllDiagnosticDescriptors(IVsHierarchy hierarchyOpt)
=> _implementation.GetAllDiagnosticDescriptors(hierarchyOpt);
public void RunAnalyzers(IVsHierarchy hierarchyOpt)
=> _implementation.RunAnalyzers(hierarchyOpt);
}
}
......@@ -43,6 +43,8 @@ public static class RoslynCommands
public const int ErrorListSetSeverityDefault = 0x0129;
public const int GoToImplementation = 0x0200;
public const int RunCodeAnalysisForProject = 0x0201;
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullable enable
using System;
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
using Microsoft.VisualStudio.Shell.Interop;
......@@ -10,13 +13,27 @@ internal interface IVisualStudioDiagnosticAnalyzerService
{
/// <summary>
/// Gets a list of the diagnostics that are provided by this service.
/// If the given <paramref name="hierarchyOpt"/> is non-null and corresponds to an existing project in the workspace, then gets the diagnostics for the project.
/// If the given <paramref name="hierarchy"/> is non-null and corresponds to an existing project in the workspace, then gets the diagnostics for the project.
/// Otherwise, returns the global set of diagnostics enabled for the workspace.
/// </summary>
/// <returns>A mapping from analyzer name to the diagnostics produced by that analyzer</returns>
/// <remarks>
/// This is used by the Ruleset Editor from ManagedSourceCodeAnalysis.dll in VisualStudio.
/// </remarks>
IReadOnlyDictionary<string, IEnumerable<DiagnosticDescriptor>> GetAllDiagnosticDescriptors(IVsHierarchy hierarchyOpt);
IReadOnlyDictionary<string, IEnumerable<DiagnosticDescriptor>> GetAllDiagnosticDescriptors(IVsHierarchy? hierarchy);
/// <summary>
/// Runs all the applicable NuGet and VSIX diagnostic analyzers for the given project OR current solution in background and updates the error list.
/// </summary>
/// <param name="hierarchy">
/// If non-null hierarchy for a project, then analyzers are run on the project.
/// Otherwise, analyzers are run on the current solution.
/// </param>
void RunAnalyzers(IVsHierarchy? hierarchy);
/// <summary>
/// Initializes the service.
/// </summary>
void Initialize(IServiceProvider serviceProvider);
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Roslyn.Utilities;
using Task = System.Threading.Tasks.Task;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.Diagnostics
{
[Export(typeof(IVisualStudioDiagnosticAnalyzerService))]
internal partial class VisualStudioDiagnosticAnalyzerService : IVisualStudioDiagnosticAnalyzerService
{
// "Run Code Analysis on <%ProjectName%>" command for Top level "Build" and "Analyze" menus.
// The below ID is actually defined as "ECMD_RUNFXCOPSEL" in stdidcmd.h, we're just referencing it here.
private const int RunCodeAnalysisForSelectedProjectCommandId = 1647;
private readonly VisualStudioWorkspace _workspace;
private readonly IDiagnosticAnalyzerService _diagnosticService;
private readonly IThreadingContext _threadingContext;
private readonly IVsHierarchyItemManager _vsHierarchyItemManager;
private readonly IAsynchronousOperationListener _listener;
private IServiceProvider? _serviceProvider;
[ImportingConstructor]
public VisualStudioDiagnosticAnalyzerService(VisualStudioWorkspace workspace, IDiagnosticAnalyzerService diagnosticService)
public VisualStudioDiagnosticAnalyzerService(
VisualStudioWorkspace workspace,
IDiagnosticAnalyzerService diagnosticService,
IThreadingContext threadingContext,
IVsHierarchyItemManager vsHierarchyItemManager,
IAsynchronousOperationListenerProvider listenerProvider)
{
_workspace = workspace;
_diagnosticService = diagnosticService;
_threadingContext = threadingContext;
_vsHierarchyItemManager = vsHierarchyItemManager;
_listener = listenerProvider.GetListener(FeatureAttribute.DiagnosticService);
}
// *DO NOT DELETE*
// This is used by Ruleset Editor from ManagedSourceCodeAnalysis.dll.
public IReadOnlyDictionary<string, IEnumerable<DiagnosticDescriptor>> GetAllDiagnosticDescriptors(IVsHierarchy hierarchyOpt)
public void Initialize(IServiceProvider serviceProvider)
{
if (hierarchyOpt == null)
_serviceProvider = serviceProvider;
// Hook up the "Run Code Analysis" menu command for CPS based managed projects.
var menuCommandService = (IMenuCommandService)_serviceProvider.GetService(typeof(IMenuCommandService));
if (menuCommandService != null)
{
AddCommand(menuCommandService, RunCodeAnalysisForSelectedProjectCommandId, VSConstants.VSStd2K, OnRunCodeAnalysisForSelectedProject, OnRunCodeAnalysisForSelectedProjectStatus);
AddCommand(menuCommandService, ID.RoslynCommands.RunCodeAnalysisForProject, Guids.RoslynGroupId, OnRunCodeAnalysisForSelectedProject, OnRunCodeAnalysisForSelectedProjectStatus);
}
return;
// Local functions
static OleMenuCommand AddCommand(
IMenuCommandService menuCommandService,
int commandId,
Guid commandGroup,
EventHandler invokeHandler,
EventHandler beforeQueryStatus)
{
var commandIdWithGroupId = new CommandID(commandGroup, commandId);
var command = new OleMenuCommand(invokeHandler, delegate { }, beforeQueryStatus, commandIdWithGroupId);
menuCommandService.AddCommand(command);
return command;
}
}
public IReadOnlyDictionary<string, IEnumerable<DiagnosticDescriptor>> GetAllDiagnosticDescriptors(IVsHierarchy? hierarchy)
{
if (hierarchy == null)
{
return Transform(_diagnosticService.CreateDiagnosticDescriptorsPerReference(projectOpt: null));
}
......@@ -37,7 +93,7 @@ public VisualStudioDiagnosticAnalyzerService(VisualStudioWorkspace workspace, ID
// Analyzers are only supported for C# and VB currently.
var projectsWithHierarchy = _workspace.CurrentSolution.Projects
.Where(p => p.Language == LanguageNames.CSharp || p.Language == LanguageNames.VisualBasic)
.Where(p => _workspace.GetHierarchy(p.Id) == hierarchyOpt);
.Where(p => _workspace.GetHierarchy(p.Id) == hierarchy);
if (projectsWithHierarchy.Count() <= 1)
{
......@@ -74,5 +130,160 @@ public VisualStudioDiagnosticAnalyzerService(VisualStudioWorkspace workspace, ID
// unfortunately, we had to do this since ruleset editor and us are set to use this signature
return map.ToDictionary(kv => kv.Key, kv => (IEnumerable<DiagnosticDescriptor>)kv.Value);
}
private void OnRunCodeAnalysisForSelectedProjectStatus(object sender, EventArgs e)
{
var command = (OleMenuCommand)sender;
// We hook up the "Run Code Analysis" menu commands for CPS based managed projects.
// These commands are already hooked up for csproj based projects in StanCore, but those will eventually go away.
var visible = TryGetSelectedProjectHierarchy(out var hierarchy) &&
hierarchy.IsCapabilityMatch("CPS") &&
hierarchy.IsCapabilityMatch(".NET");
var enabled = false;
if (visible)
{
if (command.CommandID.ID == RunCodeAnalysisForSelectedProjectCommandId &&
hierarchy.TryGetProject(out var project))
{
// Change to show the name of the project as part of the menu item display text.
command.Text = string.Format(ServicesVSResources.Run_Code_Analysis_on_0, project.Name);
}
enabled = !IsBuildActive();
}
if (command.Visible != visible)
{
command.Visible = visible;
}
if (command.Enabled != enabled)
{
command.Enabled = enabled;
}
}
private void OnRunCodeAnalysisForSelectedProject(object sender, EventArgs args)
{
if (TryGetSelectedProjectHierarchy(out var hierarchy))
{
RunAnalyzers(hierarchy);
}
}
public void RunAnalyzers(IVsHierarchy? hierarchy)
{
var project = GetProject(hierarchy);
string? projectOrSolutionName = project?.Name ?? PathUtilities.GetFileName(_workspace.CurrentSolution.FilePath);
// Add a message to VS status bar that we are running code analysis.
var statusMessage = projectOrSolutionName != null
? string.Format(ServicesVSResources.Running_code_analysis_for_0, projectOrSolutionName)
: ServicesVSResources.Running_code_analysis_for_Solution;
var statusBar = _serviceProvider?.GetService(typeof(SVsStatusbar)) as IVsStatusbar;
statusBar?.SetText(statusMessage);
// Force complete analyzer execution in background.
var asyncToken = _listener.BeginAsyncOperation($"{nameof(VisualStudioDiagnosticAnalyzerService)}_{nameof(RunAnalyzers)}");
Task.Run(async () =>
{
await _diagnosticService.ForceAnalyzeAsync(_workspace.CurrentSolution, project?.Id, CancellationToken.None).ConfigureAwait(false);
// Add a message to VS status bar that we completed executing code analysis.
await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync();
var notificationMesage = projectOrSolutionName != null
? string.Format(ServicesVSResources.Code_analysis_completed_for_0, projectOrSolutionName)
: ServicesVSResources.Code_analysis_completed_for_Solution;
statusBar?.SetText(notificationMesage);
}).CompletesAsyncOperation(asyncToken);
}
private Project? GetProject(IVsHierarchy? hierarchy)
{
if (hierarchy != null)
{
var projectMap = _workspace.Services.GetRequiredService<IHierarchyItemToProjectIdMap>();
var projectHierarchyItem = _vsHierarchyItemManager.GetHierarchyItem(hierarchy, VSConstants.VSITEMID_ROOT);
if (projectMap.TryGetProjectId(projectHierarchyItem, targetFrameworkMoniker: null, out var projectId))
{
return _workspace.CurrentSolution.GetProject(projectId);
}
}
return null;
}
private bool TryGetSelectedProjectHierarchy([NotNullWhen(returnValue: true)] out IVsHierarchy? hierarchy)
{
hierarchy = null;
// Get the DTE service and make sure there is an open solution
if (!(_serviceProvider?.GetService(typeof(EnvDTE.DTE)) is EnvDTE.DTE dte) ||
dte.Solution == null)
{
return false;
}
var selectionHierarchy = IntPtr.Zero;
var selectionContainer = IntPtr.Zero;
// Get the current selection in the shell
if (_serviceProvider.GetService(typeof(SVsShellMonitorSelection)) is IVsMonitorSelection monitorSelection)
{
try
{
monitorSelection.GetCurrentSelection(out selectionHierarchy, out var itemId, out var multiSelect, out selectionContainer);
if (selectionHierarchy != IntPtr.Zero)
{
hierarchy = Marshal.GetObjectForIUnknown(selectionHierarchy) as IVsHierarchy;
Debug.Assert(hierarchy != null);
return hierarchy != null;
}
}
catch (Exception)
{
// If anything went wrong, just ignore it
}
finally
{
// Make sure we release the COM pointers in any case
if (selectionHierarchy != IntPtr.Zero)
{
Marshal.Release(selectionHierarchy);
}
if (selectionContainer != IntPtr.Zero)
{
Marshal.Release(selectionContainer);
}
}
}
return false;
}
private bool IsBuildActive()
{
// Using KnownUIContexts is faster in case when SBM's package was not loaded yet
if (KnownUIContexts.SolutionBuildingContext != null)
{
return KnownUIContexts.SolutionBuildingContext.IsActive;
}
else
{
// Unlikely case that above service is not available, let's try Solution Build Manager
if (_serviceProvider?.GetService(typeof(SVsSolutionBuildManager)) is IVsSolutionBuildManager buildManager)
{
buildManager.QueryBuildManagerBusy(out var buildBusy);
return buildBusy != 0;
}
else
{
Debug.Fail("Unable to determine whether build is active or not");
return true;
}
}
}
}
}
......@@ -127,6 +127,8 @@ protected override async Task LoadComponentsAsync(CancellationToken cancellation
this.ComponentModel.GetService<AnalyzerConfigDocumentAsSolutionItemHandler>().Initialize(this);
this.ComponentModel.GetService<VisualStudioAddSolutionItemService>().Initialize(this);
this.ComponentModel.GetService<IVisualStudioDiagnosticAnalyzerService>().Initialize(this);
LoadAnalyzerNodeComponents();
LoadComponentsBackgroundAsync(cancellationToken).Forget();
......
......@@ -587,6 +587,24 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Code analysis completed for &apos;{0}&apos;..
/// </summary>
internal static string Code_analysis_completed_for_0 {
get {
return ResourceManager.GetString("Code_analysis_completed_for_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Code analysis completed for Solution..
/// </summary>
internal static string Code_analysis_completed_for_Solution {
get {
return ResourceManager.GetString("Code_analysis_completed_for_Solution", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Code block preferences:.
/// </summary>
......@@ -2790,6 +2808,33 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Run Code Analysis on {0}.
/// </summary>
internal static string Run_Code_Analysis_on_0 {
get {
return ResourceManager.GetString("Run_Code_Analysis_on_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Running code analysis for &apos;{0}&apos;....
/// </summary>
internal static string Running_code_analysis_for_0 {
get {
return ResourceManager.GetString("Running_code_analysis_for_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Running code analysis for Solution....
/// </summary>
internal static string Running_code_analysis_for_Solution {
get {
return ResourceManager.GetString("Running_code_analysis_for_Solution", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Running low priority background processes.
/// </summary>
......
......@@ -1329,4 +1329,19 @@ I agree to all of the foregoing:</value>
<data name="A_new_editorconfig_file_was_detected_at_the_root_of_your_solution_Would_you_like_to_make_it_a_solution_item" xml:space="preserve">
<value>A new .editorconfig file was detected at the root of your solution. Would you like to make it a solution item?</value>
</data>
<data name="Run_Code_Analysis_on_0" xml:space="preserve">
<value>Run Code Analysis on {0}</value>
</data>
<data name="Running_code_analysis_for_0" xml:space="preserve">
<value>Running code analysis for '{0}'...</value>
</data>
<data name="Running_code_analysis_for_Solution" xml:space="preserve">
<value>Running code analysis for Solution...</value>
</data>
<data name="Code_analysis_completed_for_0" xml:space="preserve">
<value>Code analysis completed for '{0}'.</value>
</data>
<data name="Code_analysis_completed_for_Solution" xml:space="preserve">
<value>Code analysis completed for Solution.</value>
</data>
</root>
\ No newline at end of file
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Seřadit direktivy &amp;using</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">&amp;Výchozí</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">&amp;Using-Anweisungen sortieren</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">&amp;Standard</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Ordenar instrucciones &amp;Using</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">Pre&amp;determinado</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Trier les &amp;using</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">Par &amp;défaut</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Ordina &amp;using</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">Pre&amp;definito</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">using の並べ替え(&amp;U)</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">既定(&amp;D)</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Using 정렬(&amp;U)</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">기본값(&amp;D)</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Sortuj &amp;użycia</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">&amp;Domyślny</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Classificar &amp;Usos</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">&amp;Padrão</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">Сортировать д&amp;ирективы using</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">&amp;По умолчанию</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">&amp;Using’leri Sırala</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">&amp;Varsayılan</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">对 using 排序(&amp;U)</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">默认值(&amp;D)</target>
......
......@@ -2,6 +2,11 @@
<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="../Commands.vsct">
<body>
<trans-unit id="ECMD_RUNFXCOPSEL|ButtonText">
<source>Run Code &amp;Analysis on Selection</source>
<target state="new">Run Code &amp;Analysis on Selection</target>
<note />
</trans-unit>
<trans-unit id="cmdidCSharpOrganizeSortUsings|ButtonText">
<source>Sort &amp;Usings</source>
<target state="translated">排序 Using(&amp;U)</target>
......@@ -207,6 +212,21 @@
<target state="translated">OpenActiveRuleSet</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|ButtonText">
<source>Run C&amp;ode Analysis</source>
<target state="new">Run C&amp;ode Analysis</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|CommandName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidRunCodeAnalysisForProject|LocCanonicalName">
<source>RunCodeAnalysisForProject</source>
<target state="new">RunCodeAnalysisForProject</target>
<note />
</trans-unit>
<trans-unit id="cmdidSetSeverityDefault|ButtonText">
<source>&amp;Default</source>
<target state="translated">預設(&amp;D)</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Klasifikace</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Obarvit regulární výrazy</target>
......@@ -422,6 +432,21 @@
<target state="translated">Zkontrolovat změny</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Spouštění procesů s nízkou prioritou na pozadí</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Klassifizierungen</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Reguläre Ausdrücke farbig hervorheben</target>
......@@ -422,6 +432,21 @@
<target state="translated">Änderungen überprüfen</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Hintergrundprozesse mit niedriger Priorität werden ausgeführt.</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Clasificaciones</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Colorear expresiones regulares</target>
......@@ -422,6 +432,21 @@
<target state="translated">Revisar cambios</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Ejecutando procesos en segundo plano de baja prioridad</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Classifications</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Coloriser les expressions régulières</target>
......@@ -422,6 +432,21 @@
<target state="translated">Passer en revue les changements</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Exécution des processus d’arrière-plan basse priorité</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Classificazioni</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Colora espressioni regolari</target>
......@@ -422,6 +432,21 @@
<target state="translated">Esamina modifiche</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Esecuzione di processi in background con priorità bassa</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">分類</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">正規表現をカラー化</target>
......@@ -422,6 +432,21 @@
<target state="translated">変更のプレビュー</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">優先度の低いバックグラウンド プロセスを実行しています</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">분류</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">정규식 색 지정</target>
......@@ -422,6 +432,21 @@
<target state="translated">변경 내용 검토</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">낮은 우선 순위 백그라운드 프로세스 실행 중</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Klasyfikacje</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Koloruj wyrażenia regularne</target>
......@@ -422,6 +432,21 @@
<target state="translated">Przejrzyj zmiany</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Uruchamianie procesów w tle o niskim priorytecie</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Classificações</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Colorir expressões regulares</target>
......@@ -422,6 +432,21 @@
<target state="translated">Revisar alterações</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Executando processos de baixa prioridade em segundo plano</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Классификации</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Выделить регулярные выражения цветом</target>
......@@ -422,6 +432,21 @@
<target state="translated">Проверить изменения</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Запуск фоновых процессов с низким приоритетом</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">Sınıflandırmalar</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">Normal ifadeleri renklendir</target>
......@@ -422,6 +432,21 @@
<target state="translated">Değişiklikleri Gözden Geçir</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">Düşük öncelikli arka plan işlemleri çalıştırılıyor</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">分类</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">为正规表达式着色</target>
......@@ -422,6 +432,21 @@
<target state="translated">预览更改</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">正在运行低优先级后台进程</target>
......
......@@ -77,6 +77,16 @@
<target state="translated">分類</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="new">Code analysis completed for '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Code_analysis_completed_for_Solution">
<source>Code analysis completed for Solution.</source>
<target state="new">Code analysis completed for Solution.</target>
<note />
</trans-unit>
<trans-unit id="Colorize_regular_expressions">
<source>Colorize regular expressions</source>
<target state="translated">為規則運算式添加色彩</target>
......@@ -422,6 +432,21 @@
<target state="translated">檢閱變更</target>
<note />
</trans-unit>
<trans-unit id="Run_Code_Analysis_on_0">
<source>Run Code Analysis on {0}</source>
<target state="new">Run Code Analysis on {0}</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_0">
<source>Running code analysis for '{0}'...</source>
<target state="new">Running code analysis for '{0}'...</target>
<note />
</trans-unit>
<trans-unit id="Running_code_analysis_for_Solution">
<source>Running code analysis for Solution...</source>
<target state="new">Running code analysis for Solution...</target>
<note />
</trans-unit>
<trans-unit id="Running_low_priority_background_processes">
<source>Running low priority background processes</source>
<target state="translated">正在執行低優先順序背景流程</target>
......
......@@ -517,6 +517,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
Public Function IsCompilationEndAnalyzer(analyzer As DiagnosticAnalyzer, project As Project, compilation As Compilation) As Boolean Implements IDiagnosticAnalyzerService.IsCompilationEndAnalyzer
Throw New NotImplementedException()
End Function
Public Function ForceAnalyzeAsync(solution As Solution, Optional projectId As ProjectId = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task Implements IDiagnosticAnalyzerService.ForceAnalyzeAsync
Throw New NotImplementedException()
End Function
End Class
End Class
End Namespace
......@@ -119,6 +119,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.EditAndContinue
Public Function IsCompilationEndAnalyzer(analyzer As DiagnosticAnalyzer, project As Project, compilation As Compilation) As Boolean Implements IDiagnosticAnalyzerService.IsCompilationEndAnalyzer
Throw New NotImplementedException()
End Function
Public Function ForceAnalyzeAsync(solution As Solution, Optional projectId As ProjectId = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task Implements IDiagnosticAnalyzerService.ForceAnalyzeAsync
Throw New NotImplementedException()
End Function
End Class
End Class
End Namespace
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册