Skip to content
Merged
2 changes: 1 addition & 1 deletion eng/targets/Settings.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<NoWarn>$(NoWarn);VSIXCompatibility1001</NoWarn>

<!-- TODO: https://github.com/dotnet/roslyn/issues/71667 -->
<NoWarn>$(NoWarn);NU1507</NoWarn>
<NoWarn>$(NoWarn);NU1507;NU1510</NoWarn>

<CommonExtensionInstallationRoot>CommonExtensions</CommonExtensionInstallationRoot>
<LanguageServicesExtensionInstallationFolder>Microsoft\VBCSharp\LanguageServices</LanguageServicesExtensionInstallationFolder>
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"sdk": {
"version": "9.0.106",
"version": "10.0.100-preview.5.25277.114",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we also change the arcade channel we're using? this is typically updated by arcade and I'm not sure what happens if we move to 10 but we're still on the net9 arcade channel (will it try and revert us back)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we will see

"allowPrerelease": false,
"rollForward": "patch"
},
"tools": {
"dotnet": "9.0.106",
"dotnet": "10.0.100-preview.5.25277.114",
"vs": {
"version": "17.8.0"
"version": "17.14.0"
},
"vswhere": "3.1.7"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ namespace Microsoft.CodeAnalysis.Shared.Utilities;
/// </summary>
internal readonly partial struct HashCodeAnalyzer
{
private readonly Compilation _compilation;
private readonly IMethodSymbol _objectGetHashCodeMethod;
private readonly INamedTypeSymbol? _equalityComparerType;

public readonly INamedTypeSymbol SystemHashCodeType;

private HashCodeAnalyzer(
Compilation compilation, IMethodSymbol objectGetHashCodeMethod,
IMethodSymbol objectGetHashCodeMethod,
INamedTypeSymbol? equalityComparerType, INamedTypeSymbol systemHashCodeType)
{
_compilation = compilation;
_objectGetHashCodeMethod = objectGetHashCodeMethod;
_equalityComparerType = equalityComparerType;
SystemHashCodeType = systemHashCodeType;
Expand All @@ -47,7 +45,7 @@ public static bool TryGetAnalyzer(Compilation compilation, [NotNullWhen(true)] o
if (systemHashCodeType == null)
return false;

analyzer = new HashCodeAnalyzer(compilation, objectGetHashCodeMethod, equalityComparerType, systemHashCodeType);
analyzer = new HashCodeAnalyzer(objectGetHashCodeMethod, equalityComparerType, systemHashCodeType);
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/Compilers/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ dotnet_diagnostic.RS0100.severity = none
# RS0102: Braces must not have blank lines between them
dotnet_diagnostic.RS0102.severity = none

# IDE0051: Unused member
dotnet_diagnostic.IDE0051.severity = none
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a useful analyzer to have turned on

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjonescz I agree but this was disabled for the expediency of unblocking the bigger work here. Have a follow up PR where I enable it and handle the fallout


# IDE0170: Prefer extended property pattern
dotnet_diagnostic.IDE0170.severity = suggestion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ when ConvertExpressionToType(expr, out var leftType):
default:
type = null;
return false;
};
}
}

private PatternSyntax ParsePattern(Precedence precedence, bool afterIs = false, bool inSwitchArmPattern = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void ScanRawStringLiteral(ref TokenInfo info, bool inDirective)

default:
throw ExceptionUtilities.UnexpectedValue(info.Kind);
};
}
}

info.Text = TextWindow.GetText(intern: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4126,7 +4126,7 @@ static void Main()
if (isFromMetadata)
{
VerifyParamArrayAttribute(parameterB);
};
}
};

var verifier = CompileAndVerify(source, symbolValidator: validator(true), sourceSymbolValidator: validator(false), expectedOutput: @"System.Int32[]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void SimpleDelegateMembersTest(string ob, string cb)
GetMember<NamedTypeSymbol>("voidDelegate").GetMembers().ToArray();

AssertEx.SetEqual(actualMembers.Select(s => s.Name), expectedMembers);
};
}
};

VerifyType verify = (winmd, expected) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ void validate(ModuleSymbol module)
AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsByRefLikeAttribute, Accessibility.Public);
AssertHasCompilerFeatureRequired(includeCompilerFeatureRequired, peType, peModule, new MetadataDecoder(peModule));
}
};
}

CompileAndVerify(new[] { text, GetCompilerFeatureRequiredAttributeText(includeCompilerFeatureRequired) }, verify: Verification.Passes, symbolValidator: validate, sourceSymbolValidator: validate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5752,7 +5752,7 @@ void metadataValidator(ModuleSymbol module)

Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(method.GetAttributes()));
Assert.True(method.RequiresSecurityObject);
};
}

var verifier = CompileAndVerify(
source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void validate(ModuleSymbol module)
Assert.Equal(0, m.OverloadResolutionPriority);
}
}
};
}
}

[Theory, CombinatorialData]
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/Core/Portable/EmbeddedText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public override void WriteByte(byte value)
base.WriteByte(value);

// same rationale for checked arithmetic as above.
checked { BytesWritten++; };
checked { BytesWritten++; }
}

public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Expand Down
13 changes: 0 additions & 13 deletions src/Compilers/Core/Portable/MetadataReader/PEModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2338,19 +2338,6 @@ private static bool CrackBoolAndStringInAttributeValue(out BoolAndStringData val
return false;
}

private static bool CrackBoolAndBoolInAttributeValue(out (bool, bool) value, ref BlobReader sig)
{
if (CrackBooleanInAttributeValue(out bool item1, ref sig) &&
CrackBooleanInAttributeValue(out bool item2, ref sig))
{
value = (item1, item2);
return true;
}

value = default;
return false;
}

private static bool CrackBooleanInAttributeValue(out bool value, ref BlobReader sig)
{
if (sig.RemainingBytes >= 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,6 @@ private static bool ShouldRemoveBraceForEventDeclaration(EventDeclarationSyntax

#region AddBrace

private static AccessorListSyntax GetAccessorListNode(SyntaxFormattingOptions formattingOptions)
=> AccessorList().WithOpenBraceToken(GetOpenBrace(formattingOptions)).WithCloseBraceToken(GetCloseBrace(formattingOptions));

private static InitializerExpressionSyntax GetInitializerExpressionNode(SyntaxFormattingOptions formattingOptions)
=> InitializerExpression(SyntaxKind.ObjectInitializerExpression)
.WithOpenBraceToken(GetOpenBrace(formattingOptions));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ internal sealed class ConvertNamespaceCommandHandler(
ITextUndoHistoryRegistry textUndoHistoryRegistry,
IEditorOperationsFactoryService editorOperationsFactoryService,
EditorOptionsService editorOptionsService,
IGlobalOptionService globalOptions,
IIndentationManagerService indentationManager) : IChainedCommandHandler<TypeCharCommandArgs>
IGlobalOptionService globalOptions) : IChainedCommandHandler<TypeCharCommandArgs>
{
/// <summary>
/// Option setting 'use file scoped'. That way we can call into the helpers
Expand All @@ -54,7 +53,6 @@ internal sealed class ConvertNamespaceCommandHandler(
private readonly ITextUndoHistoryRegistry _textUndoHistoryRegistry = textUndoHistoryRegistry;
private readonly IEditorOperationsFactoryService _editorOperationsFactoryService = editorOperationsFactoryService;
private readonly EditorOptionsService _editorOptionsService = editorOptionsService;
private readonly IIndentationManagerService _indentationManager = indentationManager;
private readonly IGlobalOptionService _globalOptions = globalOptions;

public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,15 @@ internal sealed partial class StringCopyPasteCommandHandler(
IEditorOperationsFactoryService editorOperationsFactoryService,
IGlobalOptionService globalOptions,
ITextBufferFactoryService2 textBufferFactoryService,
EditorOptionsService editorOptionsService,
IIndentationManagerService indentationManager) :
EditorOptionsService editorOptionsService) :
IChainedCommandHandler<CutCommandArgs>,
IChainedCommandHandler<CopyCommandArgs>,
IChainedCommandHandler<PasteCommandArgs>
{
private const string CopyId = "RoslynStringCopyPasteId";

private readonly IThreadingContext _threadingContext = threadingContext;
private readonly ITextUndoHistoryRegistry _undoHistoryRegistry = undoHistoryRegistry;
private readonly IEditorOperationsFactoryService _editorOperationsFactoryService = editorOperationsFactoryService;
private readonly EditorOptionsService _editorOptionsService = editorOptionsService;
private readonly IIndentationManagerService _indentationManager = indentationManager;
private readonly IGlobalOptionService _globalOptions = globalOptions;
private readonly ITextBufferFactoryService2 _textBufferFactoryService = textBufferFactoryService;

Expand Down
2 changes: 1 addition & 1 deletion src/EditorFeatures/Core/Editor/IContainedDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ namespace Microsoft.CodeAnalysis.Editor;

internal interface IContainedDocument
{
public ITextSnapshot ApplyChanges(IEnumerable<TextChange> changes);
ITextSnapshot ApplyChanges(IEnumerable<TextChange> changes);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.CodeAnalysis.LanguageServer;

namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api;

internal abstract class AbstractVSTypeScriptRequestHandlerFactory : ILspServiceFactory
{
public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind)
Expand Down
3 changes: 0 additions & 3 deletions src/EditorFeatures/Core/InlineRename/InlineRenameService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ internal sealed class InlineRenameService(
ITextBufferCloneService textBufferCloneService,
IFeatureServiceFactory featureServiceFactory,
IGlobalOptionService globalOptions,
[ImportMany] IEnumerable<IRefactorNotifyService> refactorNotifyServices,
IAsynchronousOperationListenerProvider listenerProvider) : IInlineRenameService
{
private readonly IThreadingContext _threadingContext = threadingContext;
private readonly IUIThreadOperationExecutor _uiThreadOperationExecutor = uiThreadOperationExecutor;
private readonly ITextBufferAssociatedViewService _textBufferAssociatedViewService = textBufferAssociatedViewService;
private readonly IAsynchronousOperationListener _asyncListener = listenerProvider.GetListener(FeatureAttribute.Rename);
private readonly IEnumerable<IRefactorNotifyService> _refactorNotifyServices = refactorNotifyServices;
private readonly ITextBufferFactoryService _textBufferFactoryService = textBufferFactoryService;
private readonly ITextBufferCloneService _textBufferCloneService = textBufferCloneService;
private readonly IFeatureServiceFactory _featureServiceFactory = featureServiceFactory;
Expand Down Expand Up @@ -114,7 +112,6 @@ public async Task<InlineRenameSessionInfo> StartInlineSessionAsync(
_textBufferFactoryService,
_textBufferCloneService,
_featureServiceFactory,
_refactorNotifyServices,
_asyncListener);

return new InlineRenameSessionInfo(ActiveSession);
Expand Down
3 changes: 0 additions & 3 deletions src/EditorFeatures/Core/InlineRename/InlineRenameSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ internal sealed partial class InlineRenameSession : IInlineRenameSession, IFeatu

private readonly IFeatureService _featureService;
private readonly IFeatureDisableToken _completionDisabledToken;
private readonly IEnumerable<IRefactorNotifyService> _refactorNotifyServices;
private readonly IAsynchronousOperationListener _asyncListener;
private readonly Solution _baseSolution;
private readonly ITextView _triggerView;
Expand Down Expand Up @@ -146,7 +145,6 @@ public InlineRenameSession(
ITextBufferFactoryService textBufferFactoryService,
ITextBufferCloneService textBufferCloneService,
IFeatureServiceFactory featureServiceFactory,
IEnumerable<IRefactorNotifyService> refactorNotifyServices,
IAsynchronousOperationListener asyncListener)
{
// This should always be touching a symbol since we verified that upon invocation
Expand Down Expand Up @@ -177,7 +175,6 @@ public InlineRenameSession(
_completionDisabledToken = _featureService.Disable(PredefinedEditorFeatureNames.Completion, this);
RenameService = renameService;
_uiThreadOperationExecutor = uiThreadOperationExecutor;
_refactorNotifyServices = refactorNotifyServices;
_asyncListener = asyncListener;
_triggerView = textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).FirstOrDefault(v => v.HasAggregateFocus) ??
textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).First();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ internal interface IInlineRenameColorUpdater
/// <summary>
/// Implemented by a host to set the properties on <see cref="InlineRenameColors"/>.
/// </summary>
public void UpdateColors();
void UpdateColors();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ internal sealed partial class SmartRenameViewModel : INotifyPropertyChanged, IDi
/// </summary>
private CancellationTokenSource _cancellationTokenSource = new();
private bool _isDisposed;
private TimeSpan AutomaticFetchDelay => _smartRenameSession.AutomaticFetchDelay;
private TimeSpan _semanticContextDelay;
private bool _semanticContextError;
private bool _semanticContextUsed;
Expand All @@ -67,7 +66,7 @@ internal sealed partial class SmartRenameViewModel : INotifyPropertyChanged, IDi

/// <summary>
/// Indicates whether a request to get suggestions is in progress.
/// The request to get suggestions is comprised of initial short delay, <see cref="AutomaticFetchDelay"/>
/// The request to get suggestions is comprised of initial short delay, see AutomaticFetchDelay
/// and call to <see cref="ISmartRenameSessionWrapper.GetSuggestionsAsync(ImmutableDictionary{string, ImmutableArray{ValueTuple{string, string}}}, CancellationToken)"/>.
/// When <c>true</c>, the UI shows the progress bar, and prevents <see cref="FetchSuggestions(bool)"/> from making parallel request.
/// </summary>
Expand Down Expand Up @@ -196,7 +195,7 @@ private void FetchSuggestions(bool isAutomaticOnInitialization)

/// <summary>
/// The request for rename suggestions. It's made of three parts:
/// 1. Short delay of duration <see cref="AutomaticFetchDelay"/>.
/// 1. Short delay of duration AutomaticFetchDelay.
/// 2. Get definition and references if <see cref="IsUsingSemanticContext"/> is set.
/// 3. Call to <see cref="ISmartRenameSessionWrapper.GetSuggestionsAsync(ImmutableDictionary{string, ImmutableArray{ValueTuple{string, string}}}, CancellationToken)"/>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ internal sealed partial class NavigableSymbolService : INavigableSymbolSourcePro
{
private static readonly object s_key = new();

private readonly IUIThreadOperationExecutor _uiThreadOperationExecutor;
private readonly IThreadingContext _threadingContext;
private readonly IAsynchronousOperationListener _listener;

[ImportingConstructor]
[SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")]
public NavigableSymbolService(
IUIThreadOperationExecutor uiThreadOperationExecutor,
IThreadingContext threadingContext,
IAsynchronousOperationListenerProvider listenerProvider)
{
_uiThreadOperationExecutor = uiThreadOperationExecutor;
_threadingContext = threadingContext;
_listener = listenerProvider.GetListener(FeatureAttribute.NavigableSymbols);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.Preview;
internal interface IDifferenceViewerPreview<TDifferenceViewer> : IDisposable
where TDifferenceViewer : IDifferenceViewer
{
public TDifferenceViewer Viewer { get; }
TDifferenceViewer Viewer { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ internal sealed class SplitCommentCommandHandler(
ITextUndoHistoryRegistry undoHistoryRegistry,
IEditorOperationsFactoryService editorOperationsFactoryService,
EditorOptionsService editorOptionsService,
IIndentationManagerService indentationManager,
IGlobalOptionService globalOptions) : ICommandHandler<ReturnKeyCommandArgs>
{
private readonly ITextUndoHistoryRegistry _undoHistoryRegistry = undoHistoryRegistry;
private readonly IEditorOperationsFactoryService _editorOperationsFactoryService = editorOperationsFactoryService;
private readonly EditorOptionsService _editorOptionsService = editorOptionsService;
private readonly IIndentationManagerService _indentationManager = indentationManager;
private readonly IGlobalOptionService _globalOptions = globalOptions;

public string DisplayName => EditorFeaturesResources.Split_comment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ private sealed partial class TagSource

private readonly AbstractAsynchronousTaggerProvider<TTag> _dataSource;

/// <summary>
/// Information about what workspace the buffer we're tagging is associated with.
/// </summary>
private readonly WorkspaceRegistration _workspaceRegistration;

/// <summary>
/// Work queue that collects high priority requests to call TagsChanged with.
/// </summary>
Expand Down Expand Up @@ -155,7 +150,7 @@ public TagSource(
_nonFrozenComputationCancellationSeries = new(_disposalTokenSource.Token);
_tagSpanSetPool = new ObjectPool<HashSet<TagSpan<TTag>>>(() => new HashSet<TagSpan<TTag>>(this), trimOnFree: false);

_workspaceRegistration = Workspace.GetWorkspaceRegistration(subjectBuffer.AsTextContainer());
Workspace.GetWorkspaceRegistration(subjectBuffer.AsTextContainer());

// PERF: Use AsyncBatchingWorkQueue<_, VoidResult> instead of AsyncBatchingWorkQueue<_> because the latter
// has an async state machine that rethrows a very common cancellation exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ End Class"
Private Shared Function ExtractSymbol(workspace As EditorTestWorkspace, position As Integer) As Task(Of INavigableSymbol)
Dim threadingContext = workspace.ExportProvider.GetExportedValue(Of IThreadingContext)()
Dim listenerProvider = workspace.ExportProvider.GetExportedValue(Of IAsynchronousOperationListenerProvider)
Dim service = New NavigableSymbolService(workspace.ExportProvider.GetExportedValue(Of IUIThreadOperationExecutor)(), threadingContext, listenerProvider)
Dim service = New NavigableSymbolService(threadingContext, listenerProvider)
Dim view = workspace.Documents.First().GetTextView()
Dim buffer = workspace.Documents.First().GetTextBuffer()
Dim triggerSpan = New SnapshotSpan(buffer.CurrentSnapshot, New Span(position, 0))
Expand Down
2 changes: 2 additions & 0 deletions src/EditorFeatures/TestUtilities/Threading/WpfTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace Roslyn.Test.Utilities;
/// </summary>
public sealed class WpfTestRunner : XunitTestRunner
{
#pragma warning disable IDE0052 // Remove unread private members. Can be used for debugging purposes.
private static string s_wpfFactRequirementReason;
#pragma warning restore IDE0052 // Remove unread private members

public WpfTestSharedData SharedData { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,6 @@ public override void Open()
public SourceTextContainer GetOpenTextContainer()
=> this.GetTextBuffer().AsTextContainer();

private void Update(string newText)
{
using var edit = this.GetTextBuffer().CreateEdit(EditOptions.DefaultMinimalChange, reiteratedVersionNumber: null, editTag: null);
edit.Replace(new Span(0, this.GetTextBuffer().CurrentSnapshot.Length), newText);
edit.Apply();
}

internal void CloseTextView()
{
if (_textView != null && !_textView.IsClosed)
Expand Down
Loading
Loading