- 03 6月, 2019 1 次提交
-
-
由 Manish Vasani 提交于
-
- 02 6月, 2019 1 次提交
-
-
由 Manish Vasani 提交于
-
- 31 5月, 2019 1 次提交
-
-
由 Manish Vasani 提交于
Add new analyzer API (DiagnosticSuppressor) to allow programmatic suppression of analyzer and/or compiler non-error diagnostics Fixes #20242 and #30172 Detailed design proposal [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a). Added public APIs with documentation comments: ```cs namespace Microsoft.CodeAnalysis.Diagnostics { /// <summary> /// The base type for diagnostic suppressors that can programmatically suppress analyzer and/or compiler non-error diagnostics. /// </summary> public abstract class DiagnosticSuppressor : DiagnosticAnalyzer { // Disallow suppressors from reporting diagnostics or registering analysis actions. public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray<DiagnosticDescriptor>.Empty; public sealed override void Initialize(AnalysisContext context) { } /// <summary> /// Returns a set of descriptors for the suppressions that this suppressor is capable of producing. /// </summary> public abstract ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; } /// <summary> /// Suppress analyzer and/or compiler non-error diagnostics reported for the compilation. /// This may be a subset of the full set of reported diagnostics, as an optimization for /// supporting incremental and partial analysis scenarios. /// A diagnostic is considered suppressible by a DiagnosticSuppressor if *all* of the following conditions are met: /// 1. Diagnostic is not already suppressed in source via pragma/suppress message attribute. /// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>. /// 3. Diagnostic is not tagged with <see cref="WellKnownDiagnosticTags.NotConfigurable"/> custom tag. /// </summary> public abstract void ReportSuppressions(SuppressionAnalysisContext context); } /// <summary> /// Provides a description about a programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>. /// </summary> public sealed class SuppressionDescriptor : IEquatable<SuppressionDescriptor> { /// <summary> /// An unique identifier for the suppression. /// </summary> public string Id { get; } /// <summary> /// Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. /// </summary> public string SuppressedDiagnosticId { get; } /// <summary> /// A localizable description about the suppression. /// </summary> public LocalizableString Description { get; } } /// <summary> /// Context for suppressing analyzer and/or compiler non-error diagnostics reported for the compilation. /// </summary> public struct SuppressionAnalysisContext { /// <summary> /// Suppressible analyzer and/or compiler non-error diagnostics reported for the compilation. /// This may be a subset of the full set of reported diagnostics, as an optimization for /// supporting incremental and partial analysis scenarios. /// A diagnostic is considered suppressible by a DiagnosticSuppressor if *all* of the following conditions are met: /// 1. Diagnostic is not already suppressed in source via pragma/suppress message attribute. /// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>. /// 3. Diagnostic is not tagged with <see cref="WellKnownDiagnosticTags.NotConfigurable"/> custom tag. /// </summary> public ImmutableArray<Diagnostic> ReportedDiagnostics { get; } /// <summary> /// Report a <see cref="Suppression"/> for a reported diagnostic. /// </summary> public void ReportSuppression(Suppression suppression); /// <summary> /// Gets a <see cref="SemanticModel"/> for the given <see cref="SyntaxTree"/>, which is shared across all analyzers. /// </summary> public SemanticModel GetSemanticModel(SyntaxTree syntaxTree); /// <summary> /// <see cref="CodeAnalysis.Compilation"/> for the context. /// </summary> public Compilation Compilation { get; } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get; } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get; } } /// <summary> /// Programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>. /// </summary> public struct Suppression { /// <summary> /// Creates a suppression of a <see cref="Diagnostic"/> with the given <see cref="SuppressionDescriptor"/>. /// </summary> /// <param name="descriptor"> /// Descriptor for the suppression, which must be from <see cref="DiagnosticSuppressor.SupportedSuppressions"/> /// for the <see cref="DiagnosticSuppressor"/> creating this suppression. /// </param> /// <param name="suppressedDiagnostic"> /// <see cref="Diagnostic"/> to be suppressed, which must be from <see cref="SuppressionAnalysisContext.ReportedDiagnostics"/> /// for the suppression context in which this suppression is being created.</param> public static Suppression Create(SuppressionDescriptor descriptor, Diagnostic suppressedDiagnostic); /// <summary> /// Descriptor for this suppression. /// </summary> public SuppressionDescriptor Descriptor { get; } /// <summary> /// Diagnostic suppressed by this suppression. /// </summary> public Diagnostic SuppressedDiagnostic { get; } } } ``` For batch compilation, suppressors always run after all the analyzer diagnostics have been computed. For IDE partial/incremental analysis scenario, we may run the suppressors with partial diagnostics. Suppressed diagnostics from diagnostic suppressors are equivalent to source suppressed diagnostics: they show up in the error list with "Suppression State" column as "Suppressed" and are also output to errorlog as suppressed diagnostics.
-
- 30 5月, 2019 3 次提交
-
-
由 Manish Vasani 提交于
-
由 Manish Vasani 提交于
-
由 Manish Vasani 提交于
Fix false positive inside catch clause (port of https://github.com/dotnet/roslyn-analyzers/pull/2501)
-
- 29 5月, 2019 3 次提交
-
-
由 CyrusNajmabadi 提交于
* Move IndentationService down to Feature layer. * MOve to workspaces * Cleanup * Fix. * move ISmartTokenFormatter down as well * simplify * Get building * Update * Move using inside * Move using inside * Move using inside * Move using inside * Add links
-
由 Ivan Basov 提交于
-
由 Jonathon Marolf 提交于
-
- 25 5月, 2019 9 次提交
-
-
由 Chris Sienkiewicz 提交于
* Infer nested nullability for implicitly typed deconstruction variable: - When the left hand side is 'var', re-infer the type from the visited right hand side - Update and add tests
-
由 David Barbet 提交于
Include lambdas in generate unique name filter when language version is greater than or equal to c# 8.
-
由 Andrew Hall 提交于
-
由 Rikki Gibson 提交于
* Allow nullable variance for in/out params when converting method group to delegate * Fix diagnostic messages for mismatched out parameter nullable variance * Improve delegate in parameter variance tests * Add IdentityConversion_DelegateInParameter test
-
由 Jason Malinowski 提交于
When some web projects are created, ICSInputSet.SetOutputFileName is called with a non-absolute path. We should throw these away rather than set VisualStudioProject.IntermediateOutputFilePath since they're just placeholders and don't really mean anything.
-
由 Jason Malinowski 提交于
I totally forgot to do this, but in practice it was hard to observe because of https://github.com/dotnet/roslyn/issues/35372. That bug meant that a later project creation would end up re-running the subscription to the IVsSolution, which also checked the UIContext and that implicitly set _solutionLoaded. Once that bug was fixed this problem was now observable.
-
由 David Barbet 提交于
-
由 David Barbet 提交于
-
由 CyrusNajmabadi 提交于
* Property thread through cancellation through a bunch of our RPC services. * Tokens * Fix * Revert
-
- 24 5月, 2019 9 次提交
-
-
由 David Barbet 提交于
-
由 Filip W 提交于
* include exception type in CommonObjectFormatter for scripting/interactive * fixed tests
-
由 Tomáš Matoušek 提交于
Two issues: 1) Replace AfterTargets="Build" with BeforeTargets="AfterBuild" Workaround for https://github.com/microsoft/msbuild/issues/3345 2) System.ValueTuple Seems like the System.ValueTuple package is missing lib/net472/_._, so lib/net47/System.ValueTuple.dll is identified as a runtime dependency although it is not.
-
由 AlekseyTs 提交于
Support re-abstraction of interface members in derived interfaces
-
由 Cyrus Najmabadi 提交于
-
由 Cyrus Najmabadi 提交于
-
由 Cyrus Najmabadi 提交于
-
由 Joey Robichaud 提交于
-
由 Sam Harwell 提交于
Fixes #34165
-
- 23 5月, 2019 8 次提交
-
-
由 Sam Harwell 提交于
-
由 Ivan Basov 提交于
* Set non-blocking mode per textView * Update CompletionSource.cs * unit test for switching between blocking and non-blocking * can use the global option if switching it back and force
-
由 Yair Halberstadt 提交于
* Make methods overrides when pulling to base class with the make abstract option. Remove abstract methods when pulling to base class with the make abstract option. * Fix broken Unit tests * Simplify code to add override modifier based on Code Review * don't use generic ReplaceNode where not necessary in MembersPuller.PullMembersIntoClassAsync
-
由 Heejae Chang 提交于
* Revert "Revert "move StreamJsonRpc to 2.x from 1.3.x (#33960)" (#34654)" This reverts commit 297aaf20. * fix streamJsonRpc version conflict errors * move stream json rpc to more recent version and remove unnecessary explicit dependency * fix nuget version conflict issue * json rpc array bug workaround * move ToArray fix to lower layer * underlying issue is fixed in stream json rpc already and inserted to VS before we going in. removed workaround.
-
由 Joey Robichaud 提交于
-
由 Charles Stoner 提交于
-
由 yair halberstadt 提交于
-
- 22 5月, 2019 5 次提交
-
-
由 Alireza Habibi 提交于
-
由 Sam Harwell 提交于
The code is updated to always assume this is true.
-
由 Alireza Habibi 提交于
-
由 Alireza Habibi 提交于
-
由 Alireza Habibi 提交于
-