Skip to content

Extensions: nullability analysis for property access#78646

Merged
jcouv merged 7 commits intodotnet:mainfrom
jcouv:extensions-nullable3
May 28, 2025
Merged

Extensions: nullability analysis for property access#78646
jcouv merged 7 commits intodotnet:mainfrom
jcouv:extensions-nullable3

Conversation

@jcouv
Copy link
Member

@jcouv jcouv commented May 19, 2025

This PR includes:

  • Nullability analysis of property access and invocation of the implementation accessors (changes in NullableWalker)
  • Adjusting attributes emitted (changes in SourceExtensionImplementationMethodSymbol):
    We were missing synthesized attributes on implementation method (NullableContext for method, Nullable for implementation parameter)
    We need to synthesize some nullability attributes onto return of getter implementation or value parameter of setter implementation
  • Relaxing an assertion in ExtensionMethodReferenceRewriter
  • Some tests related to well-known attributes (disallows ModuleInitializer attribute in extensions)

Ran into a couple of existing/known issues:

Relates to test plan #76130

@jcouv jcouv self-assigned this May 19, 2025
@jcouv jcouv added Area-Compilers Feature - Extension Everything The extension everything feature labels May 19, 2025
invokedAsExtensionMethod = true;

Debug.Assert(receiverOpt.Type!.Equals(method.Parameters[0].Type, TypeCompareKind.ConsiderEverything));
Debug.Assert(receiverOpt.Type!.Equals(method.Parameters[0].Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
Copy link
Member Author

Choose a reason for hiding this comment

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

📝 See the logic in CreateConversion

@jcouv jcouv force-pushed the extensions-nullable3 branch 3 times, most recently from b8c7c09 to c632cd0 Compare May 19, 2025 23:50
@jcouv jcouv force-pushed the extensions-nullable3 branch from 7460b72 to 5e9d509 Compare May 20, 2025 00:52
@jcouv jcouv marked this pull request as ready for review May 20, 2025 04:33
@jcouv jcouv requested a review from a team as a code owner May 20, 2025 04:33
if (tryShortCircuitTargetTypedExpression(argument, argumentNoConversion))
{
Debug.Assert(method is ErrorMethodSymbol);
Debug.Assert(member is ErrorMethodSymbol);
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

member

Is this change really necessary? #Closed

@AlekseyTs
Copy link
Contributor

AlekseyTs commented May 20, 2025

                ImmutableHashSet<string>? returnNotNullIfParameterNotNull = IsAnalyzingAttribute ? null : method?.ReturnNotNullIfParameterNotNull;

It is not obvious why this line doesn't need to handle properties. #Closed


Refers to: src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs:7138 in 5e9d509. [](commit_id = 5e9d509, deletion_comment = False)

invokedAsExtensionMethod = true;

Debug.Assert(receiverOpt.Type!.Equals(method.Parameters[0].Type, TypeCompareKind.ConsiderEverything));
Debug.Assert(receiverOpt.Type!.Equals(method.Parameters[0].Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

IgnoreNullableModifiersForReferenceTypes

IgnoreAllOptions? #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

That's not necessary. We create a conversion in CreateConversion when there are non-nullability differences.

internal override void AddSynthesizedReturnTypeAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
{
// Copy NotNull/MaybeNull attribute from the property onto the implementation getter
if (_originalMethod is SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertyGet, AssociatedSymbol: SourcePropertySymbolBase extensionProperty })
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertyGet, AssociatedSymbol: SourcePropertySymbolBase extensionProperty }

I think checks for specific implementation types are unnecessary and undesirable. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

I was not able to solve this. I'll let you take a look at update and we can discuss

Copy link
Contributor

Choose a reason for hiding this comment

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

I was not able to solve this. I'll let you take a look at update and we can discuss

With the helper in SourcePropertyAccessorSymbol that we are using, I think it is appropriate to do a type check for SourcePropertyAccessorSymbol and that is the only check that we would need before calling the helper.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the clarification. An instance method does factor better.

SourceMethodSymbol.AddSynthesizedAttributes(this, moduleBuilder, ref attributes);
}

internal override void AddSynthesizedReturnTypeAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

AddSynthesizedReturnTypeAttributes

The logic in this method is very different from the logic in SourcePropertyAccessorSymbol.AddSynthesizedReturnTypeAttributes. It is quite possible that it achieves the same thing, but it is hard to tell. At the same time, I think our intent is to achieve exactly the same thing. Consider extracting a helper that deals with synthesizing the attributes for SourcePropertyAccessorSymbol into a helper in that class and simply calling it on _originalMethod from here when appropriate.
#Closed

}
}

// Synthesized nullability attributes are context-dependent, so we intentionally do not call base.AddSynthesizedAttributes here
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

we intentionally do not call base.AddSynthesizedAttributes here

I think WrappedParameterSymbol.AddSynthesizedAttributes should be changed to an abstract override. If that is going to add too many changes to this PR, let's open an issue to do this during a "quality milestone". #Closed

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably should do the same for other "Wrapped" symbol classes

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried doing that initially, but it was a lot of change, so I kept the current structure. Filed #78655

{
// Copy AllowNull/DisallowNull from the property onto the implementation setter's `value` parameter
if (this._underlyingParameter is SynthesizedAccessorValueParameterSymbol
&& this._underlyingParameter.ContainingSymbol is SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertySet, AssociatedSymbol: SourcePropertySymbolBase extensionProperty })
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

Similar suggestion as for AddSynthesizedReturnTypeAttributes. I.e. extract shared helper from SynthesizedAccessorValueParameterSymbol.AddSynthesizedAttributes and call it from here on _underlyingParameter instead of trying to duplicate the logic inside this if statement. #Closed

}
}
""";
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : there should be no error on nameof
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

// Tracked by #76130 : there should be no error on nameof

It is not obvious why this comment is removed. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

Talked to Mads and confirmed this is expected. Instead we want object.P to work (see comment below in this test).

}

[Fact]
public void SynthesizedAttributeOnParameters_Params_01()
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

SynthesizedAttributeOnParameters_Params_01

I think that for synthesized attributes we should test them directly. I.e. asserting their presence in metadata instead of only inferring their presence indirectly from behavior. #Closed

{
foreach (CSharpAttributeData attr in extensionProperty.GetAttributes())
{
if (attr.IsTargetAttribute(AttributeDescription.NotNullAttribute)
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

if (attr.IsTargetAttribute(AttributeDescription.NotNullAttribute)

Do we have tests that explicitly verify presence/lack of these attributes in metadata? #Closed

Copy link
Member Author

@jcouv jcouv May 20, 2025

Choose a reason for hiding this comment

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

See Nullability_PropertyAccess_16 (for NotNull). I'll reinforce Nullability_PropertyAccess_17 (for MaybeNull) with direct check too

base.AddSynthesizedReturnTypeAttributes(moduleBuilder, ref attributes);
}

internal override byte? GetLocalNullableContextValue()
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

GetLocalNullableContextValue

Do we have tests that explicitly observe effect from this override in the form of attributes in metadata? #Closed

foreach (CSharpAttributeData attr in extensionProperty.GetAttributes())
{
if (attr.IsTargetAttribute(AttributeDescription.AllowNullAttribute)
|| attr.IsTargetAttribute(AttributeDescription.DisallowNullAttribute))
Copy link
Contributor

@AlekseyTs AlekseyTs May 20, 2025

Choose a reason for hiding this comment

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

Do we have tests that explicitly verify presence/lack of these attributes in metadata? #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

See Nullability_PropertyAccess_18 Nullability_PropertyAccess_19. I'll add explicit check for lack in those tests too

@AlekseyTs
Copy link
Contributor

AlekseyTs commented May 20, 2025

Done with review pass (commit 2) #Closed

@jcouv
Copy link
Member Author

jcouv commented May 20, 2025

                ImmutableHashSet<string>? returnNotNullIfParameterNotNull = IsAnalyzingAttribute ? null : method?.ReturnNotNullIfParameterNotNull;

It does. That's tracked by a follow up comment in a NotNullIfNotNull test. OP lists two existing bugs this PR ran into (one for NotNullIfNotNull and one for DoesNotReturn)


In reply to: 2894496058


Refers to: src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs:7138 in 5e9d509. [](commit_id = 5e9d509, deletion_comment = False)

@jcouv jcouv requested a review from AlekseyTs May 21, 2025 18:13
}

var annotations = ReturnTypeFlowAnalysisAnnotations;
internal static void AddSynthesizedReturnTypeFlowAnalysisAttributes(MethodSymbol accessor, SourcePropertySymbolBase property, ref ArrayBuilder<CSharpAttributeData> attributes)
Copy link
Contributor

@AlekseyTs AlekseyTs May 22, 2025

Choose a reason for hiding this comment

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

internal static void AddSynthesizedReturnTypeFlowAnalysisAttributes(MethodSymbol accessor, SourcePropertySymbolBase property, ref ArrayBuilder attributes)

Consider keeping this an instance member, simply extracting the code as is. The method would take just ref ArrayBuilder<CSharpAttributeData> attributes. #Closed

{
if (_originalMethod is SourcePropertyAccessorSymbol { AssociatedSymbol: SourcePropertySymbolBase extensionProperty })
{
SourcePropertyAccessorSymbol.AddSynthesizedReturnTypeFlowAnalysisAttributes(_originalMethod, extensionProperty, ref attributes);
Copy link
Contributor

@AlekseyTs AlekseyTs May 22, 2025

Choose a reason for hiding this comment

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

SourcePropertyAccessorSymbol.AddSynthesizedReturnTypeFlowAnalysisAttributes(_originalMethod, extensionProperty, ref attributes);

This is a continuation of the suggestion in SourcePropertyAccessorSymbol.cs:
Here, consider simply calling that instance method on _originalMethod previously type checked and converted to SourcePropertyAccessorSymbol. #Closed

}
}

if (ContainingSymbol is SourcePropertyAccessorSymbol propertyAccessor && propertyAccessor.AssociatedSymbol is SourcePropertySymbolBase property)
Copy link
Contributor

@AlekseyTs AlekseyTs May 22, 2025

Choose a reason for hiding this comment

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

if (ContainingSymbol is SourcePropertyAccessorSymbol propertyAccessor && propertyAccessor.AssociatedSymbol is SourcePropertySymbolBase property)

I think this condition should be part of the extracted helper. Basically I would like to make the same suggestion as for a similar helper in SourcePropertyAccessorSymbol - make it an instance method by simply extracting the relevant portion as is (the entire if statement in this particular case) #Closed

{
if (this is { _underlyingParameter: SynthesizedAccessorValueParameterSymbol { ContainingSymbol: SourcePropertyAccessorSymbol { AssociatedSymbol: SourcePropertySymbolBase extensionProperty } } })
{
SynthesizedAccessorValueParameterSymbol.AddSynthesizedFlowAnalysisAttributes(this, extensionProperty, ref attributes);
Copy link
Contributor

@AlekseyTs AlekseyTs May 22, 2025

Choose a reason for hiding this comment

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

SynthesizedAccessorValueParameterSymbol.AddSynthesizedFlowAnalysisAttributes(this, extensionProperty, ref attributes);

Similar suggestion to call the instance helper passing just ref attributes as parameters. #Closed

{
var module = (PEModuleSymbol)m;
var parameterSymbol = (PEParameterSymbol)m.GlobalNamespace.GetMember<MethodSymbol>("E.M").Parameters[1];
AssertEx.SetEqual(["System.Runtime.CompilerServices.ParamCollectionAttribute"], module.GetCustomAttributesForToken(parameterSymbol.Handle).ToStrings());
Copy link
Contributor

@AlekseyTs AlekseyTs May 22, 2025

Choose a reason for hiding this comment

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

AssertEx.SetEqual(["System.Runtime.CompilerServices.ParamCollectionAttribute"], module.GetCustomAttributesForToken(parameterSymbol.Handle).ToStrings());

We have a PEModule.HasParamArrayAttribute helper #Closed

{
var module = (PEModuleSymbol)m;
var parameterSymbol = (PEParameterSymbol)m.GlobalNamespace.GetMember<MethodSymbol>("E.get_P").Parameters[0];
AssertEx.SetEqual(["System.Runtime.CompilerServices.IsReadOnlyAttribute"], module.GetCustomAttributesForToken(parameterSymbol.Handle).ToStrings());
Copy link
Contributor

@AlekseyTs AlekseyTs May 22, 2025

Choose a reason for hiding this comment

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

AssertEx.SetEqual(["System.Runtime.CompilerServices.IsReadOnlyAttribute"], module.GetCustomAttributesForToken(parameterSymbol.Handle).ToStrings());

I think we have a HasIsReadOnlyAttribute helper #Closed

@AlekseyTs
Copy link
Contributor

Done with review pass (commit 5)

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 6), assuming CI is passing

@jcouv
Copy link
Member Author

jcouv commented May 23, 2025

@dotnet/roslyn-compiler for second review. Thanks

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Done review pass. Just a couple of small questions/test suggestions.

return true;
}

if (node is BoundPropertyAccess)
Copy link
Member

@333fred 333fred May 27, 2025

Choose a reason for hiding this comment

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

Nit: at this point, would it make sense to change to a switch statement? #ByDesign

else if (member.GetIsNewExtensionMember() && member.ContainingType is { } extension && ConstraintsHelper.RequiresChecking(extension))
{
CheckExtensionConstraints(syntaxForConstraintCheck, extension);
}
Copy link
Member

@333fred 333fred May 27, 2025

Choose a reason for hiding this comment

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

Should we throw/assert in the else case here? #Pending

oNull2.P = new object();

object? oNotNull = new object();
oNotNull.P = null; // 1
Copy link
Member

@333fred 333fred May 27, 2025

Choose a reason for hiding this comment

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

Consider also testing oNotNull?.P = null; #Pending

#nullable enable

object? oNull = null;
_ = oNull.P;
Copy link
Member

@333fred 333fred May 27, 2025

Choose a reason for hiding this comment

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

Consider also testing oNull?.P. #Pending

@jcouv jcouv requested a review from 333fred May 27, 2025 23:01
@jcouv jcouv merged commit fc3bdf2 into dotnet:main May 28, 2025
28 checks passed
@jcouv jcouv deleted the extensions-nullable3 branch May 28, 2025 03:24
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 28, 2025
333fred added a commit to 333fred/roslyn that referenced this pull request May 28, 2025
* upstream/main: (162 commits)
  Invoke `dotnet run-api` to obtain virtual project (dotnet#78648)
  [main] Update dependencies from dotnet/arcade (dotnet#78578)
  [main] Source code updates from dotnet/dotnet (dotnet#78724)
  Do not convert tuple expression with error to a bad expression too early (dotnet#78645)
  Updat epersistence version
  Add helper for mapping between documents and hierarchy+itemids
  Extensions: nullability analysis for property access (dotnet#78646)
  Add IsNull property to IAsyncToken (dotnet#78718)
  Update MicrosoftVisualStudioExtensibilityTestingVersion (dotnet#78661)
  Always log PID
  avoid not needed compilationUnit clone (dotnet#78676)
  Fix
  Make operator glyph consistent witht eh rest of the members
  [main] Source code updates from dotnet/dotnet (dotnet#78710)
  fix: RS2007 table borders
  Run on UI thread
  Organize
  Handle error case: static ref field (No NullReferenceException) (dotnet#78707)
  Sort
  Fix crash with introduce local within a compilation unit
  ...
333fred added a commit that referenced this pull request May 29, 2025
* Add XML Solution (SLNX) support to MSBuildWorkspace

* Update `AbstractImplementAbstractClassCodeFixProvider.cs` source

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>

* IN progress

* IN progress

* in progress

* in progress

* Simplify

* Simplify

* Cleanup

* Rename

* Push through initial description

* Rename

* Removed

* Add back disposal

* Linked source

* Rename

* Update docs

* Remove

* Add comment

* Add comment

* Fix

* Delay loading of CodeRefactoringProvider's till absolutely needed

* CR feedback and tests.

* Fix comment

* CR feedback

* Fix crash in 'introduce variable' on top-level statements

* CR feedback

* Seal certain types in LSP layer

* Seal certain types in LSP layer

* Publish PR validation to internal feeds

* PooledObjects cleanup (#78382)

* moved condition above top-level statements

* REvert

* Seal

* Gracefully handle span mapping failing

* Fix information logs getting logged as debug in VSCode

* Don't unnecessarily create a document when only the document state is needed. (#78463)

Cyrus noticed this during a chat where I was considering a larger change to this code. Might as well make the simple/safe change while I consider the larger change too.

Other small changes:
1) Early exit if no changed documents
2) Unrelated change adding Checksum overload as I noticed a high frequency caller during solution load (ProjectSystemProjectOptionsProcessor.ReparseCommandLineIfChanged_NoLock) had an ImmutableArray and it was getting boxed and enumerator alloced.

* Ensure loghub collects the now verbose level logs

* Adjust some more logging messages

* Cancel running requests when the connection terminates

* Shorten log category name

* Extensions: handle extensions in VB SymbolDisplay (#78512)

* Switch to non-scouting queue to unblock CI (#78521)

* Fix test helper message to avoid NRE (#78532)

* Collect data about which code fixes end up making changes that conflict with other code fixes

* docs

* Revert

* Source package fixes (#78534)

* Extract helper to make it easier for other features to request copilot analysis

* lint

* lint

* Extensions: only count extensions for determining identifier (#78523)

* Cache extension method import info per project ID

* Remove telemetry

* Use pattern matching

* Lint

* Add VB ref assembly to semantic search (#78537)

* Add support for FieldRva to EnC delta (#78033)

* [main] Source code updates from dotnet/dotnet (#78527)

* [VMR] Codeflow c53bdd8-c53bdd8

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 267468

* [VMR] Codeflow b422f78-b422f78

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 267725

* Update dependencies from https://github.com/dotnet/dotnet build 267776

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Introduce -productBuild and -sourceBuild switches (#78519)

* Introduce -productBuild and -sourceBuild switches

* Update eng/build.sh

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>

* Update build.sh

* Add new options for SB and PB switches

* Remove leftover SB arg

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>

* Document more steps in our C# release process (#78539)

* Extensions: analyzer actions (#78319)

* Update XAML EA to use DocumentUri instead of System.Uri

* Update field value for NavBar Integration Tests (#78553)

* fix

* fix

* Update GetFirstRelatedDocumentId to not return documents with the same path within the same project (#78475)

GetFirstRelatedDocumentId had a mismatch in behavior for files within the same project that have the same path (shouldn't really happen, would cause compile errors). Previously, the code would return files from the same proejct when searching the cache, but not when doing the linear walk. Talked with Jason, and he indicated that it was better to have the code not return files from the same project, as callers wouldn't expect that.

* Implement PDG.WithProjectsRemoved (#78428)

This allows batch removal of projects from the ProjectDependencyGraph. This should eventually give us a small perf benefit, but only at the point where our projects can be disposed (or processed) in batches, which is not something we currently do.

* Selectively persist the commandline to temporary storage (#78441)

Only write command lines to temporary storage when they may later be needed.

Persisting project command line arguments is surprisingly costly, as evidenced by the profile image below. As this storage is only needed when there is an effective ruleset path, we can limit when we persist to storage to be limited to that scenario.

See PR for detailed performance information.

* File based programs IDE support (#78488)

Co-authored-by: Cyrus Najmabadi <cyrus.najmabadi@gmail.com>
Co-authored-by: Jason Malinowski <jason@jason-m.com>

* Update dependencies from https://github.com/dotnet/arcade build 20250513.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XliffTasks
 From Version 9.0.0-beta.25255.5 -> To Version 9.0.0-beta.25263.2

* Extensions: pattern-based constructs (#78480)

* Unset CompilerType from Csc (#78483)

* Unset CompilerType from Csc

* Remove CompilerType logic

* Add Microsoft.CodeAnalysis.Extensions package (#78388)

* Fix MoveType to create debuggable documents (#78554)

* Move SpecializedCollections to Microsoft.CodeAnalysis.Collections namespace (#78466)

* Add a reference to the tracking bug for a workaround

* Fix embedded language classification inside multi-line string

* Remove 'Opt' suffixes

* Unify resource strings for special case checks

* NRT

* mIn progress

* Simplify

* Simplify

* Remove localized strings from Collections source package (#78576)

* Revert "Update XAML EA to use DocumentUri instead of System.Uri (#78555)"

This reverts commit 2611c9a, reversing
changes made to f4e6964.

* Implement `Enum.IsDefined` check refactoring

* Rename LSP messages for VisualStudio.Extensibility integration (#78598)

Co-authored-by: Matteo Prosperi <maprospe@microsoft.com>

* More improvements to source packages (#78587)

* Editor configs for source packages

* Add nullable enable

* Include linked files in source packages

* Suppress RS1024

* Remove duplicate nullability directives

* Remove unnecessary extensions

* Move FatalError and FailFast to Contracts package

* Add disclaimer

* Ensure we pass unique binlog paths to each BuildHost

Otherwise if we launch multiple processes, they might step atop
each other and cause locking issues.

* Clean up our SpellingExclusions

Somehow almost every line started with a UTF-8 BOM. This fixes it.

* Track used assemblies of data section string literals (#78552)

* Track used assemblies of data section string literals

* Move reporting to module

* Fix a failing test

* Improve test

* Add a comment

* Support local functions in breadcrumbs

* hotfix to fix restore and stop including bin/obj artifacts in directory with loose files (#78615)

* Fix angle brackets in generics in hover

* more directly walk the tree for local functions and add tests

* Give .NET Framework build task in sdk different identity (#78584)

closes #78565

* [VMR] Codeflow 015a854-015a854

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 268651
No dependency updates to commit

* [VMR] Codeflow 604dfc7-170498a

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 268722
No dependency updates to commit

* review feedback

* Fix option reading

* Simplify equivalence keys

* Make refactoring resilient against absence of `InvalidEnumArgumentException` type

* Fix formatting

* Update Workspace.MSBuild to reference Microsoft.Build.Framework.

* LSP: Fix batch builds for file-based programs and fix `"dotnet.projects.binaryLogPath"` throwing an exception (#78644)

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>

* Convert operand of `true`/`false` operator invoked as part of `&&`/`||`operator evaluation (#78629)

Fixes #78609.

* Extensions: rename syntax node (#78625)

* Simplify

* Use SolutionFileReader instead of calling out to BuildHost

Removes the GetProjectsInSolution BuildHost API. Instead we can use the SolutionPersister library in processes to parse the projects from a solution file.

* StaticLogMessage isn't pooling correctly

Noticed this when looking at a profile and was curious why there were 3 MB of allocations of the StaticLogMessage type.

LogMessage.Free sets _message to null before calling FreeCore, thus StaticLogMessage.FreeCore was never adding items back to it's pool. The ordering of LogMessage setting _message to null and calling FreeCore is important, so that can't be changed. Instead, add a flag to StaticLogMessage to indicate whether it's in a constructed state or not.

* Fixing symbol publishing (#78650)

These need to be manually listed given that they aren't published directly as a NuPkg

* Compare symbols by metadata name when searching for eqivalent symbols in FAR engine

* Extensions: disallow indexers (#78626)

* Add untriaged label to all new issues (#78658)

* Update resourceManagement.yml

* Update resourceManagement.yml

* Fixed crash in CSharpConvertToRecordRefactoringProvider.

* Return arity check for method symbols

* Fix doc comment

* Update src/Features/Core/Portable/SymbolSearch/SymbolSearchOptions.cs

* Fix

* Make solution file reading async

* Fix storage

* Hot Reload: Handle document deletes (#78516)

* Use SBRP version of M.CA for analyzers in the context of source build (#78668)

* fix symbol publishing? (#78671)

* Cleanup

* Use ThrowIfFalse when resolving paths

* Add test assertions

* Applied code review suggestions.

* Update Microsoft.Build.Tasks.CodeAnalysis.Sdk.csproj (#78681)

* Fix nullable crash for field keyword in partial property (#78672)

* Use VerifyDiagnostics format to report CompileAndVerify diagnostics (#78666)

* Revert "Update Microsoft.Build.Tasks.CodeAnalysis.Sdk.csproj (#78681)" (#78687)

This reverts commit 6d490de.

* Revert "fix symbol publishing? (#78671)" (#78686)

This reverts commit 2b6024e.

* Add comment

* [main] Source code updates from dotnet/dotnet (#78663)

* [VMR] Codeflow c3c7ad6-c3c7ad6

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 268973
No dependency updates to commit

* [VMR] Codeflow d219c4f-d219c4f

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 269082
No dependency updates to commit

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Add a test to verify that behavior is expected and bug no longer occurs

* [main] Source code updates from dotnet/dotnet (#78692)

* [VMR] Codeflow 2b6024e-2b6024e

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 269352
No dependency updates to commit

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Modify ABWQ.AddWork to take in a ROS instead of an IEnumerable (#78691)

I'm seeing this enumerator allocation as account for 50 MB (0.9%) in a customer trace for feedback ticket https://developercommunity.visualstudio.com/t/Razor-Development:-30-Second-CPU-Churn-A/10904811

This shows up a bit smaller in the C# editing speedometer test, but does show as 2.3 MB. Test insertion showed allocations were removed.

See PR for more numbers and speedometer test results.

* Add assert

* Add test

* Add support for 'fixed'

* Fix crash with introduce local within a compilation unit

* Sort

* Handle error case: static ref field (No NullReferenceException) (#78707)

* Organize

* Run on UI thread

* fix: RS2007 table borders

* [main] Source code updates from dotnet/dotnet (#78710)

* [VMR] Codeflow 533fde8-533fde8

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 269499
No dependency updates to commit

* Update dependencies from https://github.com/dotnet/dotnet build 269610
No dependency updates to commit

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Make operator glyph consistent witht eh rest of the members

* Fix

* avoid not needed compilationUnit clone (#78676)

* Always log PID

* Update MicrosoftVisualStudioExtensibilityTestingVersion (#78661)

* update extensibility version

* remove added package?

* update minversion

* test

* update vswhere version

* update versions.props vswhere

* update min version

* update coreeditor version ranges

* Add IsNull property to IAsyncToken (#78718)

* Extensions: nullability analysis for property access (#78646)

* Add helper for mapping between documents and hierarchy+itemids

* Updat epersistence version

* Do not convert tuple expression with error to a bad expression too early (#78645)

* [main] Source code updates from dotnet/dotnet (#78724)

* [VMR] Codeflow f5705c8-57b0396

[[ commit created by automation ]]

* Update dependencies from https://github.com/dotnet/dotnet build 269724
No dependency updates to commit

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* [main] Update dependencies from dotnet/arcade (#78578)

* Update dependencies from https://github.com/dotnet/arcade build 20250513.5

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XliffTasks
 From Version 9.0.0-beta.25263.2 -> To Version 9.0.0-beta.25263.5

* Update dependencies from https://github.com/dotnet/arcade build 20250516.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XliffTasks
 From Version 9.0.0-beta.25263.2 -> To Version 9.0.0-beta.25266.2

* Update dependencies from https://github.com/dotnet/arcade build 2025052.1

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XliffTasks
 From Version 9.0.0-beta.25263.2 -> To Version 9.0.0-beta.25271.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Invoke `dotnet run-api` to obtain virtual project (#78648)

Co-authored-by: David Barbet <dibarbet@gmail.com>

---------

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Co-authored-by: Deepak Rathore (ALLYIS INC) <v-deerathore@microsoft.com>
Co-authored-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Co-authored-by: Cyrus Najmabadi <cyrus.najmabadi@gmail.com>
Co-authored-by: Cyrus Najmabadi <cyrusn@microsoft.com>
Co-authored-by: Evgeny Tvorun <evgenyt@microsoft.com>
Co-authored-by: Victor Pogor <victor.pogor@outlook.com>
Co-authored-by: David Barbet <dabarbet@microsoft.com>
Co-authored-by: Tomáš Matoušek <tmat@users.noreply.github.com>
Co-authored-by: Jason Malinowski <jason.malinowski@microsoft.com>
Co-authored-by: Andrew Hall <andrha@microsoft.com>
Co-authored-by: Todd Grunke <toddgrun@microsoft.com>
Co-authored-by: Julien Couvreur <julien.couvreur@gmail.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Joey Robichaud <jorobich@microsoft.com>
Co-authored-by: Ella Hathaway <67609881+ellahathaway@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Ankita Khera <40616383+akhera99@users.noreply.github.com>
Co-authored-by: Rikki Gibson <rigibson@microsoft.com>
Co-authored-by: Jason Malinowski <jason@jason-m.com>
Co-authored-by: Jan Jones <janjones@microsoft.com>
Co-authored-by: DoctorKrolic <mapmyp03@gmail.com>
Co-authored-by: Matteo Prosperi <41970398+matteo-prosperi@users.noreply.github.com>
Co-authored-by: Matteo Prosperi <maprospe@microsoft.com>
Co-authored-by: Jared Parsons <jared@paranoidcoding.org>
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Co-authored-by: AlekseyTs <AlekseyTs@users.noreply.github.com>
Co-authored-by: John Douglas Leitch <JohnLeitch@outlook.com>
Co-authored-by: Matt Thalman <mthalman@microsoft.com>
Co-authored-by: Bernd Baumanns <baumannsbernd@gmail.com>
Co-authored-by: Thomas Shephard <thomas@thomas-shephard.com>
Co-authored-by: DoctorKrolic <70431552+DoctorKrolic@users.noreply.github.com>
Co-authored-by: David Barbet <dibarbet@gmail.com>
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Feature - Extension Everything The extension everything feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants