From e0ac997a8a3fd5d61eaf2027d82a3bfd52cef1de Mon Sep 17 00:00:00 2001 From: sdelarosbil Date: Fri, 8 Mar 2024 13:49:32 -0500 Subject: [PATCH 01/94] Qualify the type when negating a pattern to a not pattern --- .../CSharpUseNotPatternTests.cs | 43 +++++++++++++++++++ .../SyntaxGeneratorExtensions_Negate.cs | 16 +++++++ 2 files changed, 59 insertions(+) diff --git a/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs b/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs index 5a97b2bf607b8..670fadbda1249 100644 --- a/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs +++ b/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs @@ -174,6 +174,49 @@ void M(object x) }.RunAsync(); } + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72370")] + public async Task UseNotPattern2() + { + await new VerifyCS.Test + { + TestCode = """ + public class Program + { + public class C + { + } + public static void Main() + { + C C = new(); + object O = C; + + if (!(O [|is|] C)) + { + } + } + } + """, + FixedCode = """ + public class Program + { + public class C + { + } + public static void Main() + { + C C = new(); + object O = C; + + if (O is not Program.C) + { + } + } + } + """, + LanguageVersion = LanguageVersion.CSharp9, + }.RunAsync(); + } + [Fact] public async Task UnavailableInCSharp8() { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index 5e19a079b55e8..1bd708759e8d8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -158,6 +158,22 @@ private static SyntaxNode GetNegationOfBinaryExpression( return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression())); } + // With a not pattern, it is possible to have an ambiguity between a type name or a local identifier. + // For example, if a class is named C and we have: + // C C = new(); + // object O = C; + // if (O is not C) + // ... + // Then there is an ambiguity between the type C and the local named C. + // To address this, we use an expression with the fully qualified type name which the simplifier + // will shorten to the shortest possible without ambiguity + if (operation is IIsTypeOperation { TypeOperand.SpecialType: SpecialType.None } isTypeOperation && + syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) + { + var typeNode = generatorInternal.Type(isTypeOperation.TypeOperand, false); + return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.ConstantPattern(typeNode))); + } + // `is y` -> `is not y` if (syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.TypePattern(rightOperand))); From 11c1f9dce90bdbe1aa3a8043bb03138d93a760b7 Mon Sep 17 00:00:00 2001 From: sdelarosbil Date: Fri, 8 Mar 2024 14:56:45 -0500 Subject: [PATCH 02/94] Specify the arg name --- .../Core/Extensions/SyntaxGeneratorExtensions_Negate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index 1bd708759e8d8..01b69fa27c64d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -170,7 +170,7 @@ private static SyntaxNode GetNegationOfBinaryExpression( if (operation is IIsTypeOperation { TypeOperand.SpecialType: SpecialType.None } isTypeOperation && syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) { - var typeNode = generatorInternal.Type(isTypeOperation.TypeOperand, false); + var typeNode = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.ConstantPattern(typeNode))); } From 7a841bca097bddc0049c4e65653c9cae7361da69 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Tue, 28 Jun 2022 09:11:40 -0700 Subject: [PATCH 03/94] Implement ImmutableSegmentedHashSet.ValueBuilder for internal use --- .../ImmutableSegmentedHashSet`1+Builder.cs | 211 ++----------- ...mmutableSegmentedHashSet`1+ValueBuilder.cs | 282 ++++++++++++++++++ .../ImmutableSegmentedHashSet`1.cs | 21 +- .../ImmutableSegmentedList`1+Builder.cs | 2 +- .../Internal/ICollectionCalls`1.cs | 8 + ...crosoft.CodeAnalysis.Collections.projitems | 1 + 6 files changed, 332 insertions(+), 193 deletions(-) create mode 100644 src/Dependencies/Collections/ImmutableSegmentedHashSet`1+ValueBuilder.cs diff --git a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+Builder.cs b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+Builder.cs index 646c2a4bb93ca..f5140e38238f5 100644 --- a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+Builder.cs +++ b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+Builder.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; @@ -15,263 +14,115 @@ internal readonly partial struct ImmutableSegmentedHashSet public sealed class Builder : ISet, IReadOnlyCollection { /// - /// The immutable collection this builder is based on. + /// The private builder implementation. /// - private ImmutableSegmentedHashSet _set; - - /// - /// The current mutable collection this builder is operating on. This field is initialized to a copy of - /// the first time a change is made. - /// - private SegmentedHashSet? _mutableSet; + private ValueBuilder _builder; internal Builder(ImmutableSegmentedHashSet set) - { - _set = set; - _mutableSet = null; - } + => _builder = new ValueBuilder(set); /// public IEqualityComparer KeyComparer { - get - { - return ReadOnlySet.Comparer; - } - - set - { - if (Equals(KeyComparer, value ?? EqualityComparer.Default)) - return; - - _mutableSet = new SegmentedHashSet(ReadOnlySet, value ?? EqualityComparer.Default); - _set = default; - } + get => _builder.KeyComparer; + set => _builder.KeyComparer = value; } /// - public int Count => ReadOnlySet.Count; - - private SegmentedHashSet ReadOnlySet => _mutableSet ?? _set._set; - - bool ICollection.IsReadOnly => false; - - private SegmentedHashSet GetOrCreateMutableSet() - { - if (_mutableSet is null) - { - var originalSet = RoslynImmutableInterlocked.InterlockedExchange(ref _set, default); - if (originalSet.IsDefault) - throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}"); - - _mutableSet = new SegmentedHashSet(originalSet._set, originalSet.KeyComparer); - } + public int Count => _builder.Count; - return _mutableSet; - } + bool ICollection.IsReadOnly => ICollectionCalls.IsReadOnly(ref _builder); /// public bool Add(T item) - { - if (_mutableSet is null && Contains(item)) - return false; - - return GetOrCreateMutableSet().Add(item); - } + => _builder.Add(item); /// public void Clear() - { - if (ReadOnlySet.Count != 0) - { - if (_mutableSet is null) - { - _mutableSet = new SegmentedHashSet(KeyComparer); - _set = default; - } - else - { - _mutableSet.Clear(); - } - } - } + => _builder.Clear(); /// public bool Contains(T item) - => ReadOnlySet.Contains(item); + => _builder.Contains(item); /// public void ExceptWith(IEnumerable other) { - if (other is null) - ThrowHelper.ThrowArgumentNullException(ExceptionArgument.other); - - if (_mutableSet is not null) - { - _mutableSet.ExceptWith(other); - return; - } - if (other == this) { - Clear(); - return; - } - else if (other is ImmutableSegmentedHashSet otherSet) - { - if (otherSet == _set) - { - Clear(); - return; - } - else if (otherSet.IsEmpty) - { - // No action required - return; - } - else - { - GetOrCreateMutableSet().ExceptWith(otherSet._set); - return; - } + // The ValueBuilder knows how to optimize for this case by calling Clear, provided it does not need + // to access properties of the wrapping Builder instance. + _builder.ExceptWith(_builder.ReadOnlySet); } else { - // Manually enumerate to avoid changes to the builder if 'other' is empty or does not contain any - // items present in the current set. - SegmentedHashSet? mutableSet = null; - foreach (var item in other) - { - if (mutableSet is null) - { - if (!ReadOnlySet.Contains(item)) - continue; - - mutableSet = GetOrCreateMutableSet(); - } - - mutableSet.Remove(item); - } - - return; + _builder.ExceptWith(other); } } /// public Enumerator GetEnumerator() - => new Enumerator(GetOrCreateMutableSet()); + => _builder.GetEnumerator(); /// public void IntersectWith(IEnumerable other) - => GetOrCreateMutableSet().IntersectWith(other); + => _builder.IntersectWith(other); /// public bool IsProperSubsetOf(IEnumerable other) - => ReadOnlySet.IsProperSubsetOf(other); + => _builder.IsProperSubsetOf(other); /// public bool IsProperSupersetOf(IEnumerable other) - => ReadOnlySet.IsProperSupersetOf(other); + => _builder.IsProperSupersetOf(other); /// public bool IsSubsetOf(IEnumerable other) - => ReadOnlySet.IsSubsetOf(other); + => _builder.IsSubsetOf(other); /// public bool IsSupersetOf(IEnumerable other) - => ReadOnlySet.IsSupersetOf(other); + => _builder.IsSupersetOf(other); /// public bool Overlaps(IEnumerable other) - => ReadOnlySet.Overlaps(other); + => _builder.Overlaps(other); /// public bool Remove(T item) - { - if (_mutableSet is null && !Contains(item)) - return false; - - return GetOrCreateMutableSet().Remove(item); - } + => _builder.Remove(item); /// public bool SetEquals(IEnumerable other) - => ReadOnlySet.SetEquals(other); + => _builder.SetEquals(other); /// public void SymmetricExceptWith(IEnumerable other) - => GetOrCreateMutableSet().SymmetricExceptWith(other); + => _builder.SymmetricExceptWith(other); /// public bool TryGetValue(T equalValue, out T actualValue) - { - if (ReadOnlySet.TryGetValue(equalValue, out var value)) - { - actualValue = value; - return true; - } - - actualValue = equalValue; - return false; - } + => _builder.TryGetValue(equalValue, out actualValue); /// public void UnionWith(IEnumerable other) - { - if (other is null) - ThrowHelper.ThrowArgumentNullException(ExceptionArgument.other); - - if (_mutableSet is not null) - { - _mutableSet.UnionWith(other); - return; - } - - if (other is ImmutableSegmentedHashSet { IsEmpty: true }) - { - return; - } - else - { - // Manually enumerate to avoid changes to the builder if 'other' is empty or only contains items - // already present in the current set. - SegmentedHashSet? mutableSet = null; - foreach (var item in other) - { - if (mutableSet is null) - { - if (ReadOnlySet.Contains(item)) - continue; - - mutableSet = GetOrCreateMutableSet(); - } - - mutableSet.Add(item); - } - - return; - } - } + => _builder.UnionWith(other); /// public ImmutableSegmentedHashSet ToImmutable() - { - _set = new ImmutableSegmentedHashSet(ReadOnlySet); - _mutableSet = null; - return _set; - } + => _builder.ToImmutable(); void ICollection.Add(T item) - => ((ICollection)GetOrCreateMutableSet()).Add(item); + => ICollectionCalls.Add(ref _builder, item); void ICollection.CopyTo(T[] array, int arrayIndex) - => ((ICollection)ReadOnlySet).CopyTo(array, arrayIndex); + => ICollectionCalls.CopyTo(ref _builder, array, arrayIndex); IEnumerator IEnumerable.GetEnumerator() - => GetEnumerator(); + => IEnumerableCalls.GetEnumerator(ref _builder); IEnumerator IEnumerable.GetEnumerator() - => GetEnumerator(); + => IEnumerableCalls.GetEnumerator(ref _builder); } } } diff --git a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+ValueBuilder.cs b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+ValueBuilder.cs new file mode 100644 index 0000000000000..c672df7acd97f --- /dev/null +++ b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1+ValueBuilder.cs @@ -0,0 +1,282 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics; +using Microsoft.CodeAnalysis.Collections.Internal; + +namespace Microsoft.CodeAnalysis.Collections +{ + internal readonly partial struct ImmutableSegmentedHashSet + { + private struct ValueBuilder : ISet, IReadOnlyCollection + { + /// + /// The immutable collection this builder is based on. + /// + private ImmutableSegmentedHashSet _set; + + /// + /// The current mutable collection this builder is operating on. This field is initialized to a copy of + /// the first time a change is made. + /// + private SegmentedHashSet? _mutableSet; + + internal ValueBuilder(ImmutableSegmentedHashSet set) + { + _set = set; + _mutableSet = null; + } + + /// + public IEqualityComparer KeyComparer + { + readonly get + { + return ReadOnlySet.Comparer; + } + + set + { + if (Equals(KeyComparer, value ?? EqualityComparer.Default)) + return; + + _mutableSet = new SegmentedHashSet(ReadOnlySet, value ?? EqualityComparer.Default); + _set = default; + } + } + + /// + public readonly int Count => ReadOnlySet.Count; + + internal readonly SegmentedHashSet ReadOnlySet => _mutableSet ?? _set._set; + + readonly bool ICollection.IsReadOnly => false; + + private SegmentedHashSet GetOrCreateMutableSet() + { + if (_mutableSet is null) + { + var originalSet = RoslynImmutableInterlocked.InterlockedExchange(ref _set, default); + if (originalSet.IsDefault) + throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}"); + + _mutableSet = new SegmentedHashSet(originalSet._set, originalSet.KeyComparer); + } + + return _mutableSet; + } + + /// + public bool Add(T item) + { + if (_mutableSet is null && Contains(item)) + return false; + + return GetOrCreateMutableSet().Add(item); + } + + /// + public void Clear() + { + if (ReadOnlySet.Count != 0) + { + if (_mutableSet is null) + { + _mutableSet = new SegmentedHashSet(KeyComparer); + _set = default; + } + else + { + _mutableSet.Clear(); + } + } + } + + /// + public readonly bool Contains(T item) + => ReadOnlySet.Contains(item); + + /// + public void ExceptWith(IEnumerable other) + { + if (other is null) + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.other); + + if (_mutableSet is not null) + { + _mutableSet.ExceptWith(other); + return; + } + + // ValueBuilder is not a public API, so there shouldn't be any callers trying to pass a boxed instance + // to this method. + Debug.Assert(other is not ValueBuilder); + + if (other == ReadOnlySet) + { + Clear(); + return; + } + else if (other is ImmutableSegmentedHashSet otherSet) + { + if (otherSet == _set) + { + Clear(); + return; + } + else if (otherSet.IsEmpty) + { + // No action required + return; + } + else + { + GetOrCreateMutableSet().ExceptWith(otherSet._set); + return; + } + } + else + { + // Manually enumerate to avoid changes to the builder if 'other' is empty or does not contain any + // items present in the current set. + SegmentedHashSet? mutableSet = null; + foreach (var item in other) + { + if (mutableSet is null) + { + if (!ReadOnlySet.Contains(item)) + continue; + + mutableSet = GetOrCreateMutableSet(); + } + + mutableSet.Remove(item); + } + + return; + } + } + + /// + public Enumerator GetEnumerator() + => new(GetOrCreateMutableSet()); + + /// + public void IntersectWith(IEnumerable other) + => GetOrCreateMutableSet().IntersectWith(other); + + /// + public readonly bool IsProperSubsetOf(IEnumerable other) + => ReadOnlySet.IsProperSubsetOf(other); + + /// + public readonly bool IsProperSupersetOf(IEnumerable other) + => ReadOnlySet.IsProperSupersetOf(other); + + /// + public readonly bool IsSubsetOf(IEnumerable other) + => ReadOnlySet.IsSubsetOf(other); + + /// + public readonly bool IsSupersetOf(IEnumerable other) + => ReadOnlySet.IsSupersetOf(other); + + /// + public readonly bool Overlaps(IEnumerable other) + => ReadOnlySet.Overlaps(other); + + /// + public bool Remove(T item) + { + if (_mutableSet is null && !Contains(item)) + return false; + + return GetOrCreateMutableSet().Remove(item); + } + + /// + public readonly bool SetEquals(IEnumerable other) + => ReadOnlySet.SetEquals(other); + + /// + public void SymmetricExceptWith(IEnumerable other) + => GetOrCreateMutableSet().SymmetricExceptWith(other); + + /// + public readonly bool TryGetValue(T equalValue, out T actualValue) + { + if (ReadOnlySet.TryGetValue(equalValue, out var value)) + { + actualValue = value; + return true; + } + + actualValue = equalValue; + return false; + } + + /// + public void UnionWith(IEnumerable other) + { + if (other is null) + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.other); + + if (_mutableSet is not null) + { + _mutableSet.UnionWith(other); + return; + } + + if (other is ImmutableSegmentedHashSet { IsEmpty: true }) + { + return; + } + else + { + // Manually enumerate to avoid changes to the builder if 'other' is empty or only contains items + // already present in the current set. + SegmentedHashSet? mutableSet = null; + foreach (var item in other) + { + if (mutableSet is null) + { + if (ReadOnlySet.Contains(item)) + continue; + + mutableSet = GetOrCreateMutableSet(); + } + + mutableSet.Add(item); + } + + return; + } + } + + /// + public ImmutableSegmentedHashSet ToImmutable() + { + _set = new ImmutableSegmentedHashSet(ReadOnlySet); + _mutableSet = null; + return _set; + } + + void ICollection.Add(T item) + => ((ICollection)GetOrCreateMutableSet()).Add(item); + + readonly void ICollection.CopyTo(T[] array, int arrayIndex) + => ((ICollection)ReadOnlySet).CopyTo(array, arrayIndex); + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + } + } +} diff --git a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs index a00875ab0a459..bc546108c8a2f 100644 --- a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs +++ b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs @@ -67,9 +67,8 @@ public ImmutableSegmentedHashSet Add(T value) } else { - // TODO: Avoid the builder allocation // TODO: Reuse all pages with no changes - var builder = self.ToBuilder(); + var builder = self.ToValueBuilder(); builder.Add(value); return builder.ToImmutable(); } @@ -113,9 +112,8 @@ public ImmutableSegmentedHashSet Except(IEnumerable other) } else { - // TODO: Avoid the builder allocation // TODO: Reuse all pages with no changes - var builder = self.ToBuilder(); + var builder = self.ToValueBuilder(); builder.ExceptWith(other); return builder.ToImmutable(); } @@ -136,9 +134,8 @@ public ImmutableSegmentedHashSet Intersect(IEnumerable other) } else { - // TODO: Avoid the builder allocation // TODO: Reuse all pages with no changes - var builder = self.ToBuilder(); + var builder = self.ToValueBuilder(); builder.IntersectWith(other); return builder.ToImmutable(); } @@ -175,9 +172,8 @@ public ImmutableSegmentedHashSet Remove(T value) } else { - // TODO: Avoid the builder allocation // TODO: Reuse all pages with no changes - var builder = self.ToBuilder(); + var builder = self.ToValueBuilder(); builder.Remove(value); return builder.ToImmutable(); } @@ -206,9 +202,8 @@ public ImmutableSegmentedHashSet SymmetricExcept(IEnumerable other) } else { - // TODO: Avoid the builder allocation // TODO: Reuse all pages with no changes - var builder = self.ToBuilder(); + var builder = self.ToValueBuilder(); builder.SymmetricExceptWith(other); return builder.ToImmutable(); } @@ -240,9 +235,8 @@ public ImmutableSegmentedHashSet Union(IEnumerable other) return otherSet.WithComparer(self.KeyComparer); } - // TODO: Avoid the builder allocation // TODO: Reuse all pages with no changes - var builder = self.ToBuilder(); + var builder = self.ToValueBuilder(); builder.UnionWith(other); return builder.ToImmutable(); } @@ -251,6 +245,9 @@ public ImmutableSegmentedHashSet Union(IEnumerable other) public Builder ToBuilder() => new(this); + private ValueBuilder ToValueBuilder() + => new ValueBuilder(this); + /// public ImmutableSegmentedHashSet WithComparer(IEqualityComparer? equalityComparer) { diff --git a/src/Dependencies/Collections/ImmutableSegmentedList`1+Builder.cs b/src/Dependencies/Collections/ImmutableSegmentedList`1+Builder.cs index 865107bbe052e..174d53ff8904b 100644 --- a/src/Dependencies/Collections/ImmutableSegmentedList`1+Builder.cs +++ b/src/Dependencies/Collections/ImmutableSegmentedList`1+Builder.cs @@ -14,7 +14,7 @@ internal partial struct ImmutableSegmentedList public sealed class Builder : IList, IReadOnlyList, IList { /// - /// The immutable collection this builder is based on. + /// The private builder implementation. /// private ValueBuilder _builder; diff --git a/src/Dependencies/Collections/Internal/ICollectionCalls`1.cs b/src/Dependencies/Collections/Internal/ICollectionCalls`1.cs index 3eec844a90f5b..45fa0142859da 100644 --- a/src/Dependencies/Collections/Internal/ICollectionCalls`1.cs +++ b/src/Dependencies/Collections/Internal/ICollectionCalls`1.cs @@ -20,5 +20,13 @@ internal static class ICollectionCalls public static bool IsReadOnly(ref TCollection collection) where TCollection : ICollection => collection.IsReadOnly; + + public static void Add(ref TCollection collection, T item) + where TCollection : ICollection + => collection.Add(item); + + public static void CopyTo(ref TCollection collection, T[] array, int arrayIndex) + where TCollection : ICollection + => collection.CopyTo(array, arrayIndex); } } diff --git a/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems b/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems index 45608e695a754..dbaab9715bd37 100644 --- a/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems +++ b/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems @@ -25,6 +25,7 @@ + From 855bc78d9ce39b0daf003985919fdd442ebfdddc Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Tue, 28 Jun 2022 09:12:01 -0700 Subject: [PATCH 04/94] Document use cases for ImmutableSegmentedHashSet --- .../ImmutableSegmentedHashSet`1.cs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs index bc546108c8a2f..b99e4e99373cc 100644 --- a/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs +++ b/src/Dependencies/Collections/ImmutableSegmentedHashSet`1.cs @@ -10,6 +10,57 @@ namespace Microsoft.CodeAnalysis.Collections { + /// + /// Represents a segmented hash set that is immutable; meaning it cannot be changed once it is created. + /// + /// + /// There are different scenarios best for and others + /// best for . + /// + /// The following table summarizes the performance characteristics of + /// : + /// + /// + /// + /// Operation + /// Complexity + /// Complexity + /// Comments + /// + /// + /// Contains + /// O(1) + /// O(log n) + /// Directly index into the underlying segmented list + /// + /// + /// Add() + /// O(n) + /// O(log n) + /// Requires creating a new segmented hash set and cloning all impacted segments + /// + /// + /// + /// This type is backed by segmented arrays to avoid using the Large Object Heap without impacting algorithmic + /// complexity. + /// + /// The type of the value in the set. + /// + /// This type has a documented contract of being exactly one reference-type field in size. Our own + /// class depends on it, as well as others externally. + /// + /// IMPORTANT NOTICE FOR MAINTAINERS AND REVIEWERS: + /// + /// This type should be thread-safe. As a struct, it cannot protect its own fields from being changed from one + /// thread while its members are executing on other threads because structs can change in place simply by + /// reassigning the field containing this struct. Therefore it is extremely important that ⚠⚠ Every member + /// should only dereference this ONCE ⚠⚠. If a member needs to reference the + /// field, that counts as a dereference of this. Calling other instance members + /// (properties or methods) also counts as dereferencing this. Any member that needs to use this more + /// than once must instead assign this to a local variable and use that for the rest of the code instead. + /// This effectively copies the one field in the struct to a local variable so that it is insulated from other + /// threads. + /// internal readonly partial struct ImmutableSegmentedHashSet : IImmutableSet, ISet, ICollection, IEquatable> { /// From b3e8dffce55f0f39b0644dec098c7d2c02591a54 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Tue, 28 Jun 2022 10:20:08 -0700 Subject: [PATCH 05/94] Implement ImmutableSegmentedDictionary.ValueBuilder for internal use --- .../ImmutableSegmentedDictionary`2+Builder.cs | 179 +++--------- ...tableSegmentedDictionary`2+ValueBuilder.cs | 259 ++++++++++++++++++ .../ImmutableSegmentedDictionary`2.cs | 43 ++- .../Collections/Internal/IDictionaryCalls.cs | 57 ++++ ...crosoft.CodeAnalysis.Collections.projitems | 2 + 5 files changed, 375 insertions(+), 165 deletions(-) create mode 100644 src/Dependencies/Collections/ImmutableSegmentedDictionary`2+ValueBuilder.cs create mode 100644 src/Dependencies/Collections/Internal/IDictionaryCalls.cs diff --git a/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+Builder.cs b/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+Builder.cs index 26f264cf961fe..67029c4f6360c 100644 --- a/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+Builder.cs +++ b/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+Builder.cs @@ -6,6 +6,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using Microsoft.CodeAnalysis.Collections.Internal; namespace Microsoft.CodeAnalysis.Collections { @@ -14,50 +15,26 @@ internal readonly partial struct ImmutableSegmentedDictionary public sealed partial class Builder : IDictionary, IReadOnlyDictionary, IDictionary { /// - /// The immutable collection this builder is based on. + /// The private builder implementation. /// - private ImmutableSegmentedDictionary _dictionary; - - /// - /// The current mutable collection this builder is operating on. This field is initialized to a copy of - /// the first time a change is made. - /// - private SegmentedDictionary? _mutableDictionary; + private ValueBuilder _builder; internal Builder(ImmutableSegmentedDictionary dictionary) - { - _dictionary = dictionary; - } + => _builder = new ValueBuilder(dictionary); public IEqualityComparer KeyComparer { - get - { - return ReadOnlyDictionary.Comparer; - } - - set - { - if (value is null) - throw new ArgumentNullException(nameof(value)); - - if (value != KeyComparer) - { - // Rewrite the mutable dictionary using a new comparer - var valuesToAdd = ReadOnlyDictionary; - _mutableDictionary = new SegmentedDictionary(value); - AddRange(valuesToAdd); - } - } + get => _builder.KeyComparer; + set => _builder.KeyComparer = value; } - public int Count => ReadOnlyDictionary.Count; + public int Count => _builder.Count; public KeyCollection Keys => new(this); public ValueCollection Values => new(this); - private SegmentedDictionary ReadOnlyDictionary => _mutableDictionary ?? _dictionary._dictionary; + private SegmentedDictionary ReadOnlyDictionary => _builder.ReadOnlyDictionary; IEnumerable IReadOnlyDictionary.Keys => Keys; @@ -67,181 +44,105 @@ public IEqualityComparer KeyComparer ICollection IDictionary.Values => Values; - bool ICollection>.IsReadOnly => false; + bool ICollection>.IsReadOnly => ICollectionCalls>.IsReadOnly(ref _builder); ICollection IDictionary.Keys => Keys; ICollection IDictionary.Values => Values; - bool IDictionary.IsReadOnly => false; + bool IDictionary.IsReadOnly => IDictionaryCalls.IsReadOnly(ref _builder); - bool IDictionary.IsFixedSize => false; + bool IDictionary.IsFixedSize => IDictionaryCalls.IsFixedSize(ref _builder); object ICollection.SyncRoot => this; - bool ICollection.IsSynchronized => false; + bool ICollection.IsSynchronized => ICollectionCalls.IsSynchronized(ref _builder); public TValue this[TKey key] { - get => ReadOnlyDictionary[key]; - set => GetOrCreateMutableDictionary()[key] = value; + get => _builder[key]; + set => _builder[key] = value; } object? IDictionary.this[object key] { - get => ((IDictionary)ReadOnlyDictionary)[key]; - set => ((IDictionary)GetOrCreateMutableDictionary())[key] = value; - } - - private SegmentedDictionary GetOrCreateMutableDictionary() - { - return _mutableDictionary ??= new SegmentedDictionary(_dictionary._dictionary, _dictionary.KeyComparer); + get => IDictionaryCalls.GetItem(ref _builder, key); + set => IDictionaryCalls.SetItem(ref _builder, key, value); } public void Add(TKey key, TValue value) - { - if (Contains(new KeyValuePair(key, value))) - return; - - GetOrCreateMutableDictionary().Add(key, value); - } + => _builder.Add(key, value); public void Add(KeyValuePair item) - => Add(item.Key, item.Value); + => _builder.Add(item); public void AddRange(IEnumerable> items) - { - if (items == null) - throw new ArgumentNullException(nameof(items)); - - foreach (var pair in items) - Add(pair.Key, pair.Value); - } + => _builder.AddRange(items); public void Clear() - { - if (ReadOnlyDictionary.Count != 0) - { - if (_mutableDictionary is null) - _mutableDictionary = new SegmentedDictionary(KeyComparer); - else - _mutableDictionary.Clear(); - } - } + => _builder.Clear(); public bool Contains(KeyValuePair item) - { - return TryGetValue(item.Key, out var value) - && EqualityComparer.Default.Equals(value, item.Value); - } + => _builder.Contains(item); public bool ContainsKey(TKey key) - => ReadOnlyDictionary.ContainsKey(key); + => _builder.ContainsKey(key); public bool ContainsValue(TValue value) - { - return _dictionary.ContainsValue(value); - } + => _builder.ContainsValue(value); public Enumerator GetEnumerator() - => new(GetOrCreateMutableDictionary(), Enumerator.ReturnType.KeyValuePair); + => _builder.GetEnumerator(); public TValue? GetValueOrDefault(TKey key) - { - if (TryGetValue(key, out var value)) - return value; - - return default; - } + => _builder.GetValueOrDefault(key); public TValue GetValueOrDefault(TKey key, TValue defaultValue) - { - if (TryGetValue(key, out var value)) - return value; - - return defaultValue; - } + => _builder.GetValueOrDefault(key, defaultValue); public bool Remove(TKey key) - { - if (_mutableDictionary is null && !ContainsKey(key)) - return false; - - return GetOrCreateMutableDictionary().Remove(key); - } + => _builder.Remove(key); public bool Remove(KeyValuePair item) - { - if (!Contains(item)) - { - return false; - } - - GetOrCreateMutableDictionary().Remove(item.Key); - return true; - } + => _builder.Remove(item); public void RemoveRange(IEnumerable keys) - { - if (keys is null) - throw new ArgumentNullException(nameof(keys)); - - foreach (var key in keys) - { - Remove(key); - } - } + => _builder.RemoveRange(keys); public bool TryGetKey(TKey equalKey, out TKey actualKey) - { - foreach (var key in Keys) - { - if (KeyComparer.Equals(key, equalKey)) - { - actualKey = key; - return true; - } - } - - actualKey = equalKey; - return false; - } + => _builder.TryGetKey(equalKey, out actualKey); #pragma warning disable CS8767 // Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value) #pragma warning restore CS8767 // Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). - => ReadOnlyDictionary.TryGetValue(key, out value); + => _builder.TryGetValue(key, out value); public ImmutableSegmentedDictionary ToImmutable() - { - _dictionary = new ImmutableSegmentedDictionary(ReadOnlyDictionary); - _mutableDictionary = null; - return _dictionary; - } + => _builder.ToImmutable(); void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) - => ((ICollection>)ReadOnlyDictionary).CopyTo(array, arrayIndex); + => ICollectionCalls>.CopyTo(ref _builder, array, arrayIndex); IEnumerator> IEnumerable>.GetEnumerator() - => new Enumerator(GetOrCreateMutableDictionary(), Enumerator.ReturnType.KeyValuePair); + => IEnumerableCalls>.GetEnumerator(ref _builder); IEnumerator IEnumerable.GetEnumerator() - => new Enumerator(GetOrCreateMutableDictionary(), Enumerator.ReturnType.KeyValuePair); + => IEnumerableCalls.GetEnumerator(ref _builder); bool IDictionary.Contains(object key) - => ((IDictionary)ReadOnlyDictionary).Contains(key); + => IDictionaryCalls.Contains(ref _builder, key); void IDictionary.Add(object key, object? value) - => ((IDictionary)GetOrCreateMutableDictionary()).Add(key, value); + => IDictionaryCalls.Add(ref _builder, key, value); IDictionaryEnumerator IDictionary.GetEnumerator() - => new Enumerator(GetOrCreateMutableDictionary(), Enumerator.ReturnType.DictionaryEntry); + => IDictionaryCalls.GetEnumerator(ref _builder); void IDictionary.Remove(object key) - => ((IDictionary)GetOrCreateMutableDictionary()).Remove(key); + => IDictionaryCalls.Remove(ref _builder, key); void ICollection.CopyTo(Array array, int index) - => ((ICollection)ReadOnlyDictionary).CopyTo(array, index); + => ICollectionCalls.CopyTo(ref _builder, array, index); } } } diff --git a/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+ValueBuilder.cs b/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+ValueBuilder.cs new file mode 100644 index 0000000000000..3b7faa1d619ca --- /dev/null +++ b/src/Dependencies/Collections/ImmutableSegmentedDictionary`2+ValueBuilder.cs @@ -0,0 +1,259 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Microsoft.CodeAnalysis.Collections +{ + internal readonly partial struct ImmutableSegmentedDictionary + { + private struct ValueBuilder : IDictionary, IReadOnlyDictionary, IDictionary + { + /// + /// The immutable collection this builder is based on. + /// + private ImmutableSegmentedDictionary _dictionary; + + /// + /// The current mutable collection this builder is operating on. This field is initialized to a copy of + /// the first time a change is made. + /// + private SegmentedDictionary? _mutableDictionary; + + internal ValueBuilder(ImmutableSegmentedDictionary dictionary) + { + _dictionary = dictionary; + _mutableDictionary = null; + } + + public IEqualityComparer KeyComparer + { + readonly get + { + return ReadOnlyDictionary.Comparer; + } + + set + { + if (value is null) + throw new ArgumentNullException(nameof(value)); + + if (value != KeyComparer) + { + // Rewrite the mutable dictionary using a new comparer + var valuesToAdd = ReadOnlyDictionary; + _mutableDictionary = new SegmentedDictionary(value); + _dictionary = default; + AddRange(valuesToAdd); + } + } + } + + public readonly int Count => ReadOnlyDictionary.Count; + + internal readonly SegmentedDictionary ReadOnlyDictionary => _mutableDictionary ?? _dictionary._dictionary; + + readonly IEnumerable IReadOnlyDictionary.Keys => throw new NotSupportedException(); + + readonly IEnumerable IReadOnlyDictionary.Values => throw new NotSupportedException(); + + readonly ICollection IDictionary.Keys => throw new NotSupportedException(); + + readonly ICollection IDictionary.Values => throw new NotSupportedException(); + + readonly bool ICollection>.IsReadOnly => false; + + readonly ICollection IDictionary.Keys => throw new NotSupportedException(); + + readonly ICollection IDictionary.Values => throw new NotSupportedException(); + + readonly bool IDictionary.IsReadOnly => false; + + readonly bool IDictionary.IsFixedSize => false; + + readonly object ICollection.SyncRoot => throw new NotSupportedException(); + + readonly bool ICollection.IsSynchronized => false; + + public TValue this[TKey key] + { + readonly get => ReadOnlyDictionary[key]; + set => GetOrCreateMutableDictionary()[key] = value; + } + + object? IDictionary.this[object key] + { + readonly get => ((IDictionary)ReadOnlyDictionary)[key]; + set => ((IDictionary)GetOrCreateMutableDictionary())[key] = value; + } + + private SegmentedDictionary GetOrCreateMutableDictionary() + { + if (_mutableDictionary is null) + { + var originalDictionary = RoslynImmutableInterlocked.InterlockedExchange(ref _dictionary, default); + if (originalDictionary.IsDefault) + throw new InvalidOperationException($"Unexpected concurrent access to {GetType()}"); + + _mutableDictionary = new SegmentedDictionary(originalDictionary._dictionary, originalDictionary.KeyComparer); + } + + return _mutableDictionary; + } + + public void Add(TKey key, TValue value) + { + if (Contains(new KeyValuePair(key, value))) + return; + + GetOrCreateMutableDictionary().Add(key, value); + } + + public void Add(KeyValuePair item) + => Add(item.Key, item.Value); + + public void AddRange(IEnumerable> items) + { + if (items == null) + throw new ArgumentNullException(nameof(items)); + + foreach (var pair in items) + Add(pair.Key, pair.Value); + } + + public void Clear() + { + if (ReadOnlyDictionary.Count != 0) + { + if (_mutableDictionary is null) + { + _mutableDictionary = new SegmentedDictionary(KeyComparer); + _dictionary = default; + } + else + { + _mutableDictionary.Clear(); + } + } + } + + public readonly bool Contains(KeyValuePair item) + { + return TryGetValue(item.Key, out var value) + && EqualityComparer.Default.Equals(value, item.Value); + } + + public readonly bool ContainsKey(TKey key) + => ReadOnlyDictionary.ContainsKey(key); + + public readonly bool ContainsValue(TValue value) + => ReadOnlyDictionary.ContainsValue(value); + + public Enumerator GetEnumerator() + => new(GetOrCreateMutableDictionary(), Enumerator.ReturnType.KeyValuePair); + + public readonly TValue? GetValueOrDefault(TKey key) + { + if (TryGetValue(key, out var value)) + return value; + + return default; + } + + public readonly TValue GetValueOrDefault(TKey key, TValue defaultValue) + { + if (TryGetValue(key, out var value)) + return value; + + return defaultValue; + } + + public bool Remove(TKey key) + { + if (_mutableDictionary is null && !ContainsKey(key)) + return false; + + return GetOrCreateMutableDictionary().Remove(key); + } + + public bool Remove(KeyValuePair item) + { + if (!Contains(item)) + { + return false; + } + + GetOrCreateMutableDictionary().Remove(item.Key); + return true; + } + + public void RemoveRange(IEnumerable keys) + { + if (keys is null) + throw new ArgumentNullException(nameof(keys)); + + foreach (var key in keys) + { + Remove(key); + } + } + +#pragma warning disable IDE0251 // Make member 'readonly' (false positive: https://github.com/dotnet/roslyn/issues/72335) + public bool TryGetKey(TKey equalKey, out TKey actualKey) +#pragma warning restore IDE0251 // Make member 'readonly' + { + foreach (var pair in this) + { + if (KeyComparer.Equals(pair.Key, equalKey)) + { + actualKey = pair.Key; + return true; + } + } + + actualKey = equalKey; + return false; + } + +#pragma warning disable CS8767 // Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). + public readonly bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value) +#pragma warning restore CS8767 // Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). + => ReadOnlyDictionary.TryGetValue(key, out value); + + public ImmutableSegmentedDictionary ToImmutable() + { + _dictionary = new ImmutableSegmentedDictionary(ReadOnlyDictionary); + _mutableDictionary = null; + return _dictionary; + } + + readonly void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) + => ((ICollection>)ReadOnlyDictionary).CopyTo(array, arrayIndex); + + IEnumerator> IEnumerable>.GetEnumerator() + => new Enumerator(GetOrCreateMutableDictionary(), Enumerator.ReturnType.KeyValuePair); + + IEnumerator IEnumerable.GetEnumerator() + => new Enumerator(GetOrCreateMutableDictionary(), Enumerator.ReturnType.KeyValuePair); + + readonly bool IDictionary.Contains(object key) + => ((IDictionary)ReadOnlyDictionary).Contains(key); + + void IDictionary.Add(object key, object? value) + => ((IDictionary)GetOrCreateMutableDictionary()).Add(key, value); + + IDictionaryEnumerator IDictionary.GetEnumerator() + => new Enumerator(GetOrCreateMutableDictionary(), Enumerator.ReturnType.DictionaryEntry); + + void IDictionary.Remove(object key) + => ((IDictionary)GetOrCreateMutableDictionary()).Remove(key); + + readonly void ICollection.CopyTo(Array array, int index) + => ((ICollection)ReadOnlyDictionary).CopyTo(array, index); + } + } +} diff --git a/src/Dependencies/Collections/ImmutableSegmentedDictionary`2.cs b/src/Dependencies/Collections/ImmutableSegmentedDictionary`2.cs index 99d8a6ce511d7..bdcdcdddcf96a 100644 --- a/src/Dependencies/Collections/ImmutableSegmentedDictionary`2.cs +++ b/src/Dependencies/Collections/ImmutableSegmentedDictionary`2.cs @@ -147,9 +147,9 @@ public ImmutableSegmentedDictionary Add(TKey key, TValue value) if (self.Contains(new KeyValuePair(key, value))) return self; - var dictionary = new SegmentedDictionary(self._dictionary, self._dictionary.Comparer); - dictionary.Add(key, value); - return new ImmutableSegmentedDictionary(dictionary); + var builder = ToValueBuilder(); + builder.Add(key, value); + return builder.ToImmutable(); } public ImmutableSegmentedDictionary AddRange(IEnumerable> pairs) @@ -162,21 +162,9 @@ public ImmutableSegmentedDictionary AddRange(IEnumerable? dictionary = null; - foreach (var pair in pairs) - { - ICollection> collectionToCheck = dictionary ?? self._dictionary; - if (collectionToCheck.Contains(pair)) - continue; - - dictionary ??= new SegmentedDictionary(self._dictionary, self._dictionary.Comparer); - dictionary.Add(pair.Key, pair.Value); - } - - if (dictionary is null) - return self; - - return new ImmutableSegmentedDictionary(dictionary); + var builder = ToValueBuilder(); + builder.AddRange(pairs); + return builder.ToImmutable(); } public ImmutableSegmentedDictionary Clear() @@ -211,9 +199,9 @@ public ImmutableSegmentedDictionary Remove(TKey key) if (!self._dictionary.ContainsKey(key)) return self; - var dictionary = new SegmentedDictionary(self._dictionary, self._dictionary.Comparer); - dictionary.Remove(key); - return new ImmutableSegmentedDictionary(dictionary); + var builder = ToValueBuilder(); + builder.Remove(key); + return builder.ToImmutable(); } public ImmutableSegmentedDictionary RemoveRange(IEnumerable keys) @@ -221,7 +209,7 @@ public ImmutableSegmentedDictionary RemoveRange(IEnumerable if (keys is null) throw new ArgumentNullException(nameof(keys)); - var result = ToBuilder(); + var result = ToValueBuilder(); result.RemoveRange(keys); return result.ToImmutable(); } @@ -234,9 +222,9 @@ public ImmutableSegmentedDictionary SetItem(TKey key, TValue value return self; } - var dictionary = new SegmentedDictionary(self._dictionary, self._dictionary.Comparer); - dictionary[key] = value; - return new ImmutableSegmentedDictionary(dictionary); + var builder = ToValueBuilder(); + builder[key] = value; + return builder.ToImmutable(); } public ImmutableSegmentedDictionary SetItems(IEnumerable> items) @@ -244,7 +232,7 @@ public ImmutableSegmentedDictionary SetItems(IEnumerable WithComparer(IEqualityComparer public Builder ToBuilder() => new(this); + private ValueBuilder ToValueBuilder() + => new(this); + public override int GetHashCode() => _dictionary?.GetHashCode() ?? 0; diff --git a/src/Dependencies/Collections/Internal/IDictionaryCalls.cs b/src/Dependencies/Collections/Internal/IDictionaryCalls.cs new file mode 100644 index 0000000000000..79d95fd22ef6e --- /dev/null +++ b/src/Dependencies/Collections/Internal/IDictionaryCalls.cs @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; + +namespace Microsoft.CodeAnalysis.Collections.Internal +{ + /// + /// Provides static methods to invoke members on value types that explicitly implement the + /// member. + /// + /// + /// Normally, invocation of explicit interface members requires boxing or copying the value type, which is + /// especially problematic for operations that mutate the value. Invocation through these helpers behaves like a + /// normal call to an implicitly implemented member. + /// + internal static class IDictionaryCalls + { + public static bool IsFixedSize(ref TDictionary dictionary) + where TDictionary : IDictionary + => dictionary.IsFixedSize; + + public static bool IsReadOnly(ref TDictionary dictionary) + where TDictionary : IDictionary + => dictionary.IsReadOnly; + + public static object? GetItem(ref TDictionary dictionary, object key) + where TDictionary : IDictionary + => dictionary[key]; + + public static void SetItem(ref TDictionary dictionary, object key, object? value) + where TDictionary : IDictionary + => dictionary[key] = value; + + public static void Add(ref TDictionary dictionary, object key, object? value) + where TDictionary : IDictionary + => dictionary.Add(key, value); + + public static bool Contains(ref TDictionary dictionary, object key) + where TDictionary : IDictionary + => dictionary.Contains(key); + + public static void CopyTo(ref TDictionary dictionary, Array array, int index) + where TDictionary : IDictionary + => dictionary.CopyTo(array, index); + + public static IDictionaryEnumerator GetEnumerator(ref TDictionary dictionary) + where TDictionary : IDictionary + => dictionary.GetEnumerator(); + + public static void Remove(ref TDictionary dictionary, object key) + where TDictionary : IDictionary + => dictionary.Remove(key); + } +} diff --git a/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems b/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems index dbaab9715bd37..e312a04f0a72b 100644 --- a/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems +++ b/src/Dependencies/Collections/Microsoft.CodeAnalysis.Collections.projitems @@ -18,6 +18,7 @@ + @@ -40,6 +41,7 @@ + From 9e2a7f0cf391c767bb34d94e50c01290edf4d6a9 Mon Sep 17 00:00:00 2001 From: sdelarosbil Date: Tue, 19 Mar 2024 13:55:19 -0400 Subject: [PATCH 06/94] Use SyntaxFacts to check if the type operation is predefined --- .../Core/Extensions/SyntaxGeneratorExtensions_Negate.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index 01b69fa27c64d..2a32997df7af5 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -167,7 +167,8 @@ private static SyntaxNode GetNegationOfBinaryExpression( // Then there is an ambiguity between the type C and the local named C. // To address this, we use an expression with the fully qualified type name which the simplifier // will shorten to the shortest possible without ambiguity - if (operation is IIsTypeOperation { TypeOperand.SpecialType: SpecialType.None } isTypeOperation && + if (!syntaxFacts.IsPredefinedType(rightOperand) && + operation is IIsTypeOperation isTypeOperation && syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) { var typeNode = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); From 212e46138410c0230e5798f173fadc9ba74de984 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 19 Mar 2024 12:31:20 -0700 Subject: [PATCH 07/94] Update and add tests --- .../CSharpUseNotPatternTests.cs | 99 +++++++++++++++ .../Services/SyntaxFacts/CSharpSyntaxFacts.cs | 6 + .../Core/Services/SyntaxFacts/ISyntaxFacts.cs | 2 + .../SyntaxFacts/VisualBasicSyntaxFacts.vb | 8 ++ .../SyntaxGeneratorExtensions_Negate.cs | 120 +++++++++--------- 5 files changed, 176 insertions(+), 59 deletions(-) diff --git a/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs b/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs index 670fadbda1249..6cfbe14ab50e7 100644 --- a/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs +++ b/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs @@ -50,6 +50,37 @@ void M(object x) }.RunAsync(); } + [Fact] + public async Task BinaryIsExpression2() + { + await new VerifyCS.Test + { + TestCode = """ + class C + { + void M(object x) + { + if (!(x [|is|] string /*trailing*/)) + { + } + } + } + """, + FixedCode = """ + class C + { + void M(object x) + { + if (x is not string /*trailing*/) + { + } + } + } + """, + LanguageVersion = LanguageVersion.CSharp9, + }.RunAsync(); + } + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/50690")] public async Task ConstantPattern() { @@ -217,6 +248,43 @@ public static void Main() }.RunAsync(); } + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72370")] + public async Task UseNotPattern3() + { + await new VerifyCS.Test + { + TestCode = """ + public class Program + { + public class C + { + } + public static void Main(object O) + { + if (!(O [|is|] C)) + { + } + } + } + """, + FixedCode = """ + public class Program + { + public class C + { + } + public static void Main(object O) + { + if (O is not C) + { + } + } + } + """, + LanguageVersion = LanguageVersion.CSharp9, + }.RunAsync(); + } + [Fact] public async Task UnavailableInCSharp8() { @@ -268,6 +336,37 @@ void M(object x) }.RunAsync(); } + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/50690")] + public async Task BinaryIsObject2() + { + await new VerifyCS.Test + { + TestCode = """ + class C + { + void M(object x) + { + if (!(x [|is|] object /*trailing*/)) + { + } + } + } + """, + FixedCode = """ + class C + { + void M(object x) + { + if (x is null /*trailing*/) + { + } + } + } + """, + LanguageVersion = LanguageVersion.CSharp9, + }.RunAsync(); + } + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/68784")] public async Task NotInExpressionTree() { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs index 05f48a4c31a89..c755f94409b07 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs @@ -1552,6 +1552,12 @@ public bool IsMethodDeclaration([NotNullWhen(true)] SyntaxNode? node) public bool IsSimpleName([NotNullWhen(true)] SyntaxNode? node) => node is SimpleNameSyntax; + public bool IsAnyName([NotNullWhen(true)] SyntaxNode? node) + => node is NameSyntax; + + public bool IsAnyType([NotNullWhen(true)] SyntaxNode? node) + => node is TypeSyntax; + public bool IsNamedMemberInitializer([NotNullWhen(true)] SyntaxNode? node) => node is AssignmentExpressionSyntax(SyntaxKind.SimpleAssignmentExpression) { Left: IdentifierNameSyntax }; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs index 9527a41fdad19..d894dd0069a2a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs @@ -499,6 +499,8 @@ void GetPartsOfTupleExpression(SyntaxNode node, bool IsMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); bool IsMethodDeclaration([NotNullWhen(true)] SyntaxNode? node); bool IsSimpleName([NotNullWhen(true)] SyntaxNode? node); + bool IsAnyName([NotNullWhen(true)] SyntaxNode? node); + bool IsAnyType([NotNullWhen(true)] SyntaxNode? node); bool IsNamedMemberInitializer([NotNullWhen(true)] SyntaxNode? node); bool IsElementAccessInitializer([NotNullWhen(true)] SyntaxNode? node); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb index 0dd63172c64a2..d0a7eaa806e90 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb @@ -1756,6 +1756,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageService Return TypeOf node Is SimpleNameSyntax End Function + Public Function IsAnyName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyName + Return TypeOf node Is NameSyntax + End Function + + Public Function IsAnyType(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyType + Return TypeOf node Is TypeSyntax + End Function + Public Function IsNamedMemberInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNamedMemberInitializer Return TypeOf node Is NamedFieldInitializerSyntax End Function diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index 2a32997df7af5..c5d9f2d7809f2 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Diagnostics; using System.Threading; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.LanguageService; @@ -147,75 +148,76 @@ private static SyntaxNode GetNegationOfBinaryExpression( syntaxFacts.GetPartsOfBinaryExpression(expressionNode, out var leftOperand, out var operatorToken, out var rightOperand); var operation = semanticModel.GetOperation(expressionNode, cancellationToken); - if (operation is not IBinaryOperation binaryOperation) + if (operation is IBinaryOperation binaryOperation) { - if (syntaxFacts.IsIsTypeExpression(expressionNode)) + if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) + return generator.LogicalNotExpression(expressionNode); + + // Lifted relational operators return false if either operand is null. + // Inverting the operator fails to invert the behavior when an operand is null. + if (binaryOperation.IsLifted + && binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or + BinaryOperatorKind.LessThanOrEqual or + BinaryOperatorKind.GreaterThan or + BinaryOperatorKind.GreaterThanOrEqual) { - // `is object` -> `is null` - if (syntaxFacts.IsPredefinedType(rightOperand, PredefinedType.Object) && - generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) - { - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression())); - } - - // With a not pattern, it is possible to have an ambiguity between a type name or a local identifier. - // For example, if a class is named C and we have: - // C C = new(); - // object O = C; - // if (O is not C) - // ... - // Then there is an ambiguity between the type C and the local named C. - // To address this, we use an expression with the fully qualified type name which the simplifier - // will shorten to the shortest possible without ambiguity - if (!syntaxFacts.IsPredefinedType(rightOperand) && - operation is IIsTypeOperation isTypeOperation && - syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) - { - var typeNode = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.ConstantPattern(typeNode))); - } - - // `is y` -> `is not y` - if (syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.TypePattern(rightOperand))); + return generator.LogicalNotExpression(expressionNode); } - // Apply the logical not operator if it is not a binary operation. - return generator.LogicalNotExpression(expressionNode); - } + if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or + BinaryOperatorKind.And or + BinaryOperatorKind.ConditionalAnd or + BinaryOperatorKind.ConditionalOr) + { + leftOperand = generator.Negate(generatorInternal, leftOperand, semanticModel, cancellationToken); + rightOperand = generator.Negate(generatorInternal, rightOperand, semanticModel, cancellationToken); + } - if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) - return generator.LogicalNotExpression(expressionNode); + var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals + ? generatorInternal.NegateEquality(generator, expressionNode, leftOperand, negatedKind, rightOperand) + : NegateRelational(generator, binaryOperation, leftOperand, negatedKind, rightOperand); + newBinaryExpressionSyntax = newBinaryExpressionSyntax.WithTriviaFrom(expressionNode); - // Lifted relational operators return false if either operand is null. - // Inverting the operator fails to invert the behavior when an operand is null. - if (binaryOperation.IsLifted - && binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or - BinaryOperatorKind.LessThanOrEqual or - BinaryOperatorKind.GreaterThan or - BinaryOperatorKind.GreaterThanOrEqual) - { - return generator.LogicalNotExpression(expressionNode); + var newToken = syntaxFacts.GetOperatorTokenOfBinaryExpression(newBinaryExpressionSyntax); + return newBinaryExpressionSyntax.ReplaceToken( + newToken, + newToken.WithTriviaFrom(operatorToken)); } - - if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or - BinaryOperatorKind.And or - BinaryOperatorKind.ConditionalAnd or - BinaryOperatorKind.ConditionalOr) + else if (operation is IIsTypeOperation isTypeOperation && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) { - leftOperand = generator.Negate(generatorInternal, leftOperand, semanticModel, cancellationToken); - rightOperand = generator.Negate(generatorInternal, rightOperand, semanticModel, cancellationToken); - } + // `is object` -> `is null` + if (isTypeOperation.TypeOperand.SpecialType is SpecialType.System_Object) + return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression().WithTriviaFrom(rightOperand))); + + // `is y` -> `is not y` + if (syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) + { + SyntaxNode innerPattern; + if (syntaxFacts.IsAnyName(rightOperand)) + { + // For named types, we need to convert to a constant expression (where the named type becomes a member + // access expression). For other types (predefined, arrays, etc) we can keep this as a type pattern. + // For example: `x is int` can just become `x is not int` where that's a type pattern. But `x is Y` + // will need to become `x is not Y` where that's a constant pattern instead. + var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); + innerPattern = syntaxFacts.IsAnyType(typeExpression) && !syntaxFacts.IsAnyName(typeExpression) + ? generatorInternal.TypePattern(typeExpression) + : generatorInternal.ConstantPattern(typeExpression); + } + else + { + // original form was already not a name (like a predefined type, or array type, etc.). Can just + // use as is as a type pattern. + Debug.Assert(syntaxFacts.IsAnyType(rightOperand)); + innerPattern = generatorInternal.TypePattern(rightOperand); + } - var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals - ? generatorInternal.NegateEquality(generator, expressionNode, leftOperand, negatedKind, rightOperand) - : NegateRelational(generator, binaryOperation, leftOperand, negatedKind, rightOperand); - newBinaryExpressionSyntax = newBinaryExpressionSyntax.WithTriviaFrom(expressionNode); + return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(innerPattern.WithTriviaFrom(rightOperand))); + } + } - var newToken = syntaxFacts.GetOperatorTokenOfBinaryExpression(newBinaryExpressionSyntax); - return newBinaryExpressionSyntax.ReplaceToken( - newToken, - newToken.WithTriviaFrom(operatorToken)); + // Apply the logical not operator if it is not a binary operation and also doesn't support patterns. + return generator.LogicalNotExpression(expressionNode); } private static SyntaxNode GetNegationOfBinaryPattern( From be90730f6b72bbef19126caacf649694f459728c Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 19 Mar 2024 12:45:40 -0700 Subject: [PATCH 08/94] Add test --- .../CSharpUseNotPatternTests.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs b/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs index 6cfbe14ab50e7..97c6ac0dd572c 100644 --- a/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs +++ b/src/Analyzers/CSharp/Tests/UsePatternMatching/CSharpUseNotPatternTests.cs @@ -367,6 +367,41 @@ void M(object x) }.RunAsync(); } + [Fact] + public async Task BinaryIsObject3() + { + await new VerifyCS.Test + { + TestCode = """ + using System; + + class C + { + void M(object x) + { + if (!(x [|is|] Object)) + { + } + } + } + """, + FixedCode = """ + using System; + + class C + { + void M(object x) + { + if (x is null) + { + } + } + } + """, + LanguageVersion = LanguageVersion.CSharp9, + }.RunAsync(); + } + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/68784")] public async Task NotInExpressionTree() { From f6667af2a4294199d3e0004547e9ad7bc4756fb4 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 19 Mar 2024 14:28:53 -0700 Subject: [PATCH 09/94] tweak --- .../SyntaxGeneratorExtensions_Negate.cs | 60 +++++++++++-------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index c5d9f2d7809f2..dd14a12a1bc21 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -183,36 +183,44 @@ BinaryOperatorKind.ConditionalAnd or newToken, newToken.WithTriviaFrom(operatorToken)); } - else if (operation is IIsTypeOperation isTypeOperation && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) + else if (syntaxFacts.IsIsTypeExpression(expressionNode) && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) { - // `is object` -> `is null` - if (isTypeOperation.TypeOperand.SpecialType is SpecialType.System_Object) - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression().WithTriviaFrom(rightOperand))); - - // `is y` -> `is not y` - if (syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) + if (operation is IIsTypeOperation isTypeOperation) { - SyntaxNode innerPattern; - if (syntaxFacts.IsAnyName(rightOperand)) - { - // For named types, we need to convert to a constant expression (where the named type becomes a member - // access expression). For other types (predefined, arrays, etc) we can keep this as a type pattern. - // For example: `x is int` can just become `x is not int` where that's a type pattern. But `x is Y` - // will need to become `x is not Y` where that's a constant pattern instead. - var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); - innerPattern = syntaxFacts.IsAnyType(typeExpression) && !syntaxFacts.IsAnyName(typeExpression) - ? generatorInternal.TypePattern(typeExpression) - : generatorInternal.ConstantPattern(typeExpression); - } - else + // `is object` -> `is null` + if (isTypeOperation.TypeOperand.SpecialType is SpecialType.System_Object) + return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression().WithTriviaFrom(rightOperand))); + + // `is y` -> `is not y` + if (syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) { - // original form was already not a name (like a predefined type, or array type, etc.). Can just - // use as is as a type pattern. - Debug.Assert(syntaxFacts.IsAnyType(rightOperand)); - innerPattern = generatorInternal.TypePattern(rightOperand); - } + SyntaxNode innerPattern; + if (syntaxFacts.IsAnyName(rightOperand)) + { + // For named types, we need to convert to a constant expression (where the named type becomes a member + // access expression). For other types (predefined, arrays, etc) we can keep this as a type pattern. + // For example: `x is int` can just become `x is not int` where that's a type pattern. But `x is Y` + // will need to become `x is not Y` where that's a constant pattern instead. + var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); + innerPattern = syntaxFacts.IsAnyType(typeExpression) && !syntaxFacts.IsAnyName(typeExpression) + ? generatorInternal.TypePattern(typeExpression) + : generatorInternal.ConstantPattern(typeExpression); + } + else + { + // original form was already not a name (like a predefined type, or array type, etc.). Can just + // use as is as a type pattern. + Debug.Assert(syntaxFacts.IsAnyType(rightOperand)); + innerPattern = generatorInternal.TypePattern(rightOperand); + } - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(innerPattern.WithTriviaFrom(rightOperand))); + return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(innerPattern.WithTriviaFrom(rightOperand))); + } + } + else + { + return generatorInternal.IsPatternExpression( + leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.ConstantPattern(rightOperand))); } } From 50d4ad58d5c6962f3909fa6d30321df192800a89 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 19 Mar 2024 14:35:10 -0700 Subject: [PATCH 10/94] Simplify and share --- .../SyntaxGeneratorExtensions_Negate.cs | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index dd14a12a1bc21..6c5048f7773e3 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -183,49 +183,51 @@ BinaryOperatorKind.ConditionalAnd or newToken, newToken.WithTriviaFrom(operatorToken)); } - else if (syntaxFacts.IsIsTypeExpression(expressionNode) && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) + else if (operation is IIsTypeOperation { TypeOperand.SpecialType: SpecialType.System_Object } && generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options)) { + // `is object` -> `is null` + return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression().WithTriviaFrom(rightOperand))); + } + else if (syntaxFacts.IsIsTypeExpression(expressionNode) && syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) + { + // `is y` -> `is not y` + SyntaxNode innerPattern; if (operation is IIsTypeOperation isTypeOperation) { - // `is object` -> `is null` - if (isTypeOperation.TypeOperand.SpecialType is SpecialType.System_Object) - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.ConstantPattern(generator.NullLiteralExpression().WithTriviaFrom(rightOperand))); - - // `is y` -> `is not y` - if (syntaxFacts.SupportsNotPattern(semanticModel.SyntaxTree.Options)) + if (syntaxFacts.IsAnyName(rightOperand)) { - SyntaxNode innerPattern; - if (syntaxFacts.IsAnyName(rightOperand)) - { - // For named types, we need to convert to a constant expression (where the named type becomes a member - // access expression). For other types (predefined, arrays, etc) we can keep this as a type pattern. - // For example: `x is int` can just become `x is not int` where that's a type pattern. But `x is Y` - // will need to become `x is not Y` where that's a constant pattern instead. - var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); - innerPattern = syntaxFacts.IsAnyType(typeExpression) && !syntaxFacts.IsAnyName(typeExpression) - ? generatorInternal.TypePattern(typeExpression) - : generatorInternal.ConstantPattern(typeExpression); - } - else - { - // original form was already not a name (like a predefined type, or array type, etc.). Can just - // use as is as a type pattern. - Debug.Assert(syntaxFacts.IsAnyType(rightOperand)); - innerPattern = generatorInternal.TypePattern(rightOperand); - } - - return generatorInternal.IsPatternExpression(leftOperand, operatorToken, generatorInternal.NotPattern(innerPattern.WithTriviaFrom(rightOperand))); + // For named types, we need to convert to a constant expression (where the named type becomes a member + // access expression). For other types (predefined, arrays, etc) we can keep this as a type pattern. + // For example: `x is int` can just become `x is not int` where that's a type pattern. But `x is Y` + // will need to become `x is not Y` where that's a constant pattern instead. + var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); + innerPattern = syntaxFacts.IsAnyType(typeExpression) && !syntaxFacts.IsAnyName(typeExpression) + ? generatorInternal.TypePattern(typeExpression) + : generatorInternal.ConstantPattern(typeExpression); + } + else + { + // original form was already not a name (like a predefined type, or array type, etc.). Can just + // use as is as a type pattern. + Debug.Assert(syntaxFacts.IsAnyType(rightOperand)); + innerPattern = generatorInternal.TypePattern(rightOperand); } } else { - return generatorInternal.IsPatternExpression( - leftOperand, operatorToken, generatorInternal.NotPattern(generatorInternal.ConstantPattern(rightOperand))); + innerPattern = generatorInternal.ConstantPattern(rightOperand); } - } - // Apply the logical not operator if it is not a binary operation and also doesn't support patterns. - return generator.LogicalNotExpression(expressionNode); + return generatorInternal.IsPatternExpression( + leftOperand, + operatorToken, + generatorInternal.NotPattern(innerPattern.WithTriviaFrom(rightOperand))); + } + else + { + // Apply the logical not operator if it is not a binary operation and also doesn't support patterns. + return generator.LogicalNotExpression(expressionNode); + } } private static SyntaxNode GetNegationOfBinaryPattern( From af54a87dde229ab75c510e5c61293aea7ccbb791 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 19 Mar 2024 14:36:52 -0700 Subject: [PATCH 11/94] remove redundant code --- .../Core/Extensions/SyntaxGeneratorExtensions_Negate.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs index 6c5048f7773e3..3e342e41ce85f 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/SyntaxGeneratorExtensions_Negate.cs @@ -209,7 +209,6 @@ BinaryOperatorKind.ConditionalAnd or { // original form was already not a name (like a predefined type, or array type, etc.). Can just // use as is as a type pattern. - Debug.Assert(syntaxFacts.IsAnyType(rightOperand)); innerPattern = generatorInternal.TypePattern(rightOperand); } } From 5bd9f2c4a97fd0ae74ddec3e01b05a2c51d3248b Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 11:22:10 -0700 Subject: [PATCH 12/94] Do not include privates when emitting skeleton references --- ...lutionCompilationState.SkeletonReferenceCache.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.SkeletonReferenceCache.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.SkeletonReferenceCache.cs index 85b47c5e21a74..f0e1ffc395db2 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.SkeletonReferenceCache.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.SkeletonReferenceCache.cs @@ -64,7 +64,18 @@ internal partial class SolutionCompilationState [NonCopyable] private struct SkeletonReferenceCache { - private static readonly EmitOptions s_metadataOnlyEmitOptions = new(metadataOnly: true); + /// + /// We don't want to include private members for several reasons. First, it provides more opportunity to fail + /// to generate the skeleton reference. Second, it adds much more perf cost having to bind and emit all those + /// members. Finally, those members serve no purpose as within the IDE we don't even load privates from metadata + /// in our compilations. So this information doesn't even end up supporting any scenarios. Note: Due to not + /// loading privates, it means that if a cross language call references something private, you'll get an error, + /// but go-to-def won't work. That not ideal, but not the end of the world. And the cost needed to support + /// that working is simply too high (both on emit and on load) to be worthwhile. + /// + private static readonly EmitOptions s_metadataOnlyEmitOptions = new( + metadataOnly: true, + includePrivateMembers: false); /// /// Lock around and to ensure they are updated/read From a494b55ef483c71940f84dff4b3d06eb9e14044e Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 11:48:52 -0700 Subject: [PATCH 13/94] Remove unnecessary component load --- src/VisualStudio/Core/Def/RoslynPackage.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/VisualStudio/Core/Def/RoslynPackage.cs b/src/VisualStudio/Core/Def/RoslynPackage.cs index 0792b90a397e3..9f14f40d824f8 100644 --- a/src/VisualStudio/Core/Def/RoslynPackage.cs +++ b/src/VisualStudio/Core/Def/RoslynPackage.cs @@ -214,7 +214,6 @@ protected override async Task LoadComponentsAsync(CancellationToken cancellation { await TaskScheduler.Default; - await GetServiceAsync(typeof(SVsTaskStatusCenterService)).ConfigureAwait(false); await GetServiceAsync(typeof(SVsErrorList)).ConfigureAwait(false); await GetServiceAsync(typeof(SVsSolution)).ConfigureAwait(false); await GetServiceAsync(typeof(SVsShell)).ConfigureAwait(false); From a245f5741770777828143a719a0e4abe62d1973d Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:05:52 -0700 Subject: [PATCH 14/94] Remove unused resource string --- src/EditorFeatures/Core/EditorFeaturesResources.resx | 3 --- src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf | 5 ----- .../Core/xlf/EditorFeaturesResources.pt-BR.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf | 5 ----- src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf | 5 ----- .../Core/xlf/EditorFeaturesResources.zh-Hans.xlf | 5 ----- .../Core/xlf/EditorFeaturesResources.zh-Hant.xlf | 5 ----- 14 files changed, 68 deletions(-) diff --git a/src/EditorFeatures/Core/EditorFeaturesResources.resx b/src/EditorFeatures/Core/EditorFeaturesResources.resx index 2d877d8f36b63..18a5e9fae7719 100644 --- a/src/EditorFeatures/Core/EditorFeaturesResources.resx +++ b/src/EditorFeatures/Core/EditorFeaturesResources.resx @@ -201,9 +201,6 @@ XML Doc Comments - Attribute Value - - Unnecessary Code - Rude Edit diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf index 90353e934245c..a2d3abef2da31 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf @@ -577,11 +577,6 @@ Komentáře XML – hodnota atributu - - Unnecessary Code - Nepotřebný kód - - Rude Edit Hrubá úprava diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf index 3f937d5313f2a..66fbb54125073 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf @@ -577,11 +577,6 @@ XML-Dok-Kommentare - Attributwert - - Unnecessary Code - Nicht benötigter Code - - Rude Edit Nicht unterstützte Bearbeitung diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf index d7e0e1cb2ad2b..335762e94b21a 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf @@ -577,11 +577,6 @@ Comentarios de documentación XML: valor de atributo - - Unnecessary Code - Código innecesario - - Rude Edit Edición superficial diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf index d50d64846272a..d26a192ed972f 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf @@ -577,11 +577,6 @@ Commentaires documentation XML - Valeur d'attribut - - Unnecessary Code - Code inutile - - Rude Edit Modification non applicable diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf index a53427fb18c62..6b4f7bad71393 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf @@ -577,11 +577,6 @@ Commenti in formato documentazione XML - Valore attributo - - Unnecessary Code - Codice non necessario - - Rude Edit Modifica non applicabile al momento diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf index c54c236249ae7..859f844128aae 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf @@ -577,11 +577,6 @@ XML ドキュメント コメント - 属性値 - - Unnecessary Code - 不要なコード - - Rude Edit Rude 編集 diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf index 62f3425740bc0..09260543c02d7 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf @@ -577,11 +577,6 @@ XML 문서 주석 - 특성 값 - - Unnecessary Code - 불필요한 코드 - - Rude Edit 편집 다시 실행 diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf index ce4b6c7b5dbe8..21935f43e04d2 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf @@ -577,11 +577,6 @@ Komentarze dokumentacji XML — wartość atrybutu - - Unnecessary Code - Zbędny kod - - Rude Edit Edycja blokująca diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf index d5e592f61c4cb..ecd4d11e8dae9 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf @@ -577,11 +577,6 @@ Comentário da documentação XML - Valor de Atributo - - Unnecessary Code - Código Desnecessário - - Rude Edit Edição Rudimentar diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf index b25c06815fb77..fa06f552de4dc 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf @@ -577,11 +577,6 @@ Комментарии XML Doc — значения атрибутов - - Unnecessary Code - Ненужный код - - Rude Edit Грубая редакция diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf index 324653318e76e..8e9b82435743d 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf @@ -577,11 +577,6 @@ XML Belge Açıklamaları - Öznitelik Değeri - - Unnecessary Code - Gereksiz Kod - - Rude Edit İşlenmemiş Düzenleme diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf index 50f26f9d2b707..5afdf5e72fab5 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf @@ -577,11 +577,6 @@ XML 文档注释 - 属性值 - - Unnecessary Code - 不必要的代码 - - Rude Edit 原始编辑 diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf index 16545b566e995..b444b34bd8de7 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf @@ -577,11 +577,6 @@ XML 文件註解 - 屬性值 - - Unnecessary Code - 不需要的程式碼 - - Rude Edit 粗略編輯 From d6a89a4663b69bcf01b463457f20e3dbd32e3d1a Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:15:03 -0700 Subject: [PATCH 15/94] Remove unused resource string --- .../Core/EditorFeaturesResources.resx | 138 ----------- .../Core/xlf/EditorFeaturesResources.cs.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.de.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.es.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.fr.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.it.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.ja.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.ko.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.pl.xlf | 230 ------------------ .../xlf/EditorFeaturesResources.pt-BR.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.ru.xlf | 230 ------------------ .../Core/xlf/EditorFeaturesResources.tr.xlf | 230 ------------------ .../xlf/EditorFeaturesResources.zh-Hans.xlf | 230 ------------------ .../xlf/EditorFeaturesResources.zh-Hant.xlf | 230 ------------------ 14 files changed, 3128 deletions(-) diff --git a/src/EditorFeatures/Core/EditorFeaturesResources.resx b/src/EditorFeatures/Core/EditorFeaturesResources.resx index 18a5e9fae7719..b54e034e34b71 100644 --- a/src/EditorFeatures/Core/EditorFeaturesResources.resx +++ b/src/EditorFeatures/Core/EditorFeaturesResources.resx @@ -219,9 +219,6 @@ {0} unresolvable conflict(s) - - Applying "{0}"... - Adding '{0}' to '{1}' with content: @@ -255,9 +252,6 @@ Encapsulate Field - - Applying "Encapsulate Field" refactoring... - Please select the definition of the field to encapsulate. @@ -273,9 +267,6 @@ No information found. - - No usages found. - Implements @@ -288,54 +279,12 @@ Overridden By - - Directly Called In - - - Indirectly Called In - - - Called In - - - Referenced In - No references found. - - No derived types found. - - - No implementations found. - - - {0} - (Line {1}) - - - Class Parts - - - Struct Parts - - - Interface Parts - - - Type Parts - Inherits - - Inherited By - - - Already tracking document with identical key - - - document is not currently being tracked - Computing Rename information... @@ -366,18 +315,9 @@ Automatically completing... - - Automatic Pair Completion - An active inline rename session is still active. Complete it before starting a new one. - - The buffer is not part of a workspace. - - - The token is not contained in the workspace. - You cannot rename this element because it is contained in a read-only file. @@ -390,18 +330,9 @@ Refreshing navigation bars... - - Format Token - Find References - - Finding references... - - - Finding references of "{0}"... - Comment Selection @@ -429,18 +360,12 @@ Applying "Extract Method" refactoring... - - Format Document - Formatting document... Formatting - - Format Selection - Formatting currently selected text... @@ -468,9 +393,6 @@ Inline Rename Fixup - - Inline Rename Resolved Conflict - Inline Rename @@ -480,9 +402,6 @@ Start Rename - - Display conflict resolutions - Finding token to rename... @@ -507,21 +426,9 @@ Rename: {0} - - Light bulb session is already dismissed. - - - Automatic Pair Completion End Point Marker Color - Engine must be attached to an Interactive Window. - - Changes the current prompt settings. - - - Unexpected text: '{0}' - The triggerSpan is not included in the given workspace. @@ -531,9 +438,6 @@ The transaction is already complete. - - Not a source error, line/column unavailable - Can't compare positions from different text snapshots @@ -582,9 +486,6 @@ Preview Changes - - Format Paste - Formatting pasted text... @@ -625,9 +526,6 @@ Do you want to proceed? Calls To Interface Implementation '{0}' - - Computing Call Hierarchy Information - Implements '{0}' @@ -658,18 +556,12 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - Rename Tracking Removing '{0}' from '{1}' with content: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - Brace Completion @@ -712,9 +604,6 @@ Do you want to proceed? Navigating... - - Suggestion ellipses (…) - '{0}' declarations @@ -737,9 +626,6 @@ Do you want to proceed? Comment/Uncomment Selection - - Code Completion - Execute In Interactive @@ -767,30 +653,12 @@ Do you want to proceed? Signature Help - - Smart Token Formatter - - - Code cleanup is not configured - - - Format Document performed additional cleanup - - - Configure it now - - - Do not show this message again - Applying changes String - Escape Character - - Change configuration - Paste Tracking @@ -903,12 +771,6 @@ Do you want to proceed? Get help for '{0}' - - Gathering Suggestions - '{0}' - - - Gathering Suggestions - Waiting for the solution to fully load - Reassigned variable diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf index a2d3abef2da31..3c299d6a5a63f 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf @@ -17,36 +17,16 @@ Nejde navigovat k symbolu pod stříškou. - - Change configuration - Změnit konfiguraci - - - - Code cleanup is not configured - Vyčištění kódu není nakonfigurované. - - Computing 'Encapsulate Field' information Výpočet informací Encapsulate Field - - Configure it now - Nakonfigurovat teď - - Do not prefer 'this.' or 'Me.' Nepreferovat this. ani Me. - - Do not show this message again - Tuto zprávu už příště nezobrazovat - - Do you still want to proceed? This may produce broken code. Chcete přesto pokračovat? Výsledkem může být poškozený kód. @@ -77,26 +57,11 @@ Filtr Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - Příkaz Formátovat dokument provedl další čištění. - - Get help for '{0}' Získat nápovědu pro: {0} - - Gathering Suggestions - '{0}' - Shromažďují se návrhy – {0}. - - - - Gathering Suggestions - Waiting for the solution to fully load - Shromažďují se návrhy – čeká se na úplné načtení řešení. - - Go To Base Přejít na základní typ @@ -632,11 +597,6 @@ Počet nevyřešených konfliktů: {0} - - Applying "{0}"... - Použije se {0}... - - Adding '{0}' to '{1}' with content: Přidává se {0} do {1} s obsahem: @@ -692,11 +652,6 @@ Zapouzdřit pole - - Applying "Encapsulate Field" refactoring... - Použije se refaktoring Zapouzdřit pole... - - Please select the definition of the field to encapsulate. Vyberte prosím definici pole k zapouzdření. @@ -722,11 +677,6 @@ Nenašly se žádné informace. - - No usages found. - Nenašla se použití. - - Implements Implementuje @@ -747,86 +697,16 @@ Přepsáno čím: - - Directly Called In - Přímé vyvolání - - - - Indirectly Called In - Nepřímé vyvolání - - - - Called In - Vyvolání - - - - Referenced In - Odkazuje: - - No references found. Nenašly se žádné odkazy. - - No derived types found. - Nenašly se žádné odvozené typy. - - - - No implementations found. - Nenašly se žádné implementace. - - - - {0} - (Line {1}) - {0} – (řádek {1}) - - - - Class Parts - Části třídy - - - - Struct Parts - Části struktury - - - - Interface Parts - Části rozhraní - - - - Type Parts - Části typu - - Inherits Dědí - - Inherited By - Zdědil: - - - - Already tracking document with identical key - Už se sleduje dokument se shodným klíčem. - - - - document is not currently being tracked - Dokument se aktuálně nesleduje. - - Computing Rename information... Vypočítávají se informace o přejmenování... @@ -882,26 +762,11 @@ Automaticky se dokončuje... - - Automatic Pair Completion - Automatické dokončování párů - - An active inline rename session is still active. Complete it before starting a new one. Současná relace přejmenování na řádku je pořád aktivní. Než začnete novou, dokončete ji. - - The buffer is not part of a workspace. - Vyrovnávací paměť není součástí pracovního prostoru. - - - - The token is not contained in the workspace. - Token není obsažený v pracovním prostoru. - - Navigation Bars Navigační panely @@ -912,26 +777,11 @@ Aktualizují se navigační panely... - - Format Token - Formátovat token - - Find References Najít odkazy - - Finding references... - Hledají se odkazy... - - - - Finding references of "{0}"... - Hledají se odkazy pro {0}... - - Comment Selection Výběr komentáře @@ -977,11 +827,6 @@ Použije se refaktoring Extrahovat metodu... - - Format Document - Formátovat dokument - - Formatting document... Formátuje se dokument... @@ -992,11 +837,6 @@ Formátování - - Format Selection - Formátovat výběr - - Formatting currently selected text... Formátuje se aktuálně vybraný text... @@ -1037,11 +877,6 @@ Oprava přejmenování na řádku - - Inline Rename Resolved Conflict - Vyřešený konflikt při přejmenování na řádku - - Inline Rename Přejmenování na řádku @@ -1057,11 +892,6 @@ Začít přejmenování - - Display conflict resolutions - Zobrazit řešení konfliktů - - Finding token to rename... Hledá se token k přejmenování... @@ -1102,31 +932,11 @@ Přejmenovat: {0} - - Light bulb session is already dismissed. - Relace pro návrhy je už zrušená. - - - - Automatic Pair Completion End Point Marker Color - Automatické dokončování párů – barva značky koncového bodu - - Engine must be attached to an Interactive Window. Stroj musí být připojený k oknu Interactive. - - Changes the current prompt settings. - Změní aktuální nastavení výzev. - - - - Unexpected text: '{0}' - Neočekávaný text: {0} - - The triggerSpan is not included in the given workspace. triggerSpan není obsažený v pracovním prostoru. @@ -1142,11 +952,6 @@ Transakce je už dokončená. - - Not a source error, line/column unavailable - Není chyba zdroje; nedostupný řádek/sloupec. - - Can't compare positions from different text snapshots Nejde porovnat pozice z různých textových snímků. @@ -1227,11 +1032,6 @@ Náhled změn - - Format Paste - Vložit formát - - Formatting pasted text... Formátuje se vložený text... @@ -1289,11 +1089,6 @@ Chcete pokračovat? Volání implementace rozhraní '{0}' - - Computing Call Hierarchy Information - Informace o vypočítání hierarchie volání - - Implements '{0}' Implementuje '{0}' @@ -1344,11 +1139,6 @@ Chcete pokračovat? IntelliSense - - IntelliSense Commit Formatting - Potvrzení formátování IntelliSense - - Rename Tracking Sledování přejmenování @@ -1359,11 +1149,6 @@ Chcete pokračovat? Odebírání {0} z {1} s obsahem: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - 'Metoda {0} nepodporuje operaci {1}. Může ale obsahovat vnořené metody {2} (viz {2}.{3}), které tuto operaci podporují. - - Brace Completion Uzavírání hranatých závorek @@ -1424,11 +1209,6 @@ Chcete pokračovat? Probíhá navigace... - - Suggestion ellipses (…) - Výpustka návrhu (…) - - '{0}' declarations 'Deklarace symbolů {0} @@ -1459,11 +1239,6 @@ Chcete pokračovat? Okomentovat/odkomentovat výběr - - Code Completion - Dokončování kódu - - Execute In Interactive Provést v interaktivní součásti @@ -1554,11 +1329,6 @@ Chcete pokračovat? Nápověda k signatuře - - Smart Token Formatter - Inteligentní formátování tokenů - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf index 66fbb54125073..b3d26a71bf751 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf @@ -17,36 +17,16 @@ Navigieren zu dem Symbol unter dem Caret nicht möglich. - - Change configuration - Konfiguration ändern - - - - Code cleanup is not configured - Die Codebereinigung wurde nicht konfiguriert. - - Computing 'Encapsulate Field' information Berechnen von "Kapselungsfeld"-Informationen - - Configure it now - Jetzt konfigurieren - - Do not prefer 'this.' or 'Me.' "this." oder "Me." nicht bevorzugen - - Do not show this message again - Diese Meldung nicht mehr anzeigen - - Do you still want to proceed? This may produce broken code. Möchten Sie dennoch fortfahren? Möglicherweise wird fehlerhafter Code generiert. @@ -77,26 +57,11 @@ Filter Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - Bei der Dokumentformatierung wurde eine zusätzliche Bereinigung durchgeführt. - - Get help for '{0}' Hilfe zu "{0}" abrufen - - Gathering Suggestions - '{0}' - Vorschläge werden gesammelt: "{0}" - - - - Gathering Suggestions - Waiting for the solution to fully load - Vorschläge werden gesammelt. Es wird darauf gewartet, dass die Lösung vollständig geladen wird. - - Go To Base Zu Basis wechseln @@ -632,11 +597,6 @@ {0} nicht lösbare(r) Konflikt(e) - - Applying "{0}"... - "{0}" wird angewendet... - - Adding '{0}' to '{1}' with content: "{0}" wird zu "{1}" hinzugefügt mit dem Inhalt: @@ -692,11 +652,6 @@ Feld kapseln - - Applying "Encapsulate Field" refactoring... - Refactoring "Feld kapseln" wird angewendet... - - Please select the definition of the field to encapsulate. Wählen Sie die Definition des zu kapselnden Felds aus. @@ -722,11 +677,6 @@ Keine Informationen gefunden. - - No usages found. - Keine Verwendungen gefunden. - - Implements Implementiert @@ -747,86 +697,16 @@ Überschrieben von - - Directly Called In - Direkt aufgerufen - - - - Indirectly Called In - Indirekt aufgerufen - - - - Called In - Aufgerufen - - - - Referenced In - Verwiesen in - - No references found. Keine Verweise gefunden. - - No derived types found. - Keine abgeleiteten Typen gefunden. - - - - No implementations found. - Keine Implementierungen gefunden. - - - - {0} - (Line {1}) - {0} - (Zeile {1}) - - - - Class Parts - Klassenteile - - - - Struct Parts - Strukturteile - - - - Interface Parts - Schnittstellenteile - - - - Type Parts - Typenteile - - Inherits Erbt - - Inherited By - Geerbt durch - - - - Already tracking document with identical key - Dokument mit identischem Schlüssel wird bereits verfolgt - - - - document is not currently being tracked - Dokument wird aktuell nicht verfolgt - - Computing Rename information... Umbenennungsinformationen werden berechnet... @@ -882,26 +762,11 @@ Wird automatisch ergänzt... - - Automatic Pair Completion - Automatische Paarergänzung - - An active inline rename session is still active. Complete it before starting a new one. Eine aktive Inline-Umbenennungssitzung ist noch aktiv. Beenden Sie sie, bevor Sie eine neue starten. - - The buffer is not part of a workspace. - Der Puffer ist kein Teil eines Arbeitsbereichs. - - - - The token is not contained in the workspace. - Das Token ist nicht im Arbeitsbereich enthalten. - - Navigation Bars Navigationsleisten @@ -912,26 +777,11 @@ Navigationsleisten werden aktualisiert... - - Format Token - Token formatieren - - Find References Verweise suchen - - Finding references... - Verweise werden gesucht... - - - - Finding references of "{0}"... - Verweise von "{0}" werden gesucht... - - Comment Selection Kommentar für Auswahl @@ -977,11 +827,6 @@ Refactoring "Methode extrahieren" wird angewendet... - - Format Document - Dokument formatieren - - Formatting document... Dokument wird formatiert... @@ -992,11 +837,6 @@ Formatierung - - Format Selection - Auswahl formatieren - - Formatting currently selected text... Aktuell markierter Text wird formatiert... @@ -1037,11 +877,6 @@ Inline-Umbenennungskorrektur - - Inline Rename Resolved Conflict - Gelöster Inline-Umbenennungskonflikt - - Inline Rename Inline-Umbenennung @@ -1057,11 +892,6 @@ Umbenennen beginnen - - Display conflict resolutions - Konfliktlösungen anzeigen - - Finding token to rename... Umzubenennendes Token wird gesucht... @@ -1102,31 +932,11 @@ Umbenennen: {0} - - Light bulb session is already dismissed. - Light bulb-Sitzung wurde bereits beendet. - - - - Automatic Pair Completion End Point Marker Color - Farbe der Endpunktmarkierung der automatischen Paarergänzung - - Engine must be attached to an Interactive Window. Engine muss an das Interactive-Fenster angefügt werden. - - Changes the current prompt settings. - Ändert die aktuellen Eingabeaufforderungseinstellungen. - - - - Unexpected text: '{0}' - Unerwarteter Text: "{0}" - - The triggerSpan is not included in the given workspace. Die triggerSpan ist im angegebenen Arbeitsbereich nicht enthalten. @@ -1142,11 +952,6 @@ Die Transaktion ist bereits abgeschlossen. - - Not a source error, line/column unavailable - Kein Quellfehler, Zeile/Spalte nicht verfügbar - - Can't compare positions from different text snapshots Positionen aus unterschiedlichen Textmomentaufnahmen konnten nicht verglichen werden @@ -1227,11 +1032,6 @@ Vorschau der Änderungen - - Format Paste - Format einfügen - - Formatting pasted text... Eingefügter Text wird formatiert... @@ -1289,11 +1089,6 @@ Möchten Sie fortfahren? Aufrufe an die Schnittstellenimplementierung "{0}" - - Computing Call Hierarchy Information - Die Aufrufshierarchieinformationen werden berechnet. - - Implements '{0}' Implementiert "{0}" @@ -1344,11 +1139,6 @@ Möchten Sie fortfahren? IntelliSense - - IntelliSense Commit Formatting - IntelliSense-Commitformatierung - - Rename Tracking Nachverfolgung umbenennen @@ -1359,11 +1149,6 @@ Möchten Sie fortfahren? "{0}" wird aus "{1}" entfernt mit Inhalt: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - 'Der Vorgang "{1}" wird von "{0}" nicht unterstützt. Es können jedoch geschachtelte "{2}" enthalten sein (siehe "{2}.{3}"), die diesen Vorgang unterstützen. - - Brace Completion Klammerabschluss @@ -1424,11 +1209,6 @@ Möchten Sie fortfahren? Navigation... - - Suggestion ellipses (…) - Auslassungspunkte für Vorschlag (…) - - '{0}' declarations "{0}"-Deklarationen @@ -1459,11 +1239,6 @@ Möchten Sie fortfahren? Auswahl auskommentieren/Auskommentierung aufheben - - Code Completion - Codevervollständigung - - Execute In Interactive In interaktivem Fenster ausführen @@ -1554,11 +1329,6 @@ Möchten Sie fortfahren? Signaturhilfe - - Smart Token Formatter - Intelligente Tokenformatierung - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf index 335762e94b21a..103d2a430c468 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf @@ -17,36 +17,16 @@ No se puede navegar al símbolo que hay debajo del símbolo de intercalación. - - Change configuration - Configuración de cambio - - - - Code cleanup is not configured - La limpieza de código no está configurada - - Computing 'Encapsulate Field' information Calculando información de "Encapsular campo" - - Configure it now - Configúrela ahora - - Do not prefer 'this.' or 'Me.' No preferir "this." ni "Me." - - Do not show this message again - No volver a mostrar este mensaje - - Do you still want to proceed? This may produce broken code. ¿Desea continuar? Esto puede producir código roto. @@ -77,26 +57,11 @@ Filtrar Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - El formateo del documento realizó una limpieza adicional - - Get help for '{0}' Obtener ayuda para "{0}" - - Gathering Suggestions - '{0}' - Recopilando sugerencias: "{0}" - - - - Gathering Suggestions - Waiting for the solution to fully load - Recopilando sugerencias: esperando a que la solución se cargue por completo - - Go To Base Ir a base @@ -632,11 +597,6 @@ {0} conflicto(s) sin solución - - Applying "{0}"... - Aplicando "{0}"... - - Adding '{0}' to '{1}' with content: Agregando '{0}' a '{1}' con contenido: @@ -692,11 +652,6 @@ Encapsular campo - - Applying "Encapsulate Field" refactoring... - Aplicando la refactorización "Encapsular campo"... - - Please select the definition of the field to encapsulate. Seleccione la definición del campo que quiere encapsular. @@ -722,11 +677,6 @@ No se encontró información. - - No usages found. - No se encontraron usos. - - Implements Implementa @@ -747,86 +697,16 @@ Invalidado por - - Directly Called In - Llamado directamente - - - - Indirectly Called In - Llamado indirectamente - - - - Called In - Llamado - - - - Referenced In - Con referencia en - - No references found. No se encontraron referencias. - - No derived types found. - No se encontraron tipos derivados. - - - - No implementations found. - No se encontraron implementaciones. - - - - {0} - (Line {1}) - {0} - (Línea {1}) - - - - Class Parts - Elementos de clase - - - - Struct Parts - Elementos de estructura - - - - Interface Parts - Elementos de interfaz - - - - Type Parts - Elementos de tipo - - Inherits Hereda - - Inherited By - Heredado por - - - - Already tracking document with identical key - Ya se está siguiendo un documento con una clave idéntica - - - - document is not currently being tracked - el documento no es objeto de seguimiento actualmente - - Computing Rename information... Calculando información de Cambiar nombre... @@ -882,26 +762,11 @@ Completando automáticamente... - - Automatic Pair Completion - Finalización automática del par - - An active inline rename session is still active. Complete it before starting a new one. Una sesión de cambio de nombre en línea sigue activa. Complétela antes de iniciar otra. - - The buffer is not part of a workspace. - El búfer no forma parte de un área de trabajo. - - - - The token is not contained in the workspace. - El token no está contenido en el área de trabajo. - - Navigation Bars Barras de navegación @@ -912,26 +777,11 @@ Actualizando barras de navegación... - - Format Token - Dar formato al token - - Find References Buscar referencias - - Finding references... - Buscando referencias... - - - - Finding references of "{0}"... - Buscando referencias de "{0}"... - - Comment Selection Selección con comentarios @@ -977,11 +827,6 @@ Aplicando la refactorización "Extraer método"... - - Format Document - Dar formato al documento - - Formatting document... Dando formato al documento... @@ -992,11 +837,6 @@ Formato - - Format Selection - Dar formato a la selección - - Formatting currently selected text... Dando formato al texto seleccionado actualmente... @@ -1037,11 +877,6 @@ Corrección de cambio de nombre en línea - - Inline Rename Resolved Conflict - Conflicto de cambio de nombre en línea resuelto - - Inline Rename Cambio de nombre en línea @@ -1057,11 +892,6 @@ Iniciar el cambio de nombre - - Display conflict resolutions - Mostrar resoluciones de conflictos - - Finding token to rename... Buscando token al que cambiar el nombre... @@ -1102,31 +932,11 @@ Cambiar nombre: {0} - - Light bulb session is already dismissed. - La sesión de bombilla ya está descartada. - - - - Automatic Pair Completion End Point Marker Color - Finalización automática del par, color del marcador del extremo - - Engine must be attached to an Interactive Window. El motor debe estar asociado a una ventana interactiva. - - Changes the current prompt settings. - Cambia la configuración actual del aviso. - - - - Unexpected text: '{0}' - Texto inesperado: '{0}' - - The triggerSpan is not included in the given workspace. El triggerSpan no está incluido en el área de trabajo. @@ -1142,11 +952,6 @@ La transacción ya está completa. - - Not a source error, line/column unavailable - No hay error de código fuente, línea/columna no disponible - - Can't compare positions from different text snapshots No se puede comparar posiciones desde distintas instantáneas de texto @@ -1227,11 +1032,6 @@ Vista previa de los cambios - - Format Paste - Pegado de formato - - Formatting pasted text... Dando formato al texto pegado... @@ -1289,11 +1089,6 @@ Do you want to proceed? Llamadas a la implementación de interfaz '{0}' - - Computing Call Hierarchy Information - Computando información de jerarquía de llamadas - - Implements '{0}' Implementa '{0}' @@ -1344,11 +1139,6 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - Formato de confirmación de IntelliSense - - Rename Tracking Cambiar el nombre del seguimiento @@ -1359,11 +1149,6 @@ Do you want to proceed? Quitando "{0}" de "{1}" con contenido: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}' no admite la operación '{1}'. Sin embargo, puede contener '{2}' anidados (véase '{2}.{3}') que admitan esta operación. - - Brace Completion Finalización de llave @@ -1424,11 +1209,6 @@ Do you want to proceed? Navegando... - - Suggestion ellipses (…) - Puntos suspensivos de sugerencia (…) - - '{0}' declarations 'Declaraciones de "{0}" @@ -1459,11 +1239,6 @@ Do you want to proceed? Poner/Quitar marca de comentario a la selección - - Code Completion - Finalización de código - - Execute In Interactive Ejecutar en modo interactivo @@ -1554,11 +1329,6 @@ Do you want to proceed? Ayuda de signatura - - Smart Token Formatter - Formateador de token inteligente - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf index d26a192ed972f..6711fd1b8d01a 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf @@ -17,36 +17,16 @@ Impossible de naviguer jusqu'au symbole sous le caret. - - Change configuration - Changer la configuration - - - - Code cleanup is not configured - Le nettoyage du code n'est pas configuré - - Computing 'Encapsulate Field' information Calcul des informations « Encapsuler le champ » - - Configure it now - Configurer maintenant - - Do not prefer 'this.' or 'Me.' Ne pas préférer 'this.' ou 'Me.' - - Do not show this message again - Ne plus afficher ce message - - Do you still want to proceed? This may produce broken code. Voulez-vous continuer ? Le code sera interrompu. @@ -77,26 +57,11 @@ Filtrer Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - L'opération Mettre en forme le document a effectué un nettoyage supplémentaire - - Get help for '{0}' Obtenir de l'aide pour '{0}' - - Gathering Suggestions - '{0}' - Collecte des suggestions - '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - Collecte des suggestions - Attente du chargement complet de la solution - - Go To Base Accéder à la base @@ -632,11 +597,6 @@ {0} conflit(s) ne pouvant pas être résolu(s) - - Applying "{0}"... - Application de "{0}"... - - Adding '{0}' to '{1}' with content: Ajout de '{0}' à '{1}' avec le contenu : @@ -692,11 +652,6 @@ Encapsuler le champ - - Applying "Encapsulate Field" refactoring... - Application de la refactorisation "Encapsuler le champ"... - - Please select the definition of the field to encapsulate. Sélectionnez la définition du champ à encapsuler. @@ -722,11 +677,6 @@ Informations introuvables. - - No usages found. - Utilisation introuvable. - - Implements Implémente @@ -747,86 +697,16 @@ Remplacée par - - Directly Called In - Appelé directement - - - - Indirectly Called In - Appelé indirectement - - - - Called In - Appelé - - - - Referenced In - Référencé dans - - No references found. Référence introuvable. - - No derived types found. - Type dérivé introuvable. - - - - No implementations found. - Implémentation introuvable. - - - - {0} - (Line {1}) - {0} - (Ligne {1}) - - - - Class Parts - Parties de classe - - - - Struct Parts - Parties de struct - - - - Interface Parts - Pièces de l'interface - - - - Type Parts - Parties de type - - Inherits Hérite - - Inherited By - Hérité par - - - - Already tracking document with identical key - Suivi du document déjà initié avec une clé identique - - - - document is not currently being tracked - Le document ne fait pas actuellement l'objet d'un suivi - - Computing Rename information... Calcul des informations de changement de nom... @@ -882,26 +762,11 @@ Finalisation automatique... - - Automatic Pair Completion - Finalisation de paires automatique - - An active inline rename session is still active. Complete it before starting a new one. Une session de changement de nom inline est toujours active. Terminez-la avant d'en commencer une nouvelle. - - The buffer is not part of a workspace. - Le tampon ne fait pas partie d'un espace de travail. - - - - The token is not contained in the workspace. - Le jeton n'est pas contenu dans l'espace de travail. - - Navigation Bars Barres de navigation @@ -912,26 +777,11 @@ Actualisation des barres de navigation... - - Format Token - Jeton de format - - Find References Recherche de références - - Finding references... - Recherche de références... - - - - Finding references of "{0}"... - Recherche de références de "{0}"... - - Comment Selection Commenter la sélection @@ -977,11 +827,6 @@ Application de la refactorisation "Extraire la méthode"... - - Format Document - Mettre le document en forme - - Formatting document... Mise en forme du document... @@ -992,11 +837,6 @@ Mise en forme - - Format Selection - Mettre la sélection en forme - - Formatting currently selected text... Mise en forme du texte actuellement sélectionné... @@ -1037,11 +877,6 @@ Correction du changement de nom inline - - Inline Rename Resolved Conflict - Conflit du changement de nom inline résolu - - Inline Rename Changement de nom inline @@ -1057,11 +892,6 @@ Démarrer le changement de nom - - Display conflict resolutions - Afficher les résolutions de conflit - - Finding token to rename... Recherche du jeton à renommer... @@ -1102,31 +932,11 @@ Renommer : {0} - - Light bulb session is already dismissed. - La session d'information a déjà été abandonnée. - - - - Automatic Pair Completion End Point Marker Color - Couleur du marqueur du point de terminaison pour la finalisation de paires automatique - - Engine must be attached to an Interactive Window. Le moteur doit être attaché à une fenêtre interactive. - - Changes the current prompt settings. - Modifie les paramètres d'invite actuels. - - - - Unexpected text: '{0}' - Texte inattendu : '{0}' - - The triggerSpan is not included in the given workspace. triggerSpan n'est pas inclus dans l'espace de travail donné. @@ -1142,11 +952,6 @@ La transaction est déjà terminée. - - Not a source error, line/column unavailable - Il ne s'agit pas d'une erreur source, ligne/colonne non disponible - - Can't compare positions from different text snapshots Impossible de comparer les positions de différents instantanés de texte @@ -1227,11 +1032,6 @@ Aperçu des modifications - - Format Paste - Mettre en forme lors du collage - - Formatting pasted text... Mise en forme du texte collé... @@ -1289,11 +1089,6 @@ Voulez-vous continuer ? Appels à l'implémentation d'interface '{0}' - - Computing Call Hierarchy Information - Calcul des informations de hiérarchie des appels - - Implements '{0}' Implémente '{0}' @@ -1344,11 +1139,6 @@ Voulez-vous continuer ? IntelliSense - - IntelliSense Commit Formatting - Mise en forme de la validation IntelliSense - - Rename Tracking Renommer le suivi @@ -1359,11 +1149,6 @@ Voulez-vous continuer ? Suppression de '{0}' dans '{1}' avec le contenu : - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}' ne prend pas en charge l'opération '{1}'. Toutefois, il peut contenir des éléments '{2}' imbriqués (voir '{2}.{3}') qui prennent en charge cette opération. - - Brace Completion Fin de l'accolade @@ -1424,11 +1209,6 @@ Voulez-vous continuer ? Navigation... - - Suggestion ellipses (…) - Bouton de sélection (…) de suggestion - - '{0}' declarations 'Déclarations '{0}' @@ -1459,11 +1239,6 @@ Voulez-vous continuer ? Commenter/décommenter la sélection - - Code Completion - Complétion de code - - Execute In Interactive Exécuter en mode interactif @@ -1554,11 +1329,6 @@ Voulez-vous continuer ? Aide sur les signatures - - Smart Token Formatter - Formateur de jeton intelligent - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf index 6b4f7bad71393..5fa7e40170765 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf @@ -17,36 +17,16 @@ Non è possibile passare al simbolo sotto il punto di inserimento. - - Change configuration - Cambia la configurazione - - - - Code cleanup is not configured - La pulizia del codice non è configurata - - Computing 'Encapsulate Field' information Calcolo delle informazioni su 'Incapsula campo' - - Configure it now - Configura ora - - Do not prefer 'this.' or 'Me.' Non preferire 'this.' o 'Me.' - - Do not show this message again - Non visualizzare più questo messaggio - - Do you still want to proceed? This may produce broken code. Procedere comunque? Il codice ottenuto potrebbe essere danneggiato. @@ -77,26 +57,11 @@ Filtro Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - Formatta documento ha eseguito una pulizia aggiuntiva - - Get help for '{0}' Visualizza la Guida per '{0}' - - Gathering Suggestions - '{0}' - Raccolta dei suggerimenti - '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - Raccolta dei suggerimenti - In attesa del completamento del caricamento della soluzione - - Go To Base Vai a base @@ -632,11 +597,6 @@ {0} conflitti non risolti - - Applying "{0}"... - Applicazione di "{0}"... - - Adding '{0}' to '{1}' with content: Aggiunta di '{0}' a '{1}' con contenuto: @@ -692,11 +652,6 @@ Incapsula campo - - Applying "Encapsulate Field" refactoring... - Applicazione del refactoring per "Incapsula campo"... - - Please select the definition of the field to encapsulate. Selezionare la definizione del campo da incapsulare. @@ -722,11 +677,6 @@ Non sono state trovate informazioni. - - No usages found. - Non sono stati trovati utilizzi. - - Implements Implementa @@ -747,86 +697,16 @@ Sottoposto a override da - - Directly Called In - Chiamato in modo diretto - - - - Indirectly Called In - Chiamato in modo indiretto - - - - Called In - Chiamato - - - - Referenced In - Con riferimenti in - - No references found. Non sono stati trovati riferimenti. - - No derived types found. - Non sono stati trovati tipi derivati. - - - - No implementations found. - Non sono state trovate implementazioni. - - - - {0} - (Line {1}) - {0} - (riga {1}) - - - - Class Parts - Parti di classe - - - - Struct Parts - Parti struct - - - - Interface Parts - Parti interfaccia - - - - Type Parts - Parti tipo - - Inherits Eredita - - Inherited By - Ereditato da - - - - Already tracking document with identical key - La verifica del documento con chiave identica è già in corso - - - - document is not currently being tracked - al momento il documento non è sottoposto a verifica - - Computing Rename information... Elaborazione delle informazioni per la ridenominazione... @@ -882,26 +762,11 @@ Completamento automatico in... - - Automatic Pair Completion - Completamento coppia automatico - - An active inline rename session is still active. Complete it before starting a new one. Una sessione di ridenominazione inline è ancora attiva. Completarla prima di avviarne una nuova. - - The buffer is not part of a workspace. - Il buffer non fa parte di un'area di lavoro. - - - - The token is not contained in the workspace. - Il token non è contenuto nell'area di lavoro. - - Navigation Bars Barre di spostamento @@ -912,26 +777,11 @@ Aggiornamento delle barre di spostamento in corso... - - Format Token - Formatta token - - Find References Trova riferimenti - - Finding references... - Ricerca dei riferimenti in corso... - - - - Finding references of "{0}"... - Ricerca dei riferimenti di "{0}"... - - Comment Selection Commenta selezione @@ -977,11 +827,6 @@ Applicazione del refactoring per "Estrai metodo"... - - Format Document - Formatta documento - - Formatting document... Formattazione del documento... @@ -992,11 +837,6 @@ Formattazione - - Format Selection - Formatta selezione - - Formatting currently selected text... Formattazione del testo attualmente selezionato... @@ -1037,11 +877,6 @@ Ridenominazione inline - Correzione - - Inline Rename Resolved Conflict - Ridenominazione inline - Conflitto risolto - - Inline Rename Ridenominazione inline @@ -1057,11 +892,6 @@ Avvia ridenominazione - - Display conflict resolutions - Visualizza le risoluzioni dei conflitti - - Finding token to rename... Ricerca del token da rinominare... @@ -1102,31 +932,11 @@ Rinomina: {0} - - Light bulb session is already dismissed. - La sessione lampadina è già stata chiusa. - - - - Automatic Pair Completion End Point Marker Color - Colore marcatore punto finale per completamento coppia automatico - - Engine must be attached to an Interactive Window. Il motore deve essere collegato a una finestra interattiva. - - Changes the current prompt settings. - Cambia le impostazioni correnti del prompt. - - - - Unexpected text: '{0}' - Testo imprevisto: '{0}' - - The triggerSpan is not included in the given workspace. L'elemento triggerSpan non è incluso nell'area di lavoro specificata. @@ -1142,11 +952,6 @@ La transazione è già completata. - - Not a source error, line/column unavailable - L'errore non dipende dall'origine. La riga o la colonna non è disponibile - - Can't compare positions from different text snapshots Non è possibile confrontare le posizioni da snapshot testo diversi @@ -1227,11 +1032,6 @@ Anteprima modifiche - - Format Paste - Formatta testo incollato - - Formatting pasted text... Formattazione del testo incollato... @@ -1289,11 +1089,6 @@ Continuare? Chiamate all'implementazione dell'interfaccia '{0}' - - Computing Call Hierarchy Information - Elaborazione informazioni su gerarchia di chiamata - - Implements '{0}' Implementa '{0}' @@ -1344,11 +1139,6 @@ Continuare? IntelliSense - - IntelliSense Commit Formatting - Formattazione commit IntelliSense - - Rename Tracking Verifica ridenominazione @@ -1359,11 +1149,6 @@ Continuare? Rimozione di '{0}' da '{1}' con contenuto: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}' non supporta l'operazione '{1}', ma può contenere elementi '{2}' annidati (vedere '{2}.{3}') che supportano questa operazione. - - Brace Completion Completamento parentesi graffa @@ -1424,11 +1209,6 @@ Continuare? Spostamento... - - Suggestion ellipses (…) - Puntini di sospensione di suggerimento (…) - - '{0}' declarations 'Dichiarazioni di '{0}' @@ -1459,11 +1239,6 @@ Continuare? Aggiungi/Rimuovi commento selezione - - Code Completion - Completamento codice - - Execute In Interactive Esegui in finestra interattiva @@ -1554,11 +1329,6 @@ Continuare? Guida per la firma - - Smart Token Formatter - Formattatore di token intelligente - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf index 859f844128aae..30cef67bccdc3 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf @@ -17,36 +17,16 @@ カレットの下のシンボルに移動できません。 - - Change configuration - 構成の変更 - - - - Code cleanup is not configured - コード クリーンアップは構成されていません - - Computing 'Encapsulate Field' information 'フィールドのカプセル化' 情報を計算中 - - Configure it now - 今すぐ構成する - - Do not prefer 'this.' or 'Me.' 'this.' または 'Me' を優先しない - - Do not show this message again - 今後、このメッセージを表示しない - - Do you still want to proceed? This may produce broken code. 続行しますか。破損状態のコードが生成される可能性があります。 @@ -77,26 +57,11 @@ フィルター Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - ドキュメントのフォーマットで追加のクリーンアップが実行されました - - Get help for '{0}' '{0}' のヘルプの表示 - - Gathering Suggestions - '{0}' - 提案を収集しています - '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - 提案を収集しています - ソリューションが完全に読み込まれるのを待機しています - - Go To Base 基本へ移動 @@ -632,11 +597,6 @@ 未解決の競合 {0} - - Applying "{0}"... - "{0}" を適用しています... - - Adding '{0}' to '{1}' with content: コンテンツを含む '{0}' を '{1}' に追加しています: @@ -692,11 +652,6 @@ フィールドのカプセル化 - - Applying "Encapsulate Field" refactoring... - "フィールドのカプセル化" リファクタリングを適用しています... - - Please select the definition of the field to encapsulate. カプセル化するフィールドの定義を選択してください。 @@ -722,11 +677,6 @@ 情報が見つかりません。 - - No usages found. - 使用状況が見つかりません。 - - Implements 実装 @@ -747,86 +697,16 @@ オーバーライド元 - - Directly Called In - 直接に呼び出し済み - - - - Indirectly Called In - 間接的に呼び出し済み - - - - Called In - 呼び出し済み - - - - Referenced In - 参照先 - - No references found. 参照が見つかりません。 - - No derived types found. - 派生型が見つかりません。 - - - - No implementations found. - 実装が見つかりません。 - - - - {0} - (Line {1}) - {0} - (行 {1}) - - - - Class Parts - クラスの部品 - - - - Struct Parts - 構造体の部品 - - - - Interface Parts - インターフェイス パーツ - - - - Type Parts - 型の部品 - - Inherits 継承 - - Inherited By - 継承先 - - - - Already tracking document with identical key - 同じキーを持つドキュメントを既に追跡しています - - - - document is not currently being tracked - ドキュメントが現在追跡されていません - - Computing Rename information... 名前の変更情報を計算しています... @@ -882,26 +762,11 @@ 自動補完しています... - - Automatic Pair Completion - ペアの自動補完 - - An active inline rename session is still active. Complete it before starting a new one. アクティブなインラインの名前変更セッションがアクティブなままです。新しいセッションを開始する前に完了してください。 - - The buffer is not part of a workspace. - バッファーはワークスペースの一部ではありません。 - - - - The token is not contained in the workspace. - トークンはワークスペースに含まれていません。 - - Navigation Bars ナビゲーション バー @@ -912,26 +777,11 @@ ナビゲーション バーを更新しています... - - Format Token - 書式トークン - - Find References 参照の検索 - - Finding references... - 参照を検索しています... - - - - Finding references of "{0}"... - "{0}" の参照を検索しています... - - Comment Selection 選択範囲のコメント @@ -977,11 +827,6 @@ "メソッドの抽出" リファクタリングを適用しています... - - Format Document - ドキュメントのフォーマット - - Formatting document... ドキュメントを書式設定しています... @@ -992,11 +837,6 @@ 書式設定 - - Format Selection - 選択範囲のフォーマット - - Formatting currently selected text... 現在選択されているテキストを書式設定しています... @@ -1037,11 +877,6 @@ インラインの名前変更の Fixup - - Inline Rename Resolved Conflict - インラインの名前変更の競合を解決しました - - Inline Rename インラインの名前変更 @@ -1057,11 +892,6 @@ 名前の変更を開始 - - Display conflict resolutions - 競合する解像度の表示 - - Finding token to rename... 名前を変更するトークンを検索しています... @@ -1102,31 +932,11 @@ {0} の名前変更 - - Light bulb session is already dismissed. - 電球セッションは既に閉鎖されています。 - - - - Automatic Pair Completion End Point Marker Color - ペアの自動補完の終点のマーカーの色 - - Engine must be attached to an Interactive Window. インタラクティブ ウィンドウにエンジンを関連付ける必要があります。 - - Changes the current prompt settings. - 現在のプロンプトの設定を変更します。 - - - - Unexpected text: '{0}' - 予期しないテキスト: '{0}' - - The triggerSpan is not included in the given workspace. triggerSpan は指定されたワークスペースに含まれていません。 @@ -1142,11 +952,6 @@ トランザクションが既に完了します。 - - Not a source error, line/column unavailable - ソース エラーではなく、行/列を使用できません - - Can't compare positions from different text snapshots 異なるテキスト スナップショットから位置を比較できません @@ -1227,11 +1032,6 @@ 変更のプレビュー - - Format Paste - 書式の貼り付け - - Formatting pasted text... 貼り付けたテキストを書式設定しています... @@ -1289,11 +1089,6 @@ Do you want to proceed? インターフェイスの実装 '{0}' への呼び出し - - Computing Call Hierarchy Information - 呼び出し階層情報を計算しています - - Implements '{0}' '{0}' を実装します @@ -1344,11 +1139,6 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - IntelliSense のコミットの書式設定 - - Rename Tracking 名前変更の追跡 @@ -1359,11 +1149,6 @@ Do you want to proceed? コンテンツを含む '{0}' を '{1}' から削除しています: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}' は '{1}' の操作をサポートしません。ただし、この操作をサポートする入れ子になった '{2}' を含めることはできます ('{2}.{3}' を参照)。 - - Brace Completion かっこ完了 @@ -1424,11 +1209,6 @@ Do you want to proceed? 移動中... - - Suggestion ellipses (…) - 提案事項の省略記号 (…) - - '{0}' declarations '{0}' の宣言 @@ -1459,11 +1239,6 @@ Do you want to proceed? 選択範囲のコメント/コメント解除 - - Code Completion - コード補完 - - Execute In Interactive 対話形式で実行 @@ -1554,11 +1329,6 @@ Do you want to proceed? シグネチャ ヘルプ - - Smart Token Formatter - スマート トークン フォーマッタ - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf index 09260543c02d7..746b17fcaab17 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf @@ -17,36 +17,16 @@ 캐럿에서 기호를 탐색할 수 없습니다. - - Change configuration - 구성 변경 - - - - Code cleanup is not configured - 코드 정리가 구성되지 않았습니다. - - Computing 'Encapsulate Field' information 'Encapsulate Field' 정보 계산 - - Configure it now - 지금 구성 - - Do not prefer 'this.' or 'Me.' 'this.' 또는 'Me.'를 기본으로 사용하지 마세요. - - Do not show this message again - 이 메시지를 다시 표시하지 않음 - - Do you still want to proceed? This may produce broken code. 계속하시겠습니까? 계속하면 손상된 코드가 생성될 수 있습니다. @@ -77,26 +57,11 @@ 필터 Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - 추가 정리를 수행 하는 문서 - - Get help for '{0}' '{0}'에 대한 도움 받기 - - Gathering Suggestions - '{0}' - 제안을 수집하는 중 - '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - 제안을 수집하는 중 - 솔루션이 완전히 로드될 때까지 기다리는 중 - - Go To Base 기본으로 이동 @@ -632,11 +597,6 @@ 해결할 수 없는 충돌 {0}개 - - Applying "{0}"... - "{0}" 적용 중... - - Adding '{0}' to '{1}' with content: 다음 콘텐츠가 있는 '{1}'에 대한 '{0}' 추가 중: @@ -692,11 +652,6 @@ 필드 캡슐화 - - Applying "Encapsulate Field" refactoring... - "필드 캡슐화" 리팩토링 적용 중... - - Please select the definition of the field to encapsulate. 캡슐화할 필드의 정의를 선택하세요. @@ -722,11 +677,6 @@ 정보를 찾을 수 없습니다. - - No usages found. - 사용법을 찾을 수 없습니다. - - Implements 구현 @@ -747,86 +697,16 @@ 재정의 수행자 - - Directly Called In - 직접 호출됨 - - - - Indirectly Called In - 간접적으로 호출됨 - - - - Called In - 호출됨 - - - - Referenced In - 참조됨 - - No references found. 참조를 찾을 수 없습니다. - - No derived types found. - 파생 형식을 찾을 수 없습니다. - - - - No implementations found. - 구현을 찾을 수 없습니다. - - - - {0} - (Line {1}) - {0} - (줄 {1}) - - - - Class Parts - 클래스 파트 - - - - Struct Parts - 구조체 파트 - - - - Interface Parts - 인터페이스 파트 - - - - Type Parts - 형식 파트 - - Inherits 상속 - - Inherited By - 상속 대상 - - - - Already tracking document with identical key - 동일한 키로 이미 문서를 추적하는 중 - - - - document is not currently being tracked - 문서를 현재 추적하고 있지 않습니다. - - Computing Rename information... 이름 바꾸기 정보 계산 중... @@ -882,26 +762,11 @@ 자동 완성 중... - - Automatic Pair Completion - 자동 쌍 완성 - - An active inline rename session is still active. Complete it before starting a new one. 활성 인라인 이름 바꾸기 세션이 여전히 활성화되어 있습니다. 새 세션을 시작하기 전에 완료하세요. - - The buffer is not part of a workspace. - 버퍼는 작업 영역의 일부가 아닙니다. - - - - The token is not contained in the workspace. - 토큰이 작업 영역에 포함되어 있지 않습니다. - - Navigation Bars 탐색 모음 @@ -912,26 +777,11 @@ 탐색 모음을 새로 고치는 중... - - Format Token - 형식 토큰 - - Find References 참조 찾기 - - Finding references... - 참조를 찾는 중... - - - - Finding references of "{0}"... - "{0}"의 참조를 찾는 중... - - Comment Selection 선택 영역을 주석으로 처리 @@ -977,11 +827,6 @@ "메서드 추출" 리팩토링 적용 중... - - Format Document - 문서 서식 - - Formatting document... 문서 서식을 지정하는 중... @@ -992,11 +837,6 @@ 서식 - - Format Selection - 선택 영역 서식 - - Formatting currently selected text... 현재 선택한 텍스트의 서식을 지정하는 중... @@ -1037,11 +877,6 @@ 인라인 이름 바꾸기 픽스업 - - Inline Rename Resolved Conflict - 인라인 이름 바꾸기의 충돌이 해결됨 - - Inline Rename 인라인 이름 바꾸기 @@ -1057,11 +892,6 @@ 이름 바꾸기 시작 - - Display conflict resolutions - 충돌 해결 표시 - - Finding token to rename... 이름을 바꿀 토큰을 찾는 중... @@ -1102,31 +932,11 @@ 이름 바꾸기: {0} - - Light bulb session is already dismissed. - 전구 세션이 이미 해제되었습니다. - - - - Automatic Pair Completion End Point Marker Color - 자동 쌍 완성 끝점 표식 색 - - Engine must be attached to an Interactive Window. 엔진은 대화형 창에 연결되어 있어야 합니다. - - Changes the current prompt settings. - 현재 프롬프트 설정을 변경합니다. - - - - Unexpected text: '{0}' - 예기치 않은 텍스트: '{0}' - - The triggerSpan is not included in the given workspace. triggerSpan이 지정한 작업 영역에 포함되어 있지 않습니다. @@ -1142,11 +952,6 @@ 트랜잭션이 이미 완료되었습니다. - - Not a source error, line/column unavailable - 원본 오류가 아닙니다. 줄/열을 사용할 수 없습니다. - - Can't compare positions from different text snapshots 다른 텍스트 스냅샷에서 위치를 비교할 수 없습니다. @@ -1227,11 +1032,6 @@ 변경 내용 미리 보기 - - Format Paste - 서식 붙여넣기 - - Formatting pasted text... 붙여넣은 텍스트의 서식을 지정하는 중... @@ -1289,11 +1089,6 @@ Do you want to proceed? '{0}' 인터페이스 구현에 대한 호출 - - Computing Call Hierarchy Information - 호출 계층 구조 정보 계산 중 - - Implements '{0}' '{0}' 구현 @@ -1344,11 +1139,6 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - IntelliSense 커밋 서식 - - Rename Tracking 추적 이름 바꾸기 @@ -1359,11 +1149,6 @@ Do you want to proceed? 다음 내용과 함께 '{1}'에서 '{0}'을(를) 제거 중: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}'은(는) '{1}' 작업을 지원하지 않습니다. 하지만 이 작업을 지원하는 중첩 '{2}'을(를) 포함할 수 있습니다('{2}.{3}' 참조). - - Brace Completion 중괄호 완성 @@ -1424,11 +1209,6 @@ Do you want to proceed? 탐색하는 중... - - Suggestion ellipses (…) - 제안 줄임표(…) - - '{0}' declarations '{0}' 선언 @@ -1459,11 +1239,6 @@ Do you want to proceed? 선택 영역 주석 처리/주석 처리 제거 - - Code Completion - 코드 완성 - - Execute In Interactive 대화형으로 실행 @@ -1554,11 +1329,6 @@ Do you want to proceed? 시그니처 도움말 - - Smart Token Formatter - 스마트 토큰 포맷터 - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf index 21935f43e04d2..eaf19c26ad021 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf @@ -17,36 +17,16 @@ Nie można przejść do symbolu pod karetką. - - Change configuration - Zmień konfigurację - - - - Code cleanup is not configured - Nie skonfigurowano oczyszczania kodu - - Computing 'Encapsulate Field' information Obliczanie informacji „Hermetyzuj pole” - - Configure it now - Skonfiguruj je teraz - - Do not prefer 'this.' or 'Me.' Nie preferuj zapisu „this.” lub „me.” - - Do not show this message again - Nie pokazuj tego komunikatu ponownie - - Do you still want to proceed? This may produce broken code. Czy nadal chcesz kontynuować? Może to spowodować uszkodzenie kodu. @@ -77,26 +57,11 @@ Filtr Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - Funkcja formatowania dokumentu wykonała dodatkowe czyszczenie - - Get help for '{0}' Uzyskaj pomoc dla „{0}” - - Gathering Suggestions - '{0}' - Zbieranie sugestii — „{0}” - - - - Gathering Suggestions - Waiting for the solution to fully load - Zbieranie sugestii — oczekiwanie na pełne załadowanie rozwiązania - - Go To Base Przejdź do podstawy @@ -632,11 +597,6 @@ Liczba nierozwiązanych konfliktów: {0} - - Applying "{0}"... - Trwa stosowanie elementu „{0}”... - - Adding '{0}' to '{1}' with content: Trwa dodawanie elementu „{0}” do elementu „{1}” z zawartością: @@ -692,11 +652,6 @@ Hermetyzuj pole - - Applying "Encapsulate Field" refactoring... - Trwa stosowanie refaktoryzacji „Hermetyzuj pole”... - - Please select the definition of the field to encapsulate. Wybierz definicję pola, które ma zostać zahermetyzowane. @@ -722,11 +677,6 @@ Nie znaleziono informacji. - - No usages found. - Nie znaleziono użyć - - Implements Implementuje @@ -747,86 +697,16 @@ Przesłonione przez - - Directly Called In - Wywołane bezpośrednio - - - - Indirectly Called In - Wywołane pośrednio - - - - Called In - Wywołane - - - - Referenced In - Przywoływane w - - No references found. Nie znaleziono odwołań. - - No derived types found. - Nie znaleziono typów pochodnych. - - - - No implementations found. - Nie znaleziono implementacji. - - - - {0} - (Line {1}) - {0} — (wiersz {1}) - - - - Class Parts - Części klasy - - - - Struct Parts - Części struktury - - - - Interface Parts - Części interfejsu - - - - Type Parts - Części typu - - Inherits Dziedziczy - - Inherited By - Dziedziczone przez - - - - Already tracking document with identical key - Dokument z identycznym kluczem jest już śledzony - - - - document is not currently being tracked - dokument obecnie nie jest śledzony - - Computing Rename information... Trwa obliczanie informacji dotyczących zmiany nazwy... @@ -882,26 +762,11 @@ Trwa automatyczne uzupełnianie... - - Automatic Pair Completion - Automatyczne uzupełnianie par - - An active inline rename session is still active. Complete it before starting a new one. Aktywna sesja operacji zmiany nazwy wstawionego elementu nie została jeszcze zakończona. Zakończ ją przed uruchomieniem nowej sesji. - - The buffer is not part of a workspace. - Bufor nie jest częścią obszaru roboczego. - - - - The token is not contained in the workspace. - Token nie znajduje się w obszarze roboczym. - - Navigation Bars Paski nawigacji @@ -912,26 +777,11 @@ Trwa odświeżanie pasków nawigacji... - - Format Token - Token formatu - - Find References Znajdź odwołania - - Finding references... - Trwa znajdowanie odwołań... - - - - Finding references of "{0}"... - Trwa znajdowanie odwołań dla elementu „{0}”... - - Comment Selection Zakomentuj zaznaczenie @@ -977,11 +827,6 @@ Trwa stosowanie refaktoryzacji „Wyodrębnij metodę”... - - Format Document - Formatuj dokument - - Formatting document... Trwa formatowanie dokumentu... @@ -992,11 +837,6 @@ Formatowanie - - Format Selection - Formatuj zaznaczenie - - Formatting currently selected text... Trwa formatowanie aktualnie zaznaczonego tekstu... @@ -1037,11 +877,6 @@ Naprawa operacji zmiany nazwy wstawionego elementu - - Inline Rename Resolved Conflict - Rozwiązano konflikt z operacją zmiany nazwy wstawionego elementu - - Inline Rename Operacja zmiany nazwy wstawionego elementu @@ -1057,11 +892,6 @@ Rozpocznij zmienianie nazw - - Display conflict resolutions - Wyświetl rozwiązane konflikty - - Finding token to rename... Trwa znajdowanie tokenu, którego nazwa ma zostać zmieniona... @@ -1102,31 +932,11 @@ Zmień nazwę: {0} - - Light bulb session is already dismissed. - Sesję prezentowania pomysłów już odrzucono. - - - - Automatic Pair Completion End Point Marker Color - Kolor znacznika punktu końcowego automatycznego uzupełniania par - - Engine must be attached to an Interactive Window. Aparat musi być dołączony do okna Interactive. - - Changes the current prompt settings. - Zmienia bieżące ustawienia monitu. - - - - Unexpected text: '{0}' - Nieoczekiwany tekst: „{0}” - - The triggerSpan is not included in the given workspace. Element triggerSpan nie jest dołączony do danego obszaru roboczego. @@ -1142,11 +952,6 @@ Transakcja jest już ukończona. - - Not a source error, line/column unavailable - To nie jest błąd źródła. Brak dostępnego wiersza/kolumny - - Can't compare positions from different text snapshots Nie można porównać pozycji z różnych migawek tekstu @@ -1227,11 +1032,6 @@ Podgląd zmian - - Format Paste - Formatuj wklejoną zawartość - - Formatting pasted text... Trwa formatowanie wklejonego tekstu... @@ -1289,11 +1089,6 @@ Czy chcesz kontynuować? Wywołania implementacji interfejsu „{0}” - - Computing Call Hierarchy Information - Informacje o hierarchii wywołań obliczeń - - Implements '{0}' Implementuje element „{0}” @@ -1344,11 +1139,6 @@ Czy chcesz kontynuować? IntelliSense - - IntelliSense Commit Formatting - Formatowanie potwierdzenia funkcji IntelliSense - - Rename Tracking Śledzenie zmiany nazw @@ -1359,11 +1149,6 @@ Czy chcesz kontynuować? Usuwanie elementu „{0}” z elementu „{1}” z zawartością: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - 'Element „{0}” nie obsługuje operacji „{1}”. Może jednak zawierać zagnieżdżone elementy {2} (zobacz „{2}.{3}”) obsługujące tę operację. - - Brace Completion Uzupełnianie nawiasów @@ -1424,11 +1209,6 @@ Czy chcesz kontynuować? Trwa przechodzenie... - - Suggestion ellipses (…) - Wielokropki sugestii (…) - - '{0}' declarations 'Deklaracje „{0}” @@ -1459,11 +1239,6 @@ Czy chcesz kontynuować? Zakomentuj/odkomentuj zaznaczenie - - Code Completion - Uzupełnianie kodu - - Execute In Interactive Wykonaj w trybie interaktywnym @@ -1554,11 +1329,6 @@ Czy chcesz kontynuować? Pomoc dotycząca sygnatury - - Smart Token Formatter - Inteligentny element formatujący tokeny - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf index ecd4d11e8dae9..e408565f872e2 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf @@ -17,36 +17,16 @@ Não é possível navegar para o símbolo sob o cursor. - - Change configuration - Alterar configuração - - - - Code cleanup is not configured - A limpeza de código não está configurada - - Computing 'Encapsulate Field' information Computando informações de 'Encapsular Campo' - - Configure it now - Configurar agora - - Do not prefer 'this.' or 'Me.' Não preferir 'this.' nem 'Me'. - - Do not show this message again - Não mostrar esta mensagem novamente - - Do you still want to proceed? This may produce broken code. Ainda quer continuar? Isso pode produzir código desfeito. @@ -77,26 +57,11 @@ Filtrar Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - A Formatação do Documento executou uma limpeza adicional - - Get help for '{0}' Obter ajuda para '{0}' - - Gathering Suggestions - '{0}' - Obtendo Sugestões – '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - Obtendo Sugestões – aguardando a solução carregar totalmente - - Go To Base Ir Para a Base @@ -632,11 +597,6 @@ {0} conflito(s) não solucionável(is) - - Applying "{0}"... - Aplicando "{0}"... - - Adding '{0}' to '{1}' with content: Adicionando "{0}" a "{1}" com conteúdo: @@ -692,11 +652,6 @@ Encapsular Campo - - Applying "Encapsulate Field" refactoring... - Aplicando refatoração "Encapsular Campo"... - - Please select the definition of the field to encapsulate. Selecione a definição do campo a encapsular. @@ -722,11 +677,6 @@ Nenhuma informação encontrada. - - No usages found. - Nenhum uso encontrado. - - Implements Implementos @@ -747,86 +697,16 @@ Substituído por - - Directly Called In - Chamado Diretamente - - - - Indirectly Called In - Chamado Indiretamente - - - - Called In - Chamado Em - - - - Referenced In - Referenciado Em - - No references found. Nenhuma referência encontrada. - - No derived types found. - Nenhum tipo derivado encontrado. - - - - No implementations found. - Nenhuma implementação encontrada. - - - - {0} - (Line {1}) - {0} - (Linha {1}) - - - - Class Parts - Partes de Classe - - - - Struct Parts - Partes de Struct - - - - Interface Parts - Componentes da Interface - - - - Type Parts - Partes do Tipo - - Inherits Herda - - Inherited By - Herdado por - - - - Already tracking document with identical key - Já está a rastrear o documento com chave idêntica - - - - document is not currently being tracked - documento não está sendo rastreado no momento - - Computing Rename information... Computando informações de Renomeação... @@ -882,26 +762,11 @@ Concluindo automaticamente... - - Automatic Pair Completion - Conclusão de Pares Automática - - An active inline rename session is still active. Complete it before starting a new one. Uma sessão de renomeação embutida ativa ainda está ativa. Conclua-a antes de iniciar uma nova. - - The buffer is not part of a workspace. - O buffer não é parte de um workspace. - - - - The token is not contained in the workspace. - O token não está contido no workspace. - - Navigation Bars Barras de Navegação @@ -912,26 +777,11 @@ Atualizando barras de navegação... - - Format Token - Token de Formato - - Find References Localizar Referências - - Finding references... - Localizando referências... - - - - Finding references of "{0}"... - Localizando referências de "{0}"... - - Comment Selection Comentar Seleção @@ -977,11 +827,6 @@ Aplicando refatoração "Extrair Método"... - - Format Document - Formatar Documento - - Formatting document... Formatando documento... @@ -992,11 +837,6 @@ Formatação - - Format Selection - Formatar Seleção - - Formatting currently selected text... Formatando texto selecionado no momento... @@ -1037,11 +877,6 @@ Correção de Renomeação Embutida - - Inline Rename Resolved Conflict - Conflito de Renomeação Embutida Resolvido - - Inline Rename Renomeação embutida @@ -1057,11 +892,6 @@ Iniciar Renomeação - - Display conflict resolutions - Exibir resoluções de conflitos - - Finding token to rename... Localizando token para renomear... @@ -1102,31 +932,11 @@ Renomear: {0} - - Light bulb session is already dismissed. - A sessão de lâmpada já foi descartada. - - - - Automatic Pair Completion End Point Marker Color - Cor do Marcador de Ponto Final da Conclusão de Pares Automática - - Engine must be attached to an Interactive Window. O Mecanismo deve ser anexado a uma Janela Interativa. - - Changes the current prompt settings. - Altera as configurações de prompt atuais. - - - - Unexpected text: '{0}' - Texto inesperado: "{0}" - - The triggerSpan is not included in the given workspace. O triggerSpan não está incluído no workspace fornecido. @@ -1142,11 +952,6 @@ A transação já está concluída. - - Not a source error, line/column unavailable - Não é um erro de origem, linha/coluna disponível - - Can't compare positions from different text snapshots Não é possível comparar as posições de instantâneos de textos diferentes @@ -1227,11 +1032,6 @@ Visualizar Alterações - - Format Paste - Colar Formato - - Formatting pasted text... Formatando texto colado... @@ -1289,11 +1089,6 @@ Deseja continuar? Chamadas para Implementação de Interface '{0}' - - Computing Call Hierarchy Information - Informações sobre Hierarquia de Chamada de Computação - - Implements '{0}' Implementa '{0}' @@ -1344,11 +1139,6 @@ Deseja continuar? IntelliSense - - IntelliSense Commit Formatting - Formatação de Confirmação IntelliSense - - Rename Tracking Renomear Acompanhamento @@ -1359,11 +1149,6 @@ Deseja continuar? Removendo '{0}' de '{1}' com conteúdo: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}' não dá suporte à operação '{1}'. No entanto, ele pode conter '{2}'s aninhados (consulte '{2}.{3}') que dá suporte a esta operação. - - Brace Completion Preenchimento de Chaves @@ -1424,11 +1209,6 @@ Deseja continuar? Navegando... - - Suggestion ellipses (…) - Reticências de sugestão (…) - - '{0}' declarations 'Declarações de '{0}' @@ -1459,11 +1239,6 @@ Deseja continuar? Comentar/Remover Marca de Comentário da Seleção - - Code Completion - Conclusão de Código - - Execute In Interactive Executar em Interativo @@ -1554,11 +1329,6 @@ Deseja continuar? Ajuda da Assinatura - - Smart Token Formatter - Formatador de Token Inteligente - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf index fa06f552de4dc..9a8f03f5cf324 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf @@ -17,36 +17,16 @@ Не удается перейти к символу, на котором находится курсор. - - Change configuration - Изменить конфигурацию - - - - Code cleanup is not configured - Очистка кода не настроена - - Computing 'Encapsulate Field' information Вычисление сведений "Инкапсуляция поля" - - Configure it now - Настройте ее сейчас - - Do not prefer 'this.' or 'Me.' Не предпочитать "this." или "Me". - - Do not show this message again - Больше не показывать это сообщение - - Do you still want to proceed? This may produce broken code. Вы действительно хотите продолжить? Это может привести к появлению нерабочего кода. @@ -77,26 +57,11 @@ Фильтр Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - При форматировании документа была выполнена дополнительная очистка - - Get help for '{0}' Получить справку для "{0}" - - Gathering Suggestions - '{0}' - Сбор предложений — "{0}" - - - - Gathering Suggestions - Waiting for the solution to fully load - Сбор предложений — ожидается полная загрузка решения - - Go To Base Перейти к базовому @@ -632,11 +597,6 @@ {0} неразрешимые конфликты - - Applying "{0}"... - Применение "{0}"... - - Adding '{0}' to '{1}' with content: Добавление "{0}" к "{1}" с содержимым: @@ -692,11 +652,6 @@ Инкапсулировать поле - - Applying "Encapsulate Field" refactoring... - Применение рефакторинга "инкапсулирования поля" ... - - Please select the definition of the field to encapsulate. Выберите определение поля, которое нужно инкапсулировать. @@ -722,11 +677,6 @@ Информация не найдена. - - No usages found. - Использований не обнаружено. - - Implements Реализует @@ -747,86 +697,16 @@ Переопределяется - - Directly Called In - Прямой вызов - - - - Indirectly Called In - Неявный вызов - - - - Called In - Вызов - - - - Referenced In - Имеются ссылки в - - No references found. Ссылки не найдены. - - No derived types found. - Производных типов не найдено. - - - - No implementations found. - Реализаций не найдено. - - - - {0} - (Line {1}) - {0} — (Строка {1}) - - - - Class Parts - Части класса - - - - Struct Parts - Части структуры - - - - Interface Parts - Части интерфейса - - - - Type Parts - Части типа - - Inherits Наследует - - Inherited By - Наследуется - - - - Already tracking document with identical key - Документ с идентичным ключом уже отслеживается. - - - - document is not currently being tracked - Документ в настоящее время не отслеживается. - - Computing Rename information... Вычисление информации переименования... @@ -882,26 +762,11 @@ Автоматическое завершение... - - Automatic Pair Completion - Автоматическое завершение пары - - An active inline rename session is still active. Complete it before starting a new one. Встроенный сеанс переименования еще активен. Завершите его прежде, чем начинать новый. - - The buffer is not part of a workspace. - Этот буфер не является частью рабочей области. - - - - The token is not contained in the workspace. - Этот токен не помещен в рабочую область. - - Navigation Bars Панели навигации @@ -912,26 +777,11 @@ Идет обновление панелей переходов... - - Format Token - Токен формата - - Find References Найти ссылки - - Finding references... - Поиск ссылок... - - - - Finding references of "{0}"... - Поиск ссылок на "{0}"... - - Comment Selection Закомментировать выделенный фрагмент @@ -977,11 +827,6 @@ Применение рефакторинга "метода извлечения"... - - Format Document - Форматировать документ - - Formatting document... Идет форматирование документа... @@ -992,11 +837,6 @@ Форматирование - - Format Selection - Форматировать выделенный фрагмент - - Formatting currently selected text... Идет форматирование выбранного текста... @@ -1037,11 +877,6 @@ Исправление встроенного переименования - - Inline Rename Resolved Conflict - Разрешенный конфликт встроенного переименования - - Inline Rename Встроенное переименование @@ -1057,11 +892,6 @@ Начать переименование - - Display conflict resolutions - Отобразить разрешение конфликтов - - Finding token to rename... Поиск токена для переименования... @@ -1102,31 +932,11 @@ Переименовать: {0} - - Light bulb session is already dismissed. - Сеанс лампочки уже закрыт. - - - - Automatic Pair Completion End Point Marker Color - Цвет маркера конечной точки автоматического завершения пары. - - Engine must be attached to an Interactive Window. Модуль должен быть подключен к Интерактивному окну. - - Changes the current prompt settings. - Изменения текущих настроек командной строки. - - - - Unexpected text: '{0}' - Непредвиденный текст: "{0}" - - The triggerSpan is not included in the given workspace. Этот triggerSpan не входит в данную рабочую область. @@ -1142,11 +952,6 @@ Транзакция уже выполнена. - - Not a source error, line/column unavailable - Не ошибка источника, строка или столбец недоступны - - Can't compare positions from different text snapshots Не удается сравнить позиции из различных снимков текста @@ -1227,11 +1032,6 @@ Просмотреть изменения - - Format Paste - Форматировать при вставке - - Formatting pasted text... Идет форматирование вставленного текста... @@ -1289,11 +1089,6 @@ Do you want to proceed? Вызовы реализации интерфейса "{0}" - - Computing Call Hierarchy Information - Вычисление сведений об иерархии вызовов - - Implements '{0}' Реализует "{0}" @@ -1344,11 +1139,6 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - Форматирование при фиксации IntelliSense - - Rename Tracking Отслеживание переименования @@ -1359,11 +1149,6 @@ Do you want to proceed? Идет удаление "{0}" из "{1}" с содержимым: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - "{0}" не поддерживает операцию "{1}", но может содержать вложенные "{2}" (см. "{2}.{3}"), которые поддерживают эту операцию. - - Brace Completion Завершение скобок @@ -1424,11 +1209,6 @@ Do you want to proceed? Идет переход... - - Suggestion ellipses (…) - Предложение с многоточием (…) - - '{0}' declarations 'Объявления "{0}" @@ -1459,11 +1239,6 @@ Do you want to proceed? Закомментировать/раскомментировать выбранный фрагмент - - Code Completion - Завершение кода - - Execute In Interactive Выполнять в интерактивном режиме @@ -1554,11 +1329,6 @@ Do you want to proceed? Справка по сигнатурам - - Smart Token Formatter - Средство форматирования смарт-токена - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf index 8e9b82435743d..453990fe9c233 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf @@ -17,36 +17,16 @@ Giriş işareti altında sembole gidilemiyor. - - Change configuration - Değiştir yapılandırma - - - - Code cleanup is not configured - Kod temizleme yapılandırılmadı - - Computing 'Encapsulate Field' information 'Alanı Kapsülle' bilgileri hesaplanıyor - - Configure it now - Hemen yapılandırın - - Do not prefer 'this.' or 'Me.' 'this.' veya 'Me.' tercih etme - - Do not show this message again - Bu iletiyi bir daha gösterme - - Do you still want to proceed? This may produce broken code. Yine de devam etmek istiyor musunuz? Bu işlem sonucunda bozuk kod oluşturulabilir. @@ -77,26 +57,11 @@ Filtre Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - Biçimi belge ek temizleme işlemi - - Get help for '{0}' '{0}' için yardım alın - - Gathering Suggestions - '{0}' - Öneriler Toplanıyor - '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - Öneriler Toplanıyor - Çözümün tam olarak yüklenmesi bekleniyor - - Go To Base Tabana Git @@ -632,11 +597,6 @@ {0} çözümlenemeyen çakışma - - Applying "{0}"... - "{0}" uygulanıyor... - - Adding '{0}' to '{1}' with content: '{0}' şu içerik ile '{1}' üzerine ekleniyor: @@ -692,11 +652,6 @@ Alanı Kapsülle - - Applying "Encapsulate Field" refactoring... - "Alanı Yalıtma" yeniden düzenlemesi uygulanıyor... - - Please select the definition of the field to encapsulate. Lütfen yalıtılacak alanın tanımını seçin. @@ -722,11 +677,6 @@ Bilgi bulunamadı. - - No usages found. - Kullanım bulunamadı. - - Implements Uygulanan @@ -747,86 +697,16 @@ Geçersiz Kılınan - - Directly Called In - Doğrudan Çağrılma Yeri - - - - Indirectly Called In - Dolaylı Olarak Çağrılma Yeri - - - - Called In - Çağrılma Yeri - - - - Referenced In - Başvuru Yeri - - No references found. Başvuru bulunamadı. - - No derived types found. - Türetilmiş tür bulunamadı. - - - - No implementations found. - Uygulama bulunamadı. - - - - {0} - (Line {1}) - {0} - (Satır {1}) - - - - Class Parts - Sınıf Parçaları - - - - Struct Parts - Yapı Parçaları - - - - Interface Parts - Arabirim Parçaları - - - - Type Parts - Tür Parçaları - - Inherits Devralınan - - Inherited By - Devralan - - - - Already tracking document with identical key - Belge zaten özdeş anahtar ile izleniyor - - - - document is not currently being tracked - Belge şu anda izlenmiyor - - Computing Rename information... Yeniden Adlandırma bilgileri hesaplanıyor... @@ -882,26 +762,11 @@ Otomatik olarak tamamlanıyor... - - Automatic Pair Completion - Otomatik Çift Tamamlaması - - An active inline rename session is still active. Complete it before starting a new one. Etkin bir satır içi yeniden adlandırma oturumu hala etkin. Yenisini başlatmadan önce bunu tamamlayın. - - The buffer is not part of a workspace. - Arabellek bir çalışma alanının parçası değil. - - - - The token is not contained in the workspace. - Belirteç çalışma alanında yer almaz. - - Navigation Bars Gezinti Çubukları @@ -912,26 +777,11 @@ Gezinti çubukları yenileniyor... - - Format Token - Belirteci Biçimlendir - - Find References Başvuruları Bul - - Finding references... - Başvurular bulunuyor... - - - - Finding references of "{0}"... - "{0}" başvuruları bulunuyor... - - Comment Selection Seçimi Açıklama Satırı Yap @@ -977,11 +827,6 @@ "Yöntemi Ayıklama" yeniden düzenlemesi uygulanıyor... - - Format Document - Belgeyi Biçimlendir - - Formatting document... Belge biçimlendiriliyor... @@ -992,11 +837,6 @@ Biçimlendirme - - Format Selection - Biçim Seçimi - - Formatting currently selected text... Seçilen metin biçimlendiriliyor... @@ -1037,11 +877,6 @@ Satır İçi Yeniden Adlandırma Düzeltmesi - - Inline Rename Resolved Conflict - Satır İçi Yeniden Adlandırma Çözümlenen Çakışması - - Inline Rename Satır İçi Yeniden Adlandırma @@ -1057,11 +892,6 @@ Yeniden Adlandırmayı Başlat - - Display conflict resolutions - Çakışma çözümlemelerini görüntüle - - Finding token to rename... Yeniden adlandırılacak belirteç bulunuyor... @@ -1102,31 +932,11 @@ Yeniden adlandırma: {0} - - Light bulb session is already dismissed. - Ampul oturumu zaten kapatıldı. - - - - Automatic Pair Completion End Point Marker Color - Otomatik Çift Tamamlaması Bitiş Noktası İşaret Rengi - - Engine must be attached to an Interactive Window. Altyapı, Etkileşimli Pencere'ye iliştirilmelidir. - - Changes the current prompt settings. - Geçerli istem ayarlarını değiştirir. - - - - Unexpected text: '{0}' - Beklenmeyen metin: '{0}' - - The triggerSpan is not included in the given workspace. triggerSpan verilen çalışma alanında yer almaz. @@ -1142,11 +952,6 @@ İşlem zaten tamamlandı. - - Not a source error, line/column unavailable - Kaynak hatası değil, satır/sütun kullanılamıyor - - Can't compare positions from different text snapshots Konumlar farklı metin anlık görüntülerinden karşılaştırılamıyor @@ -1227,11 +1032,6 @@ Değişiklikleri Önizle - - Format Paste - Yapıştırmayı Biçimlendir - - Formatting pasted text... Yapıştırılan metin biçimlendiriliyor... @@ -1289,11 +1089,6 @@ Devam etmek istiyor musunuz? '{0}' Arayüz Uygulama Çağrıları - - Computing Call Hierarchy Information - Çağrı Hiyerarşisi Bilgileri Hesaplanıyor - - Implements '{0}' '{0}' öğesini uygular @@ -1344,11 +1139,6 @@ Devam etmek istiyor musunuz? IntelliSense - - IntelliSense Commit Formatting - IntelliSense Biçimlendirmeyi İşle - - Rename Tracking İzlemeyi Yeniden Adlandır @@ -1359,11 +1149,6 @@ Devam etmek istiyor musunuz? '{0}' öğesi, içeriği şu olan '{1}' öğesinden kaldırılıyor: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}', '{1}' işlemini desteklemiyor. Ancak bu işlemi destekleyen iç içe '{2}' (bkz. '{2}.{3}') içerebilir. - - Brace Completion Küme Ayracı Tamamlama @@ -1424,11 +1209,6 @@ Devam etmek istiyor musunuz? Gidiliyor... - - Suggestion ellipses (…) - Öneri üç noktası (…) - - '{0}' declarations '{0}' bildirimleri @@ -1459,11 +1239,6 @@ Devam etmek istiyor musunuz? Seçimi Açıklama Satırı Yap/Seçimin Açıklamasını Kaldır - - Code Completion - Kod Tamamlama - - Execute In Interactive Etkileşimli içinde Yürüt @@ -1554,11 +1329,6 @@ Devam etmek istiyor musunuz? İmza Yardımı - - Smart Token Formatter - Akıllı Belirteç Biçimlendirici - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf index 5afdf5e72fab5..474e2ead733dc 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf @@ -17,36 +17,16 @@ 无法导航到插入点下面的符号。 - - Change configuration - 更改配置 - - - - Code cleanup is not configured - 未配置代码清理 - - Computing 'Encapsulate Field' information 计算“封装字段”信息 - - Configure it now - 立即配置 - - Do not prefer 'this.' or 'Me.' 不首选 "this." 或 "Me." - - Do not show this message again - 不再显示此消息 - - Do you still want to proceed? This may produce broken code. 是否仍要继续? 这可能会导致代码损坏。 @@ -77,26 +57,11 @@ 筛选 Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - 格式文档执行了额外的清理 - - Get help for '{0}' 获取有关“{0}”的帮助 - - Gathering Suggestions - '{0}' - 正在收集建议 -“{0}” - - - - Gathering Suggestions - Waiting for the solution to fully load - 正在收集建议 - 正在等待解决方案完全加载 - - Go To Base 转到基础映像 @@ -632,11 +597,6 @@ {0} 个无法解决的冲突 - - Applying "{0}"... - 正在应用 “{0}”... - - Adding '{0}' to '{1}' with content: 将“{0}”添加到具有内容的“{1}”: @@ -692,11 +652,6 @@ 封装字段 - - Applying "Encapsulate Field" refactoring... - 正在应用 “封装字段”重构... - - Please select the definition of the field to encapsulate. 请选择要封装字段的定义。 @@ -722,11 +677,6 @@ 未找到信息。 - - No usages found. - 未找到用法。 - - Implements 实现 @@ -747,86 +697,16 @@ 重写者 - - Directly Called In - 直接调入 - - - - Indirectly Called In - 间接调入 - - - - Called In - 调入 - - - - Referenced In - 引用于 - - No references found. 未找到引用。 - - No derived types found. - 未找到派生类型。 - - - - No implementations found. - 未找到实现。 - - - - {0} - (Line {1}) - {0} - (第 {1} 行) - - - - Class Parts - 类部件 - - - - Struct Parts - 结构部件 - - - - Interface Parts - 接口部件 - - - - Type Parts - 类型部件 - - Inherits 继承 - - Inherited By - 继承者 - - - - Already tracking document with identical key - 已使用等价键跟踪文档 - - - - document is not currently being tracked - 当前未跟踪文档 - - Computing Rename information... 正在计算重命名信息... @@ -882,26 +762,11 @@ 正在自动完成... - - Automatic Pair Completion - 自动配对完成 - - An active inline rename session is still active. Complete it before starting a new one. 有效的内联重命名会话仍处于活动状态。在开始一个新会话前完成它。 - - The buffer is not part of a workspace. - 缓冲区不是工作区的一部分。 - - - - The token is not contained in the workspace. - 工作区中不包含该标记。 - - Navigation Bars 导航栏 @@ -912,26 +777,11 @@ 正在刷新导航栏... - - Format Token - 设置标记的格式 - - Find References 查找引用 - - Finding references... - 正在查找引用... - - - - Finding references of "{0}"... - 正在查找“{0}”的引用... - - Comment Selection 注释选定内容 @@ -977,11 +827,6 @@ 正在应用“提取方法”重构... - - Format Document - 设置文档的格式 - - Formatting document... 正在设置文档格式... @@ -992,11 +837,6 @@ 格式设置 - - Format Selection - 设置选定内容的格式 - - Formatting currently selected text... 正在设置当前所选文本的格式... @@ -1037,11 +877,6 @@ 内联重命名修复 - - Inline Rename Resolved Conflict - 内联重命名已解决冲突 - - Inline Rename 内联重命名 @@ -1057,11 +892,6 @@ 开始重命名 - - Display conflict resolutions - 显示冲突解决方法 - - Finding token to rename... 正在查找要重命名的标记... @@ -1102,31 +932,11 @@ 重命名: {0} - - Light bulb session is already dismissed. - 灯泡会话已解除。 - - - - Automatic Pair Completion End Point Marker Color - 自动配对完成终点标记颜色 - - Engine must be attached to an Interactive Window. 引擎必须附加到“交互窗口”。 - - Changes the current prompt settings. - 更改当前提示设置。 - - - - Unexpected text: '{0}' - 意外的文本:“{0}” - - The triggerSpan is not included in the given workspace. 给定工作区中不包括 triggerSpan。 @@ -1142,11 +952,6 @@ 该事务已完成。 - - Not a source error, line/column unavailable - 不是源错误,行/列不可用 - - Can't compare positions from different text snapshots 无法比较不同文本快照的位置 @@ -1227,11 +1032,6 @@ 预览更改 - - Format Paste - 格式粘贴 - - Formatting pasted text... 正在设置已粘贴文本的格式... @@ -1289,11 +1089,6 @@ Do you want to proceed? 对接口实现“{0}”的调用 - - Computing Call Hierarchy Information - 计算调用层次结构信息 - - Implements '{0}' 实现“{0}” @@ -1344,11 +1139,6 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - IntelliSense 提交格式 - - Rename Tracking 重命名跟踪 @@ -1359,11 +1149,6 @@ Do you want to proceed? 将“{0}”连带内容从“{1}”删除: - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - “{0}”不支持“{1}”操作。但是,它可能包含支持此操作的嵌套“{2}”(参见“{2}.{3}”)。 - - Brace Completion 大括号完成 @@ -1424,11 +1209,6 @@ Do you want to proceed? 正在导航... - - Suggestion ellipses (…) - 建议使用省略号(…) - - '{0}' declarations “{0}”声明 @@ -1459,11 +1239,6 @@ Do you want to proceed? 注释/取消注释选定内容 - - Code Completion - 代码完成 - - Execute In Interactive 交互执行 @@ -1554,11 +1329,6 @@ Do you want to proceed? 签名帮助 - - Smart Token Formatter - 智能令牌格式化程序 - - \ No newline at end of file diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf index b444b34bd8de7..b2be44ff7c95d 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf @@ -17,36 +17,16 @@ 無法巡覽至插入號下的符號。 - - Change configuration - 變更組態 - - - - Code cleanup is not configured - 未設定程式碼清除 - - Computing 'Encapsulate Field' information 正在計算 [封裝欄位] 資訊 - - Configure it now - 立即設定 - - Do not prefer 'this.' or 'Me.' 不建議使用 'this.' 或 'Me.' - - Do not show this message again - 不再顯示此訊息 - - Do you still want to proceed? This may produce broken code. 仍要繼續嗎? 這可能產生中斷的程式碼。 @@ -77,26 +57,11 @@ 篩選 Caption/tooltip for "Filter" image element displayed in completion popup. - - Format Document performed additional cleanup - 執行額外清除的格式化文件 - - Get help for '{0}' 取得 '{0}' 的說明 - - Gathering Suggestions - '{0}' - 正在蒐集建議 - '{0}' - - - - Gathering Suggestions - Waiting for the solution to fully load - 正在蒐集建議 - 正在等候解決方案完整載入 - - Go To Base 移至基底 @@ -632,11 +597,6 @@ 有 {0} 個未解決的衝突 - - Applying "{0}"... - 正在套用 "{0}"... - - Adding '{0}' to '{1}' with content: 將 '{0}' 加入包含下列內容的 '{1}': @@ -692,11 +652,6 @@ 封裝欄位 - - Applying "Encapsulate Field" refactoring... - 正在套用「封裝欄位」重構... - - Please select the definition of the field to encapsulate. 請為要封裝的欄位選取定義。 @@ -722,11 +677,6 @@ 找不到資訊。 - - No usages found. - 找不到用法。 - - Implements 實作 @@ -747,86 +697,16 @@ 覆寫者 - - Directly Called In - 直接呼叫位置 - - - - Indirectly Called In - 間接呼叫位置 - - - - Called In - 呼叫位置 - - - - Referenced In - 參考位置 - - No references found. 找不到參考。 - - No derived types found. - 找不到衍生的類型。 - - - - No implementations found. - 找不到實作。 - - - - {0} - (Line {1}) - {0} - (第 {1} 行) - - - - Class Parts - 類別組件 - - - - Struct Parts - 結構組件 - - - - Interface Parts - 介面組件 - - - - Type Parts - 類型組件 - - Inherits 繼承 - - Inherited By - 繼承者 - - - - Already tracking document with identical key - 已追蹤具有相同索引鍵的文件 - - - - document is not currently being tracked - 文件目前未加以追蹤 - - Computing Rename information... 正在計算重新命名資訊... @@ -882,26 +762,11 @@ 自動完成中... - - Automatic Pair Completion - 自動配對完成 - - An active inline rename session is still active. Complete it before starting a new one. 現用內嵌重新命名工作階段仍在執行中。請先加以結束,然後再啟動新的工作階段。 - - The buffer is not part of a workspace. - 此緩衝區不屬於工作區。 - - - - The token is not contained in the workspace. - 工作區未包含此語彙基元。 - - Navigation Bars 導覽列 @@ -912,26 +777,11 @@ 正在重新整理導覽列... - - Format Token - 格式化語彙基元 - - Find References 尋找參考 - - Finding references... - 正在尋找參考... - - - - Finding references of "{0}"... - 正在尋找 "{0}" 的參考... - - Comment Selection 註解選取範圍 @@ -977,11 +827,6 @@ 正在套用「擷取方法」重構... - - Format Document - 格式化文件 - - Formatting document... 正在格式化文件... @@ -992,11 +837,6 @@ 格式化 - - Format Selection - 格式化選取範圍 - - Formatting currently selected text... 正在格式化目前選取的文字... @@ -1037,11 +877,6 @@ 內嵌重新命名修復 - - Inline Rename Resolved Conflict - 已解決內嵌重新命名衝突 - - Inline Rename 內嵌重新命名 @@ -1057,11 +892,6 @@ 開始重新命名 - - Display conflict resolutions - 顯示衝突解決方法 - - Finding token to rename... 正在尋找要重新命名的語彙基元... @@ -1102,31 +932,11 @@ 重新命名: {0} - - Light bulb session is already dismissed. - 燈泡工作階段已關閉。 - - - - Automatic Pair Completion End Point Marker Color - 自動配對完成端點標記色彩 - - Engine must be attached to an Interactive Window. 引擎必須連結到互動視窗。 - - Changes the current prompt settings. - 變更目前的提示設定。 - - - - Unexpected text: '{0}' - 未預期的文字: '{0}' - - The triggerSpan is not included in the given workspace. 指定的工作區未包含 triggerSpan。 @@ -1142,11 +952,6 @@ 交易已完成。 - - Not a source error, line/column unavailable - 非來源錯誤,行/資料行無法使用 - - Can't compare positions from different text snapshots 無法比較不同文字快照的位置 @@ -1227,11 +1032,6 @@ 預覽變更 - - Format Paste - 貼上格式 - - Formatting pasted text... 正在格式化貼上的文字... @@ -1289,11 +1089,6 @@ Do you want to proceed? 呼叫至介面實作 '{0}' - - Computing Call Hierarchy Information - 計算呼叫階層資訊 - - Implements '{0}' 實作 '{0}' @@ -1344,11 +1139,6 @@ Do you want to proceed? IntelliSense - - IntelliSense Commit Formatting - IntelliSense 認可格式 - - Rename Tracking 重新命名追蹤 @@ -1359,11 +1149,6 @@ Do you want to proceed? 從包含下列內容的 '{1}' 移除 '{0}': - - '{0}' does not support the '{1}' operation. However, it may contain nested '{2}'s (see '{2}.{3}') that support this operation. - '{0}' 不支援 '{1}' 作業。不過,它可能包含支援這項作業的巢狀 '{2}' (請參閱 '{2}.{3}')。 - - Brace Completion 以大括號完成 @@ -1424,11 +1209,6 @@ Do you want to proceed? 正在巡覽... - - Suggestion ellipses (…) - 建議省略符號 (…) - - '{0}' declarations '{0}' 宣告 @@ -1459,11 +1239,6 @@ Do you want to proceed? 註解/取消註解選取範圍 - - Code Completion - 程式碼完成 - - Execute In Interactive 以互動方式執行 @@ -1554,11 +1329,6 @@ Do you want to proceed? 簽章說明 - - Smart Token Formatter - 智慧權杖格式器 - - \ No newline at end of file From 2ba27de5bebb19edd7ad58d6c8ac25e45a5d97c1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:17:30 -0700 Subject: [PATCH 16/94] Remove unused resource string --- .../Core.Wpf/EditorFeaturesWpfResources.resx | 9 --------- .../xlf/EditorFeaturesWpfResources.cs.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.de.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.es.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.fr.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.it.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.ja.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.ko.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.pl.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.pt-BR.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.ru.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.tr.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.zh-Hans.xlf | 15 --------------- .../xlf/EditorFeaturesWpfResources.zh-Hant.xlf | 15 --------------- 14 files changed, 204 deletions(-) diff --git a/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx b/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx index 28cfa56bfb39c..c83b28818abf3 100644 --- a/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx +++ b/src/EditorFeatures/Core.Wpf/EditorFeaturesWpfResources.resx @@ -129,12 +129,6 @@ Executing selection in Interactive Window. - - Print a list of referenced assemblies. - - - The references command is not supported in this Interactive Window implementation. - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. @@ -156,9 +150,6 @@ Enter to rename, Shift+Enter to preview - - Generating suggestions... - Enter to rename, Shift+Enter to preview, Ctrl+Space for rename suggestions diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf index 74efd3bc19924..09984a6f812ca 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.cs.xlf @@ -32,11 +32,6 @@ Výběr se spouští v okně Interactive. - - Generating suggestions... - Generování návrhů… - - Get AI-powered rename suggestions (Ctrl+Space) Získejte návrhy přejmenování využívající umělou inteligenci (Ctrl+Mezerník) @@ -47,11 +42,6 @@ Interaktivní platforma procesů hostitelů - - Print a list of referenced assemblies. - Vytiskne seznam odkazovaných sestavení. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Resetujte spouštěcí prostředí do počátečního stavu a zachovejte historii s možností přepnout modul runtime hostitelského procesu. @@ -77,11 +67,6 @@ Vlastnost CurrentWindow se dá přiřadit jenom jednou. - - The references command is not supported in this Interactive Window implementation. - Příkaz references není v této implementaci okna Interactive podporovaný. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf index 0eb0ec86d71d1..de7e4622e7435 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.de.xlf @@ -32,11 +32,6 @@ Die Auswahl wird im Interactive-Fenster ausgeführt. - - Generating suggestions... - Vorschläge werden generiert... - - Get AI-powered rename suggestions (Ctrl+Space) KI-gestützte Umbenennungsvorschläge abrufen (STRG+LEERTASTE) @@ -47,11 +42,6 @@ Interaktive Hostprozessplattform - - Print a list of referenced assemblies. - Gibt eine Liste der Assemblys aus, auf die verwiesen wird. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Setzen Sie die Ausführungsumgebung auf den Anfangszustand zurück, und behalten Sie den Verlauf bei, mit der Option, die Runtime des Hostprozesses zu wechseln. @@ -77,11 +67,6 @@ Die Eigenschaft "CurrentWindow" kann nur ein Mal zugewiesen werden. - - The references command is not supported in this Interactive Window implementation. - Der Befehl "references" wird in dieser Implementierung von Interactive-Fenster nicht unterstützt. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf index 01ffdf109b6b3..116149effe1f1 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.es.xlf @@ -32,11 +32,6 @@ Ejecutando selección en ventana interactiva. - - Generating suggestions... - Generando sugerencias... - - Get AI-powered rename suggestions (Ctrl+Space) Obtener sugerencias de cambio de nombre con tecnología de inteligencia artificial (Ctrl+Espacio) @@ -47,11 +42,6 @@ Plataforma de proceso de host interactiva - - Print a list of referenced assemblies. - Imprima una lista de ensamblados de referencia. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Restablezca el entorno de ejecución al estado inicial y mantenga el historial, con la opción de cambiar el tiempo de ejecución del proceso de host. @@ -77,11 +67,6 @@ La propiedad CurrentWindow solo se puede asignar una vez. - - The references command is not supported in this Interactive Window implementation. - No se admite el comando de referencias en esta implementación de ventana interactiva. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf index 95d215d86b752..4319062bca8d4 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.fr.xlf @@ -32,11 +32,6 @@ Exécution de la sélection dans la fenêtre interactive. - - Generating suggestions... - Génération en cours de suggestions... - - Get AI-powered rename suggestions (Ctrl+Space) Obtenir des suggestions de renommage basées sur l’intelligence artificielle (Ctrl+Espace) @@ -47,11 +42,6 @@ Plateforme de processus hôte interactive - - Print a list of referenced assemblies. - Affichez la liste des assemblys référencés. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Réinitialisez l’environnement d’exécution à l’état initial et conservez l’historique, avec l’option permettant de changer le runtime du processus hôte. @@ -77,11 +67,6 @@ La propriété CurrentWindow ne peut être assignée qu'une seule fois. - - The references command is not supported in this Interactive Window implementation. - La commande references n'est pas prise en charge dans cette implémentation de fenêtre interactive. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf index 4bfc25ea1a982..3f5deaf2491d7 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.it.xlf @@ -32,11 +32,6 @@ Esecuzione della selezione nella finestra interattiva. - - Generating suggestions... - Generazione di suggerimenti in corso - - Get AI-powered rename suggestions (Ctrl+Space) Ottieni suggerimenti di ridenominazione basati sull'intelligenza artificiale (CTRL+BARRA SPAZIATRICE) @@ -47,11 +42,6 @@ Piattaforma interattiva per processi host - - Print a list of referenced assemblies. - Stampa un elenco di tutti gli assembly di riferimento. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Reimpostare lo stato iniziale dell'ambiente di esecuzione e mantenere la cronologia, con l'opzione per cambiare il runtime del processo host. @@ -77,11 +67,6 @@ La proprietà CurrentWindow può essere assegnata una sola volta. - - The references command is not supported in this Interactive Window implementation. - Il comando references non è supportato in questa implementazione di Finestra interattiva. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf index d146d32c45dea..fcfbc0b834c31 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ja.xlf @@ -32,11 +32,6 @@ インタラクティブ ウィンドウで選択を実行します。 - - Generating suggestions... - 候補を生成しています... - - Get AI-powered rename suggestions (Ctrl+Space) AI を利用した名前変更の提示を取得する (Ctrl + Space) @@ -47,11 +42,6 @@ 対話型ホスト プロセス プラットフォーム - - Print a list of referenced assemblies. - 参照アセンブリの一覧を印刷します。 - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. ホスト プロセスのランタイムを切り替えるオプションを使用して、実行環境を初期状態にリセットし、履歴を保持します。 @@ -77,11 +67,6 @@ CurrentWindow プロパティは 1 回のみ割り当てることができます。 - - The references command is not supported in this Interactive Window implementation. - このインタラクティブ ウィンドウの実装で、参照コマンドはサポートされていません。 - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf index 689df5332a228..5065613dadc48 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ko.xlf @@ -32,11 +32,6 @@ 선택 영역을 대화형 창에서 실행하는 중입니다. - - Generating suggestions... - 제안 사항을 생성하는 중... - - Get AI-powered rename suggestions (Ctrl+Space) AI 기반 이름 바꾸기 제안 보기(Ctrl+스페이스바) @@ -47,11 +42,6 @@ 대화형 호스트 프로세스 플랫폼 - - Print a list of referenced assemblies. - 참조된 어셈블리의 목록을 인쇄합니다. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. 호스트 프로세스의 런타임을 전환하는 옵션을 사용하여 실행 환경을 초기 상태로 다시 설정하고 기록을 유지합니다. @@ -77,11 +67,6 @@ CurrentWindow 속성은 한 번만 할당될 수 있습니다. - - The references command is not supported in this Interactive Window implementation. - 참조 명령은 이 대화형 창 구현에서 지원되지 않습니다. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf index 50fb8f133ddff..23c17d9693380 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pl.xlf @@ -32,11 +32,6 @@ Wykonywanie zaznaczenia w oknie Interactive. - - Generating suggestions... - Generowanie sugestii... - - Get AI-powered rename suggestions (Ctrl+Space) Uzyskaj funkcję Zmień nazwy sugestii obsługiwane przez sztuczną inteligencję (Ctrl+Spacja) @@ -47,11 +42,6 @@ Platforma procesu hosta interaktywnego - - Print a list of referenced assemblies. - Wydrukuj listę przywoływanych zestawów. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Zresetuj środowisko wykonawcze do stanu początkowego i zachowaj historię z opcją przełączenia środowiska uruchomieniowego procesu hosta. @@ -77,11 +67,6 @@ Właściwość CurrentWindow można przypisać tylko raz. - - The references command is not supported in this Interactive Window implementation. - Polecenie references nie jest obsługiwane w tej implementacji okna Interactive. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf index 079cdb4a2f89a..f634d8dae75ed 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.pt-BR.xlf @@ -32,11 +32,6 @@ Executando seleção na Janela Interativa. - - Generating suggestions... - Gerando sugestões... - - Get AI-powered rename suggestions (Ctrl+Space) Obter sugestões de renomeação com tecnologia de IA (Ctrl+Espaço) @@ -47,11 +42,6 @@ Plataforma interativa de processo de host - - Print a list of referenced assemblies. - Imprima uma lista de assemblies referenciados. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Redefine o ambiente de execução para o estado inicial e mantém o histórico, com a opção de mudar o runtime do processo do host. @@ -77,11 +67,6 @@ A propriedade CurrentWindow deve ser atribuído apenas uma vez. - - The references command is not supported in this Interactive Window implementation. - O comando de referências não tem suporte nessa implementação de Janela Interativa. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf index 3a8f7017c51d5..e2a1e6d137a96 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.ru.xlf @@ -32,11 +32,6 @@ Выполнение выделенного фрагмента в Интерактивном окне. - - Generating suggestions... - Создаются предложения... - - Get AI-powered rename suggestions (Ctrl+Space) Подбор имени на базе искусственного интеллекта (CTRL+ПРОБЕЛ) @@ -47,11 +42,6 @@ Интерактивная платформа хост-процесса - - Print a list of referenced assemblies. - Печать списка сборок, на которые указывают ссылки. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Сбросьте среду выполнения в начальное состояние и сохраните журнал с возможностью переключения среды выполнения хост-процесса. @@ -77,11 +67,6 @@ Свойство CurrentWindow может быть назначено только один раз. - - The references command is not supported in this Interactive Window implementation. - Команда, на которую указывает ссылка, не поддерживается в этой реализации Интерактивного окна. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf index d46c18482e002..3ebd606908af6 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.tr.xlf @@ -32,11 +32,6 @@ Seçim, Etkileşimli Pencere'de yürütülüyor. - - Generating suggestions... - Öneriler oluşturuluyor... - - Get AI-powered rename suggestions (Ctrl+Space) Yapay zeka destekli yeniden adlandırma önerileri alın (Ctrl+Space) @@ -47,11 +42,6 @@ Etkileşimli ana işlem platformu - - Print a list of referenced assemblies. - Başvurulan bütünleştirilmiş kodların listesini yazdırın. - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. Ana işleminin çalışma zamanını değiştirme seçeneğini belirleyerek yürütme ortamını başlangıç durumuna sıfırlayın ve geçmişi tutun. @@ -77,11 +67,6 @@ CurrentWindow özelliği yalnızca bir kez atanabilir. - - The references command is not supported in this Interactive Window implementation. - Başvurular komutu bu Etkileşimli Pencere uygulamasında desteklenmiyor. - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf index 452f68938ee69..6d6dbb3d7f0e1 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hans.xlf @@ -32,11 +32,6 @@ 在交互窗口中执行所选内容。 - - Generating suggestions... - 正在生成建议... - - Get AI-powered rename suggestions (Ctrl+Space) 获取 AI 支持的重命名建议(Ctrl+空格键) @@ -47,11 +42,6 @@ 交互式主机进程平台 - - Print a list of referenced assemblies. - 打印引用程序集的列表。 - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. 通过选择切换主机进程的运行时,将执行环境重置为初始状态并保留历史记录。 @@ -77,11 +67,6 @@ 只能对 CurrentWindow 属性进行一次赋值。 - - The references command is not supported in this Interactive Window implementation. - 此交互窗口实现中不支持引用命令。 - - \ No newline at end of file diff --git a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf index 865b373a6b6c0..54c10200392fc 100644 --- a/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf +++ b/src/EditorFeatures/Core.Wpf/xlf/EditorFeaturesWpfResources.zh-Hant.xlf @@ -32,11 +32,6 @@ 正在於互動視窗中執行選取範圍。 - - Generating suggestions... - 正在產生建議... - - Get AI-powered rename suggestions (Ctrl+Space) 取得 AI 支援的重新命名建議 (Ctrl+Space) @@ -47,11 +42,6 @@ 互動式主機處理序平台 - - Print a list of referenced assemblies. - 列印參考組件的清單。 - - Reset the execution environment to the initial state and keep history, with the option to switch the runtime of the host process. 使用切換主機處理序的執行階段選項,將執行環境重設為初始狀態並保留歷程記錄。 @@ -77,11 +67,6 @@ CurrentWindow 屬性只能受指派一次。 - - The references command is not supported in this Interactive Window implementation. - 在此互動視窗實作中不支援參考命令。 - - \ No newline at end of file From 8b467c0031ae982cbfb0691a32e1be0824e6c54f Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:19:54 -0700 Subject: [PATCH 17/94] Remove unused resource string --- .../CSharp/CSharpEditorResources.resx | 3 --- .../CSharp/xlf/CSharpEditorResources.cs.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.de.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.es.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.fr.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.it.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.ja.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.ko.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.pl.xlf | 5 ----- .../xlf/CSharpEditorResources.pt-BR.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.ru.xlf | 5 ----- .../CSharp/xlf/CSharpEditorResources.tr.xlf | 5 ----- .../xlf/CSharpEditorResources.zh-Hans.xlf | 5 ----- .../xlf/CSharpEditorResources.zh-Hant.xlf | 5 ----- .../VisualBasic/VBEditorResources.resx | 12 ----------- .../VisualBasic/xlf/VBEditorResources.cs.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.de.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.es.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.fr.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.it.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.ja.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.ko.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.pl.xlf | 20 ------------------- .../xlf/VBEditorResources.pt-BR.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.ru.xlf | 20 ------------------- .../VisualBasic/xlf/VBEditorResources.tr.xlf | 20 ------------------- .../xlf/VBEditorResources.zh-Hans.xlf | 20 ------------------- .../xlf/VBEditorResources.zh-Hant.xlf | 20 ------------------- 28 files changed, 340 deletions(-) diff --git a/src/EditorFeatures/CSharp/CSharpEditorResources.resx b/src/EditorFeatures/CSharp/CSharpEditorResources.resx index 0c85188266fe5..d1d4976bedfe1 100644 --- a/src/EditorFeatures/CSharp/CSharpEditorResources.resx +++ b/src/EditorFeatures/CSharp/CSharpEditorResources.resx @@ -126,9 +126,6 @@ (Press TAB to insert) - - Smart Indenting - Split string diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.cs.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.cs.xlf index 83f5df838eaf0..7f7b5c9f24d72 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.cs.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.cs.xlf @@ -52,11 +52,6 @@ (Pro vložení stiskněte TAB.) - - Smart Indenting - Chytré odsazování - - Split raw string Rozdělit nezpracovaný řetězec diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.de.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.de.xlf index b514ba01c2205..dc4b02342fff9 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.de.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.de.xlf @@ -52,11 +52,6 @@ (Zum Einfügen TAB-TASTE drücken) - - Smart Indenting - Intelligenter Einzug - - Split raw string Rohzeichenfolge teilen diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.es.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.es.xlf index f2040ac30a13a..b59460b830055 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.es.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.es.xlf @@ -52,11 +52,6 @@ (Presione TAB para insertar) - - Smart Indenting - Sangría inteligente - - Split raw string Dividir cadena sin formato diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.fr.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.fr.xlf index 5140bf6b601bb..1d0de182ad5c9 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.fr.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.fr.xlf @@ -52,11 +52,6 @@ (Appuyez sur TAB pour insérer) - - Smart Indenting - Retrait intelligent - - Split raw string Fractionner la chaîne brute diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.it.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.it.xlf index 9d87f65e41bba..ffb05af54605b 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.it.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.it.xlf @@ -52,11 +52,6 @@ (Premere TAB per inserire) - - Smart Indenting - Rientro automatico - - Split raw string Dividi stringa non elaborata diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ja.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ja.xlf index 663feaf7a0ce9..024dbb366400f 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ja.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ja.xlf @@ -52,11 +52,6 @@ (Tab キーを押して挿入) - - Smart Indenting - スマート インデント - - Split raw string 生文字列の分割 diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ko.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ko.xlf index 38519446fcd9c..0af667ee68fb1 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ko.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ko.xlf @@ -52,11 +52,6 @@ (삽입하려면 <Tab> 키 누름) - - Smart Indenting - 스마트 들여쓰기 - - Split raw string 원시 문자열 분할 diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pl.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pl.xlf index 9df9db622e3ef..0869e65dfd49e 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pl.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pl.xlf @@ -52,11 +52,6 @@ (Naciśnij klawisz TAB, aby wstawić) - - Smart Indenting - Inteligentne tworzenie wcięć - - Split raw string Podziel nieprzetworzony ciąg diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pt-BR.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pt-BR.xlf index 034ad04abab07..71adb01c65ef2 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pt-BR.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.pt-BR.xlf @@ -52,11 +52,6 @@ (Pressione TAB para inserir) - - Smart Indenting - Recuo Inteligente - - Split raw string Dividir cadeia de caracteres bruta diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ru.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ru.xlf index 8aa57ab44cc5a..7a2e26b488f70 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ru.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.ru.xlf @@ -52,11 +52,6 @@ (Нажмите клавишу TAB для вставки) - - Smart Indenting - Интеллектуальные отступы - - Split raw string Разделить необработанную строку diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.tr.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.tr.xlf index f19bbf1db2a3a..4f4e0e1b6b51b 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.tr.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.tr.xlf @@ -52,11 +52,6 @@ (Eklemek için TAB tuşuna basın) - - Smart Indenting - Akıllı Girintileme - - Split raw string Ham dizeyi böl diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hans.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hans.xlf index 2fbffb81bebb9..5d8955cc11670 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hans.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hans.xlf @@ -52,11 +52,6 @@ (按 Tab 插入) - - Smart Indenting - 智能缩进 - - Split raw string 拆分原始字符串 diff --git a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hant.xlf b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hant.xlf index 95e6024d5558d..a5bf2b3f46e4e 100644 --- a/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hant.xlf +++ b/src/EditorFeatures/CSharp/xlf/CSharpEditorResources.zh-Hant.xlf @@ -52,11 +52,6 @@ (按 TAB 鍵插入) - - Smart Indenting - 智慧縮排 - - Split raw string 分割原始字串 diff --git a/src/EditorFeatures/VisualBasic/VBEditorResources.resx b/src/EditorFeatures/VisualBasic/VBEditorResources.resx index 29ae2b06c9cad..fe28efc13036a 100644 --- a/src/EditorFeatures/VisualBasic/VBEditorResources.resx +++ b/src/EditorFeatures/VisualBasic/VBEditorResources.resx @@ -117,12 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Case Correction - - - Correcting word casing... - This call is required by the designer. @@ -132,18 +126,12 @@ End Construct - - Smart Indenting - Formatting Document... Insert new line - - Format Paste - Formatting pasted text... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.cs.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.cs.xlf index cdfbfebd88fbd..88e6b385c91ad 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.cs.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.cs.xlf @@ -12,16 +12,6 @@ Přidávají se chybějící direktivy import... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Oprava velkých a malých písmen - - - - Correcting word casing... - Opravují se velká a malá písmena u slov... - - This call is required by the designer. Toto volání je vyžadované návrhářem. @@ -37,11 +27,6 @@ Koncová konstrukce - - Smart Indenting - Chytré odsazování - - Formatting Document... Formátuje se dokument... @@ -52,11 +37,6 @@ Vložit nový řádek - - Format Paste - Vložit formát - - Formatting pasted text... Formátuje se vložený text... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.de.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.de.xlf index b0727e1815756..06bb3a2ef9322 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.de.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.de.xlf @@ -12,16 +12,6 @@ Fehlende import-Anweisungen werden hinzugefügt... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Fallkorrektur - - - - Correcting word casing... - Wortschreibweise wird korrigiert... - - This call is required by the designer. Dieser Aufruf ist für den Designer erforderlich. @@ -37,11 +27,6 @@ Endkonstrukt - - Smart Indenting - Intelligenter Einzug - - Formatting Document... Dokument wird formatiert... @@ -52,11 +37,6 @@ Neue Zeile einfügen - - Format Paste - Format einfügen - - Formatting pasted text... Eingefügter Text wird formatiert... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.es.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.es.xlf index 847ad1ba6498b..c66c433c08f84 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.es.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.es.xlf @@ -12,16 +12,6 @@ Agregando las importaciones que faltan... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Corrección de mayúsculas/minúsculas - - - - Correcting word casing... - Corrigiendo uso de mayúsculas/minúsculas... - - This call is required by the designer. Esta llamada es exigida por el diseñador. @@ -37,11 +27,6 @@ Terminar construcción - - Smart Indenting - Sangría inteligente - - Formatting Document... Dando formato al documento... @@ -52,11 +37,6 @@ Insertar nueva línea - - Format Paste - Pegado de formato - - Formatting pasted text... Dando formato al texto pegado... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.fr.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.fr.xlf index 1dcb4921e452d..49a5f9eff36eb 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.fr.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.fr.xlf @@ -12,16 +12,6 @@ Ajout des imports manquants... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Correction de la casse - - - - Correcting word casing... - Correction de la casse des mots... - - This call is required by the designer. Cet appel est requis par le concepteur. @@ -37,11 +27,6 @@ Construction de fin - - Smart Indenting - Retrait intelligent - - Formatting Document... Mise en forme du document... @@ -52,11 +37,6 @@ Insérer une nouvelle ligne - - Format Paste - Mettre en forme lors du collage - - Formatting pasted text... Mise en forme du texte collé... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.it.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.it.xlf index 5535cc89df841..ba3f0561e77b5 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.it.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.it.xlf @@ -12,16 +12,6 @@ Aggiunta di Import mancanti... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Correzione maiuscole/minuscole - - - - Correcting word casing... - Correzione dell'uso delle maiuscole/minuscole per le parole... - - This call is required by the designer. La chiamata è richiesta dalla finestra di progettazione. @@ -37,11 +27,6 @@ Costrutto End - - Smart Indenting - Rientro automatico - - Formatting Document... Formattazione del documento... @@ -52,11 +37,6 @@ Inserisci nuova riga - - Format Paste - Formatta testo incollato - - Formatting pasted text... Formattazione del testo incollato... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ja.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ja.xlf index f429fc607061b..19e3d6a0997f8 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ja.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ja.xlf @@ -12,16 +12,6 @@ 欠落している imports を追加しています... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - 大文字小文字の修正 - - - - Correcting word casing... - 単語の大文字と小文字を修正しています... - - This call is required by the designer. この呼び出しはデザイナーで必要です。 @@ -37,11 +27,6 @@ コンストラクターの終了 - - Smart Indenting - スマート インデント - - Formatting Document... ドキュメントを書式設定しています... @@ -52,11 +37,6 @@ 改行の挿入 - - Format Paste - 書式の貼り付け - - Formatting pasted text... 貼り付けたテキストを書式設定しています... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ko.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ko.xlf index ae6770bf43541..b5aaf6566249b 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ko.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ko.xlf @@ -12,16 +12,6 @@ 누락된 import 추가 중... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - 대/소문자 수정 - - - - Correcting word casing... - 단어 대/소문자 수정 중... - - This call is required by the designer. 디자이너에서 이 호출이 필요합니다. @@ -37,11 +27,6 @@ 구문 종료 - - Smart Indenting - 스마트 들여쓰기 - - Formatting Document... 문서 서식을 지정하는 중... @@ -52,11 +37,6 @@ 새 줄 삽입 - - Format Paste - 서식 붙여넣기 - - Formatting pasted text... 붙여넣은 텍스트의 서식을 지정하는 중... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pl.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pl.xlf index a615e8298ab35..1e5631858f1a9 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pl.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pl.xlf @@ -12,16 +12,6 @@ Trwa dodawanie brakujących dyrektyw import... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Poprawianie wielkości liter - - - - Correcting word casing... - Trwa poprawianie wielkości liter w słowie... - - This call is required by the designer. To wywołanie jest wymagane przez projektanta. @@ -37,11 +27,6 @@ Konstrukcja końcowa - - Smart Indenting - Inteligentne tworzenie wcięć - - Formatting Document... Trwa formatowanie dokumentu... @@ -52,11 +37,6 @@ Wstaw nowy wiersz - - Format Paste - Formatuj wklejoną zawartość - - Formatting pasted text... Trwa formatowanie wklejonego tekstu... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pt-BR.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pt-BR.xlf index 6c57c75360d31..c58cf8fd6d22c 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pt-BR.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.pt-BR.xlf @@ -12,16 +12,6 @@ Adicionando as importações ausentes... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Correção de Caso - - - - Correcting word casing... - Corrigindo maiúsculas e minúsculas de palavras... - - This call is required by the designer. Esta chamada é requerida pelo designer. @@ -37,11 +27,6 @@ Finalizar Construção - - Smart Indenting - Recuo Inteligente - - Formatting Document... Formatando documento... @@ -52,11 +37,6 @@ Inserir Nova Linha - - Format Paste - Colar Formato - - Formatting pasted text... Formatando texto colado... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ru.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ru.xlf index d0323526781ea..8dcceed7fa120 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ru.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.ru.xlf @@ -12,16 +12,6 @@ Добавление недостающих директив import… Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Исправление регистра - - - - Correcting word casing... - Идет исправление регистра слов... - - This call is required by the designer. Этот вызов является обязательным для конструктора. @@ -37,11 +27,6 @@ Закончить конструкцию - - Smart Indenting - Интеллектуальные отступы - - Formatting Document... Идет форматирование документа... @@ -52,11 +37,6 @@ Вставить новую строку - - Format Paste - Форматировать при вставке - - Formatting pasted text... Идет форматирование вставленного текста... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.tr.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.tr.xlf index 07f0ef6244a63..ad3a0dba7f81e 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.tr.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.tr.xlf @@ -12,16 +12,6 @@ Eksik import ifadeleri ekleniyor... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - Büyük/Küçük Harf Düzeltmesi - - - - Correcting word casing... - Sözcük büyük/küçük harfleri düzeltiliyor... - - This call is required by the designer. Bu çağrı tasarımcı için gerekli. @@ -37,11 +27,6 @@ Bitiş Yapısı - - Smart Indenting - Akıllı Girintileme - - Formatting Document... Belge biçimlendiriliyor... @@ -52,11 +37,6 @@ Yeni Satır Ekle - - Format Paste - Yapıştırmayı Biçimlendir - - Formatting pasted text... Yapıştırılan metin biçimlendiriliyor... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hans.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hans.xlf index 48e3953136f3b..bcc70a0b32b09 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hans.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hans.xlf @@ -12,16 +12,6 @@ 正在添加缺少的 imports… Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - 大小写更正 - - - - Correcting word casing... - 正在更正单词的大小写... - - This call is required by the designer. 此调用是设计器所必需的。 @@ -37,11 +27,6 @@ 最终构造 - - Smart Indenting - 智能缩进 - - Formatting Document... 正在设置文档格式... @@ -52,11 +37,6 @@ 插入新行 - - Format Paste - 格式粘贴 - - Formatting pasted text... 正在设置已粘贴文本的格式... diff --git a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hant.xlf b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hant.xlf index 0fe645f96358b..6d32ce5305caf 100644 --- a/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hant.xlf +++ b/src/EditorFeatures/VisualBasic/xlf/VBEditorResources.zh-Hant.xlf @@ -12,16 +12,6 @@ 正在新增缺少的 import... Thread awaited dialog text. "imports" is a language specific term and should not be localized - - Case Correction - 大小寫修正 - - - - Correcting word casing... - 正在修正文字大小寫... - - This call is required by the designer. 設計工具需要此呼叫。 @@ -37,11 +27,6 @@ End 建構 - - Smart Indenting - 智慧縮排 - - Formatting Document... 正在格式化文件... @@ -52,11 +37,6 @@ 插入新行 - - Format Paste - 貼上格式 - - Formatting pasted text... 正在格式化貼上的文字... From 4e14cd0aedcda28f013899012885469772f1a442 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:20:36 -0700 Subject: [PATCH 18/94] Remove unused resource string --- .../Host/InteractiveHostResources.resx | 9 --------- .../Host/xlf/InteractiveHostResources.cs.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.de.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.es.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.fr.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.it.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.ja.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.ko.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.pl.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.pt-BR.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.ru.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.tr.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.zh-Hans.xlf | 15 --------------- .../Host/xlf/InteractiveHostResources.zh-Hant.xlf | 15 --------------- 14 files changed, 204 deletions(-) diff --git a/src/Interactive/Host/InteractiveHostResources.resx b/src/Interactive/Host/InteractiveHostResources.resx index 3b41a16366d27..29d8c70a19358 100644 --- a/src/Interactive/Host/InteractiveHostResources.resx +++ b/src/Interactive/Host/InteractiveHostResources.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Attempt to connect to process #{0} failed, retrying ... - Cannot resolve reference '{0}'. @@ -156,10 +153,4 @@ Failed to create a remote process for interactive code execution: '{0}' - - Failed to initialize remote interactive process. - - - Interactive Host not initialized. - \ No newline at end of file diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.cs.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.cs.xlf index 02c88bfc63802..b148f452092fb 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.cs.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.cs.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Pokus o připojení k procesu #{0} se nepovedl. Akce se opakuje... - - Cannot resolve reference '{0}'. Nejde vyřešit odkaz {0}. @@ -17,11 +12,6 @@ Nepovedlo se vytvořit vzdálený proces pro provádění interaktivního kódu: {0} - - Failed to initialize remote interactive process. - Nepodařilo se inicializovat vzdálený interaktivní proces. - - Failed to launch '{0}' process (exit code: {1}) with output: Nepodařilo se spustit proces {0} (ukončovací kód: {1}) s výstupem: @@ -32,11 +22,6 @@ Hostovací proces skončil s ukončovacím kódem {0}. - - Interactive Host not initialized. - Interaktivní hostitel není inicializovaný. - - Loading context from '{0}'. Načítá se kontext z {0}. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.de.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.de.xlf index d2e66d503fd4f..18ad40bfe31c7 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.de.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.de.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Verbinden mit dem Prozess #{0} fehlgeschlagen, wird wiederholt ... - - Cannot resolve reference '{0}'. Verweis "{0}" konnte nicht aufgelöst werden. @@ -17,11 +12,6 @@ Ein Remoteprozess für die interaktive Codeausführung konnte nicht erstellt werden: {0} - - Failed to initialize remote interactive process. - Der interaktive Remoteprozess konnte nicht initialisiert werden. - - Failed to launch '{0}' process (exit code: {1}) with output: "{0}"-Prozess konnte nicht gestartet werden (Beendigungscode: {1}) mit Ausgabe: @@ -32,11 +22,6 @@ Der Hostprozess wurde mit dem Exitcode "{0}" beendet. - - Interactive Host not initialized. - Interaktiver Host nicht initialisiert. - - Loading context from '{0}'. Kontext aus "{0}" wird geladen. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.es.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.es.xlf index 17d701f7db3d6..d059603973bf2 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.es.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.es.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Error al intentar conectar con el proceso #{0}, reintentando... - - Cannot resolve reference '{0}'. No se puede resolver la referencia '{0}'. @@ -17,11 +12,6 @@ No se pudo crear un proceso remoto para la ejecución de código interactivo: "{0}" - - Failed to initialize remote interactive process. - Error al inicializar el proceso remoto interactivo. - - Failed to launch '{0}' process (exit code: {1}) with output: Error al iniciar el proceso '{0}' (código de salida: {1}) con la salida: @@ -32,11 +22,6 @@ El proceso de hospedaje terminó con el código de salida {0}. - - Interactive Host not initialized. - Host interactivo no inicializado. - - Loading context from '{0}'. Cargando contexto de '{0}'. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.fr.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.fr.xlf index 3322cc4e83657..22a741092f4f5 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.fr.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.fr.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Échec de la connexion au processus n° {0}. Nouvelle tentative... - - Cannot resolve reference '{0}'. Impossible de résoudre la référence '{0}'. @@ -17,11 +12,6 @@ Échec de création d'un processus à distance pour l'exécution de code interactif : '{0}' - - Failed to initialize remote interactive process. - Échec de l'initialisation de processus interactif à distance. - - Failed to launch '{0}' process (exit code: {1}) with output: Échec du lancement du processus '{0}' (code de sortie : {1}) avec la sortie : @@ -32,11 +22,6 @@ Le processus d'hébergement s'est arrêté avec le code de sortie {0}. - - Interactive Host not initialized. - L'hôte interactif n'est pas initialisé. - - Loading context from '{0}'. Chargement du contexte de '{0}'. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.it.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.it.xlf index 59acf5a5bfa9c..2d2bd92e4ea86 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.it.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.it.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Il tentativo di connessione al processo {0} non è riuscito. Verrà effettuato un nuovo tentativo... - - Cannot resolve reference '{0}'. Non è possibile risolvere il riferimento '{0}'. @@ -17,11 +12,6 @@ Non è stato possibile creare un processo remoto per l'esecuzione di codice interattiva: '{0}' - - Failed to initialize remote interactive process. - Non è stato possibile inizializzare il processo interattivo remoto. - - Failed to launch '{0}' process (exit code: {1}) with output: Non è stato possibile avviare il processo '{0}' (codice di uscita: {1}). Output: @@ -32,11 +22,6 @@ Processo di hosting terminato con codice di uscita {0}. - - Interactive Host not initialized. - L'host interattivo non è inizializzato. - - Loading context from '{0}'. Caricamento del contesto da '{0}'. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.ja.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.ja.xlf index 647671842fcdb..d72e40ac914b4 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.ja.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.ja.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - プロセス #{0} に接続できませんでした。再試行しています... - - Cannot resolve reference '{0}'. 参照 '{0}' を解決できません。 @@ -17,11 +12,6 @@ 対話型コード実行のリモート プロセスを作成できませんでした: '{0}' - - Failed to initialize remote interactive process. - リモートの対話型プロセスを初期化できませんでした。 - - Failed to launch '{0}' process (exit code: {1}) with output: 次の出力がある '{0}' プロセスを起動できませんでした (終了コード: {1}): @@ -32,11 +22,6 @@ ホスティング プロセスは終了コード {0} で終了しました。 - - Interactive Host not initialized. - 対話型ホストが初期化されていません。 - - Loading context from '{0}'. '{0}' からコンテキストを読み込んでいます。 diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.ko.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.ko.xlf index 6b5784bc57500..547a30b3dd17d 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.ko.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.ko.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - #{0} 프로세스에 연결하지 못했습니다. 다시 시도하고 있습니다. - - Cannot resolve reference '{0}'. '{0}' 참조를 확인할 수 없습니다. @@ -17,11 +12,6 @@ 대화형 코드 실행에 대한 원격 프로세스를 만들지 못했습니다. '{0}' - - Failed to initialize remote interactive process. - 원격 대화형 프로세스를 초기화하지 못했습니다. - - Failed to launch '{0}' process (exit code: {1}) with output: 출력에서 '{0}' 프로세스(종료 코드: {1})를 실행하지 못했습니다. @@ -32,11 +22,6 @@ 호스팅 프로세스가 종료되었습니다(종료 코드: {0}). - - Interactive Host not initialized. - 대화형 호스트가 초기화되지 않았습니다. - - Loading context from '{0}'. '{0}'에서 컨텍스트를 로드하는 중입니다. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.pl.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.pl.xlf index 77a153f796c96..ddf8c57a98eee 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.pl.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.pl.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Próba połączenia z procesem #{0} nie powiodła się. Ponawianie próby... - - Cannot resolve reference '{0}'. Nie można rozpoznać odwołania „{0}”. @@ -17,11 +12,6 @@ Nie można utworzyć procesu zdalnego dla wykonania kodu interaktywnego: „{0}” - - Failed to initialize remote interactive process. - Zainicjowanie zdalnego procesu interaktywnego nie powiodło się. - - Failed to launch '{0}' process (exit code: {1}) with output: Uruchomienie procesu „{0}” nie powiodło się (kod zakończenia: {1}) z wynikiem: @@ -32,11 +22,6 @@ Proces hostujący zakończył się z kodem zakończenia {0}. - - Interactive Host not initialized. - Host interaktywny nie został zainicjowany. - - Loading context from '{0}'. Ładowanie kontekstu z elementu „{0}”. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.pt-BR.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.pt-BR.xlf index b893f3775fff3..a8afe70d6d7bd 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.pt-BR.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.pt-BR.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Tentativa para conectar ao processo #{0} falhou, repetindo... - - Cannot resolve reference '{0}'. Não é possível resolver a referência "{0}". @@ -17,11 +12,6 @@ Falha ao criar um processo remoto para a execução de código interativa: '{0}' - - Failed to initialize remote interactive process. - Falha ao inicializar o processo interativo remoto. - - Failed to launch '{0}' process (exit code: {1}) with output: Falha ao iniciar o "{0}" processo (código de saída: {1}) com saída: @@ -32,11 +22,6 @@ O processo de hospedagem saiu com o código de saída {0}. - - Interactive Host not initialized. - Host interativo não inicializado. - - Loading context from '{0}'. Carregando contexto de "{0}". diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.ru.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.ru.xlf index 87d473a621bea..63854b525f170 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.ru.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.ru.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - Сбой попытки подключения к процессу #{0}, выполнение повторной попытки... - - Cannot resolve reference '{0}'. Не удается разрешить ссылку "{0}". @@ -17,11 +12,6 @@ Не удалось создать удаленный процесс для интерактивного выполнения кода: "{0}" - - Failed to initialize remote interactive process. - Не удалось инициализировать удаленный интерактивный процесс. - - Failed to launch '{0}' process (exit code: {1}) with output: Не удалось запустить процесс "{0}" (код выхода: {1}) с выходными данными: @@ -32,11 +22,6 @@ Ведущий процесс завершен, код завершения: {0}. - - Interactive Host not initialized. - Интерактивный узел не инициализирован. - - Loading context from '{0}'. Загрузка контекста из "{0}". diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.tr.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.tr.xlf index 958975498a554..a62561975625c 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.tr.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.tr.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - #{0} işlemine bağlanma girişimi başarısız oldu, yeniden deneniyor... - - Cannot resolve reference '{0}'. '{0}' başvurusu çözümlenemiyor. @@ -17,11 +12,6 @@ Etkileşimli kod yürütme için uzak işlem oluşturulamadı: '{0}' - - Failed to initialize remote interactive process. - Uzak etkileşimli işlem başlatılamadı. - - Failed to launch '{0}' process (exit code: {1}) with output: '{0}' işlemi (çıkış kodu: {1}) çıkış ile başlatılamadı: @@ -32,11 +22,6 @@ Barındırma işlemi {0} çıkış koduyla çıkış yaptı. - - Interactive Host not initialized. - Etkileşimli Konak başlatılmadı. - - Loading context from '{0}'. '{0}' üzerinden bağlam yükleniyor. diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hans.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hans.xlf index a7b8be76aa290..578ccded1cc7c 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hans.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hans.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - 尝试连接到进程 #{0} 失败,正在重试... - - Cannot resolve reference '{0}'. 无法解析“{0}”引用。 @@ -17,11 +12,6 @@ 为交互代码的执行创建远程进程失败:“{0}” - - Failed to initialize remote interactive process. - 初始化远程交互进程失败。 - - Failed to launch '{0}' process (exit code: {1}) with output: 启动“{0}”进程失败(退出代码: {1}),输出为: @@ -32,11 +22,6 @@ 宿主进程已退出,退出代码为 {0}。 - - Interactive Host not initialized. - 未初始化交互式主机。 - - Loading context from '{0}'. 从“{0}”加载上下文。 diff --git a/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hant.xlf b/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hant.xlf index cf8ded63cebbf..1b8698373768a 100644 --- a/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hant.xlf +++ b/src/Interactive/Host/xlf/InteractiveHostResources.zh-Hant.xlf @@ -2,11 +2,6 @@ - - Attempt to connect to process #{0} failed, retrying ... - 嘗試連接到處理序 #{0} 失敗,正在重試... - - Cannot resolve reference '{0}'. 無法解析參考 '{0}'。 @@ -17,11 +12,6 @@ 無法為互動式程式碼執行建立遠端處理序: '{0}' - - Failed to initialize remote interactive process. - 無法初始化遠端互動式處理序。 - - Failed to launch '{0}' process (exit code: {1}) with output: 無法啟動 '{0}' 處理序 (結束代碼: {1}),輸出如下: @@ -32,11 +22,6 @@ 裝載處理序已結束,結束代碼為 {0}。 - - Interactive Host not initialized. - 未初始化互動式主機。 - - Loading context from '{0}'. 正在載入 '{0}' 的內容。 From 06c46da6372fb8c0bacb2471992229f20b97e957 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:25:01 -0700 Subject: [PATCH 19/94] Remove unused resource string --- .../CSharp/Analyzers/CSharpAnalyzersResources.resx | 7 ++----- .../CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs | 2 +- .../Analyzers/xlf/CSharpAnalyzersResources.cs.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.de.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.es.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.fr.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.it.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.ja.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.ko.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.pl.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.ru.xlf | 11 +++-------- .../Analyzers/xlf/CSharpAnalyzersResources.tr.xlf | 11 +++-------- .../xlf/CSharpAnalyzersResources.zh-Hans.xlf | 11 +++-------- .../xlf/CSharpAnalyzersResources.zh-Hant.xlf | 11 +++-------- 15 files changed, 42 insertions(+), 110 deletions(-) diff --git a/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx b/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx index 9682396b88b75..a0493c14e1860 100644 --- a/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx +++ b/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx @@ -289,17 +289,14 @@ Remove operator (preserves semantics) - - Remove suppression operators - Remove unnecessary suppression operator Suppression operator has no effect and can be misinterpreted - - 'typeof' can be converted to 'nameof' + + 'typeof' can be converted to 'nameof' Use 'new(...)' diff --git a/src/Analyzers/CSharp/Analyzers/ConvertTypeofToNameof/CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/ConvertTypeofToNameof/CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs index f6c3d60969c21..c1a62cac3a434 100644 --- a/src/Analyzers/CSharp/Analyzers/ConvertTypeofToNameof/CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs +++ b/src/Analyzers/CSharp/Analyzers/ConvertTypeofToNameof/CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs @@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.CSharp.ConvertTypeOfToNameOf; [DiagnosticAnalyzer(LanguageNames.CSharp)] internal sealed class CSharpConvertTypeOfToNameOfDiagnosticAnalyzer : AbstractConvertTypeOfToNameOfDiagnosticAnalyzer { - private static readonly string s_title = CSharpAnalyzersResources.typeof_can_be_converted__to_nameof; + private static readonly string s_title = CSharpAnalyzersResources.typeof_can_be_converted_to_nameof; public CSharpConvertTypeOfToNameOfDiagnosticAnalyzer() : base(s_title) { diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf index b485bfe17c5b5..a7a15178f83ab 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf @@ -172,11 +172,6 @@ Odebrat redundantní direktivu s možnou hodnotou null - - Remove suppression operators - Odebrat operátory potlačení - - Remove unnecessary lambda expression Odebrat nepotřebný výraz lambda @@ -457,9 +452,9 @@ Výraz „new“ může být zjednodušený. - - 'typeof' can be converted to 'nameof' - typeof se dá převést na nameof. + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf index 6ff3705cc68a5..b5ec0a85191d3 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf @@ -172,11 +172,6 @@ Die redundante nullable-Direktive entfernen - - Remove suppression operators - Unterdrückungsoperatoren entfernen - - Remove unnecessary lambda expression Unnötigen Lambdaausdruck entfernen @@ -457,9 +452,9 @@ new-Ausdruck kann vereinfacht werden - - 'typeof' can be converted to 'nameof' - "typeof" kann in "nameof" konvertiert werden. + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf index b6d67d308c8d5..7a51869b61fbc 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf @@ -172,11 +172,6 @@ Quitar directiva redundante que admite un valor NULL - - Remove suppression operators - Quitar operadores de supresión - - Remove unnecessary lambda expression Quitar la expresión lambda innecesaria @@ -457,9 +452,9 @@ La expresión "new" se puede simplificar. - - 'typeof' can be converted to 'nameof' - "typeof" puede convertirse en "nameof" + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf index 270a3f05a8fa7..2af2443407a99 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf @@ -172,11 +172,6 @@ Supprimer la directive nullable redondante - - Remove suppression operators - Supprimer les opérateurs de suppression - - Remove unnecessary lambda expression Supprimer l’expression lambda inutile @@ -457,9 +452,9 @@ L'expression 'new' peut être simplifiée - - 'typeof' can be converted to 'nameof' - 'typeof' peut être converti en 'nameof' + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf index 13dbd08e7716a..f3bb72c10ca99 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf @@ -172,11 +172,6 @@ Rimuovi direttiva che ammette i valori Null ridondante - - Remove suppression operators - Rimuovi gli operatori di eliminazione - - Remove unnecessary lambda expression Rimuovi espressione lambda non necessaria @@ -457,9 +452,9 @@ L'espressione 'new' può essere semplificata - - 'typeof' can be converted to 'nameof' - 'typeof' può essere convertito in 'nameof' + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf index 374f99f4b75d0..e775f0b6a2511 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf @@ -172,11 +172,6 @@ 冗長な null 許容ディレクティブを削除します - - Remove suppression operators - 抑制演算子の削除 - - Remove unnecessary lambda expression 不要なラムダ式の削除 @@ -457,9 +452,9 @@ 'new' 式を簡素化できます - - 'typeof' can be converted to 'nameof' - 'typeof' を 'nameof' に変換できます + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf index 85f2d27edae89..9bb8a212c10b9 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf @@ -172,11 +172,6 @@ 중복 null 허용 지시문 제거 - - Remove suppression operators - 비표시 오류(Suppression) 연산자 제거 - - Remove unnecessary lambda expression 불필요한 람다 식 제거 @@ -457,9 +452,9 @@ 'new' 식을 단순화할 수 있습니다. - - 'typeof' can be converted to 'nameof' - 'typeof'를 'nameof'로 변환할 수 있습니다. + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf index 17825648087f7..24ff89ea899fd 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf @@ -172,11 +172,6 @@ Usuwanie nadmiarowej dyrektywy dopuszczania wartości null - - Remove suppression operators - Usuń operatory pomijania - - Remove unnecessary lambda expression Usuń niepotrzebne wyrażenie lambda @@ -457,9 +452,9 @@ Wyrażenie „new” można uprościć - - 'typeof' can be converted to 'nameof' - Element „typeof” można przekonwertować na element „nameof” + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf index 6c2efc3a35f31..11ae62d4bbae9 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf @@ -172,11 +172,6 @@ Remover diretiva que permite valor nulo redundante - - Remove suppression operators - Remover operadores de supressão - - Remove unnecessary lambda expression Remover expressão lambda desnecessária @@ -457,9 +452,9 @@ A expressão 'new' pode ser simplificada - - 'typeof' can be converted to 'nameof' - 'typeof' pode ser convertido em 'nameof' + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf index caa0742ff2280..aac6d9dc7df5d 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf @@ -172,11 +172,6 @@ Удалите избыточную директиву, допускающую значение NULL - - Remove suppression operators - Удалить операторы подавления - - Remove unnecessary lambda expression Удалить ненужное лямбда-выражение @@ -457,9 +452,9 @@ выражение new можно упростить - - 'typeof' can be converted to 'nameof' - "typeof" можно преобразовать в "nameof". + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf index b009bdd608b86..0d353386d64aa 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf @@ -172,11 +172,6 @@ Yinelenen null atanabilir yönergeyi kaldırın - - Remove suppression operators - Gizleme işleçlerini kaldır - - Remove unnecessary lambda expression Gereksiz lambda ifadesini kaldır @@ -457,9 +452,9 @@ 'new' ifadesi basitleştirilebilir - - 'typeof' can be converted to 'nameof' - 'typeof' metodu 'nameof' metoduna dönüştürülebilir + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf index 1f964aab79bae..6affe14302f04 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf @@ -172,11 +172,6 @@ 删除冗余的可为空的指令 - - Remove suppression operators - 请删除忽略运算符 - - Remove unnecessary lambda expression 删除不必要的 lambda 表达式 @@ -457,9 +452,9 @@ 可简化 "new" 表达式 - - 'typeof' can be converted to 'nameof' - "typeof" 可以转换为 "nameof" + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf index 0feb0aa243ef3..8f83bfb1286d1 100644 --- a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf +++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf @@ -172,11 +172,6 @@ 移除多餘而可為 Null 的指示詞 - - Remove suppression operators - 移除隱藏的運算子 - - Remove unnecessary lambda expression 移除不必要的 Lambda 運算式 @@ -457,9 +452,9 @@ 'new' 運算式可簡化 - - 'typeof' can be converted to 'nameof' - 'typeof' 可轉換為 'nameof' + + 'typeof' can be converted to 'nameof' + 'typeof' can be converted to 'nameof' From 50f31fed1a81ebbc84ecc8bea0653704a2691d96 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:25:59 -0700 Subject: [PATCH 20/94] Remove unused resource string --- .../Core/Analyzers/CodeStyleResources.resx | 12 ----------- .../Analyzers/xlf/CodeStyleResources.cs.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.de.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.es.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.fr.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.it.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.ja.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.ko.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.pl.xlf | 20 ------------------- .../xlf/CodeStyleResources.pt-BR.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.ru.xlf | 20 ------------------- .../Analyzers/xlf/CodeStyleResources.tr.xlf | 20 ------------------- .../xlf/CodeStyleResources.zh-Hans.xlf | 20 ------------------- .../xlf/CodeStyleResources.zh-Hant.xlf | 20 ------------------- 14 files changed, 272 deletions(-) diff --git a/src/CodeStyle/Core/Analyzers/CodeStyleResources.resx b/src/CodeStyle/Core/Analyzers/CodeStyleResources.resx index 9af69937766bd..9cf410e3da82f 100644 --- a/src/CodeStyle/Core/Analyzers/CodeStyleResources.resx +++ b/src/CodeStyle/Core/Analyzers/CodeStyleResources.resx @@ -129,21 +129,9 @@ New line preferences - - Arrays with more than one dimension cannot be serialized. - Value too large to be represented as a 30 bit unsigned integer. - - The type '{0}' is not understood by the serialization binder. - - - Cannot serialize type '{0}'. - - - Deserialization reader for '{0}' read incorrect number of values. - Stream is too long. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.cs.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.cs.xlf index 6b665b44244cf..5def367e19048 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.cs.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.cs.xlf @@ -12,21 +12,6 @@ Pro tuto možnost se musí zadat název jazyka. - - Arrays with more than one dimension cannot be serialized. - Pole s víc než jedním rozměrem nejsou serializované. - - - - Cannot serialize type '{0}'. - Typ {0} nejde serializovat. - - - - Deserialization reader for '{0}' read incorrect number of values. - Čtečka deserializace pro {0} přečetla nesprávný počet hodnot. - - Indentation and spacing Odsazení a mezery @@ -42,11 +27,6 @@ Stream je moc dlouhý. - - The type '{0}' is not understood by the serialization binder. - Vazač serializace nerozumí typu {0}. - - Value too large to be represented as a 30 bit unsigned integer. Hodnota je moc velká, než aby se dala vyjádřit jako 30bitové nepodepsané celé číslo. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.de.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.de.xlf index 65536220096ef..f14719bac2c7e 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.de.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.de.xlf @@ -12,21 +12,6 @@ Für diese Option muss ein Sprachenname angegeben werden. - - Arrays with more than one dimension cannot be serialized. - Arrays mit mehr als einer Dimension können nicht serialisiert werden. - - - - Cannot serialize type '{0}'. - Typ "{0}" kann nicht serialisiert werden. - - - - Deserialization reader for '{0}' read incorrect number of values. - Der Deserialisierungsreader für "{0}" hat eine falsche Anzahl von Werten gelesen. - - Indentation and spacing Einzüge und Abstände @@ -42,11 +27,6 @@ Der Datenstrom ist zu lang. - - The type '{0}' is not understood by the serialization binder. - Der Typ "{0}" wird vom Serialisierungsbinder nicht verstanden. - - Value too large to be represented as a 30 bit unsigned integer. Der Wert ist zu groß, um als ganze 30-Bit-Zahl ohne Vorzeichen dargestellt zu werden. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.es.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.es.xlf index 453bfd280c8c6..61f0515e6ec7e 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.es.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.es.xlf @@ -12,21 +12,6 @@ Se debe especificar un nombre de lenguaje para esta opción. - - Arrays with more than one dimension cannot be serialized. - Las matrices con más de una dimensión no se pueden serializar. - - - - Cannot serialize type '{0}'. - No se puede serializar el tipo "{0}". - - - - Deserialization reader for '{0}' read incorrect number of values. - El lector de deserialización de "{0}" leyó un número incorrecto de valores. - - Indentation and spacing Sangría y espaciado @@ -42,11 +27,6 @@ Secuencia demasiado larga. - - The type '{0}' is not understood by the serialization binder. - El enlazador de serialización no comprende el tipo "{0}". - - Value too large to be represented as a 30 bit unsigned integer. Valor demasiado largo para representarse como entero sin signo de 30 bits. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.fr.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.fr.xlf index 2e80c95c8651b..7eecc89cf845e 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.fr.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.fr.xlf @@ -12,21 +12,6 @@ Un nom de langage doit être spécifié pour cette option. - - Arrays with more than one dimension cannot be serialized. - Impossible de sérialiser les tableaux de plus d'une dimension. - - - - Cannot serialize type '{0}'. - Impossible de sérialiser le type '{0}'. - - - - Deserialization reader for '{0}' read incorrect number of values. - Le lecteur de désérialisation pour '{0}' a lu un nombre incorrect de valeurs. - - Indentation and spacing Indentation et espacement @@ -42,11 +27,6 @@ Le flux est trop long. - - The type '{0}' is not understood by the serialization binder. - Le type '{0}' n'est pas pris en charge par le binder de sérialisation. - - Value too large to be represented as a 30 bit unsigned integer. La valeur est trop grande pour être représentée comme un entier non signé 30 bits. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.it.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.it.xlf index 8b436e39c3029..34d3b3f5eb787 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.it.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.it.xlf @@ -12,21 +12,6 @@ È necessario specificare un nome di linguaggio per questa opzione. - - Arrays with more than one dimension cannot be serialized. - Non è possibile serializzare le matrice con più di una dimensione. - - - - Cannot serialize type '{0}'. - Non è possibile serializzare il tipo '{0}'. - - - - Deserialization reader for '{0}' read incorrect number of values. - Il numero di valori letto dal lettore di deserializzazioni per '{0}' non è corretto. - - Indentation and spacing Rientro e spaziatura @@ -42,11 +27,6 @@ Il flusso è troppo lungo. - - The type '{0}' is not understood by the serialization binder. - Il tipo '{0}' non è riconosciuto dal binder di serializzazioni. - - Value too large to be represented as a 30 bit unsigned integer. Il valore è troppo grande per essere rappresentato come intero senza segno a 30 bit. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ja.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ja.xlf index b657348745190..bbb3acec1c903 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ja.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ja.xlf @@ -12,21 +12,6 @@ このオプションの言語名を指定する必要があります。 - - Arrays with more than one dimension cannot be serialized. - 複数の次元を持つ配列はシリアル化できません。 - - - - Cannot serialize type '{0}'. - 型 '{0}' をシリアル化できません。 - - - - Deserialization reader for '{0}' read incorrect number of values. - '{0}' の逆シリアル化のリーダーが、正しくない数の値を読み取りました。 - - Indentation and spacing インデントと間隔 @@ -42,11 +27,6 @@ ストリームが長すぎます。 - - The type '{0}' is not understood by the serialization binder. - 型 '{0}' がシリアル化バインダーで認識されません。 - - Value too large to be represented as a 30 bit unsigned integer. 値が大きすぎるため、30 ビットの符号なし整数として表すことができません。 diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ko.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ko.xlf index 1da1870ef4588..4a163e439f589 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ko.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ko.xlf @@ -12,21 +12,6 @@ 이 옵션에 대한 언어 이름을 지정해야 합니다. - - Arrays with more than one dimension cannot be serialized. - 차원이 두 개 이상인 배열을 직렬화할 수 없습니다. - - - - Cannot serialize type '{0}'. - '{0}' 형식을 직렬화할 수 없습니다. - - - - Deserialization reader for '{0}' read incorrect number of values. - '{0}'에 대한 역직렬화 판독기가 잘못된 숫자 값을 읽습니다. - - Indentation and spacing 들여쓰기 및 간격 @@ -42,11 +27,6 @@ 스트림이 너무 깁니다. - - The type '{0}' is not understood by the serialization binder. - 직렬화 바인더가 '{0}' 형식을 인식할 수 없습니다. - - Value too large to be represented as a 30 bit unsigned integer. 값이 너무 커서 30비트 정수로 표시할 수 없습니다. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pl.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pl.xlf index 2fade54b30f6e..4b8e25f3f99c7 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pl.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pl.xlf @@ -12,21 +12,6 @@ Nazwa języka musi zostać określona dla tej opcji. - - Arrays with more than one dimension cannot be serialized. - Nie można przeprowadzić serializacji tablic z więcej niż jednym wymiarem. - - - - Cannot serialize type '{0}'. - Nie można serializować typu „{0}”. - - - - Deserialization reader for '{0}' read incorrect number of values. - Czytnik deserializacji dla elementu „{0}” odczytuje nieprawidłową liczbę wartości. - - Indentation and spacing Wcięcia i odstępy @@ -42,11 +27,6 @@ Strumień jest za długi. - - The type '{0}' is not understood by the serialization binder. - Typ „{0}” nie jest zrozumiały dla integratora serializacji. - - Value too large to be represented as a 30 bit unsigned integer. Wartość jest zbyt duża, dlatego nie może być reprezentowana jako 30-bitowa liczba całkowita bez znaku. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pt-BR.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pt-BR.xlf index 39024086a97b4..580260de33771 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pt-BR.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.pt-BR.xlf @@ -12,21 +12,6 @@ Um nome de idioma deve ser especificado para esta opção. - - Arrays with more than one dimension cannot be serialized. - As matrizes com mais de uma dimensão não podem ser serializadas. - - - - Cannot serialize type '{0}'. - Não é possível serializar o tipo '{0}'. - - - - Deserialization reader for '{0}' read incorrect number of values. - O leitor de desserialização para '{0}' lê o número incorreto de valores. - - Indentation and spacing Recuo e espaçamento @@ -42,11 +27,6 @@ O fluxo é muito longo. - - The type '{0}' is not understood by the serialization binder. - O tipo '{0}' não é compreendido pelo associador de serialização. - - Value too large to be represented as a 30 bit unsigned integer. Valor muito grande para ser representado como um inteiro não assinado de 30 bits. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ru.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ru.xlf index 9f5375fb8dbdd..65b227be92275 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ru.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.ru.xlf @@ -12,21 +12,6 @@ Для данного параметра необходимо указать имя языка. - - Arrays with more than one dimension cannot be serialized. - Массивы с несколькими измерениями нельзя сериализовать. - - - - Cannot serialize type '{0}'. - Невозможно сериализовать тип "{0}". - - - - Deserialization reader for '{0}' read incorrect number of values. - Считыватель десериализации для "{0}" считал неверное количество значений. - - Indentation and spacing Отступы и интервалы @@ -42,11 +27,6 @@ Слишком длинный поток. - - The type '{0}' is not understood by the serialization binder. - Тип "{0}" не распознан модулем привязки сериализации. - - Value too large to be represented as a 30 bit unsigned integer. Слишком большое значение для представления в виде 30-разрядного целого числа без знака. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.tr.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.tr.xlf index 6d829c94c4a2c..113d378f9a817 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.tr.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.tr.xlf @@ -12,21 +12,6 @@ Bu seçenek için bir dil adı belirtilmelidir. - - Arrays with more than one dimension cannot be serialized. - Birden çok boyutlu diziler seri hale getirilemez. - - - - Cannot serialize type '{0}'. - '{0}' türü seri hale getirilemiyor. - - - - Deserialization reader for '{0}' read incorrect number of values. - '{0}' türünün seri durumdan çıkarma okuyucusu, yanlış sayıda değer okudu. - - Indentation and spacing Girinti ve aralığı @@ -42,11 +27,6 @@ Akış çok uzun. - - The type '{0}' is not understood by the serialization binder. - '{0}' türü, serileştirme bağlayıcısı tarafından anlaşılamıyor. - - Value too large to be represented as a 30 bit unsigned integer. Değer, 30 bit işaretsiz tamsayı olarak temsil edilemeyecek kadar büyük. diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hans.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hans.xlf index e9fcd58ca57a9..96dc9830f0bb1 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hans.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hans.xlf @@ -12,21 +12,6 @@ 必须为此选项指定语言名称。 - - Arrays with more than one dimension cannot be serialized. - 不能序列化具有多个维度的数组。 - - - - Cannot serialize type '{0}'. - 无法序列化类型“{0}”。 - - - - Deserialization reader for '{0}' read incorrect number of values. - “{0}”的反序列化读取器读取到错误数量的值。 - - Indentation and spacing 缩进和间距 @@ -42,11 +27,6 @@ “流”过长。 - - The type '{0}' is not understood by the serialization binder. - 序列化绑定器不理解“{0}”类型。 - - Value too large to be represented as a 30 bit unsigned integer. 值太大,无法表示为 30 位无符号整数。 diff --git a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hant.xlf b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hant.xlf index 496c7109778ea..d27ad2de0de00 100644 --- a/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hant.xlf +++ b/src/CodeStyle/Core/Analyzers/xlf/CodeStyleResources.zh-Hant.xlf @@ -12,21 +12,6 @@ 必須指定此選項的語言名稱。 - - Arrays with more than one dimension cannot be serialized. - 無法序列化包含多個維度的陣列。 - - - - Cannot serialize type '{0}'. - 無法將類型 '{0}' 序列化。 - - - - Deserialization reader for '{0}' read incorrect number of values. - '{0}' 的還原序列化讀取器所讀取的值數目不正確。 - - Indentation and spacing 縮排和間距 @@ -42,11 +27,6 @@ 資料流過長。 - - The type '{0}' is not understood by the serialization binder. - 序列化繫結器無法辨識類型 '{0}'。 - - Value too large to be represented as a 30 bit unsigned integer. 值太大,無法呈現為 30 位元不帶正負號的整數。 From 30b8d8ceab2b519e1174add43ba8e865184b43d7 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:27:42 -0700 Subject: [PATCH 21/94] Remove unused resource string --- src/Features/Core/Portable/FeaturesResources.resx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Features/Core/Portable/FeaturesResources.resx b/src/Features/Core/Portable/FeaturesResources.resx index 159e455f961cc..647ad76210a32 100644 --- a/src/Features/Core/Portable/FeaturesResources.resx +++ b/src/Features/Core/Portable/FeaturesResources.resx @@ -1328,9 +1328,6 @@ This version used in: {2} Implement explicitly - - Resolve conflict markers - Base classes contain inaccessible unimplemented members From fc208d3bd51950792a361233875ab25a74086c04 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:28:09 -0700 Subject: [PATCH 22/94] Remove unused resource string --- src/Features/CSharp/Portable/CSharpFeaturesResources.resx | 3 --- .../CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf | 5 ----- .../CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.de.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.es.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.it.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf | 5 ----- src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf | 5 ----- 27 files changed, 133 deletions(-) diff --git a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx index 8fe9e8961bd0c..86f5bdb590361 100644 --- a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx +++ b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx @@ -552,9 +552,6 @@ Apply new() preferences - - Apply parameter null preferences - Apply pattern matching preferences diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf index b384254337b26..ff279bf7660ee 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf @@ -82,11 +82,6 @@ Použít předvolby new() - - Apply parameter null preferences - Použít předvolby parametru null - - Apply pattern matching preferences Použít předvolby porovnávání vzorů diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf index d130dd8093453..8f439bd30bc62 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf @@ -82,11 +82,6 @@ new()-Einstellungen anwenden - - Apply parameter null preferences - Parameter-NULL-Einstellungen anwenden - - Apply pattern matching preferences Anwenden von Musterabgleichseinstellungen diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf index b6049ea244686..16049e9a5f0d4 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf @@ -82,11 +82,6 @@ Aplicar preferencias new() - - Apply parameter null preferences - Aplicar preferencias NULL de parámetro - - Apply pattern matching preferences Aplicar preferencias de coincidencia de patrones diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf index df11ba002a89c..d946c0442f313 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf @@ -82,11 +82,6 @@ Appliquer les préférences new() - - Apply parameter null preferences - Appliquer les préférences null du paramètre - - Apply pattern matching preferences Appliquer les préférences relatives aux critères spéciaux diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf index 35b652738ab1c..45bae0feffabd 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf @@ -82,11 +82,6 @@ Applica le preferenze di new() - - Apply parameter null preferences - Applica preferenze parametro Null - - Apply pattern matching preferences Applica preferenze per criteri di ricerca diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf index f6fb99eafcb9a..46fa52589d4cd 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf @@ -82,11 +82,6 @@ new() の基本設定を適用する - - Apply parameter null preferences - パラメーターの null 値の基本設定を適用する - - Apply pattern matching preferences パターン マッチングの基本設定を適用する diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf index 03123013f18af..0f28589d761b9 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf @@ -82,11 +82,6 @@ new() 적용 기본 설정 - - Apply parameter null preferences - 매개 변수 Null 적용 기본 설정 - - Apply pattern matching preferences 패턴 일치 적용 기본 설정 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf index 44dc5a417afb6..cbc7b0bd7168c 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf @@ -82,11 +82,6 @@ Zastosuj nowe() preferencje - - Apply parameter null preferences - Zastosuj preferencje parametru o wartości null - - Apply pattern matching preferences Zastosuj preferencje dopasowywania wzorca diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf index 512e5e9dce53e..272ccdd82e79b 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf @@ -82,11 +82,6 @@ Aplicar novas() preferências - - Apply parameter null preferences - Aplicar preferências nulas de parâmetro - - Apply pattern matching preferences Aplicar preferências de correspondência de padrões diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf index 4ca60b53c2063..1e1619079b728 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf @@ -82,11 +82,6 @@ Применить новые настройки - - Apply parameter null preferences - Применить настройки со значением NULL для параметров - - Apply pattern matching preferences Применить настройки для сопоставления шаблонов diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf index 071406fd95f07..c6ea9557ae284 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf @@ -82,11 +82,6 @@ Yeni() tercihleri uygula - - Apply parameter null preferences - Parametre null tercihlerini uygula - - Apply pattern matching preferences Desen eşleştirme tercihlerini uygula diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf index 8a9dfda75f2f7..25d81712c0818 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf @@ -82,11 +82,6 @@ 应用新的()首选项 - - Apply parameter null preferences - 应用参数 Null 首选项 - - Apply pattern matching preferences 应用模式匹配首选项 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf index ea7a9416ce097..f478d1165b697 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf @@ -82,11 +82,6 @@ 套用新增() 喜好設定 - - Apply parameter null preferences - 套用參數 Null 喜好設定 - - Apply pattern matching preferences 套用模式比對喜好設定 diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf index c6439c02d7061..a52cf97af5dfc 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf @@ -2580,11 +2580,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv Přeložit: {0} - - Resolve conflict markers - Vyřešit značky konfliktů - - Resolve module: '{0}' of '{1}' Přeložit modul: {0} z {1} diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf index c612e597f7bc1..257cfbee11f0f 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf @@ -2580,11 +2580,6 @@ Positive Lookbehindassertionen mit Nullbreite werden normalerweise am Anfang reg Auflösen: {0} - - Resolve conflict markers - Konfliktmarkierungen auflösen - - Resolve module: '{0}' of '{1}' Modul auflösen: {0} von {1} diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf index 31dba1fe8d457..93752733daa70 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf @@ -2580,11 +2580,6 @@ Las aserciones de búsqueda retrasada (lookbehind) positivas de ancho cero se us Resolver: "{0}" - - Resolve conflict markers - Resolver los marcadores de conflicto - - Resolve module: '{0}' of '{1}' Resolver el módulo: "{0}" de "{1}" diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf index d5f8403a86575..891c8819d11a2 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf @@ -2580,11 +2580,6 @@ Les assertions arrière positives de largeur nulle sont généralement utilisée Résoudre : '{0}' - - Resolve conflict markers - Résoudre les marqueurs de conflit - - Resolve module: '{0}' of '{1}' Résoudre le module '{0}' sur '{1}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf index 3f30b72ddce5e..9990bfc5b2331 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf @@ -2580,11 +2580,6 @@ Le asserzioni lookbehind positive di larghezza zero vengono usate in genere all' Risolvi: '{0}' - - Resolve conflict markers - Risolvi gli indicatori di conflitto - - Resolve module: '{0}' of '{1}' Risolvi il modulo: '{0}' di '{1}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf index 9cabd1a91d68a..012dfaf2ab5a0 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf @@ -2580,11 +2580,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 解決: "{0}" - - Resolve conflict markers - 競合マーカーの解決 - - Resolve module: '{0}' of '{1}' モジュールの解決: '{1}' の '{0}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf index c7c27519ed525..36e1a5bc9759a 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf @@ -2580,11 +2580,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 확인: '{0}' - - Resolve conflict markers - 충돌 표식 확인 - - Resolve module: '{0}' of '{1}' 모듈 확인: '{0}'/'{1}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf index 8fa8e1a47e203..45dd052c352e2 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf @@ -2580,11 +2580,6 @@ Pozytywne asercje wsteczne o zerowej szerokości są zwykle używane na początk Rozpoznaj: „{0}” - - Resolve conflict markers - Rozwiąż znaczniki konfliktów - - Resolve module: '{0}' of '{1}' Rozpoznaj moduł: „{0}” z „{1}” diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf index e79d5819a63c4..f6c9a68b9bc48 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf @@ -2580,11 +2580,6 @@ As declarações de lookbehind positivas de largura zero normalmente são usadas Resolver: '{0}' - - Resolve conflict markers - Resolver marcadores de conflitos - - Resolve module: '{0}' of '{1}' Resolver o módulo: '{0}' de '{1}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf index ed7361d8061f6..5b659f1bfd234 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf @@ -2580,11 +2580,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Разрешить: "{0}" - - Resolve conflict markers - Разрешение меток конфликтов - - Resolve module: '{0}' of '{1}' Разрешить модуль: "{0}" из "{1}" diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf index 6bb92c790872c..59e82662636d9 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf @@ -2580,11 +2580,6 @@ Sıfır genişlikli pozitif geri yönlü onaylamalar genellikle normal ifadeleri Çözümle: '{0}' - - Resolve conflict markers - Çakışma işaretçilerini çözümle - - Resolve module: '{0}' of '{1}' '{1}' modül içinden '{0}' modülü çözümle diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf index 6b158e5a7025a..cb054cb1d31d7 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf @@ -2580,11 +2580,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 解析: "{0}" - - Resolve conflict markers - 解决冲突标记 - - Resolve module: '{0}' of '{1}' 解析模块: "{0}" 个(共 "{1}" 个) diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf index 023a4104d0860..02e569fe0d0d2 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf @@ -2580,11 +2580,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 解析: '{0}' - - Resolve conflict markers - 解決衝突標記 - - Resolve module: '{0}' of '{1}' 解析模組: '{0}' 之 '{1}' From 2d8112d4c63578a250041febc24bc7753f09561a Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:34:26 -0700 Subject: [PATCH 23/94] Remove unused resource string --- .../CSharp/Impl/CSharpVSResources.resx | 24 -- .../CSharp/Impl/xlf/CSharpVSResources.cs.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.de.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.es.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.fr.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.it.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.ja.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.ko.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.pl.xlf | 40 --- .../Impl/xlf/CSharpVSResources.pt-BR.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.ru.xlf | 40 --- .../CSharp/Impl/xlf/CSharpVSResources.tr.xlf | 40 --- .../Impl/xlf/CSharpVSResources.zh-Hans.xlf | 40 --- .../Impl/xlf/CSharpVSResources.zh-Hant.xlf | 40 --- .../Core/Def/ServicesVSResources.resx | 141 ----------- .../Core/Def/xlf/ServicesVSResources.cs.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.de.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.es.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.fr.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.it.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.ja.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.ko.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.pl.xlf | 236 ------------------ .../Def/xlf/ServicesVSResources.pt-BR.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.ru.xlf | 236 ------------------ .../Core/Def/xlf/ServicesVSResources.tr.xlf | 236 ------------------ .../Def/xlf/ServicesVSResources.zh-Hans.xlf | 236 ------------------ .../Def/xlf/ServicesVSResources.zh-Hant.xlf | 236 ------------------ 28 files changed, 3753 deletions(-) diff --git a/src/VisualStudio/CSharp/Impl/CSharpVSResources.resx b/src/VisualStudio/CSharp/Impl/CSharpVSResources.resx index 3570618d71a2e..4d5832f4d4f0b 100644 --- a/src/VisualStudio/CSharp/Impl/CSharpVSResources.resx +++ b/src/VisualStudio/CSharp/Impl/CSharpVSResources.resx @@ -313,9 +313,6 @@ New line options for keywords - - Use 'var' when generating locals - _Show procedure line separators @@ -397,9 +394,6 @@ Suggest usings for types in _NuGet packages - - Type Inference preferences: - For built-in types @@ -496,12 +490,6 @@ Prefer pattern matching over 'as' with 'null' check - - Prefer block body - - - Prefer expression body - Automatically format on return @@ -546,22 +534,10 @@ Remove unnecessary usings - - Sort usings - - - Format Document Settings (Experiment) - - - Apply all C# formatting rules (indentation, wrapping, spacing) - In relational operators: < > <= >= is as == != 'is' and 'as' are C# keywords and should not be localized - - Perform additional code cleanup during formatting - Discard diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.cs.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.cs.xlf index f6377d71c9dc1..827dfef8ab73a 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.cs.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.cs.xlf @@ -32,11 +32,6 @@ Povolit vložené příkazy na stejném řádku - - Apply all C# formatting rules (indentation, wrapping, spacing) - Použít všechna formátovací pravidla jazyka C# (odsazení, zabalení, mezery) - - Automatically complete statement on semicolon Automaticky dokončit příkaz středníkem @@ -87,11 +82,6 @@ Obor souboru - - Format Document Settings (Experiment) - Nastavení formátování dokumentu (experiment) - - General Obecné @@ -132,11 +122,6 @@ Předvolby porovnávání vzorů: - - Perform additional code cleanup during formatting - Při formátování provést dodatečné vyčištění kódu - - Place open brace on new line for object, collection, array, and with initializers Pro objekty, kolekce, pole a inicializátory with umístit levou složenou závorku na nový řádek @@ -207,11 +192,6 @@ Zobrazit poznámky v Rychlých informacích - - Sort usings - Seřadit direktivy using - - Suggest usings for types in .NET Framework assemblies Navrhnout použití typů v sestaveních .NET Framework @@ -522,11 +502,6 @@ Nepoužitá místní - - Use 'var' when generating locals - Při generování lokálních proměnných použijte var. - - _Show procedure line separators Zob_razit oddělovače řádků procedur @@ -652,11 +627,6 @@ Navrhnout použití typů v balíčcích _NuGet - - Type Inference preferences: - Předvolby odvození typu proměnné: - - For built-in types Pro předdefinované typy @@ -822,16 +792,6 @@ Preferovat porovnávání vzorů přes prvek as s kontrolou hodnot null - - Prefer block body - Dávat přednost textu bloku - - - - Prefer expression body - Dávat přednost textu výrazu - - Automatically format on return Automaticky formátovat při stisknutí klávesy Enter diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.de.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.de.xlf index ac2796424ddd2..5fe89b000b3e4 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.de.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.de.xlf @@ -32,11 +32,6 @@ Eingebettete Anweisungen in derselben Zeile zulassen - - Apply all C# formatting rules (indentation, wrapping, spacing) - Alle C#-Formatierungsregeln anwenden (Einzug, Umbruch, Abstand) - - Automatically complete statement on semicolon Anweisung bei Semikolon automatisch abschließen @@ -87,11 +82,6 @@ Dateibereich - - Format Document Settings (Experiment) - Einstellungen zur Dokumentformatierung (experimentell) - - General Allgemein @@ -132,11 +122,6 @@ Einstellungen für den Musterabgleich: - - Perform additional code cleanup during formatting - Zusätzliche Codebereinigung während der Formatierung durchführen - - Place open brace on new line for object, collection, array, and with initializers Öffnende geschweifte Klammer für Objekt-, Sammlungs-, Array- und with-Initialisierer in neue Zeile einfügen @@ -207,11 +192,6 @@ Hinweise in QuickInfo anzeigen - - Sort usings - Using-Direktiven sortieren - - Suggest usings for types in .NET Framework assemblies Using-Anweisungen für Typen in .NET Framework-Assemblys vorschlagen @@ -522,11 +502,6 @@ Nicht verwendete lokale Variable - - Use 'var' when generating locals - Beim Generieren lokaler Variablen "var" verwenden. - - _Show procedure line separators _Zeilentrennzeichen in Prozeduren anzeigen @@ -652,11 +627,6 @@ Using-Direktiven für Typen in _NuGet-Paketen vorschlagen - - Type Inference preferences: - Typrückschlusseinstellungen: - - For built-in types Für integrierte Typen @@ -822,16 +792,6 @@ Bei der NULL-Überprüfung Musterabgleich gegenüber "as" bevorzugen - - Prefer block body - Blocktextkörper bevorzugen - - - - Prefer expression body - Ausdruckskörper bevorzugen - - Automatically format on return Bei Verwendung der EINGABETASTE automatisch formatieren diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.es.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.es.xlf index 65057f7952a53..c82475b89aae7 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.es.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.es.xlf @@ -32,11 +32,6 @@ Permitir instrucciones incrustadas en la misma línea - - Apply all C# formatting rules (indentation, wrapping, spacing) - Aplicar todas las reglas de formato de C# (sangría, ajuste, espaciado) - - Automatically complete statement on semicolon Completar automáticamente la instrucción al introducir punto y coma @@ -87,11 +82,6 @@ Archivo con ámbito - - Format Document Settings (Experiment) - Configuración de “Dar formato al documento” (experimento) - - General General @@ -132,11 +122,6 @@ Preferencias de coincidencia de patrón: - - Perform additional code cleanup during formatting - Realizar limpieza de código adicional durante la aplicación de formato - - Place open brace on new line for object, collection, array, and with initializers Colocar llave de apertura en la nueva línea para los inicializadores de objeto, colección, matriz y with @@ -207,11 +192,6 @@ Mostrar comentarios en Información rápida - - Sort usings - Ordenar instrucciones Using - - Suggest usings for types in .NET Framework assemblies Sugerir usos para tipos en ensamblados .NET Framework @@ -522,11 +502,6 @@ Local sin uso - - Use 'var' when generating locals - Usar 'var' al generar variables locales - - _Show procedure line separators Mo_strar separadores de líneas de procedimientos @@ -652,11 +627,6 @@ Sugerir usos para tipos de paquetes _NuGet - - Type Inference preferences: - Preferencias de inferencia de tipo: - - For built-in types Para tipos integrados @@ -822,16 +792,6 @@ Preferir coincidencia de patrones en lugar de "as" con comprobación de "null" - - Prefer block body - Preferir cuerpo del bloque - - - - Prefer expression body - Preferir cuerpo de expresiones - - Automatically format on return Dar formato automáticamente al volver diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.fr.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.fr.xlf index eaca3c16844e5..1a90cb4f1859e 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.fr.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.fr.xlf @@ -32,11 +32,6 @@ Autoriser les instructions imbriquées sur la même ligne - - Apply all C# formatting rules (indentation, wrapping, spacing) - Appliquer toutes les règles de mise en forme de C# (indentation, enveloppement, espacement) - - Automatically complete statement on semicolon Effectuer la complétion automatique de l'instruction après l'entrée d'un point-virgule @@ -87,11 +82,6 @@ Fichier inclus dans l'étendue - - Format Document Settings (Experiment) - Paramètres de mise en forme du document (essai) - - General Général @@ -132,11 +122,6 @@ Préférences relatives aux critères spéciaux : - - Perform additional code cleanup during formatting - Effectuer un nettoyage supplémentaire du code pendant la mise en forme - - Place open brace on new line for object, collection, array, and with initializers Placer une accolade ouvrante sur une nouvelle ligne pour les initialiseurs d'objets, de collections, de tableaux et with @@ -207,11 +192,6 @@ Afficher les notes dans Info express - - Sort usings - Trier les instructions using - - Suggest usings for types in .NET Framework assemblies Suggérer des using pour les types dans les assemblys .NET Framework @@ -522,11 +502,6 @@ Local inutilisé - - Use 'var' when generating locals - Utiliser 'var' lors de la génération de variables locales - - _Show procedure line separators _Afficher les séparateurs de ligne de procédure @@ -652,11 +627,6 @@ Suggérer des usings pour les types dans les packages _NuGet - - Type Inference preferences: - Préférences d'inférence de type : - - For built-in types Pour les types intégrés @@ -822,16 +792,6 @@ Préférer les critères spéciaux à 'as' avec le contrôle de 'null' - - Prefer block body - Préférer un corps de bloc - - - - Prefer expression body - Préférer un corps d'expression - - Automatically format on return Mise en forme automatique au retour diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.it.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.it.xlf index d3c3b12c9d3a0..16058cee02eda 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.it.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.it.xlf @@ -32,11 +32,6 @@ Consenti istruzioni incorporate sulla stessa riga - - Apply all C# formatting rules (indentation, wrapping, spacing) - Applica tutte le regole di formattazione di C# (rientro, ritorno a capo, spaziatura) - - Automatically complete statement on semicolon Completa automaticamente istruzione dopo punto e virgola @@ -87,11 +82,6 @@ Con ambito file - - Format Document Settings (Experiment) - Impostazioni formattazione documento (sperimentale) - - General Generale @@ -132,11 +122,6 @@ Preferenze per criteri di ricerca: - - Perform additional code cleanup during formatting - Esegui la pulizia del codice aggiuntiva durante la formattazione - - Place open brace on new line for object, collection, array, and with initializers Inserisci parentesi graffa di apertura in una nuova riga per oggetto, raccolta, matrice e inizializzatori with @@ -207,11 +192,6 @@ Mostra i commenti in Informazioni rapide - - Sort usings - Ordina using - - Suggest usings for types in .NET Framework assemblies Suggerisci le direttive using per i tipi in assembly .NET Framework @@ -522,11 +502,6 @@ Variabile locale inutilizzata - - Use 'var' when generating locals - Usa 'var' durante la generazione di variabili locali - - _Show procedure line separators _Mostra separatori di riga routine @@ -652,11 +627,6 @@ Suggerisci le direttive using per i tipi in pacchetti _NuGet - - Type Inference preferences: - Preferenze per inferenza del tipo: - - For built-in types Per tipi predefiniti @@ -822,16 +792,6 @@ Preferisci criteri di ricerca a 'as' con controllo 'null' - - Prefer block body - Preferisci corpo del blocco - - - - Prefer expression body - Preferisci corpo dell'espressione - - Automatically format on return Formatta automaticamente dopo INVIO diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ja.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ja.xlf index ec177d35f3e23..2c1db671696b5 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ja.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ja.xlf @@ -32,11 +32,6 @@ 同一の行に複数の埋め込みステートメントを許可する - - Apply all C# formatting rules (indentation, wrapping, spacing) - C# のすべての書式ルール (インデント、折り返し、スペース) を適用します - - Automatically complete statement on semicolon セミコロンでステートメントをオートコンプリートに設定する @@ -87,11 +82,6 @@ 範囲指定されたファイル - - Format Document Settings (Experiment) - ドキュメントのフォーマットの設定 (実験) - - General 全般 @@ -132,11 +122,6 @@ パターン マッチング設定: - - Perform additional code cleanup during formatting - 書式設定中に追加のコード クリーンアップを実行 - - Place open brace on new line for object, collection, array, and with initializers 新しい行にオブジェクト、コレクション、配列、with 初期化子用の始めかっこを配置する @@ -207,11 +192,6 @@ クイック ヒントに注釈を表示する - - Sort usings - using を並べ替える - - Suggest usings for types in .NET Framework assemblies .NET Framework アセンブリの型に using を提案する @@ -522,11 +502,6 @@ 未使用のローカル - - Use 'var' when generating locals - ローカルの生成時に 'var' を使用する - - _Show procedure line separators プロシージャ行の区切り記号を表示する(_S) @@ -652,11 +627,6 @@ NuGet パッケージの型に using を提案する(_N) - - Type Inference preferences: - 型の推定を優先: - - For built-in types ビルトイン型の場合 @@ -822,16 +792,6 @@ as' を 'null' チェックで使用するよりもパターン マッチングを優先します - - Prefer block body - ブロック本体を優先する - - - - Prefer expression body - 式本体を優先する - - Automatically format on return 戻り時にオートフォーマットする diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ko.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ko.xlf index 96a9ad8e9ced4..361bd1d08c30a 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ko.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ko.xlf @@ -32,11 +32,6 @@ 같은 줄에 포함 문 허용 - - Apply all C# formatting rules (indentation, wrapping, spacing) - 모든 C# 서식 규칙 적용(들여쓰기, 래핑, 간격 조정) - - Automatically complete statement on semicolon 세미콜론 입력 시 자동으로 문 완성 @@ -87,11 +82,6 @@ 파일 범위 지정됨 - - Format Document Settings (Experiment) - 문서 서식 설정(실험) - - General 일반 @@ -132,11 +122,6 @@ 패턴 일치 기본 설정: - - Perform additional code cleanup during formatting - 서식을 지정하는 동안 추가 코드 정리 수행 - - Place open brace on new line for object, collection, array, and with initializers 개체, 컬렉션, 배열 및 with 이니셜라이저의 여는 중괄호를 새 줄에 배치 @@ -207,11 +192,6 @@ 요약 정보에 설명 표시 - - Sort usings - Using 정렬 - - Suggest usings for types in .NET Framework assemblies .NET Framework 어셈블리의 형식에 using 제안 @@ -522,11 +502,6 @@ 사용하지 않는 로컬 - - Use 'var' when generating locals - 지역 변수를 생성할 때 'var'을 사용합니다. - - _Show procedure line separators 프로시저 줄 구분선 표시(_S) @@ -652,11 +627,6 @@ NuGet 패키지의 형식에 대한 using 제안(_N) - - Type Inference preferences: - 형식 유추 기본 설정: - - For built-in types 기본 제공 형식인 경우 @@ -822,16 +792,6 @@ null' 검사에서 'as'보다 패턴 일치 기본 사용 - - Prefer block body - 블록 본문 기본 사용 - - - - Prefer expression body - 식 본문 기본 사용 - - Automatically format on return 반환할 때 서식 자동 지정 diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pl.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pl.xlf index e301708356143..369bfaf224361 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pl.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pl.xlf @@ -32,11 +32,6 @@ Zezwalaj na osadzone instrukcje w tym samym wierszu - - Apply all C# formatting rules (indentation, wrapping, spacing) - Zastosuj wszystkie reguły formatowania kodu C# (wcięcia, zawijanie, odstępy) - - Automatically complete statement on semicolon Automatyczne uzupełniaj instrukcje po naciśnięciu średnika @@ -87,11 +82,6 @@ Plik objęty zakresem - - Format Document Settings (Experiment) - Ustawienia dokumentu formatu (eksperyment) - - General Ogólne @@ -132,11 +122,6 @@ Preferencje dopasowywania wzorca: - - Perform additional code cleanup during formatting - Wykonaj dodatkowe oczyszczanie kodu podczas formatowania - - Place open brace on new line for object, collection, array, and with initializers Umieść otwierający nawias klamrowy w nowym wierszu dla inicjatorów obiektów, kolekcji, tablic i with @@ -207,11 +192,6 @@ Pokaż uwagi w szybkich podpowiedziach - - Sort usings - Sortuj użycia - - Suggest usings for types in .NET Framework assemblies Sugeruj dyrektywy using dla typów w zestawach platformy .NET Framework @@ -522,11 +502,6 @@ Nieużywane zmienne lokalne - - Use 'var' when generating locals - Użyj słowa „var” podczas generowania zmiennych lokalnych - - _Show procedure line separators _Pokaż separatory wierszy procedury @@ -652,11 +627,6 @@ Sugeruj dyrektywy using dla typów w pakietach _NuGet - - Type Inference preferences: - Preferencje wnioskowania o typie: - - For built-in types Dla typów wbudowanych @@ -822,16 +792,6 @@ Preferuj dopasowywanie wzorców względem klauzuli „As” podczas testu na obecność wartości „null” - - Prefer block body - Preferuj treść bloku - - - - Prefer expression body - Preferuj treść wyrażenia - - Automatically format on return Formatuj automatycznie po przejściu do nowego wiersza diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pt-BR.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pt-BR.xlf index a50df565bda4b..fb04081eda7bd 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pt-BR.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pt-BR.xlf @@ -32,11 +32,6 @@ Permitir instruções inseridas na mesma linha - - Apply all C# formatting rules (indentation, wrapping, spacing) - Aplicar todas as regras de formatação de C# (recuo, quebra de linha, espaçamento) - - Automatically complete statement on semicolon Concluir a instrução automaticamente no ponto e vírgula @@ -87,11 +82,6 @@ Escopo do arquivo - - Format Document Settings (Experiment) - Formatar Configurações do Documento (Experimento) - - General Geral @@ -132,11 +122,6 @@ Preferências de correspondência de padrões: - - Perform additional code cleanup during formatting - Executar limpeza de código adicional durante a formatação - - Place open brace on new line for object, collection, array, and with initializers Colocar uma chave de abertura em uma nova linha para inicializadores de objeto, coleção, matriz e with @@ -207,11 +192,6 @@ Mostrar os comentários nas Informações Rápidas - - Sort usings - Classificar usos - - Suggest usings for types in .NET Framework assemblies Sugerir usings para tipos nos assemblies do .NET Framework @@ -522,11 +502,6 @@ Local não usado - - Use 'var' when generating locals - Usar "var" ao gerar locais - - _Show procedure line separators _Mostrar separadores de linha de procedimento @@ -652,11 +627,6 @@ Sugerir usos para tipos nos pacotes _NuGet - - Type Inference preferences: - Preferências de Inferência de Tipos: - - For built-in types Para tipos internos @@ -822,16 +792,6 @@ Preferir a correspondência de padrões 'as' com a seleção 'null' - - Prefer block body - Preferir o corpo do bloco - - - - Prefer expression body - Preferir o corpo da expressão - - Automatically format on return Formatar automaticamente no retorno diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ru.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ru.xlf index ee2e17d1eef03..5bb3ba19a965e 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ru.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ru.xlf @@ -32,11 +32,6 @@ Разрешать встроенные операторы на одной строке - - Apply all C# formatting rules (indentation, wrapping, spacing) - Применять все правила форматирования C# (отступ, перенос по словам, задание интервала) - - Automatically complete statement on semicolon Автоматически завершать инструкцию при вводе точки с запятой @@ -87,11 +82,6 @@ Область видимого файла - - Format Document Settings (Experiment) - Параметры форматирования документа (эксперимент) - - General Общие @@ -132,11 +122,6 @@ Параметры сопоставления шаблонов: - - Perform additional code cleanup during formatting - Выполнять при форматировании дополнительную очистку кода - - Place open brace on new line for object, collection, array, and with initializers Помещать открывающую фигурную скобку на новой строке для объекта, коллекции, массива и инициализаторов with @@ -207,11 +192,6 @@ Показать заметки в кратких сведениях - - Sort usings - Сортировать директивы using - - Suggest usings for types in .NET Framework assemblies Предлагать using для типов в сборках .NET Framework @@ -522,11 +502,6 @@ Не использовать локальный аргумент - - Use 'var' when generating locals - Использовать ключевое слово "var" при создании локальных переменных - - _Show procedure line separators _Показывать разделительные линии процедур @@ -652,11 +627,6 @@ Предлагать using для типов в _пакетах NuGet - - Type Inference preferences: - Предпочтения для определения типа: - - For built-in types Для встроенных типов @@ -822,16 +792,6 @@ Предпочитать сопоставление шаблонов элементу "as" с проверкой значений "null" - - Prefer block body - Предпочитать тело блока - - - - Prefer expression body - Предпочитать тело выражения - - Automatically format on return Автоматически форматировать при возврате diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.tr.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.tr.xlf index 3d7963616bcec..bbbf0a9425801 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.tr.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.tr.xlf @@ -32,11 +32,6 @@ Aynı satırda katıştırılmış ifadelere izin ver - - Apply all C# formatting rules (indentation, wrapping, spacing) - Tüm C# biçimlendirme kurallarını (girinti, kaydırma, boşluklar) uygula - - Automatically complete statement on semicolon Deyimi noktalı virgülle otomatik olarak tamamla @@ -87,11 +82,6 @@ Dosya kapsama alındı - - Format Document Settings (Experiment) - Belge Biçimlendirme Ayarları (Deneme) - - General Genel @@ -132,11 +122,6 @@ Desen eşleştirme tercihleri: - - Perform additional code cleanup during formatting - Biçimlendirme sırasında ek kod temizleme gerçekleştir - - Place open brace on new line for object, collection, array, and with initializers Nesne, koleksiyon, dizi ve with başlatıcıları için açma küme ayracını yeni satıra yerleştir @@ -207,11 +192,6 @@ Hızlı Bilgi notlarını göster - - Sort usings - Using’leri sırala - - Suggest usings for types in .NET Framework assemblies .NET Framework bütünleştirilmiş kodlarında türler için using öner @@ -522,11 +502,6 @@ Kullanılmayan yerel - - Use 'var' when generating locals - Yerelleri üretirken 'var' kullan - - _Show procedure line separators Yordam satır ayıraçlarını _göster @@ -652,11 +627,6 @@ _NuGet paketlerinde türler için using öner - - Type Inference preferences: - Tür Çıkarımı tercihleri: - - For built-in types Yerleşik türler için @@ -822,16 +792,6 @@ 'null' ile 'as' denetimi yerine desen eşleştirme kullan - - Prefer block body - Blok gövdesini tercih et - - - - Prefer expression body - İfade gövdesini tercih et - - Automatically format on return Return tuşuna basıldığında otomatik biçimlendir diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hans.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hans.xlf index a8581c7c8e417..87692c2ad2c7b 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hans.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hans.xlf @@ -32,11 +32,6 @@ 允许将嵌入的语句放在同一行上 - - Apply all C# formatting rules (indentation, wrapping, spacing) - 应用所有 C# 格式规则(缩进、换行、间隔) - - Automatically complete statement on semicolon 以分号自动补全语句 @@ -87,11 +82,6 @@ 文件范围限定 - - Format Document Settings (Experiment) - 设定文档设置的格式(试验) - - General 常规 @@ -132,11 +122,6 @@ 模式匹配首选项: - - Perform additional code cleanup during formatting - 在格式设置期间执行其他代码清理 - - Place open brace on new line for object, collection, array, and with initializers 对于对象、集合、数组和 with 初始值设定项,另起一行放置左花括号 @@ -207,11 +192,6 @@ 在快速信息中显示备注 - - Sort usings - 对 using 排序 - - Suggest usings for types in .NET Framework assemblies 建议对 .NET Framework 程序集中的类型使用 using @@ -522,11 +502,6 @@ 未使用的本地 - - Use 'var' when generating locals - 生成局部变量时,使用“var” - - _Show procedure line separators 显示过程行分隔符(_S) @@ -652,11 +627,6 @@ 建议对 NuGet 包中的类型使用 using(_N) - - Type Inference preferences: - 类型推理首选项: - - For built-in types 对于内置类型 @@ -822,16 +792,6 @@ 使用 "null" 检查时首选模式匹配而不是 "as" - - Prefer block body - 选择程序块主体 - - - - Prefer expression body - 选择表达式主体 - - Automatically format on return 返回时自动格式化 diff --git a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hant.xlf b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hant.xlf index 9eda48bf09f9d..1ad6b54c70796 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hant.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.zh-Hant.xlf @@ -32,11 +32,6 @@ 允許在同一行使用內嵌陳述式 - - Apply all C# formatting rules (indentation, wrapping, spacing) - 套用所有 C# 格式化規則 (縮排、換行、間距) - - Automatically complete statement on semicolon 在遇到分號時自動完成陳述式 @@ -87,11 +82,6 @@ 檔案已設定範圍 - - Format Document Settings (Experiment) - 格式化文件設定 (實驗) - - General 一般 @@ -132,11 +122,6 @@ 模式比對喜好設定: - - Perform additional code cleanup during formatting - 在格式化期間執行額外程式碼清除 - - Place open brace on new line for object, collection, array, and with initializers 在物件、集合、陣列以及 with 初始設定式的新行上放上左大括弧 @@ -207,11 +192,6 @@ 在快速諮詢中顯示備註 - - Sort usings - 排序 Using - - Suggest usings for types in .NET Framework assemblies 為 .NET Framework 組件中的類型建議 using @@ -522,11 +502,6 @@ 未使用的區域函式 - - Use 'var' when generating locals - 產生區域變數時,請使用 'var' - - _Show procedure line separators 顯示程序行分隔符號(_S) @@ -652,11 +627,6 @@ 為 NuGet 封裝中的類型建議 Using(_N) - - Type Inference preferences: - 型別推斷喜好設定: - - For built-in types 適用於內建類型 @@ -822,16 +792,6 @@ 建議使用 'null' 檢查對 'as' 進行模式比對 - - Prefer block body - 偏好區塊主體 - - - - Prefer expression body - 偏好運算式主體 - - Automatically format on return 在傳回時自動格式化 diff --git a/src/VisualStudio/Core/Def/ServicesVSResources.resx b/src/VisualStudio/Core/Def/ServicesVSResources.resx index 0573814067f63..aca53283fce6f 100644 --- a/src/VisualStudio/Core/Def/ServicesVSResources.resx +++ b/src/VisualStudio/Core/Def/ServicesVSResources.resx @@ -165,21 +165,12 @@ Inherits - - Inherited By - Implements Implemented By - - Maximum number of documents are open. - - - Failed to create document in miscellaneous files project. - Invalid access. @@ -294,12 +285,6 @@ Use the dropdown to view and switch to other projects this file may belong to. The analyzer assembly '{0}' has changed. Diagnostics may be incorrect until Visual Studio is restarted. - - C#/VB Diagnostics Table Data Source - - - C#/VB Todo List Table Data Source - Cancel @@ -396,9 +381,6 @@ Use the dropdown to view and switch to other projects this file may belong to. More about {0} - - Navigation must be performed on the foreground thread. - [+] @@ -420,9 +402,6 @@ Use the dropdown to view and switch to other projects this file may belong to. AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - {0} references @@ -450,15 +429,9 @@ Use the dropdown to view and switch to other projects this file may belong to. IntelliSense - - C#/VB Build Table Data Source - MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - Suppress diagnostics @@ -486,9 +459,6 @@ Use the dropdown to view and switch to other projects this file may belong to. This workspace does not support updating Visual Basic parse options. - - Synchronize {0} - Synchronizing with {0}... @@ -513,18 +483,9 @@ Use the dropdown to view and switch to other projects this file may belong to. Yes - - Choose a Symbol Specification and a Naming Style. - - - Enter a title for this Naming Rule. - Enter a title for this Naming Style. - - Enter a title for this Symbol Specification. - Accessibilities (can match any) @@ -546,36 +507,18 @@ Use the dropdown to view and switch to other projects this file may belong to. Pascal Case Name - - Severity: - Modifiers (must match all) - - Name: - Naming Rule Naming Style - - Naming Style: - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - Naming Style Title: - - Parent Rule: - Required Prefix: @@ -591,9 +534,6 @@ Use the dropdown to view and switch to other projects this file may belong to. Symbol Specification - - Symbol Specification: - Symbol Specification Title: @@ -623,23 +563,6 @@ Use the dropdown to view and switch to other projects this file may belong to. Package uninstall failed: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - - - Project loading failed. - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Additional information: @@ -675,12 +598,6 @@ Additional information: {1} Learn more - - Build + live analysis (NuGet package) - - - Live analysis (VSIX extension) - Prefer framework type @@ -720,9 +637,6 @@ Additional information: {1} Show guides for code level constructs - - Show guides for comments and preprocessor regions - Show guides for declaration level constructs @@ -861,12 +775,6 @@ Additional information: {1} Prefer auto properties - - Add a symbol specification - - - Remove symbol specification - Add item @@ -897,9 +805,6 @@ Additional information: {1} Options - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Never show this again @@ -942,9 +847,6 @@ Additional information: {1} Parentheses preferences: - - Module has been unloaded. - Prefer deconstructed variable declaration @@ -996,9 +898,6 @@ Additional information: {1} Prefer readonly fields - - Analyzing '{0}' - Prefer conditional expression over 'if' with assignments @@ -1282,15 +1181,6 @@ Additional information: {1} Containing Type - - Running low priority background processes - - - Evaluating ({0} tasks in queue) - - - Paused ({0} tasks in queue) - Naming rules @@ -1342,13 +1232,6 @@ Additional information: {1} _Edit - - Edit {0} - {0} is a parameter description - - - Parameter Details - _Add Adding an element to a list @@ -1432,15 +1315,6 @@ Additional information: {1} Entire repository - - Indexed in organization - - - Indexed in repo - - - Item origin - Loaded items @@ -1450,9 +1324,6 @@ Additional information: {1} Local - - Local metadata - Others @@ -1563,9 +1434,6 @@ Additional information: {1} Display all hints while pressing Alt+F1 - - C#/Visual Basic Diagnostics Language Client - New Type Name: @@ -1593,9 +1461,6 @@ Additional information: {1} Apply - - Remove All - Action Action to perform on an unused reference, such as remove or keep @@ -1708,9 +1573,6 @@ Additional information: {1} This rule is not configurable - - Inline Diagnostics (experimental) - Display diagnostics inline (experimental) @@ -1902,9 +1764,6 @@ Additional information: {1} Remove unnecessary usings - - Sort usings - Navigate to External Sources diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf index ae2497f77c27f..d1e7bfbf1c0bb 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf @@ -162,16 +162,6 @@ 64b - - Build + live analysis (NuGet package) - Sestavení + živá analýza (balíček NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Klient jazyka diagnostiky C# nebo Visual Basic - - Calculating... Probíhá výpočet… @@ -382,11 +372,6 @@ _Upravit - - Edit {0} - Upravit {0} - {0} is a parameter description - Editor Color Scheme Barevné schéma editoru @@ -462,11 +447,6 @@ Chyba při aktualizaci potlačení: {0} - - Evaluating ({0} tasks in queue) - Vyhodnocování (počet úloh ve frontě: {0}) - - External Sources Externí zdroje @@ -577,16 +557,6 @@ Odvodit z kontextu - - Indexed in organization - Indexováno v organizaci - - - - Indexed in repo - Indexováno v úložišti - - Inheritance Margin Míra dědičnosti @@ -597,11 +567,6 @@ Zděděná rozhraní - - Inline Diagnostics (experimental) - Vložená diagnostika (experimentální) - - Inline Hints Vložené nápovědy @@ -612,11 +577,6 @@ Vkládá se hodnota lokality volání {0}. - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Nainstalujte Microsoftem doporučené analyzátory Roslyn, které poskytují další diagnostiku a opravy pro běžné problémy s návrhem, zabezpečením, výkonem a spolehlivostí rozhraní API. - - Interface cannot have field. Rozhraní nemůže mít pole. @@ -632,11 +592,6 @@ Neplatný název typu - - Item origin - Původ položky - - JSON strings Řetězce JSON @@ -657,11 +612,6 @@ Druh - - Live analysis (VSIX extension) - Živá analýza (rozšíření VSIX) - - Loaded items Načtené položky @@ -677,11 +627,6 @@ Místní - - Local metadata - Místní metadata - - Location Lokalita @@ -1027,11 +972,6 @@ Balíčky - - Parameter Details - Podrobnosti o parametru - - Parameter name: Název parametru: @@ -1077,11 +1017,6 @@ Pokud chcete zobrazit a procházet jeho hodnoty, vložte trasování zásobníku. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Pozastaveno (počet úloh ve frontě: {0}) - - Please enter a type name Zadejte prosím název typu. @@ -1207,11 +1142,6 @@ Regulární výrazy - - Remove All - Odebrat vše - - Remove Unused References Odebrat nepoužívané odkazy @@ -1312,11 +1242,6 @@ Spouští se analýza kódu pro řešení... - - Running low priority background processes - Spouštění procesů s nízkou prioritou na pozadí - - Save .editorconfig file Uložit soubor .editorconfig @@ -1437,11 +1362,6 @@ Některé barvy barevného schématu se přepsaly změnami na stránce možností Prostředí > Písma a barvy. Pokud chcete zrušit všechna přizpůsobení, vyberte na stránce Písma a barvy možnost Použít výchozí. - - Sort usings - Seřadit direktivy using - - Stack Trace Trasování zásobníku @@ -1767,11 +1687,6 @@ Dědí - - Inherited By - Zdědil: - - Implements Implementuje @@ -1782,16 +1697,6 @@ Implementoval: - - Maximum number of documents are open. - Více dokumentů už nejde otevřít. - - - - Failed to create document in miscellaneous files project. - V projektu s různorodými soubory se nepovedlo vytvořit dokument. - - Invalid access. Neplatný přístup @@ -2024,16 +1929,6 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Sestavení analyzátoru {0} se změnilo. Diagnostika možná nebude odpovídat skutečnosti, dokud se Visual Studio nerestartuje. - - C#/VB Diagnostics Table Data Source - Zdroj dat pro tabulku diagnostiky jazyka C#/VB - - - - C#/VB Todo List Table Data Source - Zdroj dat pro tabulku seznamu úkolů jazyka C#/VB - - Cancel Storno @@ -2184,11 +2079,6 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Další informace o {0} - - Navigation must be performed on the foreground thread. - Navigace musí probíhat ve vlákně na popředí. - - [+] [+] @@ -2224,11 +2114,6 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Sestavení analyzátoru {0} a {1} mají obě identitu {2}, ale různý obsah. Načte se jenom jedno z nich. Analyzátory, které tato sestavení používají, možná nepoběží tak, jak by měly. - - {0} references Počet odkazů: {0} @@ -2274,21 +2159,11 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento IntelliSense - - C#/VB Build Table Data Source - Zdroj dat pro tabulku sestavení jazyka C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - Sestavení analyzátoru {0} závisí na sestavení {1}, to se ale nepovedlo najít. Analyzátory možná nepoběží tak, jak by měly, dokud se jako odkaz analyzátoru nepřidá i chybějící sestavení. - - Suppress diagnostics Potlačit diagnostiku @@ -2329,11 +2204,6 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Tento pracovní prostor nepodporuje aktualizaci možností analýzy jazyka Visual Basic. - - Synchronize {0} - Synchronizovat {0} - - Synchronizing with {0}... Probíhá synchronizace s {0}... @@ -2374,26 +2244,11 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Ano - - Choose a Symbol Specification and a Naming Style. - Zvolte specifikaci symbolů a styl pojmenování. - - - - Enter a title for this Naming Rule. - Zadejte název tohoto pravidla pojmenování. - - Enter a title for this Naming Style. Zadejte název tohoto stylu pojmenování. - - Enter a title for this Symbol Specification. - Zadejte název této specifikace symbolů. - - Accessibilities (can match any) Přístupnosti (můžou odpovídat čemukoli) @@ -2429,21 +2284,11 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Název ve stylu JazykaPascal - - Severity: - Závažnost: - - Modifiers (must match all) Modifikátory (můžou odpovídat libovolným) - - Name: - Název: - - Naming Rule Pravidlo pojmenování @@ -2454,31 +2299,11 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Styl pojmenování - - Naming Style: - Styl pojmenování: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Pravidla pojmenování umožňují definovat, jak se mají pojmenovat konkrétní sady symbolů a jak se mají zpracovat nesprávně pojmenované symboly. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - Při pojmenovávání symbolu se standardně použije první odpovídající pravidlo pojmenování nejvyšší úrovně. Speciální případy se řeší odpovídajícím podřízeným pravidlem. - - Naming Style Title: Název stylu pojmenování: - - Parent Rule: - Nadřazené pravidlo: - - Required Prefix: Požadovaná předpona: @@ -2504,11 +2329,6 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Specifikace symbolů - - Symbol Specification: - Specifikace symbolů: - - Symbol Specification Title: Název specifikace symbolů: @@ -2554,37 +2374,6 @@ V rozevíracím seznamu si můžete zobrazit jiné projekty, ke kterým by tento Nepovedlo se odinstalovat balíček: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Při načítání projektu došlo k chybě. Některé funkce projektu, třeba úplná analýza řešení pro neúspěšný projekt a projekty, které na něm závisí, jsou zakázané. - - - - Project loading failed. - Nepovedlo se načíst projekt. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Pokud chcete zjistit příčinu problému, zkuste prosím následující. - -1. Zavřete Visual Studio. -2. Otevřete Visual Studio Developer Command Prompt. -3. Nastavte proměnnou prostředí TraceDesignTime na hodnotu true (set TraceDesignTime=true). -4. Odstraňte adresář .vs nebo soubor /.suo. -5. Restartujte VS z příkazového řádku, ve kterém jste nastavili proměnnou prostředí (devenv). -6. Otevřete řešení. -7. Zkontrolujte {0} a vyhledejte neúspěšné úlohy (FAILED). - - Additional information: Další informace: @@ -2703,11 +2492,6 @@ Další informace: {1} Zobrazit vodítka pro konstrukty na úrovni kódu - - Show guides for comments and preprocessor regions - Zobrazit vodítka pro komentáře a oblasti pro preprocesor - - Show guides for declaration level constructs Zobrazit vodítka pro konstrukty na úrovni deklarace @@ -2928,16 +2712,6 @@ Další informace: {1} Vybrat členy - - Add a symbol specification - Přidat specifikaci symbolu - - - - Remove symbol specification - Odebrat specifikaci symbolu - - Add item Přidat položku @@ -3058,11 +2832,6 @@ Další informace: {1} preferovat automatické vlastnosti - - Module has been unloaded. - Modul byl uvolněn. - - Enable navigation to decompiled sources Povolit navigaci na dekompilované zdroje @@ -3078,11 +2847,6 @@ Další informace: {1} Synchronizovat Zobrazení tříd - - Analyzing '{0}' - Analyzuje se {0}. - - Manage naming styles Spravovat styly pojmenování diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf index 49ecfb64f7cf6..545fe7c9d2db4 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf @@ -162,16 +162,6 @@ 64 Bit - - Build + live analysis (NuGet package) - Build + Liveanalyse (NuGet-Paket) - - - - C#/Visual Basic Diagnostics Language Client - Client für C#-/Visual Basic-Diagnosesprache - - Calculating... Wird berechnet... @@ -382,11 +372,6 @@ _Bearbeiten - - Edit {0} - "{0}" bearbeiten - {0} is a parameter description - Editor Color Scheme Editor-Farbschema @@ -462,11 +447,6 @@ Fehler bei der Aktualisierung von Unterdrückungen: {0} - - Evaluating ({0} tasks in queue) - Auswertung ({0} Tasks in der Warteschlange) - - External Sources Externe Quellen @@ -577,16 +557,6 @@ Aus Kontext ableiten - - Indexed in organization - In Organisation indiziert - - - - Indexed in repo - In Repository indiziert - - Inheritance Margin Vererbungsrand @@ -597,11 +567,6 @@ Geerbte Schnittstelle - - Inline Diagnostics (experimental) - Inline-Diagnose (experimentell) - - Inline Hints Inlinehinweise @@ -612,11 +577,6 @@ Der Wert der Aufrufsite "{0}" wird eingefügt. - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Installieren Sie von Microsoft empfohlene Roslyn-Analysetools, die zusätzliche Diagnosen und Fixes für allgemeine Design-, Sicherheits-, Leistungs- und Zuverlässigkeitsprobleme bei APIs bereitstellen. - - Interface cannot have field. Die Schnittstelle kann kein Feld aufweisen. @@ -632,11 +592,6 @@ Ungültiger Typname - - Item origin - Elementursprung - - JSON strings JSON-Zeichenfolgen @@ -657,11 +612,6 @@ Art - - Live analysis (VSIX extension) - Liveanalyse (VSIX-Erweiterung) - - Loaded items Geladene Elemente @@ -677,11 +627,6 @@ Lokal - - Local metadata - Lokale Metadaten - - Location Speicherort @@ -1027,11 +972,6 @@ Pakete - - Parameter Details - Parameterdetails - - Parameter name: Parametername: @@ -1077,11 +1017,6 @@ Fügen Sie eine Stapelüberwachung ein, und navigieren Sie durch ihre Werte. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Angehalten ({0} Tasks in der Warteschlange) - - Please enter a type name Geben Sie einen Typnamen ein. @@ -1207,11 +1142,6 @@ Reguläre Ausdrücke - - Remove All - Alle entfernen - - Remove Unused References Nicht verwendete Verweise entfernen @@ -1312,11 +1242,6 @@ Die Codeanalyse für die Projektmappe wird ausgeführt... - - Running low priority background processes - Hintergrundprozesse mit niedriger Priorität werden ausgeführt. - - Save .editorconfig file EDITORCONFIG-Datei speichern @@ -1437,11 +1362,6 @@ Einige Farbschemafarben werden durch Änderungen überschrieben, die auf der Optionsseite "Umgebung" > "Schriftarten und Farben" vorgenommen wurden. Wählen Sie auf der Seite "Schriftarten und Farben" die Option "Standardwerte verwenden" aus, um alle Anpassungen rückgängig zu machen. - - Sort usings - Using-Direktiven sortieren - - Stack Trace Stapelüberwachung @@ -1767,11 +1687,6 @@ Erbt - - Inherited By - Geerbt durch - - Implements Implementiert @@ -1782,16 +1697,6 @@ Implementiert von - - Maximum number of documents are open. - Die maximale Anzahl von Dokumenten ist geöffnet. - - - - Failed to create document in miscellaneous files project. - Das Dokument im Projekt "Sonstige Dateien" konnte nicht erstellt werden. - - Invalid access. Ungültiger Zugriff. @@ -2024,16 +1929,6 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Die Analysetoolassembly "{0}" wurde geändert. Die Diagnose ist bis zu einem Neustart von Visual Studio möglicherweise nicht korrekt. - - C#/VB Diagnostics Table Data Source - Datenquelle der C#/VB-Diagnosetabelle - - - - C#/VB Todo List Table Data Source - Datenquelle der C#/VB-Aufgabenliste - - Cancel Abbrechen @@ -2184,11 +2079,6 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Weitere Informationen zu "{0}" - - Navigation must be performed on the foreground thread. - Die Navigation muss im Vordergrundthread ausgeführt werden. - - [+] [+] @@ -2224,11 +2114,6 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Die Assemblys "{0}" des Analysetools und "{1}" weisen beide die Identität "{2}", aber unterschiedliche Inhalte auf. Nur eine Assembly wird geladen, und Analysetools, die diese Assemblys verwenden, werden möglicherweise nicht ordnungsgemäß ausgeführt. - - {0} references {0} Verweise @@ -2274,21 +2159,11 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a IntelliSense - - C#/VB Build Table Data Source - Datenquelle der C#/VB-Buildtabelle - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - Die Assembly "{0}" des Analysetools hängt von "{1}" ab, diese Assembly wurde aber nicht gefunden. Analysetools werden möglicherweise nicht ordnungsgemäß ausgeführt, wenn die fehlende Assembly nicht als Analysetoolverweis hinzugefügt wird. - - Suppress diagnostics Diagnose unterdrücken @@ -2329,11 +2204,6 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Das Aktualisieren von Visual Basic-Analyseoptionen wird von diesem Arbeitsbereich nicht unterstützt. - - Synchronize {0} - "{0}" synchronisieren - - Synchronizing with {0}... Synchronisierung mit "{0}" wird durchgeführt... @@ -2374,26 +2244,11 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Ja - - Choose a Symbol Specification and a Naming Style. - Wählen Sie eine Symbolspezifikation und einen Benennungsstil aus. - - - - Enter a title for this Naming Rule. - Geben Sie einen Titel für diese Benennungsregel ein. - - Enter a title for this Naming Style. Geben Sie einen Titel für diesen Benennungsstil ein. - - Enter a title for this Symbol Specification. - Geben Sie einen Titel für diese Symbolspezifikation ein. - - Accessibilities (can match any) Zugriffsebenen (beliebige Übereinstimmung) @@ -2429,21 +2284,11 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Name in Pascal-Schreibweise - - Severity: - Schweregrad: - - Modifiers (must match all) Modifizierer (muss mit allen übereinstimmen) - - Name: - Name: - - Naming Rule Benennungsregel @@ -2454,31 +2299,11 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Benennungsstil - - Naming Style: - Benennungsstil: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Mithilfe von Benennungsregeln können Sie definieren, wie bestimmte Symbolsätze benannt und wie falsch benannte Symbole behandelt werden sollen. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - Die erste übereinstimmende Benennungsregel oberster Ebene wird standardmäßig zum Benennen eines Symbols verwendet, während Sonderfälle durch eine übereinstimmende untergeordnete Regel verarbeitet werden. - - Naming Style Title: Titel des Benennungsstils: - - Parent Rule: - Übergeordnete Regel: - - Required Prefix: Erforderliches Präfix: @@ -2504,11 +2329,6 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Symbolspezifikation - - Symbol Specification: - Symbolspezifikation: - - Symbol Specification Title: Titel der Symbolspezifikation: @@ -2554,37 +2374,6 @@ Verwenden Sie die Dropdownliste, um weitere zu dieser Datei gehörige Projekte a Fehler bei der Paketdeinstallation: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Fehler beim Laden des Projekts. Einige Projektfeatures (z. B. die vollständige Projektmappenanalyse für das fehlerhafte Projekt und davon abhängige Projekte) wurden deaktiviert. - - - - Project loading failed. - Fehler beim Laden des Projekts. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Führen Sie die unten aufgeführten Aktionen aus, um die Ursache des Problems zu ermitteln. - -1. Schließen Sie Visual Studio. -2. Öffnen Sie eine Visual Studio Developer-Eingabeaufforderung. -3. Legen Sie die Umgebungsvariable "TraceDesignTime" auf TRUE fest (set TraceDesignTime=true). -4. Löschen Sie die Datei ".vs directory/.suo". -5. Starten Sie VS über die Eingabeaufforderung neu, in der Sie die Umgebungsvariable festgelegt haben (devenv). -6. Öffnen Sie die Projektmappe. -7. Überprüfen Sie "{0}", und ermitteln Sie die fehlerhaften Tasks (FAILED). - - Additional information: Zusätzliche Informationen: @@ -2703,11 +2492,6 @@ Zusätzliche Informationen: {1} Führungslinien für Konstrukte auf Codeebene anzeigen - - Show guides for comments and preprocessor regions - Führungslinien für Kommentare und Präprozessorregionen anzeigen - - Show guides for declaration level constructs Führungslinien für Konstrukte auf Deklarationsebene anzeigen @@ -2928,16 +2712,6 @@ Zusätzliche Informationen: {1} Member auswählen - - Add a symbol specification - Symbolspezifikation hinzufügen - - - - Remove symbol specification - Symbolspezifikation entfernen - - Add item Element hinzufügen @@ -3058,11 +2832,6 @@ Zusätzliche Informationen: {1} automatische Eigenschaften bevorzugen - - Module has been unloaded. - Das Modul wurde entladen. - - Enable navigation to decompiled sources Aktivieren der Navigation zu dekompilierten Quellen @@ -3078,11 +2847,6 @@ Zusätzliche Informationen: {1} Synchronisierungsklassenansicht - - Analyzing '{0}' - "{0}" wird analysiert. - - Manage naming styles Benennungsstile verwalten diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf index 6c40dddaa46b9..a096c54a69956 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf @@ -162,16 +162,6 @@ 64 bits - - Build + live analysis (NuGet package) - Compilación y análisis en directo (paquete NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Cliente de lenguaje de diagnóstico de C#/Visual Basic - - Calculating... Calculando... @@ -382,11 +372,6 @@ _Editar - - Edit {0} - Editar {0} - {0} is a parameter description - Editor Color Scheme Combinación de colores del editor @@ -462,11 +447,6 @@ Actualización de errores de forma periódica: {0} - - Evaluating ({0} tasks in queue) - Evaluando ({0} tareas en cola) - - External Sources Orígenes externos @@ -577,16 +557,6 @@ Inferir del contexto - - Indexed in organization - Indexado en la organización - - - - Indexed in repo - Indexado en el repositorio - - Inheritance Margin Margen de herencia @@ -597,11 +567,6 @@ Interfaces heredadas - - Inline Diagnostics (experimental) - Diagnósticos incorporados (experimental) - - Inline Hints Sugerencias insertadas @@ -612,11 +577,6 @@ Insertando el valor del sitio de llamada "{0}" - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Instale los analizadores de Roslyn recomendados por Microsoft, que proporcionan diagnósticos y correcciones adicionales para problemas comunes de confiabilidad, rendimiento, seguridad y diseño de API. - - Interface cannot have field. La interfaz no puede tener campos. @@ -632,11 +592,6 @@ Nombre de tipo no válido. - - Item origin - Origen del elemento - - JSON strings Cadenas JSON @@ -657,11 +612,6 @@ Tipo - - Live analysis (VSIX extension) - Análisis en directo (extensión VSIX) - - Loaded items Elementos cargados @@ -677,11 +627,6 @@ Local - - Local metadata - Metadatos locales - - Location Ubicación @@ -1027,11 +972,6 @@ Paquetes - - Parameter Details - Detalles de parámetros - - Parameter name: Nombre del parámetro: @@ -1077,11 +1017,6 @@ Pegar un seguimiento de pila para ver y navegar sus valores. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - En pausa ({0} tareas en cola) - - Please enter a type name Escriba un nombre de tipo. @@ -1207,11 +1142,6 @@ Expresiones regulares - - Remove All - Quitar todo - - Remove Unused References Quitar referencias sin usar @@ -1312,11 +1242,6 @@ Ejecutando el análisis de código para la solución... - - Running low priority background processes - Ejecutando procesos en segundo plano de baja prioridad - - Save .editorconfig file Guardar archivo .editorconfig @@ -1437,11 +1362,6 @@ Algunos de los colores de la combinación se reemplazan por los cambios realizados en la página de opciones de Entorno > Fuentes y colores. Elija "Usar valores predeterminados" en la página Fuentes y colores para revertir todas las personalizaciones. - - Sort usings - Ordenar instrucciones Using - - Stack Trace Seguimiento de la pila @@ -1767,11 +1687,6 @@ Hereda - - Inherited By - Heredado por - - Implements Implementa @@ -1782,16 +1697,6 @@ Implementado por - - Maximum number of documents are open. - Está abierto el número máximo de documentos. - - - - Failed to create document in miscellaneous files project. - No se pudo crear el documento en el proyecto de archivos varios. - - Invalid access. Acceso no válido. @@ -2024,16 +1929,6 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe El ensamblado del analizador "{0}" cambió. Los diagnósticos podrían ser incorrectos hasta que se reinicie Visual Studio. - - C#/VB Diagnostics Table Data Source - Origen de datos de tabla de diagnóstico de C#/VB - - - - C#/VB Todo List Table Data Source - Origen de datos de tabla de lista de tareas pendientes de C#/VB - - Cancel Cancelar @@ -2184,11 +2079,6 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe Más información sobre {0} - - Navigation must be performed on the foreground thread. - La navegación se debe realizar en el subproceso en primer plano. - - [+] [+] @@ -2224,11 +2114,6 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Los dos ensamblados del analizador, "{0}" y "{1}", tienen la identidad "{2}" pero contenido distinto. Solo se cargará uno de ellos y es posible que estos analizadores no se ejecuten correctamente. - - {0} references {0} referencias @@ -2274,21 +2159,11 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe IntelliSense - - C#/VB Build Table Data Source - Origen de datos de tabla de compilación de C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - El ensamblado del analizador "{0}" depende de "{1}", pero no se encontró. Es posible que los analizadores no se ejecuten correctamente, a menos que el ensamblado que falta se agregue también como referencia del analizador. - - Suppress diagnostics Suprimir diagnóstico @@ -2329,11 +2204,6 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe Esta área de trabajo no admite la actualización de opciones de análisis de Visual Basic. - - Synchronize {0} - Sincronizar {0} - - Synchronizing with {0}... Sincronizando con {0}... @@ -2374,26 +2244,11 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe - - Choose a Symbol Specification and a Naming Style. - Elija una especificación de símbolo y un estilo de nomenclatura. - - - - Enter a title for this Naming Rule. - Escriba un título para la regla de nomenclatura. - - Enter a title for this Naming Style. Escriba un título para el estilo de nomenclatura. - - Enter a title for this Symbol Specification. - Escriba un título para la especificación de símbolo. - - Accessibilities (can match any) Accesibilidades (puede coincidir con cualquiera) @@ -2429,21 +2284,11 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe Nombre en Pascal Case - - Severity: - Gravedad - - Modifiers (must match all) Modificadores (deben coincidir todos) - - Name: - Nombre: - - Naming Rule Regla de nomenclatura @@ -2454,31 +2299,11 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe Estilo de nomenclatura - - Naming Style: - Estilo de nomenclatura: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Las reglas de nomenclatura le permiten definir qué nombres se deben establecer para los conjuntos especiales de símbolos y cómo se debe tratar con los símbolos con nombres incorrectos. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - La primera regla de nomenclatura coincidente de nivel superior se usa de manera predeterminada cuando se asigna un nombre a un símbolo, mientras que todo caso especial se administra según una regla secundaria coincidente. - - Naming Style Title: Título de estilo de nomenclatura: - - Parent Rule: - Regla principal: - - Required Prefix: Prefijo requerido: @@ -2504,11 +2329,6 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe Especificación de símbolo - - Symbol Specification: - Especificación de símbolo: - - Symbol Specification Title: Título de especificación de símbolo: @@ -2554,37 +2374,6 @@ Use la lista desplegable para ver y cambiar a otros proyectos a los que puede pe No se pudo desinstalar el paquete: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Se encontró un error al cargar el proyecto. Se deshabilitaron algunas características del proyecto, como el análisis completo de la solución del proyecto con error y los proyectos que dependen de él. - - - - Project loading failed. - No se pudo cargar el proyecto. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Para descubrir la causa del problema, pruebe lo siguiente. - -1. Cierre Visual Studio -2. Abra un símbolo del sistema para desarrolladores de Visual Studio. -3. Establezca la variable de entorno “TraceDesignTime” en true (TraceDesignTime=true). -4. Elimine el archivo .suo en el directorio .vs. -5. Reinicie VS desde el símbolo del sistema donde estableció la variable de entorno (devenv). -6. Abra la solución. -7. Compruebe “{0}”y busque las tareas con errores (FAILED). - - Additional information: Información adicional: @@ -2703,11 +2492,6 @@ Información adicional: {1} Mostrar guías para construcciones a nivel de código - - Show guides for comments and preprocessor regions - Mostrar guías para regiones de preprocesador y comentarios - - Show guides for declaration level constructs Mostrar guías para construcciones a nivel de declaración @@ -2928,16 +2712,6 @@ Información adicional: {1} Seleccionar miembros - - Add a symbol specification - Agregar una especificación de símbolo - - - - Remove symbol specification - Quitar especificación de símbolo - - Add item Agregar elemento @@ -3058,11 +2832,6 @@ Información adicional: {1} preferir propiedades automáticas - - Module has been unloaded. - El módulo se descargó. - - Enable navigation to decompiled sources Habilitar la navegación a orígenes decompilados @@ -3078,11 +2847,6 @@ Información adicional: {1} Sincronizar vista de clases - - Analyzing '{0}' - Analizando “{0}” - - Manage naming styles Administrar estilos de nomenclatura diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf index b94303cf833b8..6265ab847ad9d 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf @@ -162,16 +162,6 @@ 64 bits - - Build + live analysis (NuGet package) - Build + analyse en temps réel (package NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Client de langage de diagnostics C#/Visual Basic - - Calculating... Calcul... @@ -382,11 +372,6 @@ _Modifier - - Edit {0} - Modifier {0} - {0} is a parameter description - Editor Color Scheme Modèle de couleurs de l'éditeur @@ -462,11 +447,6 @@ Erreur lors de la mise à jour des suppressions : {0} - - Evaluating ({0} tasks in queue) - Évaluation ({0} tâches en file d'attente) - - External Sources Sources externes @@ -577,16 +557,6 @@ Déduire à partir du contexte - - Indexed in organization - Indexé dans l'organisation - - - - Indexed in repo - Indexé dans le dépôt - - Inheritance Margin Marge d’héritage @@ -597,11 +567,6 @@ Interfaces héritées - - Inline Diagnostics (experimental) - Diagnostic en ligne (expérimental) - - Inline Hints Indicateurs inline @@ -612,11 +577,6 @@ Insertion de la valeur de site d'appel '{0}' - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Installer les analyseurs Roslyn recommandés par Microsoft, qui fournissent des diagnostics et des correctifs supplémentaires pour les problèmes usuels liés à la conception, à la sécurité, au niveau de performance et à la fiabilité des API - - Interface cannot have field. L'interface ne peut pas avoir de champ. @@ -632,11 +592,6 @@ Nom de type invalide - - Item origin - Origine de l'élément - - JSON strings Chaînes JSON @@ -657,11 +612,6 @@ Genre - - Live analysis (VSIX extension) - Analyse en temps réel (extension VSIX) - - Loaded items Éléments chargés @@ -677,11 +627,6 @@ Local - - Local metadata - Métadonnées locales - - Location Emplacement @@ -1027,11 +972,6 @@ Packages - - Parameter Details - Détails du paramètre - - Parameter name: Nom du paramètre : @@ -1077,11 +1017,6 @@ Collez une trace de pile pour afficher et parcourir ses valeurs. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Suspendu ({0} tâches en file d'attente) - - Please enter a type name Entrez un nom de type @@ -1207,11 +1142,6 @@ Expressions régulières - - Remove All - Tout supprimer - - Remove Unused References Supprimer les références inutilisées @@ -1312,11 +1242,6 @@ Exécution de l'analyse du code pour la solution... - - Running low priority background processes - Exécution des processus d’arrière-plan basse priorité - - Save .editorconfig file Enregistrer le fichier .editorconfig @@ -1437,11 +1362,6 @@ Certaines couleurs du modèle de couleurs sont substituées à la suite des changements apportés dans la page d'options Environnement > Polices et couleurs. Choisissez Utiliser les valeurs par défaut dans la page Polices et couleurs pour restaurer toutes les personnalisations. - - Sort usings - Trier les instructions using - - Stack Trace Trace de la pile @@ -1767,11 +1687,6 @@ Hérite - - Inherited By - Hérité par - - Implements Implémente @@ -1782,16 +1697,6 @@ Implémenté par - - Maximum number of documents are open. - Le nombre maximum de documents est ouvert. - - - - Failed to create document in miscellaneous files project. - Échec de création du document dans le projet de fichiers divers. - - Invalid access. Accès non valide. @@ -2024,16 +1929,6 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu L'assembly d'analyseur '{0}' a été modifié. Les diagnostics seront incorrects jusqu'au redémarrage de Visual Studio. - - C#/VB Diagnostics Table Data Source - Source de données de la table de diagnostics C#/VB - - - - C#/VB Todo List Table Data Source - Source de données de la table de liste Todo C#/VB - - Cancel Annuler @@ -2184,11 +2079,6 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu En savoir plus sur {0} - - Navigation must be performed on the foreground thread. - La navigation doit être exécutée sur le thread de premier plan. - - [+] [+] @@ -2224,11 +2114,6 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Les assemblys d'analyseur '{0}' et '{1}' ont tous deux l'identité '{2}', mais des contenus différents. Un seul de ces assemblys est chargé et les analyseurs utilisant ces assemblys peuvent ne pas fonctionner correctement. - - {0} references {0} références @@ -2274,21 +2159,11 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu IntelliSense - - C#/VB Build Table Data Source - Source de données de la table de build C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - L'assembly d'analyseur '{0}' dépend de '{1}', mais il est introuvable. Les analyseurs peuvent ne pas s'exécuter correctement, sauf si l'assembly manquant est aussi ajouté comme référence d'analyseur. - - Suppress diagnostics Supprimer les diagnostics @@ -2329,11 +2204,6 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu Cet espace de travail ne prend pas en charge la mise à jour des options d'analyse Visual Basic. - - Synchronize {0} - Synchroniser {0} - - Synchronizing with {0}... Synchronisation avec {0}... @@ -2374,26 +2244,11 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu Oui - - Choose a Symbol Specification and a Naming Style. - Choisissez une spécification de symbole et un style de nommage. - - - - Enter a title for this Naming Rule. - Entrez un titre pour cette règle de nommage. - - Enter a title for this Naming Style. Entrez un titre pour ce style de nommage. - - Enter a title for this Symbol Specification. - Entrez un titre pour cette spécification de symbole. - - Accessibilities (can match any) Niveaux d'accès (peut correspondre à n'importe quel élément) @@ -2429,21 +2284,11 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu Nom en casse Pascal - - Severity: - Gravité : - - Modifiers (must match all) Modificateurs (doivent correspondre à tous les éléments) - - Name: - Nom : - - Naming Rule Règle de nommage @@ -2454,31 +2299,11 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu Style de nommage - - Naming Style: - Style de nommage : - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Les règles de nommage vous permettent de définir le mode d'appellation d'ensembles particuliers de symboles et le traitement des symboles incorrectement nommés. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - La première règle de nommage de niveau supérieur correspondante est utilisée par défaut lors de l'appellation d'un symbole, tandis que les cas spéciaux sont gérés par une règle enfant correspondante. - - Naming Style Title: Titre du style de nommage : - - Parent Rule: - Règle parente : - - Required Prefix: Préfixe obligatoire : @@ -2504,11 +2329,6 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu Spécification du symbole - - Symbol Specification: - Spécification du symbole : - - Symbol Specification Title: Titre de la spécification du symbole : @@ -2554,37 +2374,6 @@ Utilisez le menu déroulant pour afficher et basculer vers d'autres projets auqu Échec de la désinstallation du package : {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Erreur pendant le chargement du projet. Certaines fonctionnalités du projet, comme l'analyse complète de la solution pour le projet en échec et les projets qui en dépendent, ont été désactivées. - - - - Project loading failed. - Échec du chargement du projet. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Pour déterminer la cause du problème, essayez d'effectuer les actions ci-dessous. - -1. Fermez Visual Studio -2. Ouvrez une invite de commandes Visual Studio Developer -3. Affectez à la variable d'environnement "TraceDesignTime" la valeur true (set TraceDesignTime=true) -4. Supprimez le répertoire .vs/fichier .suo -5. Redémarrez VS à partir de l'invite de commandes définie dans la variable d'environnement (devenv) -6. Ouvrez la solution -7. Recherchez dans '{0}' les tâches qui n'ont pas abouti (FAILED) - - Additional information: Informations supplémentaires : @@ -2703,11 +2492,6 @@ Informations supplémentaires : {1} Afficher les repères pour les constructions au niveau du code - - Show guides for comments and preprocessor regions - Afficher les repères pour les commentaires et les régions du préprocesseur - - Show guides for declaration level constructs Afficher les repères pour les constructions au niveau des déclarations @@ -2928,16 +2712,6 @@ Informations supplémentaires : {1} Choisir les membres - - Add a symbol specification - Ajouter une spécification de symbole - - - - Remove symbol specification - Supprimer la spécification de symbole - - Add item Ajouter l'élément @@ -3058,11 +2832,6 @@ Informations supplémentaires : {1} préférer les propriétés automatiques - - Module has been unloaded. - Le module a été déchargé. - - Enable navigation to decompiled sources Activer la navigation vers des sources décompilées @@ -3078,11 +2847,6 @@ Informations supplémentaires : {1} Synchroniser l'affichage de classes - - Analyzing '{0}' - Analyse de '{0}' - - Manage naming styles Gérer les styles de nommage diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf index 9f91bdd1eb94a..bac04d1a313bf 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf @@ -162,16 +162,6 @@ 64 bit - - Build + live analysis (NuGet package) - Compilazione + analisi in tempo reale (pacchetto NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Client del linguaggio di diagnostica C#/Visual Basic - - Calculating... Calcolo... @@ -382,11 +372,6 @@ _Modifica - - Edit {0} - Modifica {0} - {0} is a parameter description - Editor Color Scheme Combinazione colori editor @@ -462,11 +447,6 @@ Errore durante l'aggiornamento delle eliminazioni: {0} - - Evaluating ({0} tasks in queue) - In fase di valutazione ({0} attività in coda) - - External Sources Origini esterne @@ -577,16 +557,6 @@ Deduci dal contesto - - Indexed in organization - Indicizzata nell'organizzazione - - - - Indexed in repo - Indicizzata nel repository - - Inheritance Margin Margine di ereditarietà @@ -597,11 +567,6 @@ Interfacce ereditate - - Inline Diagnostics (experimental) - Diagnostica inline (sperimentale) - - Inline Hints Suggerimenti inline @@ -612,11 +577,6 @@ Inserimento del valore '{0}' del sito di chiamata - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Installare gli analizzatori Roslyn consigliati da Microsoft, che offrono ulteriori funzionalità di diagnostica e correzioni per problemi comuni di sicurezza, prestazioni, affidabilità e progettazione di API - - Interface cannot have field. L'interfaccia non può contenere il campo. @@ -632,11 +592,6 @@ Nome di tipo non valido - - Item origin - Origine dell'elemento - - JSON strings Stringhe JSON @@ -657,11 +612,6 @@ Tipo - - Live analysis (VSIX extension) - Analisi in tempo reale (estensione VSIX) - - Loaded items Elementi caricati @@ -677,11 +627,6 @@ Locale - - Local metadata - Metadati locali - - Location Posizione @@ -1027,11 +972,6 @@ Pacchetti - - Parameter Details - Dettagli parametro - - Parameter name: Nome del parametro: @@ -1077,11 +1017,6 @@ Incollare un'analisi dello stack per visualizzare e spostarsi tra i valori. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Sospeso ({0} attività in coda) - - Please enter a type name Immettere un nome di tipo @@ -1207,11 +1142,6 @@ Espressioni regolari - - Remove All - Rimuovi tutto - - Remove Unused References Rimuovi riferimenti inutilizzati @@ -1312,11 +1242,6 @@ Esecuzione di Code Analysis per la soluzione... - - Running low priority background processes - Esecuzione di processi in background con priorità bassa - - Save .editorconfig file Salva file con estensione editorconfig @@ -1437,11 +1362,6 @@ Alcuni colori della combinazione colori sono sostituiti dalle modifiche apportate nella pagina di opzioni Ambiente > Tipi di carattere e colori. Scegliere `Usa impostazioni predefinite` nella pagina Tipi di carattere e colori per ripristinare tutte le personalizzazioni. - - Sort usings - Ordina using - - Stack Trace Analisi dello stack @@ -1767,11 +1687,6 @@ Eredita - - Inherited By - Ereditato da - - Implements Implementa @@ -1782,16 +1697,6 @@ Implementato da - - Maximum number of documents are open. - È stato aperto il numero massimo di documenti. - - - - Failed to create document in miscellaneous files project. - Non è stato possibile creare il documento nel progetto di file esterni. - - Invalid access. L'accesso non è valido. @@ -2024,16 +1929,6 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques L'assembly '{0}' dell'analizzatore è stato modificato. È possibile che la diagnostica non sia corretta fino al riavvio di Visual Studio. - - C#/VB Diagnostics Table Data Source - Origine dati tabella diagnostica C#/VB - - - - C#/VB Todo List Table Data Source - Origine dati tabella elenco TODO C#/VB - - Cancel Annulla @@ -2184,11 +2079,6 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques Altre informazioni su {0} - - Navigation must be performed on the foreground thread. - Gli spostamenti devono essere eseguiti nel thread in primo piano. - - [+] [+] @@ -2224,11 +2114,6 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Gli assembly '{0}' e '{1}' dell'analizzatore hanno la stessa identità '{2}' ma contenuto diverso. Ne verrà caricato solo uno e gli analizzatori che usano tali assembly potrebbero non funzionare correttamente. - - {0} references {0} riferimenti @@ -2274,21 +2159,11 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques IntelliSense - - C#/VB Build Table Data Source - Origine dati tabella compilazione C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - L'assembly '{0}' dell'analizzatore dipende da '{1}', ma non è stato trovato. Gli assembly potrebbero non funzionare correttamente a meno che l'assembly mancante non venga aggiunto anche come riferimento all'analizzatore. - - Suppress diagnostics Elimina la diagnostica @@ -2329,11 +2204,6 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques Quest'area di lavoro non supporta l'aggiornamento delle opzioni di analisi di Visual Basic. - - Synchronize {0} - Sincronizza {0} - - Synchronizing with {0}... Sincronizzazione con {0}... @@ -2374,26 +2244,11 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques - - Choose a Symbol Specification and a Naming Style. - Scegliere una specifica simboli e uno stile di denominazione. - - - - Enter a title for this Naming Rule. - Immettere un titolo per questa regola di denominazione. - - Enter a title for this Naming Style. Immettere un titolo per questo stile di denominazione. - - Enter a title for this Symbol Specification. - Immettere un titolo per questa specifica simboli. - - Accessibilities (can match any) Livello di accesso (qualsiasi corrispondenza) @@ -2429,21 +2284,11 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques Nome notazione Pascal - - Severity: - Gravità: - - Modifiers (must match all) Modificatori (corrispondenza esatta) - - Name: - Nome: - - Naming Rule Regola di denominazione @@ -2454,31 +2299,11 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques Stile di denominazione - - Naming Style: - Stile di denominazione: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Le regole di denominazione consentono di definire le modalità di denominazione di set di simboli specifici e di gestione dei simboli con nomi errati. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - Quando si assegna un nome a un simbolo, per impostazione predefinita viene usata la prima regola di denominazione corrispondente di primo livello, mentre eventuali casi speciali vengono gestiti da una regola figlio corrispondente. - - Naming Style Title: Titolo per stile di denominazione: - - Parent Rule: - Regola padre: - - Required Prefix: Prefisso obbligatorio: @@ -2504,11 +2329,6 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques Specifica simboli - - Symbol Specification: - Specifica simboli: - - Symbol Specification Title: Titolo specifica simboli: @@ -2554,37 +2374,6 @@ Usare l'elenco a discesa per visualizzare e passare ad altri progetti a cui ques La disinstallazione del pacchetto non è riuscita: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Si è verificato un errore durante il caricamento del progetto. Alcune funzionalità del progetto, come l'analisi della soluzione completa per il progetto in errore e i progetti che dipendono da essa, sono state disabilitate. - - - - Project loading failed. - Il caricamento del progetto non è riuscito. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Per individuare la causa del problema, provare a eseguire le operazioni seguenti. - -1. Chiudere Visual Studio -2. Aprire un prompt dei comandi per gli sviluppatori di Visual Studio -3. Impostare la variabile di ambiente "TraceDesignTime" su true (TraceDesignTime=true) -4. Eliminare la directory .vs/il file .suo -5. Riavviare Visual Studio dal prompt dei comandi da cui è stata impostata la variabile di ambiente (devenv) -6. Aprire la soluzione -7. Controllare '{0}' e cercare le attività non riuscite (FAILED) - - Additional information: Informazioni aggiuntive: @@ -2703,11 +2492,6 @@ Informazioni aggiuntive: {1} Mostra le guide per i costrutti a livello di codice - - Show guides for comments and preprocessor regions - Mostra le guide per i commenti e le aree del preprocessore - - Show guides for declaration level constructs Mostra le guide per i costrutti a livello di dichiarazione @@ -2928,16 +2712,6 @@ Informazioni aggiuntive: {1} Seleziona membri - - Add a symbol specification - Aggiungi una specifica simboli - - - - Remove symbol specification - Rimuovi specifica simboli - - Add item Aggiungi elemento @@ -3058,11 +2832,6 @@ Informazioni aggiuntive: {1} preferisci proprietà automatiche - - Module has been unloaded. - Il modulo è stato scaricato. - - Enable navigation to decompiled sources Abilita lo spostamento in origini decompilate @@ -3078,11 +2847,6 @@ Informazioni aggiuntive: {1} Sincronizza visualizzazione classi - - Analyzing '{0}' - Analisi di '{0}' - - Manage naming styles Gestisci stili di denominazione diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf index 748d06732aa36..6627fa184ad96 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf @@ -162,16 +162,6 @@ 64 ビット - - Build + live analysis (NuGet package) - ビルド + ライブ分析 (NuGet パッケージ) - - - - C#/Visual Basic Diagnostics Language Client - C#/Visual Basic 診断言語クライアント - - Calculating... 計算しています... @@ -382,11 +372,6 @@ 編集(_E) - - Edit {0} - {0} の編集 - {0} is a parameter description - Editor Color Scheme エディターの配色 @@ -462,11 +447,6 @@ 抑制の更新でエラーが発生しました: {0} - - Evaluating ({0} tasks in queue) - 評価中 ({0} 個のタスクがキューにあります) - - External Sources 外部ソース @@ -577,16 +557,6 @@ コンテキストから推論する - - Indexed in organization - 組織内でインデックス付け - - - - Indexed in repo - リポジトリ内でインデックス付け - - Inheritance Margin 継承の余白 @@ -597,11 +567,6 @@ 継承されたインターフェイス - - Inline Diagnostics (experimental) - インライン診断 (試験的) - - Inline Hints インラインのヒント @@ -612,11 +577,6 @@ 呼び出しサイトの値 "{0}" を挿入しています - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Microsoft で推奨されている Roslyn アナライザーをインストールします。これにより、一般的な API の設計、セキュリティ、パフォーマンス、信頼性の問題に対する追加の診断と修正が提供されます - - Interface cannot have field. インターフェイスにフィールドを含めることはできません。 @@ -632,11 +592,6 @@ 型名が無効です - - Item origin - 項目の送信元 - - JSON strings JSON 文字列 @@ -657,11 +612,6 @@ 種類 - - Live analysis (VSIX extension) - ライブ分析 (VSIX 拡張機能) - - Loaded items 読み込まれた項目 @@ -677,11 +627,6 @@ ローカル - - Local metadata - ローカル メタデータ - - Location 場所 @@ -1027,11 +972,6 @@ パッケージ - - Parameter Details - パラメーターの詳細 - - Parameter name: パラメーター名: @@ -1077,11 +1017,6 @@ 有効なスタック トレースを貼り付けて、値を表示して移動します。 "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - 一時停止中 ({0} 個のタスクがキューにあります) - - Please enter a type name 型の名前を入力してください @@ -1207,11 +1142,6 @@ 正規表現 - - Remove All - すべて削除 - - Remove Unused References 未使用の参照を削除する @@ -1312,11 +1242,6 @@ ソリューションのコード分析を実行しています... - - Running low priority background processes - 優先度の低いバックグラウンド プロセスを実行しています - - Save .editorconfig file .editorconfig ファイルの保存 @@ -1437,11 +1362,6 @@ 一部の配色パターンの色は、[環境] > [フォントおよび色] オプション ページで行われた変更によって上書きされます。[フォントおよび色] オプション ページで [既定値を使用] を選択すると、すべてのカスタマイズが元に戻ります。 - - Sort usings - using を並べ替える - - Stack Trace スタック トレース @@ -1767,11 +1687,6 @@ 継承 - - Inherited By - 継承先 - - Implements 実装 @@ -1782,16 +1697,6 @@ 実装先 - - Maximum number of documents are open. - 最大数のドキュメントが開いています。 - - - - Failed to create document in miscellaneous files project. - その他のファイル プロジェクトにドキュメントを作成できませんでした。 - - Invalid access. アクセスが無効です。 @@ -2024,16 +1929,6 @@ Use the dropdown to view and switch to other projects this file may belong to.アナライザー アセンブリ '{0}' が変更されました。Visual Studio を再起動するまで正しい診断ができない可能性があります。 - - C#/VB Diagnostics Table Data Source - C#/VB 診断テーブル データ ソース - - - - C#/VB Todo List Table Data Source - C#/VB Todo リスト テーブル データ ソース - - Cancel キャンセル @@ -2184,11 +2079,6 @@ Use the dropdown to view and switch to other projects this file may belong to.{0} の詳細 - - Navigation must be performed on the foreground thread. - ナビゲーションは、フォアグラウンドのスレッドで行う必要があります。 - - [+] [+] @@ -2224,11 +2114,6 @@ Use the dropdown to view and switch to other projects this file may belong to.AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - アナライザー アセンブリ '{0}' と '{1}' は両方とも ID が '{2}' ですが、内容が異なります。読み込まれるのは 1 つだけです。これらのアセンブリを使用するアナライザーは正常に実行されない可能性があります。 - - {0} references {0} 個の参照 @@ -2274,21 +2159,11 @@ Use the dropdown to view and switch to other projects this file may belong to.IntelliSense - - C#/VB Build Table Data Source - C#/VB ビルド テーブル データ ソース - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - アナライザー アセンブリ '{0}' は '{1}' に依存しますが、見つかりませんでした。欠落しているアセンブリがアナライザー参照として追加されない限り、アナライザーを正常に実行できない可能性があります。 - - Suppress diagnostics 診断を抑制する @@ -2329,11 +2204,6 @@ Use the dropdown to view and switch to other projects this file may belong to.このワークスペースでは、Visual Basic の解析オプションの更新はサポートされていません。 - - Synchronize {0} - {0} を同期する - - Synchronizing with {0}... {0} と同期しています... @@ -2374,26 +2244,11 @@ Use the dropdown to view and switch to other projects this file may belong to.はい - - Choose a Symbol Specification and a Naming Style. - シンボル仕様と名前付けスタイルを選択します。 - - - - Enter a title for this Naming Rule. - この名前付けルールのタイトルを入力してください。 - - Enter a title for this Naming Style. この名前付けスタイルのタイトルを入力してください。 - - Enter a title for this Symbol Specification. - このシンボル仕様のタイトルを入力してください。 - - Accessibilities (can match any) アクセシビリティ (任意のレベルと一致できます) @@ -2429,21 +2284,11 @@ Use the dropdown to view and switch to other projects this file may belong to.パスカル ケース名 - - Severity: - 重要度: - - Modifiers (must match all) 修飾子 (すべてと一致する必要があります) - - Name: - 名前: - - Naming Rule 名前付けルール @@ -2454,31 +2299,11 @@ Use the dropdown to view and switch to other projects this file may belong to.名前付けスタイル - - Naming Style: - 名前付けスタイル: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - 名前付けルールを使用すると、特定のシンボル セットの名前付け方法と、正しく名前付けされていないシンボルの処理方法を定義できます。 - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - シンボルに名前を付けるときには、最初に一致するトップレベルの名前付けルールが既定で使用されますが、特殊なケースの場合は一致する子ルールによって処理されます。 - - Naming Style Title: 名前付けスタイルのタイトル: - - Parent Rule: - 親規則: - - Required Prefix: 必要なプレフィックス: @@ -2504,11 +2329,6 @@ Use the dropdown to view and switch to other projects this file may belong to.シンボル仕様 - - Symbol Specification: - シンボル仕様: - - Symbol Specification Title: シンボル仕様のタイトル: @@ -2554,37 +2374,6 @@ Use the dropdown to view and switch to other projects this file may belong to.パッケージをアンインストールできませんでした: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - プロジェクトの読み込み中にエラーが発生しました。失敗したプロジェクトとそれに依存するプロジェクトの完全なソリューション解析など、一部のプロジェクト機能が使用できなくなりました。 - - - - Project loading failed. - プロジェクトの読み込みに失敗しました。 - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - この問題の原因を確認するには、次をお試しください。 - -1. Visual Studio を閉じる -2. Visual Studio 開発者コマンド プロンプトを開く -3. 環境変数 "TraceDesignTime" を true に設定する (set TraceDesignTime=true) -4. .vs directory/.suo ファイルを削除する -5. 環境変数 (devenv) を設定したコマンド プロンプトから VS を再起動する -6. ソリューションを開く -7. '{0}' を確認し、失敗したタスク (FAILED) を探す - - Additional information: 追加情報: @@ -2703,11 +2492,6 @@ Additional information: {1} コード レベルのコンストラクトのガイドを表示する - - Show guides for comments and preprocessor regions - コメントとプリプロセッサ領域のガイドを表示する - - Show guides for declaration level constructs 宣言レベルのコンストラクトのガイドを表示する @@ -2928,16 +2712,6 @@ Additional information: {1} メンバーの選択 - - Add a symbol specification - シンボル仕様の追加 - - - - Remove symbol specification - シンボル仕様の削除 - - Add item 項目の追加 @@ -3058,11 +2832,6 @@ Additional information: {1} 自動プロパティを優先する - - Module has been unloaded. - モジュールがアンロードされました。 - - Enable navigation to decompiled sources 逆コンパイルされたソースへのナビゲーションを有効にする @@ -3078,11 +2847,6 @@ Additional information: {1} クラス ビューの同期 - - Analyzing '{0}' - '{0}' の分析 - - Manage naming styles 名前付けスタイルを管理する diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf index 8e8ed48c57db4..19f7d6be1920a 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf @@ -162,16 +162,6 @@ 64비트 - - Build + live analysis (NuGet package) - 빌드 + 실시간 분석(NuGet 패키지) - - - - C#/Visual Basic Diagnostics Language Client - C#/Visual Basic 진단 언어 클라이언트 - - Calculating... 계산 중... @@ -382,11 +372,6 @@ 편집(_E) - - Edit {0} - {0} 편집 - {0} is a parameter description - Editor Color Scheme 편집기 색 구성표 @@ -462,11 +447,6 @@ 표시 중지를 업데이트하는 동안 오류가 발생했습니다. {0} - - Evaluating ({0} tasks in queue) - 평가 중(큐의 {0}개 작업) - - External Sources 외부 원본 @@ -577,16 +557,6 @@ 컨텍스트에서 유추 - - Indexed in organization - 조직에서 인덱싱됨 - - - - Indexed in repo - 리포지토리에서 인덱싱됨 - - Inheritance Margin 상속 여백 @@ -597,11 +567,6 @@ 상속된 인터페이스 - - Inline Diagnostics (experimental) - 인라인 진단(실험적) - - Inline Hints 인라인 힌트 @@ -612,11 +577,6 @@ 호출 사이트 값 '{0}'을(를) 삽입하는 중 - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - 일반적인 API 디자인, 보안, 성능 및 안정성 문제에 대한 추가 진단 및 수정을 제공하는 Microsoft 권장 Roslyn 분석기를 설치합니다. - - Interface cannot have field. 인터페이스에는 필드가 포함될 수 없습니다. @@ -632,11 +592,6 @@ 잘못된 형식 이름 - - Item origin - 항목 원본 - - JSON strings JSON 문자열 @@ -657,11 +612,6 @@ 종류 - - Live analysis (VSIX extension) - 실시간 분석(VSIX 확장) - - Loaded items 로드된 항목 @@ -677,11 +627,6 @@ 로컬 - - Local metadata - 로컬 메타데이터 - - Location 위치 @@ -1027,11 +972,6 @@ 패키지 - - Parameter Details - 매개 변수 정보 - - Parameter name: 매개 변수 이름: @@ -1077,11 +1017,6 @@ 값을 보고 탐색하려면 스택 추적을 붙여넣습니다. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - 일시 중지됨(큐의 {0}개 작업) - - Please enter a type name 형식 이름을 입력하세요. @@ -1207,11 +1142,6 @@ 정규식 - - Remove All - 모두 제거 - - Remove Unused References 사용하지 않는 참조 제거 @@ -1312,11 +1242,6 @@ 솔루션에 대한 코드 분석을 실행하는 중... - - Running low priority background processes - 낮은 우선 순위 백그라운드 프로세스 실행 중 - - Save .editorconfig file editorconfig 파일 저장 @@ -1437,11 +1362,6 @@ 색 구성표의 일부 색이 [환경] > [글꼴 및 색] 옵션 페이지에서 변경한 내용에 따라 재정의됩니다. 모든 사용자 지정을 되돌리려면 [글꼴 및 색] 페이지에서 '기본값 사용'을 선택하세요. - - Sort usings - Using 정렬 - - Stack Trace 스택 추적 @@ -1767,11 +1687,6 @@ 상속 - - Inherited By - 상속 대상 - - Implements 구현 @@ -1782,16 +1697,6 @@ 구현자 - - Maximum number of documents are open. - 최대 수의 문서가 열려 있습니다. - - - - Failed to create document in miscellaneous files project. - 기타 파일 프로젝트에 문서를 만들지 못했습니다. - - Invalid access. 액세스가 잘못되었습니다. @@ -2024,16 +1929,6 @@ Use the dropdown to view and switch to other projects this file may belong to.분석기 어셈블리 '{0}'이(가) 변경되었습니다. Visual Studio를 다시 시작할 때까지 진단이 올바르지 않을 수 있습니다. - - C#/VB Diagnostics Table Data Source - C#/VB 진단 테이블 데이터 원본 - - - - C#/VB Todo List Table Data Source - C#/VB 할일 목록 테이블 데이터 원본 - - Cancel 취소 @@ -2184,11 +2079,6 @@ Use the dropdown to view and switch to other projects this file may belong to.{0}에 대한 추가 정보 - - Navigation must be performed on the foreground thread. - 탐색은 포그라운드 스레드에서 수행해야 합니다. - - [+] [+] @@ -2224,11 +2114,6 @@ Use the dropdown to view and switch to other projects this file may belong to.AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - '{0}' 및 '{1}' 분석기 어셈블리의 ID는 '{2}'(으)로 동일하지만 콘텐츠가 다릅니다. 둘 중 하나만 로드되며 이러한 어셈블리를 사용하는 분석기는 제대로 실행되지 않을 수 있습니다. - - {0} references 참조 {0}개 @@ -2274,21 +2159,11 @@ Use the dropdown to view and switch to other projects this file may belong to.IntelliSense - - C#/VB Build Table Data Source - C#/VB 빌드 테이블 데이터 원본 - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - 분석기 어셈블리 '{0}'은(는) 찾을 수 없는 '{1}'에 종속됩니다. 없는 어셈블리가 분석기 참조로 추가되지 않으면 분석기가 올바르게 실행되지 않을 수 있습니다. - - Suppress diagnostics 진단 표시 안 함 @@ -2329,11 +2204,6 @@ Use the dropdown to view and switch to other projects this file may belong to.이 작업 영역은 Visual Basic 구문 분석 옵션 업데이트를 지원하지 않습니다. - - Synchronize {0} - {0} 동기화 - - Synchronizing with {0}... {0}과(와) 동기화하는 중... @@ -2374,26 +2244,11 @@ Use the dropdown to view and switch to other projects this file may belong to. - - Choose a Symbol Specification and a Naming Style. - 기호 사양 및 명명 스타일을 선택하세요. - - - - Enter a title for this Naming Rule. - 이 명명 규칙의 제목을 입력하세요. - - Enter a title for this Naming Style. 이 명명 스타일의 제목을 입력하세요. - - Enter a title for this Symbol Specification. - 이 기호 사양의 제목을 입력하세요. - - Accessibilities (can match any) 접근성(임의 항목과 일치 가능) @@ -2429,21 +2284,11 @@ Use the dropdown to view and switch to other projects this file may belong to.파스칼식 대/소문자 이름 - - Severity: - 심각도: - - Modifiers (must match all) 한정자(모두와 일치해야 함) - - Name: - 이름: - - Naming Rule 명명 규칙 @@ -2454,31 +2299,11 @@ Use the dropdown to view and switch to other projects this file may belong to.명명 스타일 - - Naming Style: - 명명 스타일: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - 명명 규칙을 사용하여 특정 기호 집합의 이름을 지정하는 방법과 이름이 잘못 지정된 기호를 처리하는 방법을 정의할 수 있습니다. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - 기호 이름을 지정할 때는 기본적으로 첫 번째 일치하는 최상위 명명 규칙이 사용되지만, 특별한 경우는 일치하는 자식 규칙으로 처리됩니다. - - Naming Style Title: 명명 스타일 제목: - - Parent Rule: - 부모 규칙: - - Required Prefix: 필수 접두사: @@ -2504,11 +2329,6 @@ Use the dropdown to view and switch to other projects this file may belong to.기호 사양 - - Symbol Specification: - 기호 사양: - - Symbol Specification Title: 기호 사양 제목: @@ -2554,37 +2374,6 @@ Use the dropdown to view and switch to other projects this file may belong to.패키지 제거 실패: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - 프로젝트를 로드하는 동안 오류가 발생했습니다. 실패한 프로젝트 및 이 프로젝트에 종속된 프로젝트에 대한 전체 솔루션 분석과 같은 일부 프로젝트 기능을 사용할 수 없습니다. - - - - Project loading failed. - 프로젝트를 로드하지 못했습니다. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - 이 문제를 일으킨 원인을 확인하려면 다음을 시도하세요. - -1. Visual Studio를 닫습니다. -2. Visual Studio 개발자 명령 프롬프트를 엽니다. -3. 환경 변수 "TraceDesignTime"을 true로 설정합니다(set TraceDesignTime=true). -4. .vs 디렉터리/.suo 파일을 삭제합니다. -5. 환경 변수(devenv)를 설정한 명령 프롬프트에서 VS를 다시 시작합니다. -6. 솔루션을 엽니다. -7. '{0}'을(를) 확인하고 실패한 작업(FAILED)을 찾습니다. - - Additional information: 추가 정보: @@ -2703,11 +2492,6 @@ Additional information: {1} 코드 수준 구문에 대한 가이드 표시 - - Show guides for comments and preprocessor regions - 설명 및 전처리기 영역에 대한 가이드 표시 - - Show guides for declaration level constructs 선언 수준 구문에 대한 가이드 표시 @@ -2928,16 +2712,6 @@ Additional information: {1} 멤버 선택 - - Add a symbol specification - 기호 사양 추가 - - - - Remove symbol specification - 기호 사양 제거 - - Add item 항목 추가 @@ -3058,11 +2832,6 @@ Additional information: {1} 자동 속성 선호 - - Module has been unloaded. - 모듈이 언로드되었습니다. - - Enable navigation to decompiled sources 디컴파일된 원본으로의 이동을 사용하도록 설정 @@ -3078,11 +2847,6 @@ Additional information: {1} 클래스 뷰 동기화 - - Analyzing '{0}' - '{0}' 분석 중 - - Manage naming styles 명명 스타일 관리 diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf index 2e8669b34eb6b..7f6c51ab3a166 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf @@ -162,16 +162,6 @@ 64-bitowa - - Build + live analysis (NuGet package) - Kompilacja i analiza na żywo (pakiet NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Klient języka diagnostyki języka C#/Visual Basic - - Calculating... Trwa obliczanie... @@ -382,11 +372,6 @@ _Edytuj - - Edit {0} - Edytuj: {0} - {0} is a parameter description - Editor Color Scheme Schemat kolorów edytora @@ -462,11 +447,6 @@ Błąd podczas pomijania aktualizacji: {0} - - Evaluating ({0} tasks in queue) - Szacowanie (zadania w kolejce: {0}) - - External Sources Źródła zewnętrzne @@ -577,16 +557,6 @@ Wnioskuj z kontekstu - - Indexed in organization - Indeksowane w organizacji - - - - Indexed in repo - Indeksowane w repozytorium - - Inheritance Margin Margines dziedziczenia @@ -597,11 +567,6 @@ Dziedziczone interfejsy - - Inline Diagnostics (experimental) - Diagnostyka w tekście (eksperymentalna) - - Inline Hints Wskazówki w tekście @@ -612,11 +577,6 @@ Wstawianie wartości miejsca wywołania „{0}” - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Zainstaluj analizatory Roslyn rekomendowane przez firmę Microsoft, które oferują dodatkową diagnostykę i poprawki w zakresie typowego projektu interfejsu API, zabezpieczeń, wydajności i niezawodności - - Interface cannot have field. Interfejs nie może mieć pola. @@ -632,11 +592,6 @@ Nieprawidłowa nazwa typu - - Item origin - Źródło elementu - - JSON strings Ciągi JSON @@ -657,11 +612,6 @@ Rodzaj - - Live analysis (VSIX extension) - Analiza na żywo (rozszerzenie VSIX) - - Loaded items Załadowane elementy @@ -677,11 +627,6 @@ Lokalne - - Local metadata - Lokalne metadane - - Location Lokalizacja @@ -1027,11 +972,6 @@ Pakiety - - Parameter Details - Szczegóły parametru - - Parameter name: Nazwa parametru: @@ -1077,11 +1017,6 @@ Wklej prawidłowy ślad stosu, aby wyświetlić jego wartości i nawigować po nich. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Wstrzymano (zadania w kolejce: {0}) - - Please enter a type name Wprowadź nazwę typu @@ -1207,11 +1142,6 @@ Wyrażenia regularne - - Remove All - Usuń wszystko - - Remove Unused References Usuń nieużywane odwołania @@ -1312,11 +1242,6 @@ Trwa analizowanie kodu dla rozwiązania... - - Running low priority background processes - Uruchamianie procesów w tle o niskim priorytecie - - Save .editorconfig file Zapisz plik .editorconfig @@ -1437,11 +1362,6 @@ Niektóre kolory w schemacie kolorów są przesłaniane przez zmiany wprowadzone na stronie opcji Środowisko > Czcionki i kolory. Wybierz pozycję „Użyj ustawień domyślnych” na stronie Czcionki i kolory, aby wycofać wszystkie dostosowania. - - Sort usings - Sortuj użycia - - Stack Trace Śledzenie stosu @@ -1767,11 +1687,6 @@ Dziedziczy - - Inherited By - Dziedziczone przez - - Implements Implementuje @@ -1782,16 +1697,6 @@ Zaimplementowane przez - - Maximum number of documents are open. - Otwarta jest maksymalna liczba dokumentów. - - - - Failed to create document in miscellaneous files project. - Nie powiodło się utworzenie dokumentu w projekcie o różnych plikach. - - Invalid access. Nieprawidłowy dostęp. @@ -2024,16 +1929,6 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Zmieniono zestaw analizatora „{0}”. Diagnostyka może nie działać poprawnie do czasu ponownego uruchomienia programu Visual Studio. - - C#/VB Diagnostics Table Data Source - Źródło danych tabeli diagnostyki dla języka C#/VB - - - - C#/VB Todo List Table Data Source - Źródło danych tabeli listy zadań do wykonania dla języka C#/VB - - Cancel Anuluj @@ -2184,11 +2079,6 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Więcej informacji o elemencie {0} - - Navigation must be performed on the foreground thread. - Nawigacja musi zostać wykonana w wątku na pierwszym planie. - - [+] [+] @@ -2224,11 +2114,6 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Zestawy analizatora „{0}” i „{1}” mają tożsamość „{2}”, ale inną zawartość. Po ich załadowaniu i użyciu przez analizatory te analizatory mogą nie działać prawidłowo. - - {0} references Odwołania: {0} @@ -2274,21 +2159,11 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ IntelliSense - - C#/VB Build Table Data Source - Źródło danych tabeli kompilacji dla języka C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - Zestaw analizatora „{0}” jest zależny od zestawu „{1}”, ale nie odnaleziono go. Analizatory mogą nie działać poprawnie, dopóki brakujący zestaw również nie zostanie dodany jako odwołanie analizatora. - - Suppress diagnostics Pomiń diagnostykę @@ -2329,11 +2204,6 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Ten obszar roboczy nie obsługuje aktualizowania opcji analizy programu Visual Basic. - - Synchronize {0} - Synchronizuj element {0} - - Synchronizing with {0}... Trwa synchronizowanie z elementem {0}... @@ -2374,26 +2244,11 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Tak - - Choose a Symbol Specification and a Naming Style. - Wybierz specyfikację symbolu i styl nazewnictwa. - - - - Enter a title for this Naming Rule. - Wprowadź tytuł dla tej reguły nazewnictwa. - - Enter a title for this Naming Style. Wprowadź tytuł dla tego stylu nazewnictwa. - - Enter a title for this Symbol Specification. - Wprowadź tytuł dla tej specyfikacji symbolu. - - Accessibilities (can match any) Poziomy dostępu (mogą być zgodne z dowolnym elementem) @@ -2429,21 +2284,11 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Nazwa z wyrazami pisanymi wielkimi literami, pierwszy z wielkiej - - Severity: - Ważność: - - Modifiers (must match all) Modyfikatory (muszą być zgodne ze wszystkimi elementami) - - Name: - Nazwa: - - Naming Rule Reguła nazewnictwa @@ -2454,31 +2299,11 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Styl nazewnictwa - - Naming Style: - Styl nazewnictwa: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Reguły nazewnictwa umożliwiają definiowanie sposobu nazywania określonych zestawów symboli i sposobu obsługi symboli z niepoprawnymi nazwami. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - Pierwsza zgodna reguła nazewnictwa najwyższego poziomu jest używany domyślnie podczas nazywania symbolu, a wszystkie szczególne przypadki są obsługiwane przez zgodną regułę podrzędną. - - Naming Style Title: Tytuł stylu nazewnictwa: - - Parent Rule: - Reguła nadrzędna: - - Required Prefix: Wymagany prefiks: @@ -2504,11 +2329,6 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Specyfikacja symbolu - - Symbol Specification: - Specyfikacja symbolu: - - Symbol Specification Title: Tytuł specyfikacji symbolu: @@ -2554,37 +2374,6 @@ Użyj listy rozwijanej, aby wyświetlać inne projekty, do których może należ Odinstalowywanie pakietu nie powiodło się: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Napotkano błąd podczas ładowania projektu. Zostały wyłączone niektóre funkcje projektu, takie jak pełna analiza rozwiązania dla błędnego projektu i zależnych od niego projektów. - - - - Project loading failed. - Ładowanie projektu nie powiodło się. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Aby ustalić przyczynę problemu, spróbuj wykonać poniższe czynności. - -1. Zamknij program Visual Studio -2. Otwórz wiersz polecenia dla deweloperów w programie Visual Studio -3. Ustaw zmienną środowiskową „TraceDesignTime” na wartość true (set TraceDesignTime=true) -4. Usuń plik .suo w katalogu .vs -5. Uruchom ponownie program Visual Studio z poziomu wiersza polecenia, w którym została ustawiona zmienna środowiskowa (devenv) -6. Otwórz rozwiązanie -7. Sprawdź element „{0}” i poszukaj zadań zakończonych niepowodzeniem (NIEPOWODZENIE) - - Additional information: Informacje dodatkowe: @@ -2703,11 +2492,6 @@ Dodatkowe informacje: {1} Pokaż przewodniki dla konstrukcji na poziomie kodu - - Show guides for comments and preprocessor regions - Pokaż prowadnice dla regionów komentarzy i preprocesora - - Show guides for declaration level constructs Pokaż przewodniki dla konstrukcji na poziomie deklaracji @@ -2928,16 +2712,6 @@ Dodatkowe informacje: {1} Wybierz składowe - - Add a symbol specification - Dodaj specyfikację symbolu - - - - Remove symbol specification - Usuń specyfikację symbolu - - Add item Dodaj element @@ -3058,11 +2832,6 @@ Dodatkowe informacje: {1} preferuj właściwości automatyczne - - Module has been unloaded. - Moduł został zwolniony. - - Enable navigation to decompiled sources Włącz nawigację do zdekompilowanych źródeł @@ -3078,11 +2847,6 @@ Dodatkowe informacje: {1} Synchronizuj widok klasy - - Analyzing '{0}' - Analizowanie elementu „{0}” - - Manage naming styles Zarządzaj stylami nazewnictwa diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf index 6f3466add00a1..4ae3db17961c4 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf @@ -162,16 +162,6 @@ 64 bits - - Build + live analysis (NuGet package) - Build + análise em tempo real (pacote NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Cliente da Linguagem de Diagnóstico C#/Visual Basic - - Calculating... Calculando... @@ -382,11 +372,6 @@ _Editar - - Edit {0} - Editar {0} - {0} is a parameter description - Editor Color Scheme Esquema de Cores do Editor @@ -462,11 +447,6 @@ Erro ao atualizar supressões: {0} - - Evaluating ({0} tasks in queue) - Avaliando ({0} tarefas na fila) - - External Sources Fontes Externas @@ -577,16 +557,6 @@ Inferir do contexto - - Indexed in organization - Indexado na organização - - - - Indexed in repo - Indexado no repositório - - Inheritance Margin Margem de herança @@ -597,11 +567,6 @@ Interfaces herdadas - - Inline Diagnostics (experimental) - Diagnóstico em linha (experimental) - - Inline Hints Dicas Embutidas @@ -612,11 +577,6 @@ Inserindo o valor do site de chamada '{0}' - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Instale os analisadores Roslyn recomendados pela Microsoft, que fornecem diagnósticos adicionais e correções para problemas comuns de confiabilidade, desempenho, segurança e design de API - - Interface cannot have field. A interface não pode ter campo. @@ -632,11 +592,6 @@ Nome de tipo inválido - - Item origin - Origem do item - - JSON strings Cadeias de caracteres JSON @@ -657,11 +612,6 @@ Tipo - - Live analysis (VSIX extension) - Análise em tempo real (extensão do VSIX) - - Loaded items Itens carregados @@ -677,11 +627,6 @@ Local - - Local metadata - Metadados locais - - Location Localização @@ -1027,11 +972,6 @@ Pacotes - - Parameter Details - Detalhes do Parâmetro - - Parameter name: Nome do parâmetro: @@ -1077,11 +1017,6 @@ Cole um rastreamento de pilha para exibir e navegar pelos seus valores. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Em pausa ({0} tarefas na fila) - - Please enter a type name Insira um nome de tipo @@ -1207,11 +1142,6 @@ Expressões regulares - - Remove All - Remover Tudo - - Remove Unused References Remover as Referências Não Usadas @@ -1312,11 +1242,6 @@ Executando a análise de código para a Solução... - - Running low priority background processes - Executando processos de baixa prioridade em segundo plano - - Save .editorconfig file Salvar arquivo .editorconfig @@ -1437,11 +1362,6 @@ Algumas cores do esquema de cores estão sendo substituídas pelas alterações feitas na página de Ambiente > Opções de Fontes e Cores. Escolha 'Usar Padrões' na página Fontes e Cores para reverter todas as personalizações. - - Sort usings - Classificar usos - - Stack Trace Rastreamento de pilha @@ -1767,11 +1687,6 @@ Herda - - Inherited By - Herdado por - - Implements Implementos @@ -1782,16 +1697,6 @@ Implementado por - - Maximum number of documents are open. - Número máximo de documentos abertos. - - - - Failed to create document in miscellaneous files project. - Falha ao criar o documento no projeto arquivos diversos. - - Invalid access. Acesso inválido. @@ -2024,16 +1929,6 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar O assembly do analisador '{0}' mudou. O diagnóstico pode estar incorreto até que o Visual Studio seja reiniciado. - - C#/VB Diagnostics Table Data Source - Fonte de Dados da Tabela de Diagnóstico do C#/VB - - - - C#/VB Todo List Table Data Source - Fonte de Dados da Tabela da Lista de Tarefas Pendentes C#/VB - - Cancel Cancelar @@ -2184,11 +2079,6 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Mais sobre {0} - - Navigation must be performed on the foreground thread. - A navegação deve ser executada no thread em primeiro plano. - - [+] [+] @@ -2224,11 +2114,6 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Os assemblies do analisador '{0}' e '{1}' têm a identidade '{2}', porém conteúdos diferentes. Somente um será carregado e os analisadores usando esses conjuntos podem não executar corretamente. - - {0} references {0} referências @@ -2274,21 +2159,11 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar IntelliSense - - C#/VB Build Table Data Source - Fonte de Dados da Tabela de Build do C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - O assembly do analisador '{0}' depende do '{1}', mas não foi encontrado. Os analisadores podem não ser executados corretamente a menos que o assembly ausente também seja adicionado como uma referência do analisador. - - Suppress diagnostics Suprimir diagnósticos @@ -2329,11 +2204,6 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Este workspace não dá suporte à atualização das opções de análise do Visual Basic. - - Synchronize {0} - Sincronizar {0} - - Synchronizing with {0}... Sincronizando a {0}... @@ -2374,26 +2244,11 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Sim - - Choose a Symbol Specification and a Naming Style. - Escolha uma Especificação de Símbolo e um Estilo de Nomenclatura. - - - - Enter a title for this Naming Rule. - Insira um título para essa Regra de Nomenclatura. - - Enter a title for this Naming Style. Insira um título para esse Estilo de Nomenclatura. - - Enter a title for this Symbol Specification. - Insira um título para essa Especificação de Símbolo. - - Accessibilities (can match any) Acessibilidades (podem corresponder a qualquer uma) @@ -2429,21 +2284,11 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Nome do Caso Pascal - - Severity: - Gravidade: - - Modifiers (must match all) Modificadores (devem corresponder a todos) - - Name: - Nome: - - Naming Rule Regra de Nomenclatura @@ -2454,31 +2299,11 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Estilo de Nomenclatura - - Naming Style: - Estilo de Nomenclatura: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - As Regras de Nomenclatura permitem definir como os conjuntos de símbolos específicos devem ser nomeados e como os símbolos nomeados incorretamente devem ser manuseados. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - A primeira Regra de Nomenclatura superior correspondente é usada por padrão ao nomear um símbolo, enquanto qualquer caso especial é manuseado por uma regra filha correspondente. - - Naming Style Title: Título do Estilo de Nomenclatura: - - Parent Rule: - Regra Pai: - - Required Prefix: Prefixo Necessário: @@ -2504,11 +2329,6 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Especificação do Símbolo - - Symbol Specification: - Especificação do Símbolo: - - Symbol Specification Title: Título da Especificação do Símbolo: @@ -2554,37 +2374,6 @@ Use a lista suspensa para exibir e mudar entre outros projetos aos quais este ar Falha na desinstalação do pacote: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Erro encontrado ao carregar o projeto. Alguns recursos do projeto, como a análise de solução completa e projetos que dependem dela, foram desabilitados. - - - - Project loading failed. - Falha ao carregar o projeto. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Para ver o que causou o problema, tente a opção abaixo. - -1. Feche o Visual Studio -2. Abra um Prompt de Comando do Desenvolvedor do Visual Studio -3. Defina a variável de ambiente “TraceDesignTime” como true (set TraceDesignTime=true) -4. Exclua o diretório .vs/arquivo .suo -5. Reinicie o VS do prompt de comando em que você definiu a variável de ambiente (devenv) -6. Abra a solução -7. Marque '{0}' e procure as tarefas com falha (COM FALHA) - - Additional information: Informações adicionais: @@ -2703,11 +2492,6 @@ Informações adicionais: {1} Mostrar guias para construções de nível de código - - Show guides for comments and preprocessor regions - Mostrar guias para regiões do pré-processador e comentários - - Show guides for declaration level constructs Mostrar guias para construções de nível de declaração @@ -2928,16 +2712,6 @@ Informações adicionais: {1} Escolher membros - - Add a symbol specification - Adicionar uma especificação de símbolo - - - - Remove symbol specification - Remover especificação de símbolo - - Add item Adicionar item @@ -3058,11 +2832,6 @@ Informações adicionais: {1} preferir propriedades automáticas - - Module has been unloaded. - O módulo foi descarregado. - - Enable navigation to decompiled sources Habilitar a navegação para origens descompiladas @@ -3078,11 +2847,6 @@ Informações adicionais: {1} Sincronizar Modo de Exibição de Classe - - Analyzing '{0}' - Analisando '{0}' - - Manage naming styles Gerenciar estilos de nomenclatura diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf index 25d3110e9549b..7f92908b97a19 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf @@ -162,16 +162,6 @@ 64-разрядный - - Build + live analysis (NuGet package) - Сборка и динамический анализ (пакет NuGet) - - - - C#/Visual Basic Diagnostics Language Client - Языковой клиент диагностики C#/Visual Basic - - Calculating... Вычисление... @@ -382,11 +372,6 @@ _Изменить - - Edit {0} - Изменить {0} - {0} is a parameter description - Editor Color Scheme Цветовая схема редактора @@ -462,11 +447,6 @@ Ошибка при обновлении подавлений: {0} - - Evaluating ({0} tasks in queue) - Оценка (задач в очереди: {0}) - - External Sources Внешние источники @@ -577,16 +557,6 @@ Вывести из контекста - - Indexed in organization - Индексированный в организации - - - - Indexed in repo - Индексированный в репозитории - - Inheritance Margin Поле наследования @@ -597,11 +567,6 @@ Унаследованные интерфейсы - - Inline Diagnostics (experimental) - Встроенная диагностика (экспериментальная функция) - - Inline Hints Встроенные подсказки @@ -612,11 +577,6 @@ Вставка значения "{0}" места вызова - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Установите рекомендуемые корпорацией Майкрософт анализаторы Roslyn, которые предоставляют дополнительные средства диагностики и исправления для распространенных проблем, связанных с разработкой, безопасностью, производительностью и надежностью API. - - Interface cannot have field. Интерфейс не может содержать поле. @@ -632,11 +592,6 @@ Недопустимое имя типа - - Item origin - Источник элемента - - JSON strings Строки JSON @@ -657,11 +612,6 @@ Вид - - Live analysis (VSIX extension) - Динамический анализ (расширение VSIX) - - Loaded items Загруженные элементы @@ -677,11 +627,6 @@ Локальное - - Local metadata - Локальные метаданные - - Location Расположение @@ -1027,11 +972,6 @@ Пакеты - - Parameter Details - Дополнительные сведения о параметрах - - Parameter name: Имя параметра: @@ -1077,11 +1017,6 @@ Вставьте трассировку стека, чтобы просмотреть ее значения и перемещаться между ними. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Приостановлено (задач в очереди: {0}) - - Please enter a type name Введите имя типа @@ -1207,11 +1142,6 @@ Регулярные выражения - - Remove All - Удалить все - - Remove Unused References Удалить неиспользуемые ссылки @@ -1312,11 +1242,6 @@ Выполняется анализ кода для решения… - - Running low priority background processes - Запуск фоновых процессов с низким приоритетом - - Save .editorconfig file Сохранить файл EDITORCONFIG @@ -1437,11 +1362,6 @@ Некоторые цвета цветовой схемы переопределяются изменениями, сделанными на странице "Среда" > "Шрифты и цвета". Выберите "Использовать значения по умолчанию" на странице "Шрифты и цвета", чтобы отменить все настройки. - - Sort usings - Сортировать директивы using - - Stack Trace Трассировка стека @@ -1767,11 +1687,6 @@ Наследует - - Inherited By - Наследуется - - Implements Реализует @@ -1782,16 +1697,6 @@ Реализуется - - Maximum number of documents are open. - Открыто предельное число документов. - - - - Failed to create document in miscellaneous files project. - Не удалось создать документ в списке прочих файлов. - - Invalid access. Недопустимый доступ. @@ -2024,16 +1929,6 @@ Use the dropdown to view and switch to other projects this file may belong to.Сборка анализатора "{0}" была изменена. Перезапустите Visual Studio, в противном случае диагностика может быть неправильной. - - C#/VB Diagnostics Table Data Source - Источник данных для таблицы диагностики C#/VB - - - - C#/VB Todo List Table Data Source - Источник данных для таблицы списка задач C#/VB - - Cancel Отмена @@ -2184,11 +2079,6 @@ Use the dropdown to view and switch to other projects this file may belong to.{0}: подробнее - - Navigation must be performed on the foreground thread. - Навигация должна осуществляться в потоке переднего плана. - - [+] [+] @@ -2224,11 +2114,6 @@ Use the dropdown to view and switch to other projects this file may belong to.AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - Сборки анализатора "{0}" и "{1}" имеют одно и то же удостоверение ("{2}"), но разное содержимое. Будет загружена только одна сборка, и анализаторы, использующие эти сборки, могут работать неправильно. - - {0} references Ссылок: {0} @@ -2274,21 +2159,11 @@ Use the dropdown to view and switch to other projects this file may belong to.IntelliSense - - C#/VB Build Table Data Source - Источник данных для таблицы сборки C#/VB - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - Сборка анализатора "{0}" зависит от "{1}", но последняя не найдена. Анализаторы могут работать неправильно, если не добавить отсутствующую сборку в качестве ссылки анализатора. - - Suppress diagnostics Подавление диагностики @@ -2329,11 +2204,6 @@ Use the dropdown to view and switch to other projects this file may belong to.Эта рабочая область не поддерживает обновление параметров синтаксического анализа Visual Basic. - - Synchronize {0} - Синхронизировать {0} - - Synchronizing with {0}... Синхронизация с {0}... @@ -2374,26 +2244,11 @@ Use the dropdown to view and switch to other projects this file may belong to.Да - - Choose a Symbol Specification and a Naming Style. - Выберите спецификацию символов и стиль именования. - - - - Enter a title for this Naming Rule. - Введите название для этого правила именования. - - Enter a title for this Naming Style. Введите название для этого стиля именования. - - Enter a title for this Symbol Specification. - Введите название для этой спецификации символа. - - Accessibilities (can match any) Модификаторы доступности (соответствие любому) @@ -2429,21 +2284,11 @@ Use the dropdown to view and switch to other projects this file may belong to.Название в регистре Pascal - - Severity: - Серьезность: - - Modifiers (must match all) Модификаторы (должны соответствовать всему) - - Name: - Название: - - Naming Rule Правило именования @@ -2454,31 +2299,11 @@ Use the dropdown to view and switch to other projects this file may belong to.Стиль именования - - Naming Style: - Стиль именования: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Правила именования позволяют определить, как должны именоваться определенные наборы символов и как должны обрабатываться неправильно названные символы. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - По умолчанию при именовании символа используется первое соответствующее правило именования верхнего уровня, а все особые случаи обрабатываются соответствующим дочерним правилом. - - Naming Style Title: Название стиля именования: - - Parent Rule: - Родительское правило: - - Required Prefix: Необходимый префикс: @@ -2504,11 +2329,6 @@ Use the dropdown to view and switch to other projects this file may belong to.Спецификация символа - - Symbol Specification: - Спецификация символа: - - Symbol Specification Title: Название спецификации символа: @@ -2554,37 +2374,6 @@ Use the dropdown to view and switch to other projects this file may belong to.Сбой при удалении пакета: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Произошла ошибка при загрузке проекта. Некоторые возможности проекта, например полный анализ решения для неработоспособного проекта и зависящих от него проектов, были отключены. - - - - Project loading failed. - Сбой при загрузке проекта. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Чтобы узнать, что вызвало проблему, попробуйте сделать следующее. - -1. Закройте Visual Studio. -2. Откройте командную строку разработчика Visual Studio. -3. Присвойте переменной "TraceDesignTime" значение true (set TraceDesignTime=true). -4. Удалите файл ".vs directory/.suo". -5. Перезапустите VS из командной строки, в которой вы присвоили значение переменной среды (devenv). -6. Откройте решение. -7. Проверьте "{0}" и найдите задачи, которые завершились сбоем (FAILED). - - Additional information: Дополнительная информация: @@ -2703,11 +2492,6 @@ Additional information: {1} Показывать направляющие для конструкций уровня кода - - Show guides for comments and preprocessor regions - Показывать направляющие для комментариев и областей препроцессора - - Show guides for declaration level constructs Показывать направляющие для конструкций уровня объявления @@ -2928,16 +2712,6 @@ Additional information: {1} Выбрать члены - - Add a symbol specification - Добавить спецификацию символа - - - - Remove symbol specification - Удалить спецификацию символа - - Add item Добавить элемент @@ -3058,11 +2832,6 @@ Additional information: {1} предпочитать автосвойства - - Module has been unloaded. - Модуль был выгружен. - - Enable navigation to decompiled sources Включить переход к декомпилированным источникам @@ -3078,11 +2847,6 @@ Additional information: {1} Синхронизировать представление классов - - Analyzing '{0}' - Выполняется анализ "{0}" - - Manage naming styles Управление стилями именования diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf index a925976b33144..88b236ef47313 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf @@ -162,16 +162,6 @@ 64 bit - - Build + live analysis (NuGet package) - Derleme ve canlı analiz (NuGet paketi) - - - - C#/Visual Basic Diagnostics Language Client - C#/Visual Basic Tanılama Dili İstemcisi - - Calculating... Hesaplanıyor... @@ -382,11 +372,6 @@ _Düzenle - - Edit {0} - {0} öğesini düzenle - {0} is a parameter description - Editor Color Scheme Düzenleyici Renk Düzeni @@ -462,11 +447,6 @@ Gizlemeler güncellenirken hata oluştu: {0} - - Evaluating ({0} tasks in queue) - Değerlendiriliyor (kuyrukta {0} görev var) - - External Sources Dış Kaynaklar @@ -577,16 +557,6 @@ Bağlamdan çıkarsa - - Indexed in organization - Kuruluş içinde dizini oluşturulmuş - - - - Indexed in repo - Depo içinde dizini oluşturulmuş - - Inheritance Margin Devralma Boşluğu @@ -597,11 +567,6 @@ Devralınan arabirimler - - Inline Diagnostics (experimental) - Satır İçi Tanılama (deneysel) - - Inline Hints Satır İçi İpuçları @@ -612,11 +577,6 @@ Çağırma yeri değeri '{0}' ekleniyor - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - Microsoft'un önerdiği, genel API tasarımı, güvenlik, performans ve güvenilirlik sorunları için ek tanılama ve düzeltmeler sağlayan Roslyn çözümleyicilerini yükleyin - - Interface cannot have field. Arabirimde alan olamaz. @@ -632,11 +592,6 @@ Geçersiz tür adı - - Item origin - Öğe çıkış noktası - - JSON strings JSON dizeleri @@ -657,11 +612,6 @@ Tür - - Live analysis (VSIX extension) - Canlı analiz (VSIX uzantısı) - - Loaded items Öğeler yüklendi @@ -677,11 +627,6 @@ Yerel - - Local metadata - Yerel meta veriler - - Location Konum @@ -1027,11 +972,6 @@ Paketler - - Parameter Details - Parametre Ayrıntıları - - Parameter name: Parametre adı: @@ -1077,11 +1017,6 @@ Değerlerini görüntülemek ve gezinmek için bir yığın izi yapıştırın. "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - Duraklatıldı (kuyrukta {0} görev var) - - Please enter a type name Lütfen bir tür adı yazın @@ -1207,11 +1142,6 @@ Normal İfadeler - - Remove All - Tümünü Kaldır - - Remove Unused References Kullanılmayan Başvuruları Kaldır @@ -1312,11 +1242,6 @@ Çözüm için kod analizi çalıştırılıyor... - - Running low priority background processes - Düşük öncelikli arka plan işlemleri çalıştırılıyor - - Save .editorconfig file .editorconfig dosyasını kaydet @@ -1437,11 +1362,6 @@ Bazı renk düzeni renkleri, Ortam > Yazı Tipleri ve Renkler seçenek sayfasında yapılan değişiklikler tarafından geçersiz kılınıyor. Tüm özelleştirmeleri geri döndürmek için Yazı Tipleri ve Renkler sayfasında `Varsayılanları Kullan` seçeneğini belirleyin. - - Sort usings - Using’leri sırala - - Stack Trace Yığın İzleme @@ -1767,11 +1687,6 @@ Devralınan - - Inherited By - Devralan - - Implements Uygulanan @@ -1782,16 +1697,6 @@ Uygulayan - - Maximum number of documents are open. - Açılabilecek en fazla belge sayısına ulaşıldı. - - - - Failed to create document in miscellaneous files project. - Diğer Dosyalar projesinde belge oluşturulamadı. - - Invalid access. Geçersiz erişim. @@ -2024,16 +1929,6 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Çözümleyici bütünleştirilmiş kodu '{0}' değiştirildi. Visual Studio yeniden başlatılmazsa tanılama yanlış olabilir. - - C#/VB Diagnostics Table Data Source - C#/VB Tanılama Tablosu Veri Kaynağı - - - - C#/VB Todo List Table Data Source - C#/VB Yapılacaklar Listesi Tablosu Veri Kaynağı - - Cancel İptal @@ -2184,11 +2079,6 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi {0} hakkında daha fazla bilgi - - Navigation must be performed on the foreground thread. - Gezintinin, ön plan iş parçacığında gerçekleştirilmesi gerekir. - - [+] [+] @@ -2224,11 +2114,6 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - '{0}' ve '{1}' çözümleyici bütünleştirilmiş kodlarının ikisi de '{2}' kimliğine sahip, ancak içerikleri farklı. Yalnızca biri yüklenecek; bu bütünleştirilmiş kodları kullanan çözümleyiciler düzgün şekilde çalışmayabilir. - - {0} references {0} başvuru @@ -2274,21 +2159,11 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi IntelliSense - - C#/VB Build Table Data Source - C#/VB Derleme Tablosu Veri Kaynağı - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - Çözümleyici bütünleştirilmiş kodu '{0}', '{1}' öğesine bağımlı ancak bu öğe bulunamadı. Eksik bütünleştirilmiş kod da çözümleyici başvurusu olarak eklenmeden, çözümleyiciler düzgün şekilde çalışmayabilir. - - Suppress diagnostics Tanılamayı gizle @@ -2329,11 +2204,6 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Bu çalışma alanı Visual Basic ayrıştırma seçeneklerinin güncelleştirilmesini desteklemiyor. - - Synchronize {0} - {0} ile eşitle - - Synchronizing with {0}... {0} ile eşitleniyor... @@ -2374,26 +2244,11 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Evet - - Choose a Symbol Specification and a Naming Style. - Sembol Belirtimi ve Adlandırma Stili seçin. - - - - Enter a title for this Naming Rule. - Bu Adlandırma Kuralı için bir başlık girin. - - Enter a title for this Naming Style. Bu Adlandırma Stili için bir başlık girin. - - Enter a title for this Symbol Specification. - Bu Sembol Belirtimi için bir başlık girin. - - Accessibilities (can match any) Erişim düzeyleri (herhangi biriyle eşleşebilir) @@ -2429,21 +2284,11 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Baş Harfleri Büyük Ad - - Severity: - Önem Derecesi: - - Modifiers (must match all) Değiştiriciler (tümüyle eşleşmelidir) - - Name: - Ad: - - Naming Rule Adlandırma Kuralı @@ -2454,31 +2299,11 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Adlandırma Stili - - Naming Style: - Adlandırma Stili: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - Adlandırma Kuralları, belirli sembol kümelerinin nasıl adlandırılması gerektiğini ve yanlış adlandırılan sembollerin nasıl işlenmesi gerektiğini tanımlamanızı sağlar. - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - Sembol adlandırılırken varsayılan olarak, eşleşen ilk üst düzey Adlandırma Kuralı kullanılır. Özel durumlar ise eşleşen bir alt kural tarafından işlenir. - - Naming Style Title: Adlandırma Stili Başlığı: - - Parent Rule: - Üst Kural: - - Required Prefix: Gerekli Ön Ek: @@ -2504,11 +2329,6 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Sembol Belirtimi - - Symbol Specification: - Sembol Belirtimi: - - Symbol Specification Title: Sembol Belirtimi Başlığı: @@ -2554,37 +2374,6 @@ Bu dosyanın ait olabileceği diğer projeleri görüntülemek ve bunlara geçi Paket kaldırılamadı: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - Proje yüklenirken hatayla karşılaşıldı. Başarısız olan proje ve buna bağımlı projeler için, tam çözüm denetimi gibi bazı proje özellikleri devre dışı bırakıldı. - - - - Project loading failed. - Proje yüklenemedi. - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - Sorunun neden kaynaklandığını görmek için lütfen aşağıdaki çözümleri deneyin. - -1. Visual Studio'yu kapatın -2. Visual Studio Geliştirici Komut İstemi'ni açın -3. “TraceDesignTime” ortam değişkenini true olarak ayarlayın (set TraceDesignTime=true) -4. .vs dizini/.suo dosyasını silin -5. Visual Studio'yu, ortam değişkenini ayarladığınız komut isteminden yeniden başlatın (devenv) -6. Çözümü açın -7. '{0}' konumuna giderek başarısız olan görevlere bakın (FAILED) - - Additional information: Ek bilgi: @@ -2703,11 +2492,6 @@ Ek bilgiler: {1} Kod düzeyinde yapılar için kılavuzları göster - - Show guides for comments and preprocessor regions - Açıklamalar ve ön işlemci bölgeleri için kılavuzları göster - - Show guides for declaration level constructs Bildirim düzeyinde yapılar için kılavuzları göster @@ -2928,16 +2712,6 @@ Ek bilgiler: {1} Üyeleri seçin - - Add a symbol specification - Sembol belirtimi ekle - - - - Remove symbol specification - Sembol belirtimini kaldır - - Add item Öğe ekle @@ -3058,11 +2832,6 @@ Ek bilgiler: {1} otomatik özellikleri tercih et - - Module has been unloaded. - Modül kaldırıldı. - - Enable navigation to decompiled sources Derlenmiş kaynaklarda gezinmeyi etkinleştir @@ -3078,11 +2847,6 @@ Ek bilgiler: {1} Sınıf Görünümünü Eşitle - - Analyzing '{0}' - '{0}' Analiz Ediliyor - - Manage naming styles Adlandırma stillerini yönetme diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf index 15e503ed81ae8..b84781af1c18d 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf @@ -162,16 +162,6 @@ 64 位 - - Build + live analysis (NuGet package) - 生成 + 实时分析(NuGet 包) - - - - C#/Visual Basic Diagnostics Language Client - C#/Visual Basic 语言服务器客户端 - - Calculating... 正在计算... @@ -382,11 +372,6 @@ 编辑(_E) - - Edit {0} - 编辑 {0} - {0} is a parameter description - Editor Color Scheme 编辑器配色方案 @@ -462,11 +447,6 @@ 更新抑制时出现错误: {0} - - Evaluating ({0} tasks in queue) - 正在评估(队列中有 {0} 个任务) - - External Sources 外部源 @@ -577,16 +557,6 @@ 从上下文推断 - - Indexed in organization - 已在组织中编入索引 - - - - Indexed in repo - 已在存储库中编入索引 - - Inheritance Margin 继承边距 @@ -597,11 +567,6 @@ 继承的接口 - - Inline Diagnostics (experimental) - 内联诊断(实验性) - - Inline Hints 内联提示 @@ -612,11 +577,6 @@ 正在插入调用站点值 "{0}" - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - 安装 Microsoft 推荐的 Roslyn 分析器,它提供了针对常见 API 设计、安全性、性能和可靠性问题的额外诊断和修补程序 - - Interface cannot have field. 接口不可具有字段。 @@ -632,11 +592,6 @@ 类型名无效 - - Item origin - 项来源 - - JSON strings JSON 字符串 @@ -657,11 +612,6 @@ 种类 - - Live analysis (VSIX extension) - 实时分析(VSIX 扩展) - - Loaded items 加载的项 @@ -677,11 +627,6 @@ 本地 - - Local metadata - 本地元数据 - - Location 位置 @@ -1027,11 +972,6 @@ - - Parameter Details - 参数详细信息 - - Parameter name: 参数名称: @@ -1077,11 +1017,6 @@ 粘贴堆栈跟踪以查看和导航其值。 "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - 已暂停(队列中有 {0} 个任务) - - Please enter a type name 请输入一个类型名称 @@ -1207,11 +1142,6 @@ 正规表达式 - - Remove All - 全部删除 - - Remove Unused References 删除未使用的引用 @@ -1312,11 +1242,6 @@ 正在为解决方案运行代码分析… - - Running low priority background processes - 正在运行低优先级后台进程 - - Save .editorconfig file 保存 .editorconfig 文件 @@ -1437,11 +1362,6 @@ 在“环境”>“字体和颜色”选项页中所做的更改将替代某些配色方案颜色。在“字体和颜色”页中选择“使用默认值”,还原所有自定义项。 - - Sort usings - 对 using 排序 - - Stack Trace 堆栈跟踪 @@ -1767,11 +1687,6 @@ 继承 - - Inherited By - 继承者 - - Implements 实现 @@ -1782,16 +1697,6 @@ 实现者 - - Maximum number of documents are open. - 打开的文档达到最大数目。 - - - - Failed to create document in miscellaneous files project. - 未能在杂项文件项目中创建文档。 - - Invalid access. 访问无效。 @@ -2024,16 +1929,6 @@ Use the dropdown to view and switch to other projects this file may belong to.分析器程序集“{0}”已更改。如果不重启 Visual Studio,诊断则可能出错。 - - C#/VB Diagnostics Table Data Source - C#/VB 诊断表格数据源 - - - - C#/VB Todo List Table Data Source - C#/VB 待办事项表格数据源 - - Cancel 取消 @@ -2184,11 +2079,6 @@ Use the dropdown to view and switch to other projects this file may belong to.有关 {0} 的详细信息 - - Navigation must be performed on the foreground thread. - 导航必须在前台线程上进行。 - - [+] [+] @@ -2224,11 +2114,6 @@ Use the dropdown to view and switch to other projects this file may belong to.AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - 分析器程序集“{0}”和“{1}”都具有标识“{2}”,但是却具有不同的内容。只会加载其中一个程序集,并且使用这些程序集的分析器可能不会正确运行。 - - {0} references {0} 个引用 @@ -2274,21 +2159,11 @@ Use the dropdown to view and switch to other projects this file may belong to.IntelliSense - - C#/VB Build Table Data Source - C#/VB 内部版本表格数据源 - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - 分析器程序集“{0}”依赖于“{1}”,但是却找不到它。除非将缺少的程序集也添加为分析器引用,否则分析器可能不会正确运行。 - - Suppress diagnostics 禁止诊断 @@ -2329,11 +2204,6 @@ Use the dropdown to view and switch to other projects this file may belong to.此工作区不支持更新 Visual Basic 分析选项。 - - Synchronize {0} - 同步 {0} - - Synchronizing with {0}... 正在与 {0} 同步... @@ -2374,26 +2244,11 @@ Use the dropdown to view and switch to other projects this file may belong to. - - Choose a Symbol Specification and a Naming Style. - 选择符号规范和命名样式。 - - - - Enter a title for this Naming Rule. - 为此命名规则输入标题。 - - Enter a title for this Naming Style. 为此命名样式输入标题。 - - Enter a title for this Symbol Specification. - 为此符号规范输入标题。 - - Accessibilities (can match any) 可访问性(可任意匹配) @@ -2429,21 +2284,11 @@ Use the dropdown to view and switch to other projects this file may belong to.帕斯卡式大小写命名 - - Severity: - 严重性: - - Modifiers (must match all) 修饰符(必须全部匹配) - - Name: - 名称: - - Naming Rule 命名规则 @@ -2454,31 +2299,11 @@ Use the dropdown to view and switch to other projects this file may belong to.命名样式 - - Naming Style: - 命名样式: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - 命名规则能够使用户定义特定符号集的命名方式以及错误命名符号的处理方式。 - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - 命名符号时,默认使用第一个匹配的顶级命名规则,而匹配的子规则会处理任何的特殊情况。 - - Naming Style Title: 命名样式标题: - - Parent Rule: - 父规则: - - Required Prefix: 必填前缀: @@ -2504,11 +2329,6 @@ Use the dropdown to view and switch to other projects this file may belong to.符号规范 - - Symbol Specification: - 符号规范: - - Symbol Specification Title: 符号规范标题: @@ -2554,37 +2374,6 @@ Use the dropdown to view and switch to other projects this file may belong to.包卸载失败: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - 加载项目时遇到了错误。已禁用了某些项目功能,例如用于失败项目和依赖于失败项目的其他项目的完整解决方案分析。 - - - - Project loading failed. - 项目加载失败。 - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - 若要查看导致问题的原因,请尝试进行以下操作。 - -1. 关闭 Visual Studio -2. 打开 Visual Studio 开发人员命令提示 -3. 将环境变量 "TraceDesignTime" 设置为 true (设置 TraceDesignTime=true) -4. 删除 .vs 目录/.suo 文件 -5. 在设置环境变量(devenv)的命令提示中重启 VS -6. 打开解决方案 -7. 检查“{0}”并查找失败任务(FAILED) - - Additional information: 其他信息: @@ -2703,11 +2492,6 @@ Additional information: {1} 显示代码级别构造的指南 - - Show guides for comments and preprocessor regions - 显示注释和预处理器区域的指南 - - Show guides for declaration level constructs 显示声明级别构造的指南 @@ -2928,16 +2712,6 @@ Additional information: {1} 挑选成员 - - Add a symbol specification - 添加符号规范 - - - - Remove symbol specification - 删除符号规范 - - Add item 添加项 @@ -3058,11 +2832,6 @@ Additional information: {1} 首选自动属性 - - Module has been unloaded. - 已卸载模块。 - - Enable navigation to decompiled sources 支持导航到反编译源 @@ -3078,11 +2847,6 @@ Additional information: {1} 同步类视图 - - Analyzing '{0}' - 分析“{0}” - - Manage naming styles 管理命名样式 diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf index 601445c0e702a..6acce6f8d8af4 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf @@ -162,16 +162,6 @@ 64 位元 - - Build + live analysis (NuGet package) - 組建 + 即時分析 (NuGet 套件) - - - - C#/Visual Basic Diagnostics Language Client - C#/Visual Basic 診斷語言用戶端 - - Calculating... 正在計算... @@ -382,11 +372,6 @@ 編輯(_E) - - Edit {0} - 編輯 {0} - {0} is a parameter description - Editor Color Scheme 編輯器色彩配置 @@ -462,11 +447,6 @@ 更新歸併時發生錯誤: {0} - - Evaluating ({0} tasks in queue) - 正在評估 (佇列中的 {0} 工作) - - External Sources 外部來源 @@ -577,16 +557,6 @@ 從內容推斷 - - Indexed in organization - 已在組織中編制索引 - - - - Indexed in repo - 已在存放庫中編制索引 - - Inheritance Margin 繼承邊界 @@ -597,11 +567,6 @@ 繼承介面 - - Inline Diagnostics (experimental) - 內嵌診斷 (實驗性) - - Inline Hints 內嵌提示 @@ -612,11 +577,6 @@ 正在插入呼叫網站值 '{0}' - - Install Microsoft-recommended Roslyn analyzers, which provide additional diagnostics and fixes for common API design, security, performance, and reliability issues - 安裝 Microsoft 建議的 Roslyn 分析器,其可為一般 API 設計、安全性、效能及可靠性問題提供額外的診斷與修正 - - Interface cannot have field. 介面不得具有欄位。 @@ -632,11 +592,6 @@ 無效的類別名稱 - - Item origin - 項目原點 - - JSON strings JSON 字串 @@ -657,11 +612,6 @@ 種類 - - Live analysis (VSIX extension) - 即時分析 (VSIX 延伸模組) - - Loaded items 已載入的項目 @@ -677,11 +627,6 @@ 本機 - - Local metadata - 本機中繼資料 - - Location 位置 @@ -1027,11 +972,6 @@ 套件 - - Parameter Details - 參數詳細資料 - - Parameter name: 參數名稱: @@ -1077,11 +1017,6 @@ 貼上堆疊追蹤以檢視及瀏覽其值。 "Stack Trace" is a language term and should be kept the same. - - Paused ({0} tasks in queue) - 已暫停 (佇列中的 {0} 工作) - - Please enter a type name 請輸入類型名稱 @@ -1207,11 +1142,6 @@ 規則運算式 - - Remove All - 全部移除 - - Remove Unused References 移除未使用的參考 @@ -1312,11 +1242,6 @@ 正在執行解決方案的程式碼分析... - - Running low priority background processes - 正在執行低優先順序背景流程 - - Save .editorconfig file 儲存 .editorconfig 檔案 @@ -1437,11 +1362,6 @@ [環境] > [字型和色彩選項] 頁面中所做的變更覆寫了某些色彩配置的色彩。請選擇 [字型和色彩] 頁面中的 [使用預設] 來還原所有自訂。 - - Sort usings - 排序 Using - - Stack Trace 堆疊追蹤 @@ -1767,11 +1687,6 @@ 繼承 - - Inherited By - 繼承者 - - Implements 實作 @@ -1782,16 +1697,6 @@ 實作者 - - Maximum number of documents are open. - 開啟的文件數已達上限。 - - - - Failed to create document in miscellaneous files project. - 無法建立其他檔案專案中的文件。 - - Invalid access. 存取無效。 @@ -2024,16 +1929,6 @@ Use the dropdown to view and switch to other projects this file may belong to.分析器組件 '{0}' 已變更。可能造成診斷錯誤,直到 Visual Studio 重新啟動為止。 - - C#/VB Diagnostics Table Data Source - C#/VB 診斷資料表資料來源 - - - - C#/VB Todo List Table Data Source - C#/VB 待辦事項清單資料表資料來源 - - Cancel 取消 @@ -2184,11 +2079,6 @@ Use the dropdown to view and switch to other projects this file may belong to.關於 {0} 的詳細資訊 - - Navigation must be performed on the foreground thread. - 瀏覽必須在前景執行緒執行。 - - [+] [+] @@ -2224,11 +2114,6 @@ Use the dropdown to view and switch to other projects this file may belong to.AnalyzerDependencyConflict - - Analyzer assemblies '{0}' and '{1}' both have identity '{2}' but different contents. Only one will be loaded and analyzers using these assemblies may not run correctly. - 分析器組件 '{0}' 及 '{1}' 均有身分識別 '{2}' 但內容不同。僅會載入其中一個,且使用這些組件的分析器可能無法正確執行。 - - {0} references {0} 個參考 @@ -2274,21 +2159,11 @@ Use the dropdown to view and switch to other projects this file may belong to.IntelliSense - - C#/VB Build Table Data Source - C#/VB 組建資料表資料來源 - - MissingAnalyzerReference MissingAnalyzerReference - - Analyzer assembly '{0}' depends on '{1}' but it was not found. Analyzers may not run correctly unless the missing assembly is added as an analyzer reference as well. - 分析器組件 '{0}' 相依於 '{1}',但找不到該項目。除非同時將遺漏的組件新增為分析器參考,否則分析器可能無法正確執行。 - - Suppress diagnostics 隱藏診斷 @@ -2329,11 +2204,6 @@ Use the dropdown to view and switch to other projects this file may belong to.此工作區不支援更新 Visual Basic 剖析選項。 - - Synchronize {0} - 同步 {0} - - Synchronizing with {0}... 正在與 {0} 同步... @@ -2374,26 +2244,11 @@ Use the dropdown to view and switch to other projects this file may belong to. - - Choose a Symbol Specification and a Naming Style. - 選擇符號規格及命名樣式。 - - - - Enter a title for this Naming Rule. - 輸入此命名規則的標題。 - - Enter a title for this Naming Style. 輸入此命名樣式的標題。 - - Enter a title for this Symbol Specification. - 輸入此符號規格的標題。 - - Accessibilities (can match any) 存取範圍 (可符合任何項目) @@ -2429,21 +2284,11 @@ Use the dropdown to view and switch to other projects this file may belong to.Pascal 命名法名稱 - - Severity: - 嚴重性: - - Modifiers (must match all) 修飾元 (必須符合所有項目) - - Name: - 名稱: - - Naming Rule 命名規則 @@ -2454,31 +2299,11 @@ Use the dropdown to view and switch to other projects this file may belong to.命名樣式 - - Naming Style: - 命名樣式: - - - - Naming Rules allow you to define how particular sets of symbols should be named and how incorrectly-named symbols should be handled. - 命名規則可讓您定義特定符號集的命名方式,以及未正確命名符號的處理方式。 - - - - The first matching top-level Naming Rule is used by default when naming a symbol, while any special cases are handled by a matching child rule. - 替符號命名時,依預設會使用第一個相符的頂層命名規則; 而任何特殊情況都將由相符的子系規則處理。 - - Naming Style Title: 命名樣式標題: - - Parent Rule: - 父系規則: - - Required Prefix: 必要前置詞: @@ -2504,11 +2329,6 @@ Use the dropdown to view and switch to other projects this file may belong to.符號規格 - - Symbol Specification: - 符號規格: - - Symbol Specification Title: 符號規格標題: @@ -2554,37 +2374,6 @@ Use the dropdown to view and switch to other projects this file may belong to.套件解除安裝失敗: {0} - - Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. - 載入專案時發生錯誤。已停用部分專案功能,例如對失敗專案及其相依專案的完整解決方案分析。 - - - - Project loading failed. - 專案載入失敗。 - - - - To see what caused the issue, please try below. - -1. Close Visual Studio -2. Open a Visual Studio Developer Command Prompt -3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true) -4. Delete .vs directory/.suo file -5. Restart VS from the command prompt you set the environment variable (devenv) -6. Open the solution -7. Check '{0}' and look for the failed tasks (FAILED) - 若要了解此問題的發生原因,請嘗試下方步驟。 - -1. 關閉 Visual Studio -2. 開啟 Visual Studio 開發人員命令提示字元 -3. 將環境變數 “TraceDesignTime” 設為 true (設定 TraceDesignTime=true) -4. 刪除 .vs 目錄/ .suo 檔案 -5. 從您設定環境變數 (devenv) 的命令提示字元處重新啟動 VS -6. 開啟解決方案 -7. 檢查 '{0}' 並尋找失敗的工作 (FAILED) - - Additional information: 其他資訊: @@ -2703,11 +2492,6 @@ Additional information: {1} 顯示程式碼層級建構的指南 - - Show guides for comments and preprocessor regions - 顯示註解及前置處理器區域的指南 - - Show guides for declaration level constructs 顯示宣告層級建構的指南 @@ -2928,16 +2712,6 @@ Additional information: {1} 選取成員 - - Add a symbol specification - 新增符號規格 - - - - Remove symbol specification - 移除符號規格 - - Add item 新增項目 @@ -3058,11 +2832,6 @@ Additional information: {1} 建議使用自動屬性 - - Module has been unloaded. - 模組已卸載。 - - Enable navigation to decompiled sources 啟用到反向組譯來源的瀏覽 @@ -3078,11 +2847,6 @@ Additional information: {1} 同步類別檢視 - - Analyzing '{0}' - 正在分析 '{0}' - - Manage naming styles 管理命名樣式 From 9388b5c4423df9ab1bbe9a7f0539cbc020ff9744 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:36:50 -0700 Subject: [PATCH 24/94] Remove unused resource string --- src/VisualStudio/VisualBasic/Impl/BasicVSResources.resx | 4 ---- .../VisualBasic/Impl/xlf/BasicVSResources.cs.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.de.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.es.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.fr.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.it.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.ja.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.ko.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.pl.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.pt-BR.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.ru.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.tr.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.zh-Hans.xlf | 5 ----- .../VisualBasic/Impl/xlf/BasicVSResources.zh-Hant.xlf | 5 ----- 14 files changed, 69 deletions(-) diff --git a/src/VisualStudio/VisualBasic/Impl/BasicVSResources.resx b/src/VisualStudio/VisualBasic/Impl/BasicVSResources.resx index 3c1c089e2bbdb..feb1994aec76a 100644 --- a/src/VisualStudio/VisualBasic/Impl/BasicVSResources.resx +++ b/src/VisualStudio/VisualBasic/Impl/BasicVSResources.resx @@ -315,10 +315,6 @@ Remove unnecessary imports {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - - Sort imports - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Prefer simplified object creation diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.cs.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.cs.xlf index 6754b224ea9b5..84a1def04bec8 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.cs.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.cs.xlf @@ -182,11 +182,6 @@ Importovat direktivy - - Sort imports - Seřadit direktivy Import - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Navrhovat importy pro typy v balíčcích _NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.de.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.de.xlf index df0ed3b678c4d..25dd17f7e540f 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.de.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.de.xlf @@ -182,11 +182,6 @@ Import-Direktiven - - Sort imports - Importe sortieren - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Import-Direktiven für Typen in _NuGet-Paketen vorschlagen diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.es.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.es.xlf index 4cee6d81709ef..b9fac78124ec8 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.es.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.es.xlf @@ -182,11 +182,6 @@ Directivas de importación - - Sort imports - Ordenar instrucciones Import - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Sugerir importaciones para tipos de paquetes _NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.fr.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.fr.xlf index 5f44e86f2b776..bc7b5d5411ccb 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.fr.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.fr.xlf @@ -182,11 +182,6 @@ Importer des directives - - Sort imports - Trier les Imports - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Suggérer des imports pour les types dans les packages _NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.it.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.it.xlf index b61b1d3b6dd23..2875c1089924e 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.it.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.it.xlf @@ -182,11 +182,6 @@ Direttive import - - Sort imports - Ordina direttive Import - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Suggerisci le direttive import per i tipi in pacchetti _NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ja.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ja.xlf index 282b439aaa355..0d5f609496cd6 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ja.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ja.xlf @@ -182,11 +182,6 @@ ディレクティブをインポートする - - Sort imports - import を並べ替える - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages NuGet パッケージの型に import を提案する(_N) diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ko.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ko.xlf index 9449f6e04513b..44a0191e1b8d8 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ko.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ko.xlf @@ -182,11 +182,6 @@ Import 지시문 - - Sort imports - import 정렬 - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages NuGet 패키지의 형식에 대한 import 제안(_N) diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pl.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pl.xlf index 220adee27b170..be4079612f862 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pl.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pl.xlf @@ -182,11 +182,6 @@ Dyrektywy import - - Sort imports - Sortuj dyrektywy Import - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Sugeruj dyrektywy import dla typów w pakietach _NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pt-BR.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pt-BR.xlf index 801d59f2a2d99..12bbbe50c8e6f 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pt-BR.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.pt-BR.xlf @@ -182,11 +182,6 @@ Importar Diretivas - - Sort imports - Classificar as imports - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Sugerir importações para tipos nos pacotes _NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ru.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ru.xlf index bdbdb33241570..18e80b678e73e 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ru.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.ru.xlf @@ -182,11 +182,6 @@ Директивы Import - - Sort imports - Сортировать импорты - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages Предлагать import для типов в _пакетах NuGet diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.tr.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.tr.xlf index 20749fed8fe6b..d5186e12e001b 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.tr.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.tr.xlf @@ -182,11 +182,6 @@ İçeri Aktarma Yönergeleri - - Sort imports - Import'ları sırala - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages _NuGet paketlerindeki türler için içeri aktarmalar öner diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hans.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hans.xlf index a1723e5a2642e..5d3359de43850 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hans.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hans.xlf @@ -182,11 +182,6 @@ Import 指令 - - Sort imports - 对 import 进行排序 - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages 建议对 NuGet 包中的类型使用 import(_N) diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hant.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hant.xlf index 5c73f3da6c0ff..b912f0c3e7c4b 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hant.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/BasicVSResources.zh-Hant.xlf @@ -182,11 +182,6 @@ Import 指示詞 - - Sort imports - 排序 Import - {Locked="Import"} 'import' is a Visual Basic keyword and should not be localized - Suggest imports for types in _NuGet packages 為 NuGet 套件中的類型建議 Import(_N) From dd4eff58983fc8dbe67e938d84df967cb1cbef1f Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:39:30 -0700 Subject: [PATCH 25/94] Fix --- src/Workspaces/Core/Portable/CodeActions/CodeAction.cs | 2 +- src/Workspaces/Core/Portable/WorkspacesResources.resx | 2 +- src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf | 4 ++-- .../Core/Portable/xlf/WorkspacesResources.pt-BR.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf | 4 ++-- src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf | 4 ++-- .../Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf | 4 ++-- .../Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf | 4 ++-- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs b/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs index 93876af77065f..9e9b300a91119 100644 --- a/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs +++ b/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs @@ -355,7 +355,7 @@ protected virtual async Task> ComputePreviewOpe internal async Task GetRequiredChangedSolutionAsync(IProgress progressTracker, CancellationToken cancellationToken) { var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false); - return solution ?? throw new InvalidOperationException(string.Format(WorkspacesResources.CodeAction__0__did_not_produce_a_changed_solution, this.Title)); + return solution ?? throw new InvalidOperationException(string.Format(WorkspacesResources.CodeAction_0_did_not_produce_a_changed_solution, this.Title)); } /// diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx index 1b0b032665437..30af82b7ba58f 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.resx +++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx @@ -530,7 +530,7 @@ Sync namespace to folder structure - + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf index ac324473a447d..c7abdd8d532ff 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf @@ -37,9 +37,9 @@ Změna dokumentu {0} není podporovaná. - + CodeAction '{0}' did not produce a changed solution - Příkaz CodeAction {0} nevytvořil změněné řešení. + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf index 50563db9c5a97..01c181a7809d1 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf @@ -37,9 +37,9 @@ Das Ändern des Dokuments "{0}" wird nicht unterstützt. - + CodeAction '{0}' did not produce a changed solution - Durch CodeAction "{0}" wurde keine geänderte Lösung erstellt. + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf index a5149db4d16df..dda83495fac4f 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf @@ -37,9 +37,9 @@ Documento cambiante '{0}' no es compatible. - + CodeAction '{0}' did not produce a changed solution - El tipo CodeAction "{0}" no generó una solución modificada + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf index b6f23e24a369d..940fb5165676d 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf @@ -37,9 +37,9 @@ Le changement du document '{0}' n'est pas pris en charge. - + CodeAction '{0}' did not produce a changed solution - Le CodeAction '{0}' n'a pas produit de solution contenant des changements + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf index f4d7e882691fd..539b498190836 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf @@ -37,9 +37,9 @@ La modifica del documento '{0}' non è supportata. - + CodeAction '{0}' did not produce a changed solution - L'elemento CodeAction '{0}' non ha generato una soluzione modificata + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf index e58c9e7958bc9..d0da42c10a81b 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf @@ -37,9 +37,9 @@ ドキュメント '{0}' の変更はサポートされていません。 - + CodeAction '{0}' did not produce a changed solution - CodeAction '{0}' は変更されたソリューションを生成しませんでした + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf index f4eb0b3f12e8d..b00d931d42926 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf @@ -37,9 +37,9 @@ '{0}' 문서 변경은 지원되지 않습니다. - + CodeAction '{0}' did not produce a changed solution - CodeAction '{0}'이(가) 변경된 솔루션을 생성하지 않았습니다. + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf index f4a02ca5ea954..801af22c332d3 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf @@ -37,9 +37,9 @@ Zmiana dokumentu „{0}” nie jest obsługiwana. - + CodeAction '{0}' did not produce a changed solution - Element CodeAction „{0}” nie utworzył zmienionego rozwiązania + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf index 2bb51a0124367..5a2782664e0e6 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf @@ -37,9 +37,9 @@ Não há suporte para alterar o documento '{0}'. - + CodeAction '{0}' did not produce a changed solution - A CodeAction '{0}' não produziu uma solução alterada + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf index 0a3f5e8d0751f..499df2a5d4326 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf @@ -37,9 +37,9 @@ Изменение документа "{0}" не поддерживается. - + CodeAction '{0}' did not produce a changed solution - Действие кода "{0}" не сформировало измененное решение. + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf index 8b2ed6925fc21..40abca5f83706 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf @@ -37,9 +37,9 @@ Değişen belge '{0}' desteklenmiyor. - + CodeAction '{0}' did not produce a changed solution - '{0}' CodeAction, değiştirilmiş çözüm üretmedi + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf index 852ead2dc7fef..a12e51182d7d7 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf @@ -37,9 +37,9 @@ 不支持更改文档“{0}”。 - + CodeAction '{0}' did not produce a changed solution - CodeAction "{0}" 未生成更改的解决方案 + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf index 2df8bf822dbf1..fa6de504d900e 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf @@ -37,9 +37,9 @@ 不支援變更文件 '{0}'。 - + CodeAction '{0}' did not produce a changed solution - CodeAction '{0}' 未產生變更的解決方案 + CodeAction '{0}' did not produce a changed solution "CodeAction" is a specific type, and {0} represents the title shown by the action. From b59bbe4653d942989948f1ab89a6807927cbf672 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:40:46 -0700 Subject: [PATCH 26/94] Remove unused resource string --- .../Core/Portable/WorkspacesResources.resx | 60 ----------- .../Portable/xlf/WorkspacesResources.cs.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.de.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.es.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.fr.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.it.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.ja.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.ko.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.pl.xlf | 100 ------------------ .../xlf/WorkspacesResources.pt-BR.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.ru.xlf | 100 ------------------ .../Portable/xlf/WorkspacesResources.tr.xlf | 100 ------------------ .../xlf/WorkspacesResources.zh-Hans.xlf | 100 ------------------ .../xlf/WorkspacesResources.zh-Hant.xlf | 100 ------------------ 14 files changed, 1360 deletions(-) diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx index 30af82b7ba58f..39e13ef0bb761 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.resx +++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx @@ -123,15 +123,9 @@ Symbol "{0}" is not from source. - - Documentation comment id must start with E, F, M, N, P or T - Cycle detected in extensions - - Node is of the wrong type. - Duplicate source file '{0}' in project '{1}' @@ -198,9 +192,6 @@ A project may not reference itself. - - The solution already contains the specified document. - The solution already contains the specified reference. @@ -228,30 +219,12 @@ Can't resolve analyzer reference: '{0}'. - - Invalid project block, expected "=" after Project. - - - Invalid project block, expected "," after project name. - - - Invalid project block, expected "," after project path. - Expected {0}. "{0}" must be a non-null and non-empty string. - - Expected header: "{0}". - - - Expected end-of-file. - - - Expected {0} line. - This submission already references another submission project. @@ -264,18 +237,9 @@ {0} is still open. - - Arrays with more than one dimension cannot be serialized. - Value too large to be represented as a 30 bit unsigned integer. - - Specified path must be absolute. - - - Unknown identifier. - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. @@ -309,9 +273,6 @@ Removed: - - Invalid CodePage value: {0} - Adding additional documents is not supported. @@ -324,9 +285,6 @@ Adding documents is not supported. - - Adding metadata references is not supported. - Adding project references is not supported. @@ -339,9 +297,6 @@ Changing documents is not supported. - - Changing project properties is not supported. - Removing additional documents is not supported. @@ -354,9 +309,6 @@ Removing documents is not supported. - - Removing metadata references is not supported. - Removing project references is not supported. @@ -369,15 +321,6 @@ Diagnostic must have span '{0}' - - Cannot deserialize type '{0}'. - - - Cannot serialize type '{0}'. - - - The type '{0}' is not understood by the serialization binder. - Label for node '{0}' is invalid, it must be within [0, {1}). @@ -441,9 +384,6 @@ Stream is too long. - - Deserialization reader for '{0}' read incorrect number of values. - Async Method {locked: async}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf index c7abdd8d532ff..01a6177cdbf0a 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf @@ -137,21 +137,11 @@ Symbol {0} nepochází ze zdroje. - - Documentation comment id must start with E, F, M, N, P or T - ID komentáře dokumentace musí začínat znakem E, F, M, N, P nebo T. - - Cycle detected in extensions V rozšířeních se zjistil cyklus. - - Node is of the wrong type. - Uzel je chybného typu. - - Duplicate source file '{0}' in project '{1}' Duplicitní zdrojový soubor {0} v projektu {1} @@ -302,11 +292,6 @@ Projekt už odkazuje na cílový projekt. - - The solution already contains the specified document. - Řešení už obsahuje zadaný dokument. - - Temporary storage cannot be written more than once. Do dočasného úložiště se nedá zapisovat víc než jednou. @@ -347,21 +332,6 @@ Nejde vyřešit odkaz na analyzátor: {0}. - - Invalid project block, expected "=" after Project. - Neplatný blok projektu; za projektem se očekával znak „=“. - - - - Invalid project block, expected "," after project name. - Neplatný blok projektu; za názvem projektu se očekával znak „,“. - - - - Invalid project block, expected "," after project path. - Neplatný blok projektu; za cestou k projektu se očekával znak „,“. - - Expected {0}. Očekávalo se {0}. @@ -372,21 +342,6 @@ {0} musí být neprázdný řetězec, který nemá hodnotu null. - - Expected header: "{0}". - Očekávaná hlavička: {0} - - - - Expected end-of-file. - Očekával se konec souboru. - - - - Expected {0} line. - Očekával se řádek {0}. - - This submission already references another submission project. Toto odeslání už odkazuje na jiný projekt odeslání. @@ -402,26 +357,11 @@ {0} je pořád otevřený. - - Arrays with more than one dimension cannot be serialized. - Pole s víc než jedním rozměrem nejsou serializované. - - Value too large to be represented as a 30 bit unsigned integer. Hodnota je moc velká, než aby se dala vyjádřit jako 30bitové nepodepsané celé číslo. - - Specified path must be absolute. - Zadaná cesta musí být absolutní. - - - - Unknown identifier. - Neznámý identifikátor - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Nejde otevřít projekt {0}, protože přípona souboru {1} není přidružená k jazyku. @@ -477,11 +417,6 @@ Odebráno: - - Invalid CodePage value: {0} - Neplatná hodnota CodePage: {0} - - Adding additional documents is not supported. Přidávání dalších dokumentů se nepodporuje. @@ -497,11 +432,6 @@ Přidávání dokumentů se nepodporuje. - - Adding metadata references is not supported. - Přidávání odkazů na metadata se nepodporuje. - - Adding project references is not supported. Přidávání odkazů na projekty se nepodporuje. @@ -517,11 +447,6 @@ Změna dokumentů se nepodporuje. - - Changing project properties is not supported. - Změna vlastností projektu se nepodporuje. - - Removing additional documents is not supported. Odebírání dalších dokumentů se nepodporuje. @@ -537,11 +462,6 @@ Odebírání dokumentů se nepodporuje. - - Removing metadata references is not supported. - Odebírání odkazů na metadata se nepodporuje. - - Removing project references is not supported. Odebírání odkazů na projekty se nepodporuje. @@ -562,21 +482,6 @@ Diagnostika musí mít rozpětí {0}. - - Cannot deserialize type '{0}'. - Typ {0} nejde deserializovat. - - - - Cannot serialize type '{0}'. - Typ {0} nejde serializovat. - - - - The type '{0}' is not understood by the serialization binder. - Vazač serializace nerozumí typu {0}. - - Label for node '{0}' is invalid, it must be within [0, {1}). Popisek uzlu {0} je neplatný. Musí být uzavřený v syntaxi [0, {1}). @@ -677,11 +582,6 @@ Stream je moc dlouhý. - - Deserialization reader for '{0}' read incorrect number of values. - Čtečka deserializace pro {0} přečetla nesprávný počet hodnot. - - Async Method Asynchronní metoda diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf index 01c181a7809d1..1f0421533b60b 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf @@ -137,21 +137,11 @@ Symbol "{0}" ist nicht aus Quelle. - - Documentation comment id must start with E, F, M, N, P or T - Dokumentationskommentar-ID muss mit E, F, M, N, P oder T beginnen - - Cycle detected in extensions Zyklus in Erweiterungen entdeckt - - Node is of the wrong type. - Knoten hat den falschen Typ. - - Duplicate source file '{0}' in project '{1}' Doppelte Quelldatei "{0}" in Projekt "{1}" @@ -302,11 +292,6 @@ Das Projekt verweist bereits auf das Zielprojekt. - - The solution already contains the specified document. - Die Lösung enthält bereits das angegebene Dokument. - - Temporary storage cannot be written more than once. Temporärer Speicher kann nicht mehr als einmal geschrieben werden. @@ -347,21 +332,6 @@ Analysereferenz kann nicht aufgelöst werden: "{0}". - - Invalid project block, expected "=" after Project. - Ungültiger Projektblock, erwartet wird "=" nach Projekt. - - - - Invalid project block, expected "," after project name. - Ungültiger Projektblock, erwartet wird "," nach Projektname. - - - - Invalid project block, expected "," after project path. - Ungültiger Projektblock, erwartet wird "," nach Projektpfad. - - Expected {0}. Erwartet wird {0}. @@ -372,21 +342,6 @@ "{0}" muss eine Zeichenfolge sein, die nicht null und nicht leer ist. - - Expected header: "{0}". - Erwartete Überschrift: "{0}". - - - - Expected end-of-file. - Erwartetes Dateiende. - - - - Expected {0} line. - Erwartete {0}-Zeile. - - This submission already references another submission project. Diese Übermittlung verweist bereits auf ein anderes Übermittlungsprojekt. @@ -402,26 +357,11 @@ "{0}" ist noch geöffnet. - - Arrays with more than one dimension cannot be serialized. - Arrays mit mehr als einer Dimension können nicht serialisiert werden. - - Value too large to be represented as a 30 bit unsigned integer. Der Wert ist zu groß, um als ganze 30-Bit-Zahl ohne Vorzeichen dargestellt zu werden. - - Specified path must be absolute. - Angegebener Pfad muss absolut sein. - - - - Unknown identifier. - Unbekannter Bezeichner. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Projekt "{0}" kann nicht geöffnet werden, da die Dateierweiterung "{1}" keiner Sprache zugeordnet ist. @@ -477,11 +417,6 @@ Entfernt: - - Invalid CodePage value: {0} - Ungültiger CodePage-Wert: {0} - - Adding additional documents is not supported. Das Hinzufügen weitere Dokumente wird nicht unterstützt. @@ -497,11 +432,6 @@ Das Hinzufügen von Dokumenten wird nicht unterstützt. - - Adding metadata references is not supported. - Das Hinzufügen von Verweisen auf Metadaten wird nicht unterstützt. - - Adding project references is not supported. Das Hinzufügen von Projektverweisen wird nicht unterstützt. @@ -517,11 +447,6 @@ Das Ändern von Dokumenten wird nicht unterstützt. - - Changing project properties is not supported. - Das Ändern von Projekteigenschaften wird nicht unterstützt. - - Removing additional documents is not supported. Das Entfernen weiterer Dokumente wird nicht unterstützt. @@ -537,11 +462,6 @@ Das Entfernen von Dokumenten wird nicht unterstützt. - - Removing metadata references is not supported. - Das Entfernen von Verweisen auf Metadaten wird nicht unterstützt. - - Removing project references is not supported. Das Entfernen von Projektverweisen wird nicht unterstützt. @@ -562,21 +482,6 @@ Diagnose muss den Bereich "{0}" enthalten - - Cannot deserialize type '{0}'. - Typ "{0}" kann nicht deserialisiert werden. - - - - Cannot serialize type '{0}'. - Typ "{0}" kann nicht serialisiert werden. - - - - The type '{0}' is not understood by the serialization binder. - Der Typ "{0}" wird vom Serialisierungsbinder nicht verstanden. - - Label for node '{0}' is invalid, it must be within [0, {1}). Die Bezeichnung für Knoten '{0}' ist ungültig, sie muss innerhalb von [0, {1}) liegen. @@ -677,11 +582,6 @@ Der Datenstrom ist zu lang. - - Deserialization reader for '{0}' read incorrect number of values. - Der Deserialisierungsreader für "{0}" hat eine falsche Anzahl von Werten gelesen. - - Async Method Asynchrone Methode diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf index dda83495fac4f..2210f10672a40 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf @@ -137,21 +137,11 @@ El símbolo "{0}" no procede del código fuente. - - Documentation comment id must start with E, F, M, N, P or T - El Id. del comentario de la documentación debe comenzar por E, F, M, N, P o T - - Cycle detected in extensions Detectado ciclo en extensiones - - Node is of the wrong type. - El nodo es del tipo erróneo. - - Duplicate source file '{0}' in project '{1}' Archivo de código fuente '{0}' duplicado en el proyecto '{1}' @@ -302,11 +292,6 @@ El proyecto ya hace referencia al proyecto de destino. - - The solution already contains the specified document. - La solución ya contiene el documento especificado. - - Temporary storage cannot be written more than once. No se puede escribir más de una vez en el almacenamiento temporal. @@ -347,21 +332,6 @@ No se puede resolver la referencia del analizador: '{0}'. - - Invalid project block, expected "=" after Project. - Bloque de proyecto no válido, se esperaba "=" después de Project. - - - - Invalid project block, expected "," after project name. - Bloque de proyecto no válido, se esperaba "," después del nombre del proyecto. - - - - Invalid project block, expected "," after project path. - Bloque de proyecto no válido, se esperaba "," después de la ruta de acceso del proyecto. - - Expected {0}. Se esperaba {0}. @@ -372,21 +342,6 @@ "{0}" debe ser una cadena que no sea Null ni esté vacía. - - Expected header: "{0}". - Se esperaba encabezado: "{0}". - - - - Expected end-of-file. - Se esperaba fin de archivo. - - - - Expected {0} line. - Se esperaba línea {0}. - - This submission already references another submission project. Este envío ya hace referencia a otro proyecto de envío. @@ -402,26 +357,11 @@ {0} aún está abierto. - - Arrays with more than one dimension cannot be serialized. - Las matrices con más de una dimensión no se pueden serializar. - - Value too large to be represented as a 30 bit unsigned integer. Valor demasiado largo para representarse como entero sin signo de 30 bits. - - Specified path must be absolute. - La ruta de acceso especificada debe ser absoluta. - - - - Unknown identifier. - Identificador desconocido. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. No se puede abrir el proyecto '{0}' porque la extensión de archivo '{1}' no está asociada a un lenguaje. @@ -477,11 +417,6 @@ Quitado: - - Invalid CodePage value: {0} - Valor de página de códigos no válido: {0} - - Adding additional documents is not supported. No se permite agregar documentos adicionales. @@ -497,11 +432,6 @@ No se permite agregar documentos. - - Adding metadata references is not supported. - No se permite agregar referencias de metadatos. - - Adding project references is not supported. No se permite agregar referencias de proyectos. @@ -517,11 +447,6 @@ No se permite cambiar documentos. - - Changing project properties is not supported. - No se permite cambiar propiedades de proyectos. - - Removing additional documents is not supported. No se permite quitar documentos adicionales. @@ -537,11 +462,6 @@ No se permite quitar documentos. - - Removing metadata references is not supported. - No se permite quitar referencias de metadatos. - - Removing project references is not supported. No se permite quitar referencias de proyectos. @@ -562,21 +482,6 @@ El diagnóstico debe tener el intervalo '{0}' - - Cannot deserialize type '{0}'. - No se puede deserializar el tipo "{0}". - - - - Cannot serialize type '{0}'. - No se puede serializar el tipo "{0}". - - - - The type '{0}' is not understood by the serialization binder. - El enlazador de serialización no comprende el tipo "{0}". - - Label for node '{0}' is invalid, it must be within [0, {1}). La etiqueta para el nodo "{0}" no es válida; debe estar dentro del intervalo [0, {1}). @@ -677,11 +582,6 @@ Secuencia demasiado larga. - - Deserialization reader for '{0}' read incorrect number of values. - El lector de deserialización de "{0}" leyó un número incorrecto de valores. - - Async Method Metodo asincrónico diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf index 940fb5165676d..bb45ae4e0a334 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf @@ -137,21 +137,11 @@ Le symbole "{0}" ne provient pas de la source. - - Documentation comment id must start with E, F, M, N, P or T - L'ID du commentaire de documentation doit commencer par E, F, M, N, P ou T - - Cycle detected in extensions Cycle détecté dans les extensions - - Node is of the wrong type. - Le type de nœud est incorrect. - - Duplicate source file '{0}' in project '{1}' Dupliquer le fichier source '{0}' dans le projet '{1}' @@ -302,11 +292,6 @@ Le projet référence déjà le projet cible. - - The solution already contains the specified document. - La solution contient déjà le document spécifié. - - Temporary storage cannot be written more than once. Il est impossible d'écrire plusieurs fois dans le stockage temporaire. @@ -347,21 +332,6 @@ Impossible de résoudre la référence de l'analyseur : '{0}'. - - Invalid project block, expected "=" after Project. - Bloc de projet non valide, "=" attendu après Project. - - - - Invalid project block, expected "," after project name. - Bloc de projet non valide, "," attendu après le nom du projet. - - - - Invalid project block, expected "," after project path. - Bloc de projet non valide, "," attendu après le chemin d'accès au projet. - - Expected {0}. {0} attendu. @@ -372,21 +342,6 @@ "{0}" doit être une chaîne non null et non vide. - - Expected header: "{0}". - En-tête attendu : "{0}". - - - - Expected end-of-file. - Fin de fichier attendue. - - - - Expected {0} line. - Ligne {0} attendue. - - This submission already references another submission project. Cette soumission référence déjà un autre projet de soumission. @@ -402,26 +357,11 @@ {0} est toujours ouvert. - - Arrays with more than one dimension cannot be serialized. - Impossible de sérialiser les tableaux de plus d'une dimension. - - Value too large to be represented as a 30 bit unsigned integer. La valeur est trop grande pour être représentée comme un entier non signé 30 bits. - - Specified path must be absolute. - Le chemin d'accès spécifié doit être absolu. - - - - Unknown identifier. - Identificateur inconnu. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Impossible d'ouvrir le projet '{0}', car l'extension de fichier '{1}' n'est pas associée à un langage. @@ -477,11 +417,6 @@ Supprimé : - - Invalid CodePage value: {0} - Valeur de CodePage non valide : {0} - - Adding additional documents is not supported. L'ajout de documents supplémentaires n'est pas pris en charge. @@ -497,11 +432,6 @@ L'ajout de documents n'est pas pris en charge. - - Adding metadata references is not supported. - L'ajout de références de métadonnées n'est pas pris en charge. - - Adding project references is not supported. L'ajout de références de projet n'est pas pris en charge. @@ -517,11 +447,6 @@ La modification de documents n'est pas prise en charge. - - Changing project properties is not supported. - La modification des propriétés de projet n'est pas prise en charge. - - Removing additional documents is not supported. La suppression de documents supplémentaires n'est pas prise en charge. @@ -537,11 +462,6 @@ La suppression de documents n'est pas prise en charge. - - Removing metadata references is not supported. - La suppression de références de métadonnées n'est pas prise en charge. - - Removing project references is not supported. La suppression de références de projet n'est pas prise en charge. @@ -562,21 +482,6 @@ Le diagnostic doit avoir l'étendue '{0}' - - Cannot deserialize type '{0}'. - Impossible de désérialiser le type '{0}'. - - - - Cannot serialize type '{0}'. - Impossible de sérialiser le type '{0}'. - - - - The type '{0}' is not understood by the serialization binder. - Le type '{0}' n'est pas pris en charge par le binder de sérialisation. - - Label for node '{0}' is invalid, it must be within [0, {1}). L’étiquette pour le nœud « {0} » n’est pas valide. Elle doit être comprise dans l’intervalle suivant [0, {1}). @@ -677,11 +582,6 @@ Le flux est trop long. - - Deserialization reader for '{0}' read incorrect number of values. - Le lecteur de désérialisation pour '{0}' a lu un nombre incorrect de valeurs. - - Async Method Méthode async diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf index 539b498190836..2859f6de346ec 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf @@ -137,21 +137,11 @@ Il simbolo "{0}" non proviene dall'origine. - - Documentation comment id must start with E, F, M, N, P or T - L'ID commento della documentazione deve iniziare con E, F, M, N, P o T - - Cycle detected in extensions È stato rilevato un ciclo nelle estensioni - - Node is of the wrong type. - Il tipo del nodo è errato. - - Duplicate source file '{0}' in project '{1}' File di origine '{0}' duplicato nel progetto '{1}' @@ -302,11 +292,6 @@ Il progetto fa già riferimento al progetto di destinazione. - - The solution already contains the specified document. - La soluzione contiene già il documento specificato. - - Temporary storage cannot be written more than once. L'archivio temporaneo non può essere scritto più di una volta. @@ -347,21 +332,6 @@ Non è possibile risolvere il riferimento all'analizzatore: '{0}'. - - Invalid project block, expected "=" after Project. - Il blocco di progetto non è valido. È previsto "=" dopo Project. - - - - Invalid project block, expected "," after project name. - Il blocco di progetto non è valido. È previsto "," dopo il nome del progetto. - - - - Invalid project block, expected "," after project path. - Il blocco di progetto non è valido. È previsto "," dopo il percorso del progetto. - - Expected {0}. È previsto '{0}'. @@ -372,21 +342,6 @@ "{0}" deve essere una stringa non Null e non vuota. - - Expected header: "{0}". - È prevista un'intestazione: "{0}". - - - - Expected end-of-file. - È prevista la fine del file. - - - - Expected {0} line. - È prevista la riga {0}. - - This submission already references another submission project. Questo invio fa già riferimento a un altro progetto di invio. @@ -402,26 +357,11 @@ {0} è ancora aperto. - - Arrays with more than one dimension cannot be serialized. - Non è possibile serializzare le matrice con più di una dimensione. - - Value too large to be represented as a 30 bit unsigned integer. Il valore è troppo grande per essere rappresentato come intero senza segno a 30 bit. - - Specified path must be absolute. - Il percorso specificato deve essere assoluto. - - - - Unknown identifier. - Identificatore sconosciuto. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Non è possibile aprire il progetto '{0}' perché l'estensione di file '{1}' non è associata a un linguaggio. @@ -477,11 +417,6 @@ Elementi rimossi: - - Invalid CodePage value: {0} - Valore di CodePage non valido: {0} - - Adding additional documents is not supported. L'aggiunta di altri documenti non è supportata. @@ -497,11 +432,6 @@ L'aggiunta di documenti non è supportata. - - Adding metadata references is not supported. - L'aggiunta di riferimenti ai metadati non è supportata. - - Adding project references is not supported. L'aggiunta di riferimenti al progetto non è supportata. @@ -517,11 +447,6 @@ La modifica di documenti non è supportata. - - Changing project properties is not supported. - La modifica delle proprietà del progetto non è supportata. - - Removing additional documents is not supported. La rimozione di altri documenti non è supportata. @@ -537,11 +462,6 @@ La rimozione di documenti non è supportata. - - Removing metadata references is not supported. - La rimozione di riferimenti ai metadati non è supportata. - - Removing project references is not supported. La rimozione di riferimenti al progetto non è supportata. @@ -562,21 +482,6 @@ La diagnostica deve contenere l'elemento span '{0}' - - Cannot deserialize type '{0}'. - Non è possibile deserializzare il tipo '{0}'. - - - - Cannot serialize type '{0}'. - Non è possibile serializzare il tipo '{0}'. - - - - The type '{0}' is not understood by the serialization binder. - Il tipo '{0}' non è riconosciuto dal binder di serializzazioni. - - Label for node '{0}' is invalid, it must be within [0, {1}). L'etichetta del nodo '{0}' non è valida. Deve essere compresa tra [0, {1}). @@ -677,11 +582,6 @@ Il flusso è troppo lungo. - - Deserialization reader for '{0}' read incorrect number of values. - Il numero di valori letto dal lettore di deserializzazioni per '{0}' non è corretto. - - Async Method Metodo asincrono diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf index d0da42c10a81b..71c364b2a340f 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf @@ -137,21 +137,11 @@ シンボル "{0}" は、ソースからではありません。 - - Documentation comment id must start with E, F, M, N, P or T - ドキュメント コメントの ID は、E、F、M、N、P、または T で始まらなければなりません - - Cycle detected in extensions 拡張機能で循環が検出されました - - Node is of the wrong type. - ノードの種類が正しくありません。 - - Duplicate source file '{0}' in project '{1}' プロジェクト '{1}' でソース ファイル '{0}' が重複しています @@ -302,11 +292,6 @@ プロジェクトは、既に対象のプロジェクトを参照します。 - - The solution already contains the specified document. - ソリューションには、指定されたドキュメントが既に含まれています。 - - Temporary storage cannot be written more than once. 一時的な記憶域は、2 回以上書き込みできません。 @@ -347,21 +332,6 @@ アナライザーの参照を解決できません: '{0}'。 - - Invalid project block, expected "=" after Project. - プロジェクト ブロックが正しくありません。プロジェクトの後に "=" が必要です。 - - - - Invalid project block, expected "," after project name. - プロジェクト ブロックが正しくありません。プロジェクト名の後に "," が必要です。 - - - - Invalid project block, expected "," after project path. - プロジェクト ブロックが正しくありません。プロジェクト パスの後に "," が必要です。 - - Expected {0}. {0} が必要です。 @@ -372,21 +342,6 @@ "{0}" は、Null 以外の空でない文字列にする必要があります。 - - Expected header: "{0}". - ヘッダーが必要です: "{0}"。 - - - - Expected end-of-file. - EOF が必要です。 - - - - Expected {0} line. - {0} 行が必要です。 - - This submission already references another submission project. この送信は、既に別の送信プロジェクトを参照しています。 @@ -402,26 +357,11 @@ {0} が開いたままです。 - - Arrays with more than one dimension cannot be serialized. - 複数の次元を持つ配列はシリアル化できません。 - - Value too large to be represented as a 30 bit unsigned integer. 値が大きすぎるため、30 ビットの符号なし整数として表すことができません。 - - Specified path must be absolute. - 絶対パスを指定する必要があります。 - - - - Unknown identifier. - 不明な識別子です。 - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. ファイルの拡張子 '{1}' が言語に関連付けられていないため、プロジェクト '{0}' を開くことができません。 @@ -477,11 +417,6 @@ 削除済み: - - Invalid CodePage value: {0} - 無効なコードページの値: {0} - - Adding additional documents is not supported. 追加ドキュメントの追加はサポートされていません。 @@ -497,11 +432,6 @@ ドキュメントの追加はサポートされていません。 - - Adding metadata references is not supported. - メタデータ参照の追加はサポートされていません。 - - Adding project references is not supported. プロジェクト参照の追加はサポートされていません。 @@ -517,11 +447,6 @@ ドキュメントの変更はサポートされていません。 - - Changing project properties is not supported. - プロジェクトのプロパティの変更はサポートされていません。 - - Removing additional documents is not supported. 追加ドキュメントの削除はサポートされていません。 @@ -537,11 +462,6 @@ ドキュメントの削除はサポートされていません。 - - Removing metadata references is not supported. - メタデータ参照の削除はサポートされていません。 - - Removing project references is not supported. プロジェクト参照の削除はサポートされていません。 @@ -562,21 +482,6 @@ 診断の範囲は '{0}' でなければなりません - - Cannot deserialize type '{0}'. - 型 '{0}' を逆シリアル化できません。 - - - - Cannot serialize type '{0}'. - 型 '{0}' をシリアル化できません。 - - - - The type '{0}' is not understood by the serialization binder. - 型 '{0}' がシリアル化バインダーで認識されません。 - - Label for node '{0}' is invalid, it must be within [0, {1}). ノード '{0}' のラベルが無効です。[0, {1}) 内になければなりません。 @@ -677,11 +582,6 @@ ストリームが長すぎます。 - - Deserialization reader for '{0}' read incorrect number of values. - '{0}' の逆シリアル化のリーダーが、正しくない数の値を読み取りました。 - - Async Method 非同期メソッド diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf index b00d931d42926..610a8d087a4a6 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf @@ -137,21 +137,11 @@ "{0}" 기호가 소스에 없습니다. - - Documentation comment id must start with E, F, M, N, P or T - 문서 주석 ID는 E, F, M, N, P 또는 T로 시작해야 합니다. - - Cycle detected in extensions 확장에서 순환 발견 - - Node is of the wrong type. - 잘못된 형식의 노드입니다. - - Duplicate source file '{0}' in project '{1}' '{1}' 프로젝트에서 중복된 '{0}' 소스 파일입니다. @@ -302,11 +292,6 @@ 프로젝트가 대상 프로젝트를 이미 참조하고 있습니다. - - The solution already contains the specified document. - 솔루션에 지정한 문서가 이미 포함되어 있습니다. - - Temporary storage cannot be written more than once. 임시 스토리지는 두 번 쓸 수 없습니다. @@ -347,21 +332,6 @@ 분석기 참조를 확인할 수 없습니다('{0}'). - - Invalid project block, expected "=" after Project. - 잘못된 프로젝트 블록입니다. Project 다음에 "="가 필요합니다. - - - - Invalid project block, expected "," after project name. - 잘못된 프로젝트 블록입니다. 프로젝트 이름 다음에 ","가 필요합니다. - - - - Invalid project block, expected "," after project path. - 잘못된 프로젝트 블록입니다. 프로젝트 경로 다음에 ","가 필요합니다. - - Expected {0}. {0}이(가) 필요합니다. @@ -372,21 +342,6 @@ "{0}"은(는) null이 아니거나 비어 있지 않은 문자열이어야 합니다. - - Expected header: "{0}". - 헤더가 필요합니다("{0}"). - - - - Expected end-of-file. - 파일 끝(EOF)이 필요합니다. - - - - Expected {0} line. - {0} 줄이 필요합니다. - - This submission already references another submission project. 이 전송은 이미 다른 전송 프로젝트가 참조했습니다. @@ -402,26 +357,11 @@ {0}이(가) 열려 있습니다. - - Arrays with more than one dimension cannot be serialized. - 차원이 두 개 이상인 배열을 직렬화할 수 없습니다. - - Value too large to be represented as a 30 bit unsigned integer. 값이 너무 커서 30비트 정수로 표시할 수 없습니다. - - Specified path must be absolute. - 지정한 경로가 절대 경로여야 합니다. - - - - Unknown identifier. - 알 수 없는 식별자입니다. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. '{1}' 파일 확장명이 언어에 연결되어 있지 않아 '{0}' 프로젝트를 열 수 없습니다. @@ -477,11 +417,6 @@ 제거됨: - - Invalid CodePage value: {0} - 잘못된 CodePage 값: {0} - - Adding additional documents is not supported. 추가 문서 추가는 지원되지 않았습니다. @@ -497,11 +432,6 @@ 문서 추가는 지원되지 않습니다. - - Adding metadata references is not supported. - 메타데이터 참조 추가는 지원되지 않습니다. - - Adding project references is not supported. 프로젝트 참조 추가는 지원되지 않습니다. @@ -517,11 +447,6 @@ 문서 변경은 지원되지 않습니다. - - Changing project properties is not supported. - 프로젝트 속성 변경은 지원되지 않습니다. - - Removing additional documents is not supported. 추가 문서 제거는 지원되지 않습니다. @@ -537,11 +462,6 @@ 문서 제거는 지원되지 않습니다. - - Removing metadata references is not supported. - 메타데이터 참조 제거는 지원되지 않습니다. - - Removing project references is not supported. 프로젝트 참조 제거는 지원되지 않습니다. @@ -562,21 +482,6 @@ 진단에는 '{0}' 범위가 있어야 합니다. - - Cannot deserialize type '{0}'. - '{0}' 형식을 역직렬화할 수 없습니다. - - - - Cannot serialize type '{0}'. - '{0}' 형식을 직렬화할 수 없습니다. - - - - The type '{0}' is not understood by the serialization binder. - 직렬화 바인더가 '{0}' 형식을 인식할 수 없습니다. - - Label for node '{0}' is invalid, it must be within [0, {1}). '{0}' 노드의 레이블이 잘못되었습니다. [0, {1}) 내에 있어야 합니다. @@ -677,11 +582,6 @@ 스트림이 너무 깁니다. - - Deserialization reader for '{0}' read incorrect number of values. - '{0}'에 대한 역직렬화 판독기가 잘못된 숫자 값을 읽습니다. - - Async Method 비동기 메서드 diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf index 801af22c332d3..978ac0bbe0bc0 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf @@ -137,21 +137,11 @@ Symbol „{0}” nie pochodzi ze źródła. - - Documentation comment id must start with E, F, M, N, P or T - Identyfikator komentarza do dokumentacji musi rozpoczynać się od litery E, F, M, N, P lub T - - Cycle detected in extensions W rozszerzeniach wykryto cykl - - Node is of the wrong type. - Węzeł ma nieprawidłowy typ. - - Duplicate source file '{0}' in project '{1}' Zduplikowany plik źródłowy „{0}” w projekcie „{1}” @@ -302,11 +292,6 @@ Projekt już przywołuje projekt docelowy. - - The solution already contains the specified document. - Rozwiązanie już zawiera określony dokument. - - Temporary storage cannot be written more than once. W tymczasowym magazynie nie można zapisać więcej niż raz. @@ -347,21 +332,6 @@ Nie można rozpoznać odwołania do analizatora: „{0}”. - - Invalid project block, expected "=" after Project. - Nieprawidłowy blok projektu, oczekiwano znaku „=” po elemencie Project. - - - - Invalid project block, expected "," after project name. - Nieprawidłowy blok projektu, oczekiwano znaku „,” (przecinek) po nazwie projektu. - - - - Invalid project block, expected "," after project path. - Nieprawidłowy blok projektu, oczekiwano znaku „,” (przecinek) po ścieżce projektu. - - Expected {0}. Oczekiwano elementu {0}. @@ -372,21 +342,6 @@ Element „{0}” musi być ciągiem, który nie ma wartości null i nie jest pusty. - - Expected header: "{0}". - Oczekiwano nagłówka: „{0}”. - - - - Expected end-of-file. - Oczekiwano końca pliku. - - - - Expected {0} line. - Oczekiwano wiersza {0}. - - This submission already references another submission project. Ten przesłany element przywołuje już inny przesłany projekt. @@ -402,26 +357,11 @@ Element {0} jest nadal otwarty. - - Arrays with more than one dimension cannot be serialized. - Nie można przeprowadzić serializacji tablic z więcej niż jednym wymiarem. - - Value too large to be represented as a 30 bit unsigned integer. Wartość jest zbyt duża, dlatego nie może być reprezentowana jako 30-bitowa liczba całkowita bez znaku. - - Specified path must be absolute. - Należy określić ścieżkę bezwzględną. - - - - Unknown identifier. - Nieznany identyfikator. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Nie można otworzyć projektu „{0}”, ponieważ rozszerzenie pliku „{1}” nie jest skojarzone z językiem. @@ -477,11 +417,6 @@ Usunięto: - - Invalid CodePage value: {0} - Nieprawidłowa wartość strony kodowej: {0} - - Adding additional documents is not supported. Dodawanie kolejnych dokumentów nie jest obsługiwane. @@ -497,11 +432,6 @@ Dodawanie dokumentów nie jest obsługiwane. - - Adding metadata references is not supported. - Dodawanie odwołań metadanych nie jest obsługiwane. - - Adding project references is not supported. Dodawanie odwołań projektów nie jest obsługiwane. @@ -517,11 +447,6 @@ Modyfikowanie dokumentów nie jest obsługiwane. - - Changing project properties is not supported. - Modyfikowanie właściwości projektów nie jest obsługiwane. - - Removing additional documents is not supported. Usuwanie dodatkowych dokumentów nie jest obsługiwane. @@ -537,11 +462,6 @@ Usuwanie dokumentów nie jest obsługiwane. - - Removing metadata references is not supported. - Usuwanie odwołań metadanych nie jest obsługiwane. - - Removing project references is not supported. Usuwanie odwołań projektów nie jest obsługiwane. @@ -562,21 +482,6 @@ Informacje diagnostyczne muszą mieć zakres „{0}” - - Cannot deserialize type '{0}'. - Nie można deserializować typu „{0}”. - - - - Cannot serialize type '{0}'. - Nie można serializować typu „{0}”. - - - - The type '{0}' is not understood by the serialization binder. - Typ „{0}” nie jest zrozumiały dla integratora serializacji. - - Label for node '{0}' is invalid, it must be within [0, {1}). Etykieta dla węzła „{0}” jest nieprawidłowa, musi być z zakresu [0, {1}). @@ -677,11 +582,6 @@ Strumień jest za długi. - - Deserialization reader for '{0}' read incorrect number of values. - Czytnik deserializacji dla elementu „{0}” odczytuje nieprawidłową liczbę wartości. - - Async Method Metoda asynchroniczna diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf index 5a2782664e0e6..0c2903fd16493 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf @@ -137,21 +137,11 @@ Símbolo "{0}" não é da fonte. - - Documentation comment id must start with E, F, M, N, P or T - Identificação do comentário de documentação deve começar com E, F, M, N, P ou T - - Cycle detected in extensions Ciclo detectado em extensões - - Node is of the wrong type. - O nó é do tipo errado. - - Duplicate source file '{0}' in project '{1}' Arquivo de origem duplicado "{0}" no projeto "{1}" @@ -302,11 +292,6 @@ O projeto já referencia o projeto de destino. - - The solution already contains the specified document. - A solução já contém o documento especificado. - - Temporary storage cannot be written more than once. Armazenamento temporário não pode ser gravado mais de uma vez. @@ -347,21 +332,6 @@ Não é possível resolver a referência do analisador: "{0}". - - Invalid project block, expected "=" after Project. - Bloco de projetos inválido, esperado "=" após Projeto. - - - - Invalid project block, expected "," after project name. - Bloco de projetos inválido, esperado "," após nome do projeto. - - - - Invalid project block, expected "," after project path. - Bloco de projetos inválido, esperado "," após caminho do projeto. - - Expected {0}. Esperado {0}. @@ -372,21 +342,6 @@ "{0}" deve ser uma cadeia de caracteres não nula e não vazia. - - Expected header: "{0}". - Cabeçalho esperado: "{0}". - - - - Expected end-of-file. - Fim de arquivo esperado. - - - - Expected {0} line. - Linha {0} esperada. - - This submission already references another submission project. Este envio já faz referência a outro projeto de envio. @@ -402,26 +357,11 @@ {0} ainda está aberto. - - Arrays with more than one dimension cannot be serialized. - As matrizes com mais de uma dimensão não podem ser serializadas. - - Value too large to be represented as a 30 bit unsigned integer. Valor muito grande para ser representado como um inteiro não assinado de 30 bits. - - Specified path must be absolute. - Caminho especificado deve ser absoluto. - - - - Unknown identifier. - Identificador desconhecido. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Não é possível abrir o projeto "{0}" porque a extensão de arquivo "{1}" não está associada a um idioma. @@ -477,11 +417,6 @@ Removido: - - Invalid CodePage value: {0} - Valor CodePage inválido: {0} - - Adding additional documents is not supported. Não há suporte para a adição de documentos adicionais. @@ -497,11 +432,6 @@ Não há suporte para a adição de documentos. - - Adding metadata references is not supported. - Não há suporte para a adição de referências de metadados. - - Adding project references is not supported. Não há suporte para a adição de referências de projeto. @@ -517,11 +447,6 @@ Não há suporte para a alteração de documentos. - - Changing project properties is not supported. - Não há suporte para a alteração de propriedades do projeto. - - Removing additional documents is not supported. Não há suporte para a remoção de documentos adicionais. @@ -537,11 +462,6 @@ Não há suporte para a remoção de documentos. - - Removing metadata references is not supported. - Não há suporte para a remoção de referências de metadado. - - Removing project references is not supported. Não há suporte para a remoção de referências do projeto. @@ -562,21 +482,6 @@ O diagnóstico deve ter a extensão '{0}' - - Cannot deserialize type '{0}'. - Não é possível desserializar o tipo '{0}'. - - - - Cannot serialize type '{0}'. - Não é possível serializar o tipo '{0}'. - - - - The type '{0}' is not understood by the serialization binder. - O tipo '{0}' não é reconhecido pelo associador de serialização. - - Label for node '{0}' is invalid, it must be within [0, {1}). O rótulo do nó '{0}' é inválido, ele deve estar contido em [0, {1}). @@ -677,11 +582,6 @@ O fluxo é muito longo. - - Deserialization reader for '{0}' read incorrect number of values. - O leitor de desserialização para '{0}' lê o número incorreto de valores. - - Async Method Método Assíncrono diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf index 499df2a5d4326..0795ab056bb85 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf @@ -137,21 +137,11 @@ Символ "{0}" не из источника. - - Documentation comment id must start with E, F, M, N, P or T - Идентификатор комментария документа должен начинаться с E, F, M, N, P или T - - Cycle detected in extensions В выражениях обнаружен цикл - - Node is of the wrong type. - Узел имеет неверный тип. - - Duplicate source file '{0}' in project '{1}' Дублирование исходного файла "{0}" в проекте "{1}" @@ -302,11 +292,6 @@ Проект уже ссылается на целевой проект. - - The solution already contains the specified document. - Указанный документ уже находится в решении. - - Temporary storage cannot be written more than once. Невозможно записать более одного раза во временное хранилище. @@ -347,21 +332,6 @@ Не удается разрешить ссылку анализатора: "{0}". - - Invalid project block, expected "=" after Project. - Недопустимый блок проекта, ожидается "=" после указания проекта. - - - - Invalid project block, expected "," after project name. - Недопустимый блок проекта, ожидается "," после указания имени проекта. - - - - Invalid project block, expected "," after project path. - Недопустимый блок проекта, ожидается "," после указания пути к проекту. - - Expected {0}. Требуется {0}. @@ -372,21 +342,6 @@ "{0}" не должен равняться Null и пустой строке. - - Expected header: "{0}". - Требуется заголовок: "{0}". - - - - Expected end-of-file. - Требуется признак конца файла - - - - Expected {0} line. - Требуется {0} строка. - - This submission already references another submission project. Отправка уже ссылается на другой проект отправки. @@ -402,26 +357,11 @@ {0} все еще открыт. - - Arrays with more than one dimension cannot be serialized. - Массивы с несколькими измерениями нельзя сериализовать. - - Value too large to be represented as a 30 bit unsigned integer. Слишком большое значение для представления в виде 30-разрядного целого числа без знака. - - Specified path must be absolute. - Указанный путь должен быть абсолютным. - - - - Unknown identifier. - Неизвестный идентификатор. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Не удается открыть проект "{0}", так как расширение файла "{1}" не связано с языком. @@ -477,11 +417,6 @@ Удалено: - - Invalid CodePage value: {0} - Недопустимое значение CodePage: {0} - - Adding additional documents is not supported. Добавление дополнительных документов не поддерживается. @@ -497,11 +432,6 @@ Добавление документов не поддерживается. - - Adding metadata references is not supported. - Добавление ссылок на метаданные не поддерживается. - - Adding project references is not supported. Добавление ссылок на проекты не поддерживается. @@ -517,11 +447,6 @@ Изменение документов не поддерживается. - - Changing project properties is not supported. - Изменение свойств проекта не поддерживается. - - Removing additional documents is not supported. Удаление дополнительных документов не поддерживается. @@ -537,11 +462,6 @@ Удаление документов не поддерживается. - - Removing metadata references is not supported. - Удаление ссылок на метаданные не поддерживается. - - Removing project references is not supported. Удаление ссылок на проекты не поддерживается. @@ -562,21 +482,6 @@ Диагностика должна находиться в диапазоне "{0}" - - Cannot deserialize type '{0}'. - Невозможно десериализовать тип "{0}". - - - - Cannot serialize type '{0}'. - Невозможно сериализовать тип "{0}". - - - - The type '{0}' is not understood by the serialization binder. - Тип "{0}" не распознан модулем привязки сериализации. - - Label for node '{0}' is invalid, it must be within [0, {1}). Метка для узла "{0}" недопустима; она должна находиться в диапазоне [0, {1}). @@ -677,11 +582,6 @@ Слишком длинный поток. - - Deserialization reader for '{0}' read incorrect number of values. - Считыватель десериализации для "{0}" считал неверное количество значений. - - Async Method Асинхронный метод diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf index 40abca5f83706..90339083761b3 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf @@ -137,21 +137,11 @@ "{0}" sembolü kaynağa ait değil. - - Documentation comment id must start with E, F, M, N, P or T - Belge açıklaması kimliği E, F, M, N, P veya T ile başlamalıdır - - Cycle detected in extensions Uzantılarda döngü algılandı - - Node is of the wrong type. - Düğüm yanlış türde. - - Duplicate source file '{0}' in project '{1}' '{1}' projesinde yinelenen kaynak dosyası '{0}' @@ -302,11 +292,6 @@ Proje zaten hedef projeye başvuruyor. - - The solution already contains the specified document. - Çözüm belirtilen belgeyi zaten içeriyor. - - Temporary storage cannot be written more than once. Geçici depolamaya birden fazla kez yazılamaz. @@ -347,21 +332,6 @@ Çözümleyici başvurusu çözümlenemiyor: '{0}'. - - Invalid project block, expected "=" after Project. - Proje bloğu geçersiz, Proje'den sonra "=" bekleniyor. - - - - Invalid project block, expected "," after project name. - Proje bloğu geçersiz, proje adından sonra "," bekleniyor. - - - - Invalid project block, expected "," after project path. - Proje bloğu geçersiz, proje yolundan sonra "," bekleniyor. - - Expected {0}. {0} bekleniyor. @@ -372,21 +342,6 @@ "{0}" null olmayan ve boş olmayan bir dize olmalıdır. - - Expected header: "{0}". - Üst bilgi bekleniyor: "{0}". - - - - Expected end-of-file. - Dosya sonu bekleniyor. - - - - Expected {0} line. - {0} satırı bekleniyor. - - This submission already references another submission project. Bu gönderim zaten farklı bir gönderim projesine başvuruyor. @@ -402,26 +357,11 @@ {0} hala açık. - - Arrays with more than one dimension cannot be serialized. - Birden çok boyutlu diziler seri hale getirilemez. - - Value too large to be represented as a 30 bit unsigned integer. Değer, 30 bit işaretsiz tamsayı olarak temsil edilemeyecek kadar büyük. - - Specified path must be absolute. - Belirtilen yol mutlak olmalıdır. - - - - Unknown identifier. - Bilinmeyen tanıtıcı. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Dosya uzantısı '{1}' bir dil ile ilişkili olmadığı için '{0}' projesi açılamıyor. @@ -477,11 +417,6 @@ Kaldırıldı: - - Invalid CodePage value: {0} - Geçersiz CodePage değeri: {0} - - Adding additional documents is not supported. Ek belgelerin eklenmesi desteklenmiyor. @@ -497,11 +432,6 @@ Belgelerin eklenmesi desteklenmiyor. - - Adding metadata references is not supported. - Meta veri başvurularının eklenmesi desteklenmiyor. - - Adding project references is not supported. Proje başvurularının eklenmesi desteklenmiyor. @@ -517,11 +447,6 @@ Belgelerin değiştirilmesi desteklenmiyor. - - Changing project properties is not supported. - Proje özelliklerinin değiştirilmesi desteklenmiyor. - - Removing additional documents is not supported. Ek belgelerin kaldırılması desteklenmiyor. @@ -537,11 +462,6 @@ Belgelerin kaldırılması desteklenmiyor. - - Removing metadata references is not supported. - Meta veri başvurularının kaldırılması desteklenmiyor. - - Removing project references is not supported. Proje başvurularının kaldırılması desteklenmiyor. @@ -562,21 +482,6 @@ Tanı, '{0}' yayılmasına sahip olmalıdır - - Cannot deserialize type '{0}'. - '{0}' türü seri durumdan çıkarılamıyor. - - - - Cannot serialize type '{0}'. - '{0}' türü seri hale getirilemiyor. - - - - The type '{0}' is not understood by the serialization binder. - '{0}' türü, serileştirme bağlayıcısı tarafından anlaşılamıyor. - - Label for node '{0}' is invalid, it must be within [0, {1}). '{0}' düğümünün etiketi geçersiz, etiket [0, {1}) içerisinde olmalıdır. @@ -677,11 +582,6 @@ Akış çok uzun. - - Deserialization reader for '{0}' read incorrect number of values. - '{0}' türünün seri durumdan çıkarma okuyucusu, yanlış sayıda değer okudu. - - Async Method Zaman Uyumsuz Metot diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf index a12e51182d7d7..f08d483010a6a 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf @@ -137,21 +137,11 @@ 符号“{0}”不是来自源。 - - Documentation comment id must start with E, F, M, N, P or T - 文档注释 ID 必须以 E、F、M、N、P 或 T 开头 - - Cycle detected in extensions 在扩展中检测到循环 - - Node is of the wrong type. - 节点类型不正确。 - - Duplicate source file '{0}' in project '{1}' 项目“{1}”中源文件“{0}”重复 @@ -302,11 +292,6 @@ 项目已引用目标项目。 - - The solution already contains the specified document. - 解决方案已包含指定的文档。 - - Temporary storage cannot be written more than once. 不能多次写入临时存储。 @@ -347,21 +332,6 @@ 无法解析分析器引用:“{0}”。 - - Invalid project block, expected "=" after Project. - 无效的项目块,项目之后应为“=”。 - - - - Invalid project block, expected "," after project name. - 无效的项目块,项目名之后应为“,”。 - - - - Invalid project block, expected "," after project path. - 无效的项目块,项目路径之后应为“,”。 - - Expected {0}. 应为 {0}。 @@ -372,21 +342,6 @@ “{0}”必须是一个非 null 和非空的字符串。 - - Expected header: "{0}". - 应为标头:“{0}”。 - - - - Expected end-of-file. - 应为文件结尾。 - - - - Expected {0} line. - 应为 {0} 行。 - - This submission already references another submission project. 此提交已引用另一个提交项目。 @@ -402,26 +357,11 @@ {0}仍处于打开状态。 - - Arrays with more than one dimension cannot be serialized. - 不能序列化具有多个维度的数组。 - - Value too large to be represented as a 30 bit unsigned integer. 值太大,无法表示为 30 位无符号整数。 - - Specified path must be absolute. - 指定的路径必须是绝对路径。 - - - - Unknown identifier. - 未知的标识符。 - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. 无法打开项目“{0}”, 因为文件扩展名“{1}”没有与某种语言关联。 @@ -477,11 +417,6 @@ 已移除: - - Invalid CodePage value: {0} - 无效的 CodePage 值: {0} - - Adding additional documents is not supported. 不支持添加其他文档。 @@ -497,11 +432,6 @@ 不支持添加文档。 - - Adding metadata references is not supported. - 不支持添加元数据引用。 - - Adding project references is not supported. 不支持添加项目引用。 @@ -517,11 +447,6 @@ 不支持更改文档。 - - Changing project properties is not supported. - 不支持更改项目属性。 - - Removing additional documents is not supported. 不支持删除其他文档。 @@ -537,11 +462,6 @@ 不支持删除文档。 - - Removing metadata references is not supported. - 不支持删除元数据引用。 - - Removing project references is not supported. 不支持删除项目引用。 @@ -562,21 +482,6 @@ 诊断必须有跨区“{0}” - - Cannot deserialize type '{0}'. - 无法反序列化类型“{0}”。 - - - - Cannot serialize type '{0}'. - 无法序列化类型“{0}”。 - - - - The type '{0}' is not understood by the serialization binder. - 序列化绑定器不理解“{0}”类型。 - - Label for node '{0}' is invalid, it must be within [0, {1}). 节点“{0}”的标签无效, 它必须在 [0, {1}) 的范围内。 @@ -677,11 +582,6 @@ “流”过长。 - - Deserialization reader for '{0}' read incorrect number of values. - “{0}”的反序列化读取器读取到错误数量的值。 - - Async Method 异步方法 diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf index fa6de504d900e..b9a09d50a4d87 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf @@ -137,21 +137,11 @@ 符號 "{0}" 非來自來源。 - - Documentation comment id must start with E, F, M, N, P or T - 文件註解 ID 必須以 E、F、M、N、P 或 T 開頭 - - Cycle detected in extensions 在擴充功能中偵測到循環 - - Node is of the wrong type. - 節點類型不正確。 - - Duplicate source file '{0}' in project '{1}' 複製專案 '{1}' 中的原始程式檔 '{0}' @@ -302,11 +292,6 @@ 此專案已經參考目標專案。 - - The solution already contains the specified document. - 此方案已含有指定的文件。 - - Temporary storage cannot be written more than once. 無法多次寫入暫時儲存區。 @@ -347,21 +332,6 @@ 無法解析分析器參考: '{0}'。 - - Invalid project block, expected "=" after Project. - 專案區塊無效,專案之後必須是 "="。 - - - - Invalid project block, expected "," after project name. - 專案區塊無效,專案名稱之後必須是 ","。 - - - - Invalid project block, expected "," after project path. - 專案區塊無效,專案路徑之後必須是 ","。 - - Expected {0}. 必須是 {0}。 @@ -372,21 +342,6 @@ "{0}" 必須是非 null 和非空白的字串。 - - Expected header: "{0}". - 預期的標頭: "{0}"。 - - - - Expected end-of-file. - 預期的檔案結尾。 - - - - Expected {0} line. - 必須要有 {0} 行。 - - This submission already references another submission project. 此提交作業已參考其他提交專案。 @@ -402,26 +357,11 @@ {0} 仍在開啟中。 - - Arrays with more than one dimension cannot be serialized. - 無法序列化包含多個維度的陣列。 - - Value too large to be represented as a 30 bit unsigned integer. 值太大,無法呈現為 30 位元不帶正負號的整數。 - - Specified path must be absolute. - 指定的路徑必須是絕對路徑。 - - - - Unknown identifier. - 未知的識別項。 - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. 無法開啟專案 '{0}',因為副檔名 '{1}' 未與語言相關聯。 @@ -477,11 +417,6 @@ 已移除: - - Invalid CodePage value: {0} - 無效的字碼頁值: {0} - - Adding additional documents is not supported. 不支援新增其他文件。 @@ -497,11 +432,6 @@ 不支援新增文件。 - - Adding metadata references is not supported. - 不支援新增中繼資料參考。 - - Adding project references is not supported. 不支援新增專案參考。 @@ -517,11 +447,6 @@ 不支援變更文件。 - - Changing project properties is not supported. - 不支援變更專案屬性。 - - Removing additional documents is not supported. 不支援移除其他文件。 @@ -537,11 +462,6 @@ 不支援移除文件。 - - Removing metadata references is not supported. - 不支援移除中繼資料參考。 - - Removing project references is not supported. 不支援移除專案參考。 @@ -562,21 +482,6 @@ 診斷範圍必須涵蓋 '{0}' - - Cannot deserialize type '{0}'. - 無法將類型 '{0}' 還原序列化。 - - - - Cannot serialize type '{0}'. - 無法將類型 '{0}' 序列化。 - - - - The type '{0}' is not understood by the serialization binder. - 序列化繫結器無法辨識類型 '{0}'。 - - Label for node '{0}' is invalid, it must be within [0, {1}). 節點 '{0}' 的標籤無效,它必須位於 [0, {1}) 內。 @@ -677,11 +582,6 @@ 資料流過長。 - - Deserialization reader for '{0}' read incorrect number of values. - '{0}' 的還原序列化讀取器所讀取的值數目不正確。 - - Async Method 非同步方法 From 8be8df132bc8b6cd8ebc319fc2e4d819d1da203e Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:42:30 -0700 Subject: [PATCH 27/94] Remove unused resource string --- .../Portable/CSharpWorkspaceResources.resx | 12 ----------- .../xlf/CSharpWorkspaceResources.cs.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.de.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.es.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.fr.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.it.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.ja.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.ko.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.pl.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.pt-BR.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.ru.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.tr.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.zh-Hans.xlf | 20 ------------------- .../xlf/CSharpWorkspaceResources.zh-Hant.xlf | 20 ------------------- .../Core/WorkspaceExtensionsResources.resx | 6 ------ .../xlf/WorkspaceExtensionsResources.cs.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.de.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.es.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.fr.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.it.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.ja.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.ko.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.pl.xlf | 10 ---------- .../WorkspaceExtensionsResources.pt-BR.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.ru.xlf | 10 ---------- .../xlf/WorkspaceExtensionsResources.tr.xlf | 10 ---------- .../WorkspaceExtensionsResources.zh-Hans.xlf | 10 ---------- .../WorkspaceExtensionsResources.zh-Hant.xlf | 10 ---------- 28 files changed, 408 deletions(-) diff --git a/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx b/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx index 628d6ff3571d6..be41fd608ad01 100644 --- a/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx +++ b/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx @@ -117,18 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Node does not descend from root. - - - Node not in parent's child list - - - Trivia is not associated with token - - - Cannot retrieve the Span of a null syntax reference. - Only attributes, constructor initializers, expressions or statements can be made explicit diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf index 979decae847f2..4d75217321cab 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf @@ -17,16 +17,6 @@ Předvolby odsazení - - Node does not descend from root. - Uzel nesestupuje z kořene. - - - - Node not in parent's child list - Uzel není v seznamu podřízených položek u nadřazené položky. - - R&emove and Sort Usings Od&ebrat a seřadit direktivy Using @@ -42,16 +32,6 @@ Předvolby mezer - - Trivia is not associated with token - Triviální prvek není přidružený k tokenu. - - - - Cannot retrieve the Span of a null syntax reference. - Nejde načíst rozpětí odkazu syntaxe s hodnotou null. - - Only attributes, constructor initializers, expressions or statements can be made explicit Jako explicitní jde nastavit jenom atributy, inicializátory konstruktorů, výrazy nebo příkazy. diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf index 3fe40d586821e..3a21c621fe8ae 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf @@ -17,16 +17,6 @@ Einstellungen für Einrückung - - Node does not descend from root. - Knoten steigt nicht vom Stamm ab. - - - - Node not in parent's child list - Knoten befindet sich nicht in der untergeordneten Liste des übergeordneten Elements - - R&emove and Sort Usings &Unnötige Using-Direktiven entfernen und sortieren @@ -42,16 +32,6 @@ Einstellungen für Abstände - - Trivia is not associated with token - Trivia ist nicht dem Token zugeordnet - - - - Cannot retrieve the Span of a null syntax reference. - Der Bereich eines Nullsyntaxverweises konnte nicht abgerufen werden. - - Only attributes, constructor initializers, expressions or statements can be made explicit Nur Attribute, Konstruktor-Initialisierungen, Ausdrücke oder Anweisungen können den Status ausdrücklich erhalten diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf index 94ad19060bd64..6030ff2225a20 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf @@ -17,16 +17,6 @@ Preferencias de indentación - - Node does not descend from root. - El nodo no desciende de la raíz. - - - - Node not in parent's child list - El nodo no está en una lista secundaria de la primaria - - R&emove and Sort Usings Q&uitar y ordenar usos @@ -42,16 +32,6 @@ Preferencias de espacio - - Trivia is not associated with token - Trivialidad no asociada con token - - - - Cannot retrieve the Span of a null syntax reference. - No se puede recuperar el intervalo de una referencia de sintaxis nula. - - Only attributes, constructor initializers, expressions or statements can be made explicit Solo los atributos, los inicializadores de constructor, las expresiones o las declaraciones se pueden hacer explícitos diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf index 116f254422ba5..fcaff8d1afc09 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf @@ -17,16 +17,6 @@ Préférences de mise en retrait - - Node does not descend from root. - Le nœud ne provient pas de la racine. - - - - Node not in parent's child list - Le nœud ne figure pas dans la liste des enfants du parent - - R&emove and Sort Usings Supprim&er et trier les instructions using @@ -42,16 +32,6 @@ Préférences d'espace - - Trivia is not associated with token - Trivia non associé au jeton - - - - Cannot retrieve the Span of a null syntax reference. - Impossible de récupérer l'étendue d'une référence de syntaxe null. - - Only attributes, constructor initializers, expressions or statements can be made explicit Seuls des attributs, des initialiseurs de constructeur, des expressions ou des instructions peuvent être explicites diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf index 96d6e49b141ec..583affc6fdbb8 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf @@ -17,16 +17,6 @@ Preferenze per rientro - - Node does not descend from root. - Il nodo non discende dalla radice. - - - - Node not in parent's child list - Il nodo non è incluso nell'elenco degli elementi figlio dell'elemento padre - - R&emove and Sort Usings Ri&muovi e ordina using @@ -42,16 +32,6 @@ Preferenze per spazi - - Trivia is not associated with token - Gli elementi semplici non sono associati al token - - - - Cannot retrieve the Span of a null syntax reference. - Non è possibile recuperare l'elemento Span di un riferimento a sintassi Null. - - Only attributes, constructor initializers, expressions or statements can be made explicit È possibile rendere espliciti solo attributi, inizializzatori di costruttore, espressioni o istruzioni diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf index d4c175b00bd8e..f4350d6ef3c19 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf @@ -17,16 +17,6 @@ インデント設定 - - Node does not descend from root. - ノードがルートから派生していません。 - - - - Node not in parent's child list - ノードが親の子リストにありません - - R&emove and Sort Usings Using の削除と並び替え(&E) @@ -42,16 +32,6 @@ スペース設定 - - Trivia is not associated with token - トリビアがトークンに関連付けられていません - - - - Cannot retrieve the Span of a null syntax reference. - Null の構文参照の範囲を取得できません。 - - Only attributes, constructor initializers, expressions or statements can be made explicit 明示できるのは、属性、コンストラクターの初期化子、式、ステートメントだけです diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf index 89faca774d95c..2cf23f5c54afb 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf @@ -17,16 +17,6 @@ 들여쓰기 기본 설정 - - Node does not descend from root. - 노드가 루트의 내림차순이 아닙니다. - - - - Node not in parent's child list - 부모의 자식 목록에 노드가 없습니다. - - R&emove and Sort Usings Using 제거 및 정렬(&E) @@ -42,16 +32,6 @@ 공간 기본 설정 - - Trivia is not associated with token - Trivia가 토큰에 연결되어 있지 않습니다. - - - - Cannot retrieve the Span of a null syntax reference. - null 구문 참조의 범위를 검색할 수 없습니다. - - Only attributes, constructor initializers, expressions or statements can be made explicit 특성, 생성자 이니셜라이저, 식 또는 문만 명시적일 수 있습니다. diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf index 29208144dd8dc..95615c8552726 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf @@ -17,16 +17,6 @@ Preferencje wcięć - - Node does not descend from root. - Węzeł nie jest elementem podrzędnym elementu głównego. - - - - Node not in parent's child list - Węzeł nie znajduje się na liście elementów podrzędnych elementu nadrzędnego - - R&emove and Sort Usings &Usuń i sortuj instrukcje Usings @@ -42,16 +32,6 @@ Preferencje dotyczące odstępów - - Trivia is not associated with token - Elementy towarzyszące składni nie są skojarzone z tokenem - - - - Cannot retrieve the Span of a null syntax reference. - Nie można pobrać zakresu odwołania do składni o wartości null. - - Only attributes, constructor initializers, expressions or statements can be made explicit Jako jawne można ustawić tylko atrybuty, inicjatory konstruktorów, wyrażenia lub instrukcje diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf index b6ac2c6bbd643..0965b568913e2 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf @@ -17,16 +17,6 @@ Preferências de recuo - - Node does not descend from root. - Nó não deriva da raiz. - - - - Node not in parent's child list - Nó não está na lista de filhos do pai - - R&emove and Sort Usings R&emover e Classificar Usos @@ -42,16 +32,6 @@ Preferências de espaço - - Trivia is not associated with token - Trívia não está associada a token - - - - Cannot retrieve the Span of a null syntax reference. - Não é possível recuperar a Extensão de uma referência de sintaxe nula. - - Only attributes, constructor initializers, expressions or statements can be made explicit Somente atributos, inicializadores de construtor, expressões ou instruções podem ser tornados explícitos diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf index 344f98ba62d1e..f7caf77dbf6ac 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf @@ -17,16 +17,6 @@ Предпочтения для отступов - - Node does not descend from root. - Узел не является корневым. - - - - Node not in parent's child list - Узел не входит в родительский список дочерних узлов - - R&emove and Sort Usings У&далить и отсортировать директивы using @@ -42,16 +32,6 @@ Предпочтения для интервалов - - Trivia is not associated with token - Trivia не связана с токеном - - - - Cannot retrieve the Span of a null syntax reference. - Не удается извлечь диапазон из синтаксической ссылки со значением Null. - - Only attributes, constructor initializers, expressions or statements can be made explicit Явными могут быть сделаны только атрибуты, инициализаторы конструктора, выражения или операторы diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf index 9ef251c9ad45c..00ad07371cc67 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf @@ -17,16 +17,6 @@ Girinti tercihleri - - Node does not descend from root. - Düğüm kökten azalmaz. - - - - Node not in parent's child list - Düğüm üst öğenin alt öğe listesinde değil - - R&emove and Sort Usings &Kaldır ve Sıralama Usings @@ -42,16 +32,6 @@ Boşluk tercihleri - - Trivia is not associated with token - Meraklısına Notlar belirteç ile ilgili değil - - - - Cannot retrieve the Span of a null syntax reference. - Boş söz dizimi başvurusunun Yayılımı alınamıyor. - - Only attributes, constructor initializers, expressions or statements can be made explicit Yalnızca öznitelikler, oluşturucu başlatıcıları, ifadeler veya deyimler açık hale getirilebilir diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf index bf5a86883935f..c699eb56b315a 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf @@ -17,16 +17,6 @@ 缩进首选项 - - Node does not descend from root. - 节点并非源自根。 - - - - Node not in parent's child list - 节点不在父级的子列表中 - - R&emove and Sort Usings 删除 Using 和对其排序(&E) @@ -42,16 +32,6 @@ 空格键首选项 - - Trivia is not associated with token - 琐事与标记不相关联 - - - - Cannot retrieve the Span of a null syntax reference. - 无法检索一个空语法引用的范围。 - - Only attributes, constructor initializers, expressions or statements can be made explicit 仅属性、构造函数初始值设定项、表达式或语句可为显式 diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf index 363b2cdc1a511..779ccfb7a7394 100644 --- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf +++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf @@ -17,16 +17,6 @@ 縮排喜好設定 - - Node does not descend from root. - 節點不是根的子系。 - - - - Node not in parent's child list - 節點不在父代的子清單中 - - R&emove and Sort Usings 移除和排序 Using(&E) @@ -42,16 +32,6 @@ 空格喜好設定 - - Trivia is not associated with token - Trivia 與語彙基元無關聯 - - - - Cannot retrieve the Span of a null syntax reference. - 無法擷取 null 語法參考的 Span。 - - Only attributes, constructor initializers, expressions or statements can be made explicit 只有屬性、建構函式初始設定式、運算式或陳述式才可明確設定 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx index 5c457c8e66223..4ca939845df3e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx @@ -126,12 +126,6 @@ Fix all '{0}' in '{1}' - - Fix all '{0}' in containing member for '{1}' - - - Fix all '{0}' in containing type for '{1}' - Fix all '{0}' in Solution diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf index efe571136f0c6..fbabe19a86657 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf @@ -72,16 +72,6 @@ Opravit vše ({0}) v řešení - - Fix all '{0}' in containing member for '{1}' - Opravit všechny {0} obsahujícího člena pro {1} - - - - Fix all '{0}' in containing type for '{1}' - Opravit všechny{0} v obsahujícím typu pro {1} - - Invalid number of parameters for binary operator. Neplatný počet parametrů pro binární operátor diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf index b0b1a72f702f6..cffd3da698896 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf @@ -72,16 +72,6 @@ Alle '{0}' in Lösung reparieren - - Fix all '{0}' in containing member for '{1}' - Alle "{0}" im enthaltenden Member für "{1}" korrigieren - - - - Fix all '{0}' in containing type for '{1}' - Alle "{0}" im enthaltenden Typ für "{1}" korrigieren - - Invalid number of parameters for binary operator. Ungültige Parameteranzahl für binären Operator. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf index 9f00f78f891d5..07164c7c23837 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf @@ -72,16 +72,6 @@ Corregir todo '{0}' en solución - - Fix all '{0}' in containing member for '{1}' - Corregir todos los '{0}' del miembro contenedor para '{1}' - - - - Fix all '{0}' in containing type for '{1}' - Corregir todos los '{0}' del tipo contenedor para '{1}' - - Invalid number of parameters for binary operator. Número de parámetros no válido para el operador binario. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf index 3d488955f4868..dbddeb1912b98 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf @@ -72,16 +72,6 @@ Corriger tous les '{0}' dans la solution - - Fix all '{0}' in containing member for '{1}' - Corriger toutes les '{0}' dans le membre conteneur pour '{1}' - - - - Fix all '{0}' in containing type for '{1}' - Corriger toutes les '{0}' dans le type conteneur pour '{1}' - - Invalid number of parameters for binary operator. Nombre de paramètres non valide pour l'opérateur binaire. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf index 08c7cb4a54ff7..a2c78b22b50ab 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf @@ -72,16 +72,6 @@ Correggi tutti '{0}' nella soluzione - - Fix all '{0}' in containing member for '{1}' - Correggi tutti i '{0}' nel membro contenitore per '{1}' - - - - Fix all '{0}' in containing type for '{1}' - Correggi tutti i '{0}' nel tipo contenitore per '{1}' - - Invalid number of parameters for binary operator. Il numero di parametri per l'operatore binario non è valido. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf index f44a80cebe053..47ac48e3daa75 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf @@ -72,16 +72,6 @@ ソリューションに含まれているすべての '{0}' を修正します - - Fix all '{0}' in containing member for '{1}' - 包含メンバー '{1}' 内すべての '{0}' を修正する - - - - Fix all '{0}' in containing type for '{1}' - 包含型 '{1}' のすべての '{0}' を修正する - - Invalid number of parameters for binary operator. 二項演算子のパラメーターの数が無効です。 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf index 72bb36a8d2a9a..9206614edb5a7 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf @@ -72,16 +72,6 @@ 솔루션의 모든 '{0}' 수정 - - Fix all '{0}' in containing member for '{1}' - '{1}'에 대한 포함 구성원의 모든 '{0}' 수정 - - - - Fix all '{0}' in containing type for '{1}' - '{1}'에 대한 포함 유형의 모든 '{0}' 수정 - - Invalid number of parameters for binary operator. 이진 연산자에 대해 잘못된 매개 변수 수입니다. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf index 879d216c57490..eab56886bbe3e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf @@ -72,16 +72,6 @@ Napraw wszystkie wystąpienia elementu „{0}” w rozwiązaniu - - Fix all '{0}' in containing member for '{1}' - Napraw wszystkie „{0}” w składowej zawierającej dla „{1}” - - - - Fix all '{0}' in containing type for '{1}' - Napraw wszystkie „{0}” w typie zawierającym dla „{1}” - - Invalid number of parameters for binary operator. Nieprawidłowa liczba parametrów operatora binarnego. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf index 7b3c34b92872c..4d335c670f6d8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf @@ -72,16 +72,6 @@ Corrigir todos os '{0}' na Solução - - Fix all '{0}' in containing member for '{1}' - Corrigir todos os '{0}' do membro que o contém para '{1}' - - - - Fix all '{0}' in containing type for '{1}' - Corrigir todos os '{0}' do tipo que o contém para '{1}' - - Invalid number of parameters for binary operator. Número inválido de parâmetros para o operador binário. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf index b4b4b41917894..5222a6f599619 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf @@ -72,16 +72,6 @@ Исправить все "{0}" в решении - - Fix all '{0}' in containing member for '{1}' - Исправить все "{0}" в содержащем элементе для "{1}" - - - - Fix all '{0}' in containing type for '{1}' - Исправить все "{0}" в содержащем типе для "{1}" - - Invalid number of parameters for binary operator. Недопустимое число параметров для бинарного оператора. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf index 965ed9cf8460c..d9c8984990dc5 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf @@ -72,16 +72,6 @@ Çözüm'de geçtiği her yerde '{0}' ifadesini düzelt - - Fix all '{0}' in containing member for '{1}' - '{1}' için kapsayan üyedeki tüm '{0}' öğelerini düzelt - - - - Fix all '{0}' in containing type for '{1}' - '{1}' için kapsayan türdeki tüm '{0}' öğelerini düzelt - - Invalid number of parameters for binary operator. İkili operatör için parametre sayısı geçersiz. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf index 72372bcb130ea..5fe06e2b21b63 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf @@ -72,16 +72,6 @@ 修复解决方案中的所有“{0}” - - Fix all '{0}' in containing member for '{1}' - 修复包含 '{1}' 成员中的所有 '{0}' - - - - Fix all '{0}' in containing type for '{1}' - 修复“{1}”的“包含”类型中的所有 '{0}' - - Invalid number of parameters for binary operator. 参数数目对二元运算符无效。 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf index 39acdd06f8340..38c4ef5ba363d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf @@ -72,16 +72,6 @@ 修正方案中的所有 '{0}' - - Fix all '{0}' in containing member for '{1}' - 修正包含 '{1}' 成員的所有 '{0}' - - - - Fix all '{0}' in containing type for '{1}' - 修正包含 '{1}' 類型中的所有 '{0}' - - Invalid number of parameters for binary operator. 二元運算子的參數數目無效。 From c1eed962ee96b871d7728404a44d9770535ed7c5 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:43:11 -0700 Subject: [PATCH 28/94] Remove unused resource string --- .../Compiler/CSharp/CSharpCompilerExtensions.projitems | 4 +++- .../Compiler/CSharp/CSharpCompilerExtensionsResources.resx | 5 ----- .../CSharp/xlf/CSharpCompilerExtensionsResources.cs.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.de.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.es.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.fr.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.it.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.ja.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.ko.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.pl.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.pt-BR.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.ru.xlf | 6 ------ .../CSharp/xlf/CSharpCompilerExtensionsResources.tr.xlf | 6 ------ .../xlf/CSharpCompilerExtensionsResources.zh-Hans.xlf | 6 ------ .../xlf/CSharpCompilerExtensionsResources.zh-Hant.xlf | 6 ------ 15 files changed, 3 insertions(+), 84 deletions(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems index 13038f752e1f5..6dd5d1089835f 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems @@ -125,7 +125,9 @@ - + + Designer + diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensionsResources.resx b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensionsResources.resx index 18368d454297c..66e63f1c3edf0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensionsResources.resx +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensionsResources.resx @@ -139,9 +139,4 @@ Expected string or char literal - - '{0}.{1}' is not supported in this version - {0}: A type name -{1}: A member name - \ No newline at end of file diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.cs.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.cs.xlf index ef943b061c586..fa634e3a893ac 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.cs.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.cs.xlf @@ -27,12 +27,6 @@ Předvolby porovnávání vzorů - - '{0}.{1}' is not supported in this version - {0}.{1} se v této verzi nepodporuje. - {0}: A type name -{1}: A member name - 'using' directive preferences Předvolby direktivy using diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.de.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.de.xlf index fffa54091aa4c..ee365d944ffd6 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.de.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.de.xlf @@ -27,12 +27,6 @@ Einstellungen für den Musterabgleich - - '{0}.{1}' is not supported in this version - "{0}.{1}" wird in dieser Version nicht unterstützt. - {0}: A type name -{1}: A member name - 'using' directive preferences Einstellungen für using-Anweisungen diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.es.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.es.xlf index 63d457ac2c32c..ac4000bbeb7a6 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.es.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.es.xlf @@ -27,12 +27,6 @@ Preferencias de coincidencia de patrón - - '{0}.{1}' is not supported in this version - "{0}.{1}" no se admite en esta versión. - {0}: A type name -{1}: A member name - 'using' directive preferences Preferencias de directiva "using" diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.fr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.fr.xlf index 1631470c7671c..5ba49bd52c4e9 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.fr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.fr.xlf @@ -27,12 +27,6 @@ Préférences correspondants au modèle - - '{0}.{1}' is not supported in this version - '{0}.{1}' n'est pas pris en charge dans cette version - {0}: A type name -{1}: A member name - 'using' directive preferences Préférences pour la directive 'using' diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.it.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.it.xlf index 61f3fceb4fefb..ff9a9076c2da0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.it.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.it.xlf @@ -27,12 +27,6 @@ Preferenze per criteri di ricerca - - '{0}.{1}' is not supported in this version - '{0}.{1}' non è supportato in questa versione - {0}: A type name -{1}: A member name - 'using' directive preferences Preferenze per direttive 'using' diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ja.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ja.xlf index 5d86eb9638fc1..b321177375f57 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ja.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ja.xlf @@ -27,12 +27,6 @@ パターン マッチング設定 - - '{0}.{1}' is not supported in this version - '{0}.{1}' は、このバージョンではサポートされていません - {0}: A type name -{1}: A member name - 'using' directive preferences 'using' ディレクティブの基本設定 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ko.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ko.xlf index a9b90ce71e454..6b3c8f3a5d364 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ko.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ko.xlf @@ -27,12 +27,6 @@ 패턴 일치 기본 설정 - - '{0}.{1}' is not supported in this version - 이 버전에서는 '{0}.{1}'이(가) 지원되지 않습니다. - {0}: A type name -{1}: A member name - 'using' directive preferences 'using' 지시문 기본 설정 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pl.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pl.xlf index d64daf46fb7ee..9afa0ebccaf45 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pl.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pl.xlf @@ -27,12 +27,6 @@ Preferencje dopasowywania do wzorca - - '{0}.{1}' is not supported in this version - Element „{0}.{1}” nie jest obsługiwany w tej wersji - {0}: A type name -{1}: A member name - 'using' directive preferences Preferencje dyrektywy „using” diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pt-BR.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pt-BR.xlf index 5e6efb5faf760..22bfa1e1b75cc 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pt-BR.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.pt-BR.xlf @@ -27,12 +27,6 @@ Preferências de correspondência de padrões - - '{0}.{1}' is not supported in this version - Não há suporte para '{0}.{1}' nesta versão - {0}: A type name -{1}: A member name - 'using' directive preferences Preferências da diretiva 'using' diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ru.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ru.xlf index a23e4673d120f..2102a5e803e06 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ru.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.ru.xlf @@ -27,12 +27,6 @@ Настройки соответствия шаблонов - - '{0}.{1}' is not supported in this version - "{0}.{1}" не поддерживается в этой версии - {0}: A type name -{1}: A member name - 'using' directive preferences предпочтения для директивы using diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.tr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.tr.xlf index ce08e631acab9..c9e54c73fa46c 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.tr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.tr.xlf @@ -27,12 +27,6 @@ Desen eşleştirme tercihleri - - '{0}.{1}' is not supported in this version - '{0}.{1}' bu sürümde desteklenmiyor - {0}: A type name -{1}: A member name - 'using' directive preferences 'using' yönergesi tercihleri diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hans.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hans.xlf index 3291ff4c83c99..e179a0b322aec 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hans.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hans.xlf @@ -27,12 +27,6 @@ 模式匹配首选项 - - '{0}.{1}' is not supported in this version - 此版本中不支持“{0}.{1}” - {0}: A type name -{1}: A member name - 'using' directive preferences "using" 指令首选项 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hant.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hant.xlf index 2e381709df945..55ee733e947ad 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hant.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/xlf/CSharpCompilerExtensionsResources.zh-Hant.xlf @@ -27,12 +27,6 @@ 模式比對喜好設定 - - '{0}.{1}' is not supported in this version - 此版本不支援 '{0}.{1}' - {0}: A type name -{1}: A member name - 'using' directive preferences 'using' 指示詞的喜好設定 From de955e3a34b88bc69e809d00747412449c116265 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:43:59 -0700 Subject: [PATCH 29/94] Remove unused resource string --- .../Compiler/Core/CompilerExtensionsResources.resx | 6 ------ .../Core/xlf/CompilerExtensionsResources.cs.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.de.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.es.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.fr.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.it.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.ja.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.ko.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.pl.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.pt-BR.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.ru.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.tr.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.zh-Hans.xlf | 10 ---------- .../Core/xlf/CompilerExtensionsResources.zh-Hant.xlf | 10 ---------- 14 files changed, 136 deletions(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensionsResources.resx b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensionsResources.resx index 00c4cceb2939b..4030a16719092 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensionsResources.resx +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensionsResources.resx @@ -120,9 +120,6 @@ Absolute path expected. - - An element with the same key but a different value already exists. - Organize usings @@ -273,9 +270,6 @@ Specified sequence has duplicate items - - Segment size must be power of 2 greater than 1 - New line preferences diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.cs.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.cs.xlf index ab9985af1ded0..89e9d8c506442 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.cs.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.cs.xlf @@ -12,11 +12,6 @@ Abstraktní metoda {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Element se stejným klíčem, ale odlišnou hodnotou už existuje. - - Begins with I Začíná na I @@ -162,11 +157,6 @@ Veřejné nebo chráněné pole {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - Velikost segmentu musí být mocnina 2 větší než 1. - - Specified sequence has duplicate items Zadané pořadí obsahuje duplicitní položky. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.de.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.de.xlf index 5cfc4519cabb2..e0390f34dd746 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.de.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.de.xlf @@ -12,11 +12,6 @@ Abstrakte Methode {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Es ist bereits ein Element mit dem gleichen Schlüssel, jedoch einem anderen Wert vorhanden. - - Begins with I Beginnt mit I @@ -162,11 +157,6 @@ Öffentliches oder geschütztes Feld {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - Die Segmentgröße muss eine Potenz von 2 und größer als 1 sein. - - Specified sequence has duplicate items Die angegebene Sequenz weist doppelte Elemente auf. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.es.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.es.xlf index 52f56868b432f..17a039d847328 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.es.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.es.xlf @@ -12,11 +12,6 @@ Método abstracto {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Ya existe un elemento con la misma clave pero un valor distinto. - - Begins with I Empieza por I @@ -162,11 +157,6 @@ Campo público o protegido {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - El tamaño del segmento debe ser una potencia de 2 mayor que 1 - - Specified sequence has duplicate items La secuencia especificada tiene elementos duplicados. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.fr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.fr.xlf index 300c4b5f0c6d9..170fa2ee5c9c1 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.fr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.fr.xlf @@ -12,11 +12,6 @@ Méthode abstraite {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Il existe déjà un élément utilisant la même clé mais une autre valeur. - - Begins with I Commence par I @@ -162,11 +157,6 @@ Champ public ou protégé {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - La taille du segment doit être une puissance de 2 supérieure à 1 - - Specified sequence has duplicate items La séquence spécifiée comporte des éléments dupliqués diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.it.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.it.xlf index eda44d212d86f..cd83e2d2838cc 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.it.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.it.xlf @@ -12,11 +12,6 @@ Metodo astratto {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Esiste già un elemento con la stessa chiave ma valore diverso. - - Begins with I Inizia con I @@ -162,11 +157,6 @@ Campo pubblico o protetto {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - Le dimensioni del segmento devono essere una potenza di 2 maggiore di 1 - - Specified sequence has duplicate items La sequenza specificata contiene elementi duplicati diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ja.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ja.xlf index 167d367e0f092..4d089882ead11 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ja.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ja.xlf @@ -12,11 +12,6 @@ 抽象メソッド {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - キーが同じで値が異なる要素が既に存在します。 - - Begins with I I で始まる @@ -162,11 +157,6 @@ パブリックまたは保護されたフィールド {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - セグメント サイズは、1 より大きい 2 の累乗にする必要があります - - Specified sequence has duplicate items 指定されたシーケンスには重複する項目があります diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ko.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ko.xlf index aebe256e8c5d2..0c796dcbc28c3 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ko.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ko.xlf @@ -12,11 +12,6 @@ 추상 메서드 {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - 키가 같지만 값이 다른 요소가 이미 있습니다. - - Begins with I I로 시작 @@ -162,11 +157,6 @@ 공용 또는 보호된 필드 {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - 세그먼트 크기는 1보다 큰 2의 거듭제곱이어야 합니다. - - Specified sequence has duplicate items 지정된 시퀀스에 중복 항목이 있습니다. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pl.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pl.xlf index 567576bed9540..8a5d33eb6818c 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pl.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pl.xlf @@ -12,11 +12,6 @@ Metoda abstrakcyjna {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Element z tym samym kluczem, ale inną wartością, już istnieje. - - Begins with I Rozpoczyna się znakiem I @@ -162,11 +157,6 @@ Pole publiczne lub chronione {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - Rozmiar segmentu musi być potęgą 2 większą niż 1 - - Specified sequence has duplicate items Określona sekwencja zawiera zduplikowane elementy diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pt-BR.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pt-BR.xlf index 4fac488864478..459b4259f8b35 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pt-BR.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.pt-BR.xlf @@ -12,11 +12,6 @@ Método Abstract {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Um elemento com a mesma chave, mas um valor diferente já existe. - - Begins with I Começa com I @@ -162,11 +157,6 @@ Campo Protegido ou Público {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - O tamanho do segmento precisa ser na potência de 2 maior que 1 - - Specified sequence has duplicate items A sequência especificada tem itens duplicados diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ru.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ru.xlf index 61c164f6ff434..63bdcffa02244 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ru.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.ru.xlf @@ -12,11 +12,6 @@ Абстрактный метод {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Элемент с таким ключом, но другим значением уже существует. - - Begins with I Начинается с I @@ -162,11 +157,6 @@ Открытое или защищенное поле {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - Размер сегмента должен представлять степень числа 2, превышающую 1 - - Specified sequence has duplicate items Указанная последовательность содержит повторяющиеся элементы. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.tr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.tr.xlf index 301c78f226590..9f94de03e8e92 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.tr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.tr.xlf @@ -12,11 +12,6 @@ Soyut Metot {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - Aynı anahtara, ancak farklı bir değere sahip olan bir öğe zaten var. - - Begins with I I ile başlar @@ -162,11 +157,6 @@ Genel veya Korunan Alan {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - Segment boyutu 1'den büyük ve 2'nin üssü olmalıdır - - Specified sequence has duplicate items Belirtilen dizide yinelenen öğeler var diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hans.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hans.xlf index 2b4d4a1323692..31c56e08bc8e9 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hans.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hans.xlf @@ -12,11 +12,6 @@ 抽象方法 {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - 已存在键相同但值不同的元素。 - - Begins with I 以 I 开始 @@ -162,11 +157,6 @@ 公共或受保护的字段 {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - 段大小必须是 2 的幂且大于 1 - - Specified sequence has duplicate items 指定的序列有重复项 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hant.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hant.xlf index 6459300fdfb0c..c1b0f5c1cb043 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hant.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/xlf/CompilerExtensionsResources.zh-Hant.xlf @@ -12,11 +12,6 @@ 抽象方法 {locked: abstract}{locked: method} These are keywords (unless the order of words or capitalization should be handled differently) - - An element with the same key but a different value already exists. - 已經有相同索引鍵但不同值的項目。 - - Begins with I 以 I 開頭 @@ -162,11 +157,6 @@ 公用或受保護欄位 {locked: public}{locked: protected}{locked:field} - - Segment size must be power of 2 greater than 1 - 區段大小必須是 2 的乘冪且大於 1 - - Specified sequence has duplicate items 指定的序列具有重複項目 From 1e800089c28acc88cc6e785c32b0f8f6e83c0d79 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:47:17 -0700 Subject: [PATCH 30/94] Remove unused resource string --- .../LanguageServerResources.resx | 3 --- .../xlf/LanguageServerResources.cs.xlf | 5 ----- .../xlf/LanguageServerResources.de.xlf | 5 ----- .../xlf/LanguageServerResources.es.xlf | 5 ----- .../xlf/LanguageServerResources.fr.xlf | 5 ----- .../xlf/LanguageServerResources.it.xlf | 5 ----- .../xlf/LanguageServerResources.ja.xlf | 5 ----- .../xlf/LanguageServerResources.ko.xlf | 5 ----- .../xlf/LanguageServerResources.pl.xlf | 5 ----- .../xlf/LanguageServerResources.pt-BR.xlf | 5 ----- .../xlf/LanguageServerResources.ru.xlf | 5 ----- .../xlf/LanguageServerResources.tr.xlf | 5 ----- .../xlf/LanguageServerResources.zh-Hans.xlf | 5 ----- .../xlf/LanguageServerResources.zh-Hant.xlf | 5 ----- src/VisualStudio/CSharp/Impl/VSPackage.resx | 6 ------ src/VisualStudio/CSharp/Impl/xlf/VSPackage.cs.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.de.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.es.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.fr.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.it.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.ja.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.ko.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.pl.xlf | 10 ---------- .../CSharp/Impl/xlf/VSPackage.pt-BR.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.ru.xlf | 10 ---------- src/VisualStudio/CSharp/Impl/xlf/VSPackage.tr.xlf | 10 ---------- .../CSharp/Impl/xlf/VSPackage.zh-Hans.xlf | 10 ---------- .../CSharp/Impl/xlf/VSPackage.zh-Hant.xlf | 10 ---------- src/VisualStudio/VisualBasic/Impl/VSPackage.resx | 6 ------ .../VisualBasic/Impl/xlf/VSPackage.cs.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.de.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.es.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.fr.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.it.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.ja.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.ko.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.pl.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.pt-BR.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.ru.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.tr.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.zh-Hans.xlf | 10 ---------- .../VisualBasic/Impl/xlf/VSPackage.zh-Hant.xlf | 10 ---------- .../Portable/VBWorkspaceResources.resx | 9 --------- .../Portable/xlf/VBWorkspaceResources.cs.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.de.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.es.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.fr.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.it.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.ja.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.ko.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.pl.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.pt-BR.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.ru.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.tr.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.zh-Hans.xlf | 15 --------------- .../Portable/xlf/VBWorkspaceResources.zh-Hant.xlf | 15 --------------- 56 files changed, 544 deletions(-) diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx index f8ecd4ed92141..6743db6dce89a 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx @@ -136,9 +136,6 @@ Completed (re)load of all projects in {0} The placeholder is a time duration like 00:15 - - Debugger attached - Debugging tests... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf index c79a2e3477a5f..071bf28df6f7e 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf @@ -32,11 +32,6 @@ Dokončilo se (opětovné) načtení všech projektů v čase {0} The placeholder is a time duration like 00:15 - - Debugger attached - Připojený ladicí program - - Debugging tests... Ladí se testy… diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf index 1157f2170e3fb..bdf495a8509c4 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf @@ -32,11 +32,6 @@ Abgeschlossenes (erneutes) Laden aller Projekte in {0} The placeholder is a time duration like 00:15 - - Debugger attached - Debugger angefügt - - Debugging tests... Debugging von Tests wird ausgeführt... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf index e0063ca4ac35a..733ccb0b42d06 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf @@ -32,11 +32,6 @@ (Re)carga completa de todos los proyectos en {0} The placeholder is a time duration like 00:15 - - Debugger attached - Depurador asociado - - Debugging tests... Depurando pruebas... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf index 1aec41ea0011c..3c7e23bc77ef4 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf @@ -32,11 +32,6 @@ Chargement ou rechargement terminé de tous les projets dans {0} The placeholder is a time duration like 00:15 - - Debugger attached - Débogueur attaché - - Debugging tests... Débogage en cours des tests... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf index f9bbcf5fe4a0d..e2e00f180c266 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf @@ -32,11 +32,6 @@ Completato il (ri)caricamento di tutti i progetti in {0} The placeholder is a time duration like 00:15 - - Debugger attached - Debugger collegato - - Debugging tests... Debug dei test... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf index f4415765da14e..56d55fec10cc8 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf @@ -32,11 +32,6 @@ {0} のすべてのプロジェクトの (再) 読み込みが完了しました The placeholder is a time duration like 00:15 - - Debugger attached - デバッガーがアタッチされました - - Debugging tests... テストをデバッグしています... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf index f37dbc82c31e2..858778324bcd9 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf @@ -32,11 +32,6 @@ {0}에 있는 모든 프로젝트의 (재)로드가 완료됨 The placeholder is a time duration like 00:15 - - Debugger attached - 디버거가 연결됨 - - Debugging tests... 테스트를 디버그하는 중... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf index 0a2c88c926424..b58cdcf14e7a5 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf @@ -32,11 +32,6 @@ Ukończono (ponownie)ładowanie wszystkich projektów w usłudze {0} The placeholder is a time duration like 00:15 - - Debugger attached - Dołączono debuger - - Debugging tests... Trwa debugowanie testów... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf index 5a7d79717f3fc..ccee5fc4f388a 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf @@ -32,11 +32,6 @@ (Re)carregamento concluído de todos os projetos em {0} The placeholder is a time duration like 00:15 - - Debugger attached - Depurador conectado - - Debugging tests... Depurando testes... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf index a616ebe4c1931..ad637a7496361 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf @@ -32,11 +32,6 @@ Завершена (повторная) загрузка всех проектов в {0} The placeholder is a time duration like 00:15 - - Debugger attached - Отладчик подключен - - Debugging tests... Идет отладка тестов... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf index 3d347a19d8e19..2f19be53bfd2f 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf @@ -32,11 +32,6 @@ Tüm projelerin (yeniden) yüklemesi {0} içinde tamamlandı The placeholder is a time duration like 00:15 - - Debugger attached - Hata ayıklayıcı eklendi - - Debugging tests... Test hataları ayıklanıyor... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf index 627d46f5e6646..57be82154c287 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf @@ -32,11 +32,6 @@ 已完成加载(重新加载) {0} 中的所有项目 The placeholder is a time duration like 00:15 - - Debugger attached - 已附加调试器 - - Debugging tests... 正在调试测试... diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf index 4657a266c80a8..49824bc2b56ed 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf @@ -32,11 +32,6 @@ 已完成 {0} 中所有專案的(重新)載入 The placeholder is a time duration like 00:15 - - Debugger attached - 已連結偵錯工具 - - Debugging tests... 正在偵錯測試... diff --git a/src/VisualStudio/CSharp/Impl/VSPackage.resx b/src/VisualStudio/CSharp/Impl/VSPackage.resx index 84ca3688187d7..07f156ef5855f 100644 --- a/src/VisualStudio/CSharp/Impl/VSPackage.resx +++ b/src/VisualStudio/CSharp/Impl/VSPackage.resx @@ -357,12 +357,6 @@ Show items from unimported namespaces (experimental); C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Help > About - - Visual C# Script - - - An empty C# script file. - Always add new line on enter diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.cs.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.cs.xlf index 53303b83f12f3..e6be2e1fc297a 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.cs.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.cs.xlf @@ -420,11 +420,6 @@ Zobrazit položky z neimportovaných oborů názvů (experimentální); Always include snippets - - An empty C# script file. - Prázdný soubor skriptu C# - - Default Default @@ -450,11 +445,6 @@ Zobrazit položky z neimportovaných oborů názvů (experimentální); Only add new line on enter after end of fully typed word - - Visual C# Script - Skript Visual C# - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.de.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.de.xlf index 67fc6d1f5377f..29b1b9ac5c565 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.de.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.de.xlf @@ -420,11 +420,6 @@ Elemente aus nicht importierten Namespaces anzeigen (experimentell); Always include snippets - - An empty C# script file. - Eine leere C#-Skriptdatei. - - Default Default @@ -450,11 +445,6 @@ Elemente aus nicht importierten Namespaces anzeigen (experimentell); Only add new line on enter after end of fully typed word - - Visual C# Script - Visual C#-Skript - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.es.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.es.xlf index 1ca635f36fe1c..7b5662fa39c84 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.es.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.es.xlf @@ -420,11 +420,6 @@ Mostrar elementos de espacios de nombres no importados (experimental); Always include snippets - - An empty C# script file. - Archivo de script de C# vacío. - - Default Default @@ -450,11 +445,6 @@ Mostrar elementos de espacios de nombres no importados (experimental); Only add new line on enter after end of fully typed word - - Visual C# Script - Script de Visual C# - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.fr.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.fr.xlf index 38b8199499681..32677cef8a0a9 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.fr.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.fr.xlf @@ -420,11 +420,6 @@ Afficher les éléments des espaces de noms qui ne sont pas importés (expérime Always include snippets - - An empty C# script file. - Fichier de script C# vide. - - Default Default @@ -450,11 +445,6 @@ Afficher les éléments des espaces de noms qui ne sont pas importés (expérime Only add new line on enter after end of fully typed word - - Visual C# Script - Script Visual C# - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.it.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.it.xlf index cc67c942f5d3b..f0dfec70e1585 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.it.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.it.xlf @@ -420,11 +420,6 @@ Mostra elementi da spazi dei nomi non importati (sperimentale); Always include snippets - - An empty C# script file. - File di script C# vuoto. - - Default Default @@ -450,11 +445,6 @@ Mostra elementi da spazi dei nomi non importati (sperimentale); Only add new line on enter after end of fully typed word - - Visual C# Script - Script Visual C# - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ja.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ja.xlf index 4230d3f9bcefc..5b7872afd6bb2 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ja.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ja.xlf @@ -420,11 +420,6 @@ Enter キーで常に新しい行を追加する; Always include snippets - - An empty C# script file. - 空の C# スクリプト ファイルです。 - - Default Default @@ -450,11 +445,6 @@ Enter キーで常に新しい行を追加する; Only add new line on enter after end of fully typed word - - Visual C# Script - Visual C# スクリプト - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ko.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ko.xlf index 4460d043b7b27..b4a9d605134dc 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ko.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ko.xlf @@ -420,11 +420,6 @@ Show items from unimported namespaces (experimental); Always include snippets - - An empty C# script file. - 비어 있는 C# 스크립트 파일입니다. - - Default Default @@ -450,11 +445,6 @@ Show items from unimported namespaces (experimental); Only add new line on enter after end of fully typed word - - Visual C# Script - Visual C# 스크립트 - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pl.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pl.xlf index 19ea6c6762b82..26706c26c5d64 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pl.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pl.xlf @@ -419,11 +419,6 @@ Pokaż elementy z niezaimportowanych przestrzeni nazw (funkcja eksperymentalna); Always include snippets - - An empty C# script file. - Pusty plik skryptu C#. - - Default Default @@ -449,11 +444,6 @@ Pokaż elementy z niezaimportowanych przestrzeni nazw (funkcja eksperymentalna); Only add new line on enter after end of fully typed word - - Visual C# Script - Skrypt Visual C# Script - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pt-BR.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pt-BR.xlf index c8366eb29e386..1297caa9e09b0 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pt-BR.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.pt-BR.xlf @@ -420,11 +420,6 @@ Mostrar itens de namespaces não importados (experimental); Always include snippets - - An empty C# script file. - Um arquivo de script C# vazio. - - Default Default @@ -450,11 +445,6 @@ Mostrar itens de namespaces não importados (experimental); Only add new line on enter after end of fully typed word - - Visual C# Script - Script do Visual C# - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ru.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ru.xlf index 2e4896f0c8b04..e48365faa2edb 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ru.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.ru.xlf @@ -420,11 +420,6 @@ Show items from unimported namespaces (experimental); Always include snippets - - An empty C# script file. - Пустой файл скрипта C#. - - Default Default @@ -450,11 +445,6 @@ Show items from unimported namespaces (experimental); Only add new line on enter after end of fully typed word - - Visual C# Script - Скрипт Visual C# - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.tr.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.tr.xlf index 31e976bd18239..4f2b330a697b9 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.tr.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.tr.xlf @@ -420,11 +420,6 @@ Ad önerilerini göster; Always include snippets - - An empty C# script file. - Boş C# betik dosyası. - - Default Default @@ -450,11 +445,6 @@ Ad önerilerini göster; Only add new line on enter after end of fully typed word - - Visual C# Script - Visual C# Betiği - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hans.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hans.xlf index a7b7bc4b0976c..09fdd1b28d195 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hans.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hans.xlf @@ -420,11 +420,6 @@ Show items from unimported namespaces (experimental); Always include snippets - - An empty C# script file. - 一个空的 C# 脚本文件。 - - Default Default @@ -450,11 +445,6 @@ Show items from unimported namespaces (experimental); Only add new line on enter after end of fully typed word - - Visual C# Script - Visual C# 脚本 - - \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hant.xlf b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hant.xlf index 22853fa56999e..2530541f2ab40 100644 --- a/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hant.xlf +++ b/src/VisualStudio/CSharp/Impl/xlf/VSPackage.zh-Hant.xlf @@ -420,11 +420,6 @@ Enter 鍵行為; Always include snippets - - An empty C# script file. - 空白的 C# 指令碼檔。 - - Default Default @@ -450,11 +445,6 @@ Enter 鍵行為; Only add new line on enter after end of fully typed word - - Visual C# Script - Visual C# 指令碼 - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/VSPackage.resx b/src/VisualStudio/VisualBasic/Impl/VSPackage.resx index 5d08b3c624aa9..a77f0471bc1f1 100644 --- a/src/VisualStudio/VisualBasic/Impl/VSPackage.resx +++ b/src/VisualStudio/VisualBasic/Impl/VSPackage.resx @@ -208,10 +208,4 @@ Use enhanced colors;Editor Color Scheme;Inheritance Margin;Import Directives;Visual Basic Tools Help > About - - Visual Basic Script - - - An empty Visual Basic script file. - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.cs.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.cs.xlf index 3e480ae5e0d4f..89b8f916f76d4 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.cs.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.cs.xlf @@ -130,16 +130,6 @@ Používat rozšířené barvy;Barevné schéma editoru;Okraj dědičnosti;Direk Nástroje Visual Basicu Help > About - - An empty Visual Basic script file. - Prázdný soubor skriptu Visual Basicu - - - - Visual Basic Script - Skript Visual Basicu - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.de.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.de.xlf index e3e7071dc4130..5f0cd72bc7208 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.de.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.de.xlf @@ -130,16 +130,6 @@ Erweiterte Farben verwenden;Editor-Farbschema;Vererbungsspielraum;Richtlinien im Visual Basic-Tools Help > About - - An empty Visual Basic script file. - Eine leere Visual Basic-Skriptdatei. - - - - Visual Basic Script - Visual Basic-Skript - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.es.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.es.xlf index d9aca8082b72e..8a092b2a86686 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.es.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.es.xlf @@ -130,16 +130,6 @@ Usar colores mejorados;Combinación de colores del editor;Margen de herencia;Dir Herramientas de Visual Basic Help > About - - An empty Visual Basic script file. - Un archivo de script de Visual Basic vacío. - - - - Visual Basic Script - Script de Visual Basic - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.fr.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.fr.xlf index 4a10289b48ac6..6f9d5251b0861 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.fr.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.fr.xlf @@ -130,16 +130,6 @@ Utiliser des couleurs améliorées ; Modèle de couleurs de l’éditeur;Marge d Outils Visual Basic Help > About - - An empty Visual Basic script file. - Fichier de script Visual Basic vide. - - - - Visual Basic Script - Script Visual Basic - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.it.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.it.xlf index f212918f97dd0..05ead449eda01 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.it.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.it.xlf @@ -130,16 +130,6 @@ Usare colori avanzati; Combinazione colori editor;Margine di ereditarietà;Diret Strumenti di Visual Basic Help > About - - An empty Visual Basic script file. - File script di Visual Basic vuoto. - - - - Visual Basic Script - Script di Visual Basic - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ja.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ja.xlf index 7bf1f9f4c24be..c4cb8c5e5ff15 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ja.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ja.xlf @@ -130,16 +130,6 @@ JSON 文字列のエディター機能の検出と提供; Visual Basic ツール Help > About - - An empty Visual Basic script file. - 空の Visual Basic スクリプト ファイル。 - - - - Visual Basic Script - Visual Basic スクリプト - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ko.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ko.xlf index dd3ec505f7e48..b43840a0f901b 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ko.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ko.xlf @@ -130,16 +130,6 @@ JSON 문자열 색상 지정, Visual Basic 도구 Help > About - - An empty Visual Basic script file. - 비어 있는 Visual Basic 스크립트 파일입니다. - - - - Visual Basic Script - Visual Basic 스크립트 - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pl.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pl.xlf index 1018c8a1f8bf9..dfc04b5da1e7f 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pl.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pl.xlf @@ -130,16 +130,6 @@ Używanie rozszerzonych kolorów; Schemat kolorów edytora;Margines dziedziczeni Narzędzia języka Visual Basic Help > About - - An empty Visual Basic script file. - Pusty plik skryptu języka Visual Basic. - - - - Visual Basic Script - Skrypt języka Visual Basic - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pt-BR.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pt-BR.xlf index f9d156fa540ba..7a64fb3e6120b 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pt-BR.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.pt-BR.xlf @@ -130,16 +130,6 @@ Usar cores aprimoradas;Esquema de Cores do Editor;Margem de Herança;Importar Di Ferramentas do Visual Basic Help > About - - An empty Visual Basic script file. - Um arquivo de script vazio do Visual Basic. - - - - Visual Basic Script - Script do Visual Basic - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ru.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ru.xlf index ab8f5e44b536f..b0315632359ad 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ru.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.ru.xlf @@ -130,16 +130,6 @@ JSON; Инструменты Visual Basic Help > About - - An empty Visual Basic script file. - Пустой файл сценария Visual Basic. - - - - Visual Basic Script - Сценарий Visual Basic - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.tr.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.tr.xlf index 81e4a19a73a15..7c8826d805575 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.tr.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.tr.xlf @@ -130,16 +130,6 @@ Gelişmiş renkleri kullan;Düzenleyici Renk Düzeni;Devralma Kenar Boşluğu;İ Visual Basic Araçları Help > About - - An empty Visual Basic script file. - Boş bir Visual Basic betik dosyası. - - - - Visual Basic Script - Visual Basic Betiği - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hans.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hans.xlf index 403ed32122a6e..8e6b9e052b60d 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hans.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hans.xlf @@ -130,16 +130,6 @@ JSON; Visual Basic 工具 Help > About - - An empty Visual Basic script file. - 空的 Visual Basic 脚本文件。 - - - - Visual Basic Script - Visual Basic 脚本 - - \ No newline at end of file diff --git a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hant.xlf b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hant.xlf index b6324ad3cf1f8..5784a3d19b718 100644 --- a/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hant.xlf +++ b/src/VisualStudio/VisualBasic/Impl/xlf/VSPackage.zh-Hant.xlf @@ -130,16 +130,6 @@ JSON; Visual Basic 工具 Help > About - - An empty Visual Basic script file. - 空白的 Visual Basic 指令碼檔。 - - - - Visual Basic Script - Visual Basic 指令碼 - - \ No newline at end of file diff --git a/src/Workspaces/VisualBasic/Portable/VBWorkspaceResources.resx b/src/Workspaces/VisualBasic/Portable/VBWorkspaceResources.resx index 6464862e1bc3a..b040162d4149e 100644 --- a/src/Workspaces/VisualBasic/Portable/VBWorkspaceResources.resx +++ b/src/Workspaces/VisualBasic/Portable/VBWorkspaceResources.resx @@ -243,15 +243,6 @@ Introduces a type conversion operation that does not throw an exception. If an attempted conversion fails, TryCast returns Nothing, which your program can test for. - - Node does not descend from root. - - - Node not in parent's child list - - - Trivia is not associated with token - <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.cs.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.cs.xlf index 14f7d84f67b5c..a5bb92f2b56b6 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.cs.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.cs.xlf @@ -227,21 +227,6 @@ Zavádí operaci převodu typu, která nevyvolá výjimku. Pokud se pokus o převod nezdaří, TryCast vrací hodnotu Nothing, kterou může váš program testovat. - - Node does not descend from root. - Uzel nesestupuje z kořene. - - - - Node not in parent's child list - Uzel není v seznamu podřízených položek u nadřazené položky. - - - - Trivia is not associated with token - Triviální prvek není přidružený k tokenu. - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.de.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.de.xlf index dead138d40102..5c1ddf495702f 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.de.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.de.xlf @@ -227,21 +227,6 @@ Führt eine Typenkonvertierungsoperation ein, die keine Ausnahme auslöst. Wenn beim Versuch einer Konvertierung ein Fehler auftritt, gibt "TryCast" den Wert "Nothing" zurück, auf den das Programm eine Überprüfung durchführen kann. - - Node does not descend from root. - Knoten steigt nicht vom Stamm ab. - - - - Node not in parent's child list - Knoten befindet sich nicht in der untergeordneten Liste des übergeordneten Elements - - - - Trivia is not associated with token - Trivia ist nicht dem Token zugeordnet - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.es.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.es.xlf index c05fdff3746ae..a828ee4730b1d 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.es.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.es.xlf @@ -227,21 +227,6 @@ Introduce una operación de conversión de tipos que no produce una excepción. Si no se puede realizar la conversión, TryCast devuelve Nothing, que el programa puede probar. - - Node does not descend from root. - El nodo no desciende de la raíz. - - - - Node not in parent's child list - El nodo no está en la lista secundaria de la primaria - - - - Trivia is not associated with token - Trivialidad no asociada con token - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.fr.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.fr.xlf index 5301e427936ea..104e111a3c795 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.fr.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.fr.xlf @@ -227,21 +227,6 @@ Introduit une opération de conversion de type qui ne lève pas d'exception. En cas d'échec d'une tentative de conversion, TryCast retourne Nothing, qui peut être testé par votre programme. - - Node does not descend from root. - Le nœud ne provient pas de la racine. - - - - Node not in parent's child list - Le nœud ne figure pas dans la liste des enfants du parent - - - - Trivia is not associated with token - Trivia non associé au jeton - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.it.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.it.xlf index 3c587b4ca1164..23926ea56983d 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.it.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.it.xlf @@ -227,21 +227,6 @@ Introduce un'operazione di conversione di tipo che non genera un'eccezione. Se un tentativo di conversione ha esito negativo, TryCast restituisce Nothing, che può essere verificato dal programma. - - Node does not descend from root. - Il nodo non discende dalla radice. - - - - Node not in parent's child list - Il nodo non è incluso nell'elenco degli elementi figlio dell'elemento padre - - - - Trivia is not associated with token - Gli elementi semplici non sono associati al token - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ja.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ja.xlf index 585be81cb8a14..01aa95869062d 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ja.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ja.xlf @@ -227,21 +227,6 @@ 例外をスローしない型変換操作を導入します。行われた変換が失敗した場合、TryCast はプログラムがテストできる Nothing を返します。 - - Node does not descend from root. - Node がルートから派生していません。 - - - - Node not in parent's child list - Node が親の子リストにありません - - - - Trivia is not associated with token - トリビアがトークンに関連付けられていません - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ko.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ko.xlf index 847eaa07fdf04..8f7664f22d652 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ko.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ko.xlf @@ -227,21 +227,6 @@ 예외를 throw하지 않는 형식 변환 작업을 지정합니다. 변환하지 못한 경우 프로그램에서 테스트할 수 있도록 TryCast에서 Nothing을 반환합니다. - - Node does not descend from root. - 노드가 루트의 내림차순이 아닙니다. - - - - Node not in parent's child list - 부모의 자식 목록에 노드가 없습니다. - - - - Trivia is not associated with token - Trivia가 토큰에 연결되어 있지 않습니다. - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pl.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pl.xlf index 6bcdbbfeaf06a..13b56c6a55309 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pl.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pl.xlf @@ -227,21 +227,6 @@ Wprowadza operację konwersji typu, która nie zgłasza wyjątku. Jeśli próba konwersji nie powiedzie się, element TryCast zwróci wartość Nothing, którą Twój program może użyć do testów. - - Node does not descend from root. - Węzeł nie jest elementem podrzędnym elementu głównego. - - - - Node not in parent's child list - Węzeł nie znajduje się na liście elementów podrzędnych elementu nadrzędnego - - - - Trivia is not associated with token - Elementy towarzyszące składni nie są skojarzone z tokenem - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pt-BR.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pt-BR.xlf index bb32983c00c88..8ee104e3ab603 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pt-BR.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.pt-BR.xlf @@ -227,21 +227,6 @@ Apresenta uma operação de conversão de tipo que não gera uma exceção. Se uma tentativa de conversão falhar, TryCast retorna Nothing, para a qual seu programa pode testar. - - Node does not descend from root. - Nó não deriva da raiz. - - - - Node not in parent's child list - Nó não está na lista de filhos do pai - - - - Trivia is not associated with token - Trívia não está associada a token - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ru.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ru.xlf index 79264b2a16f88..1b577679dc3f9 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ru.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.ru.xlf @@ -227,21 +227,6 @@ Вводит операцию преобразования типа, которая не выдает исключение. Если попытка преобразования не удалась, TryCast не возвращает ничего из того, что ваша программа может протестировать. - - Node does not descend from root. - Узел не является корневым. - - - - Node not in parent's child list - Узел не входит в родительский список дочерних узлов - - - - Trivia is not associated with token - Trivia не связана с токеном - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.tr.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.tr.xlf index 39010587cf624..aac21f16029bd 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.tr.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.tr.xlf @@ -227,21 +227,6 @@ Özel durum oluşturmayan bir tür dönüştürme işlemini ortaya çıkarır. Eğer denenen bir dönüştürme başarısız olursa, TryCast programınızın test edebileceği Hiçbir Değer döndürmez. - - Node does not descend from root. - Düğüm kökten azalmaz. - - - - Node not in parent's child list - Düğüm üst öğenin alt öğe listesinde değil - - - - Trivia is not associated with token - Meraklısına Notlar belirteç ile ilgili değil - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hans.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hans.xlf index a293e7c1ac563..1fd78caf06402 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hans.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hans.xlf @@ -227,21 +227,6 @@ 引入一个不引发异常的类型转换运算。如果尝试执行的转换失败,TryCast 会返回空值,程序可对此进行测试。 - - Node does not descend from root. - 节点并非源自根。 - - - - Node not in parent's child list - 不在父级的子列表中的节点 - - - - Trivia is not associated with token - 琐事与标记不相关联 - - <typeOrMember> <typeOrMember> diff --git a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hant.xlf b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hant.xlf index a3ed8d30591b8..44960fcd0ace1 100644 --- a/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hant.xlf +++ b/src/Workspaces/VisualBasic/Portable/xlf/VBWorkspaceResources.zh-Hant.xlf @@ -227,21 +227,6 @@ 採用不會擲出例外狀況的類型轉換作業。如果嘗試的轉換失敗,TryCast 會傳回 Nothing,讓您的程式能夠測試。 - - Node does not descend from root. - 節點不是根的子系。 - - - - Node not in parent's child list - 節點不在父代的子清單中 - - - - Trivia is not associated with token - Trivia 與語彙基元無關聯 - - <typeOrMember> <typeOrMember> From 7844cc64e01daa96a9f4095c267948e264d707db Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 12:47:47 -0700 Subject: [PATCH 31/94] Fix --- .../LanguageServerResources.resx | 2 +- .../xlf/LanguageServerResources.cs.xlf | 4 ++-- .../xlf/LanguageServerResources.de.xlf | 4 ++-- .../xlf/LanguageServerResources.es.xlf | 4 ++-- .../xlf/LanguageServerResources.fr.xlf | 4 ++-- .../xlf/LanguageServerResources.it.xlf | 4 ++-- .../xlf/LanguageServerResources.ja.xlf | 4 ++-- .../xlf/LanguageServerResources.ko.xlf | 4 ++-- .../xlf/LanguageServerResources.pl.xlf | 4 ++-- .../xlf/LanguageServerResources.pt-BR.xlf | 4 ++-- .../xlf/LanguageServerResources.ru.xlf | 4 ++-- .../xlf/LanguageServerResources.tr.xlf | 4 ++-- .../xlf/LanguageServerResources.zh-Hans.xlf | 4 ++-- .../xlf/LanguageServerResources.zh-Hant.xlf | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx index 6743db6dce89a..890a0f135613b 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx @@ -151,7 +151,7 @@ Failed: {0}, Passed: {1}, Skipped: {2}, Total: {3}, Duration: {4} - + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf index 071bf28df6f7e..fce49dc95612a 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf @@ -57,9 +57,9 @@ Neúspěšné: {0}, Úspěšné: {1}, Přeskočeno: {2}, Celkem: {3}, Doba trvání: {4} - + Failed to read .runsettings file at {0}:{1} - Čtení souboru .runsettings na {0} se nezdařilo:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf index bdf495a8509c4..606734d5d3b4f 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf @@ -57,9 +57,9 @@ Fehlgeschlagen: {0}, erfolgreich: {1}, übersprungen: {2}, gesamt: {3}, Dauer: {4} - + Failed to read .runsettings file at {0}:{1} - Fehler beim Lesen der RUNSETTINGS-Datei unter {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf index 733ccb0b42d06..130e824fefda5 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf @@ -57,9 +57,9 @@ Error: {0}, Correcto: {1}, Omitido: {2}, Total: {3}, Duración: {4} - + Failed to read .runsettings file at {0}:{1} - No se pudo leer el archivo .runsettings en {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf index 3c7e23bc77ef4..79ac14bee0805 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf @@ -57,9 +57,9 @@ Échec : {0}, Réussi : {1}, Ignoré : {2}, Total : {3}, Durée : {4} - + Failed to read .runsettings file at {0}:{1} - Échec de la lecture du fichier .runsettings à l'adresse {0} :{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf index e2e00f180c266..e28f18705f9cd 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf @@ -57,9 +57,9 @@ Non superati: {0}%1, Superati: {1}%2, Ignorati: {2}%2, Totale: {3}%2, Durata: {4} - + Failed to read .runsettings file at {0}:{1} - Non è stato possibile leggere il file con estensione runsettings in {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf index 56d55fec10cc8..18ea96ef8d519 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf @@ -57,9 +57,9 @@ 失敗: {0}、合格: {1}、スキップ: {2}、合計: {3}、期間: {4} - + Failed to read .runsettings file at {0}:{1} - {0}:{1} の .runsettings ファイルを読み取れできませんでした + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf index 858778324bcd9..546715d7d11a6 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf @@ -57,9 +57,9 @@ 실패: {0}, 통과: {1}, 건너뜀: {2}, 합계: {3}, 기간: {4} - + Failed to read .runsettings file at {0}:{1} - {0}:{1}에서 .runsettings 파일을 읽지 못했습니다. + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf index b58cdcf14e7a5..93450a5eb8081 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf @@ -57,9 +57,9 @@ Niepowodzenie: {0}, zakończone powodzeniem: {1}, pominięte: {2}, łącznie: {3}, czas trwania: {4} - + Failed to read .runsettings file at {0}:{1} - Nie można odczytać pliku .runsettings w {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf index ccee5fc4f388a..810426026e0fa 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf @@ -57,9 +57,9 @@ Falhou: {0}, Passou: {1}, Ignorado: {2}, Total: {3}, Duração: {4} - + Failed to read .runsettings file at {0}:{1} - Falha ao ler o arquivo .runsettings em {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf index ad637a7496361..ffb1d27e0ec3b 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf @@ -57,9 +57,9 @@ Не пройдено: {0}, пройдено: {1}, пропущено: {2}, всего: {3}, длительность: {4} - + Failed to read .runsettings file at {0}:{1} - Не удалось прочитать файл RUNSETTINGS в {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf index 2f19be53bfd2f..c96b2c883235f 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf @@ -57,9 +57,9 @@ Başarısız: {0}, Başarılı: {1}, Atlandı: {2}, Toplam: {3}, Süre: {4} - + Failed to read .runsettings file at {0}:{1} - Şu konumdaki .runsettings dosyası okunamadı: {0}:{1} + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf index 57be82154c287..4ae377a65b07b 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf @@ -57,9 +57,9 @@ 失败: {0} 个,通过: {1} 个,已跳过: {2} 个,总计: {3} 个,持续时间: {4} - + Failed to read .runsettings file at {0}:{1} - 无法读取 {0}:{1}的 .runsettings 文件 + Failed to read .runsettings file at {0}:{1} diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf index 49824bc2b56ed..88046acb63b22 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf @@ -57,9 +57,9 @@ 失敗: {0},通過: {1},跳過: {2},總計: {3},持續時間: {4} - + Failed to read .runsettings file at {0}:{1} - 無法讀取位於 {0} 的 .runsettings 檔案: {1} + Failed to read .runsettings file at {0}:{1} From 8c1f74ac4014c72115bd2440048ff75d7fd8da59 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 21 Mar 2024 15:27:34 -0500 Subject: [PATCH 32/94] Unify C# and VB implementations of TestCompletionInLinkedFiles Includes a documented workaround for editor race condition filed as https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2003327. --- .../CSharpCompletionCommandHandlerTests.vb | 2 ++ .../VisualBasicCompletionCommandHandlerTests.vb | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb b/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb index 68e2af22847fe..9d605373797f3 100644 --- a/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb +++ b/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb @@ -4069,6 +4069,7 @@ class C state.SendBackspace() state.SendBackspace() state.SendBackspace() + Await state.AssertCompletionSession() state.SendEscape() state.Workspace.SetDocumentContext(linkDocument.Id) state.SendTypeChars("Thing1") @@ -4080,6 +4081,7 @@ class C state.SendBackspace() state.SendBackspace() state.SendBackspace() + Await state.AssertCompletionSession() state.SendTypeChars("M") Await state.AssertSelectedCompletionItem("M") Assert.False(state.GetSelectedItem().Tags.Contains(WellKnownTags.Warning)) diff --git a/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb b/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb index 6ea49342b64d6..91bce7c96b290 100644 --- a/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb +++ b/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb @@ -2060,9 +2060,23 @@ End Class state.SendBackspace() state.SendBackspace() state.SendBackspace() + + ' Assert the lack of a completion session (which implicitly waits for background operations to complete) + ' to ensure the session is dismissed before typing the next character. + ' https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2003327 + Await state.AssertNoCompletionSession() + state.Workspace.SetDocumentContext(linkDocument.Id) state.SendTypeChars("Thi") Await state.AssertSelectedCompletionItem("Thing1") + Assert.True(state.GetSelectedItem().Tags.Contains(WellKnownTags.Warning)) + state.SendBackspace() + state.SendBackspace() + state.SendBackspace() + Await state.AssertNoCompletionSession() + state.SendTypeChars("M") + Await state.AssertSelectedCompletionItem("M") + Assert.False(state.GetSelectedItem().Tags.Contains(WellKnownTags.Warning)) End Using End Function From 92e8fa3aa8f552f414800af877f3d18aa442201d Mon Sep 17 00:00:00 2001 From: Todd Grunke Date: Thu, 21 Mar 2024 14:32:16 -0700 Subject: [PATCH 33/94] Reduce allocations in SolutionCompilationState.CreateCompilationTrackerMap (#72596) Reduce allocations due to resizes in SolutionCompilationState.CreateCompilationTrackerMap. We now use an ImmutableSegmentedDictionary builder to both simplify the code and allocate less. The builder will only create a new dictionary if it's modified, and it does so in a way that doesn't require multiple resizes (which is where the allocation gains from this change are realized). Additionally, use of the builder allowed a simplification where the modification callback can be changed to a simple action. The call to CreateCompilationTrackerMap now passes in an optimization flag indicating whether the callback needs to occur for empty collections. --- .../Solution/SolutionCompilationState.cs | 85 +++++++++---------- 1 file changed, 39 insertions(+), 46 deletions(-) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.cs index 8fae3dc62d07b..4f39efd34e3a1 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.cs @@ -179,15 +179,13 @@ private SolutionCompilationState ForceForkProject( if (trackerMap.TryGetValue(arg.projectId, out var tracker)) { if (!arg.forkTracker) - return trackerMap.Remove(arg.projectId); - - trackerMap[arg.projectId] = tracker.Fork(arg.newProjectState, arg.translate); - return true; + trackerMap.Remove(arg.projectId); + else + trackerMap[arg.projectId] = tracker.Fork(arg.newProjectState, arg.translate); } - - return false; }, - (translate, forkTracker, projectId, newProjectState)); + (translate, forkTracker, projectId, newProjectState), + skipEmptyCallback: true); return this.Branch( newSolutionState, @@ -204,10 +202,11 @@ private SolutionCompilationState ForceForkProject( private ImmutableSegmentedDictionary CreateCompilationTrackerMap( ProjectId changedProjectId, ProjectDependencyGraph dependencyGraph, - Func, TArg, bool> modifyNewTrackerInfo, - TArg arg) + Action.Builder, TArg> modifyNewTrackerInfo, + TArg arg, + bool skipEmptyCallback) { - return CreateCompilationTrackerMap(CanReuse, (changedProjectId, dependencyGraph), modifyNewTrackerInfo, arg); + return CreateCompilationTrackerMap(CanReuse, (changedProjectId, dependencyGraph), modifyNewTrackerInfo, arg, skipEmptyCallback); // Returns true if 'tracker' can be reused for project 'id' static bool CanReuse(ProjectId id, (ProjectId changedProjectId, ProjectDependencyGraph dependencyGraph) arg) @@ -231,10 +230,11 @@ static bool CanReuse(ProjectId id, (ProjectId changedProjectId, ProjectDependenc private ImmutableSegmentedDictionary CreateCompilationTrackerMap( ImmutableArray changedProjectIds, ProjectDependencyGraph dependencyGraph, - Func, TArg, bool> modifyNewTrackerInfo, - TArg arg) + Action.Builder, TArg> modifyNewTrackerInfo, + TArg arg, + bool skipEmptyCallback) { - return CreateCompilationTrackerMap(CanReuse, (changedProjectIds, dependencyGraph), modifyNewTrackerInfo, arg); + return CreateCompilationTrackerMap(CanReuse, (changedProjectIds, dependencyGraph), modifyNewTrackerInfo, arg, skipEmptyCallback); // Returns true if 'tracker' can be reused for project 'id' static bool CanReuse(ProjectId id, (ImmutableArray changedProjectIds, ProjectDependencyGraph dependencyGraph) arg) @@ -262,44 +262,39 @@ static bool CanReuse(ProjectId id, (ImmutableArray changedProjectIds, private ImmutableSegmentedDictionary CreateCompilationTrackerMap( Func canReuse, TArgCanReuse argCanReuse, - Func, TArgModifyNewTrackerInfo, bool> modifyNewTrackerInfo, - TArgModifyNewTrackerInfo argModifyNewTrackerInfo) + Action.Builder, TArgModifyNewTrackerInfo> modifyNewTrackerInfo, + TArgModifyNewTrackerInfo argModifyNewTrackerInfo, + bool skipEmptyCallback) { - using var _ = PooledDictionary.GetInstance(out var newTrackerInfo); - // Keep _projectIdToTrackerMap in a local as it can change during the execution of this method var projectIdToTrackerMap = _projectIdToTrackerMap; -#if NETCOREAPP - newTrackerInfo.EnsureCapacity(projectIdToTrackerMap.Count); -#endif + // Avoid allocating the builder if the map is empty and the callback doesn't need + // to be called with empty collections. + if (projectIdToTrackerMap.Count == 0 && skipEmptyCallback) + return projectIdToTrackerMap; - var allReused = true; + var projectIdToTrackerMapBuilder = projectIdToTrackerMap.ToBuilder(); foreach (var (id, tracker) in projectIdToTrackerMap) { - var localTracker = tracker; if (!canReuse(id, argCanReuse)) { - localTracker = tracker.Fork(tracker.ProjectState, translate: null); - allReused = false; - } + var localTracker = tracker.Fork(tracker.ProjectState, translate: null); - newTrackerInfo.Add(id, localTracker); + projectIdToTrackerMapBuilder[id] = localTracker; + } } - var isModified = modifyNewTrackerInfo(newTrackerInfo, argModifyNewTrackerInfo); - - if (allReused && !isModified) - return projectIdToTrackerMap; + modifyNewTrackerInfo(projectIdToTrackerMapBuilder, argModifyNewTrackerInfo); - return ImmutableSegmentedDictionary.CreateRange(newTrackerInfo); + return projectIdToTrackerMapBuilder.ToImmutable(); } /// public SolutionCompilationState AddProject(ProjectInfo projectInfo) { var newSolutionState = this.SolutionState.AddProject(projectInfo); - var newTrackerMap = CreateCompilationTrackerMap(projectInfo.Id, newSolutionState.GetProjectDependencyGraph(), static (_, _) => false, /* unused */ 0); + var newTrackerMap = CreateCompilationTrackerMap(projectInfo.Id, newSolutionState.GetProjectDependencyGraph(), static (_, _) => { }, /* unused */ 0, skipEmptyCallback: true); return Branch( newSolutionState, @@ -315,9 +310,10 @@ public SolutionCompilationState RemoveProject(ProjectId projectId) newSolutionState.GetProjectDependencyGraph(), static (trackerMap, projectId) => { - return trackerMap.Remove(projectId); + trackerMap.Remove(projectId); }, - projectId); + projectId, + skipEmptyCallback: true); return this.Branch( newSolutionState, @@ -1014,27 +1010,27 @@ public SolutionCompilationState WithoutFrozenSourceGeneratedDocuments() if (FrozenSourceGeneratedDocumentStates == null) return this; - var projectIdsToUnfreeze = FrozenSourceGeneratedDocumentStates.Value.States.Values.Select(static state => state.Identity.DocumentId.ProjectId).Distinct(); + var projectIdsToUnfreeze = FrozenSourceGeneratedDocumentStates.Value.States.Values + .Select(static state => state.Identity.DocumentId.ProjectId) + .Distinct() + .ToImmutableArray(); // Since we previously froze documents in these projects, we should have a CompilationTracker entry for it, and it should be a // GeneratedFileReplacingCompilationTracker. To undo the operation, we'll just restore the original CompilationTracker. var newTrackerMap = CreateCompilationTrackerMap( - projectIdsToUnfreeze.ToImmutableArray(), + projectIdsToUnfreeze, this.SolutionState.GetProjectDependencyGraph(), static (trackerMap, projectIdsToUnfreeze) => { - var mapModified = false; foreach (var projectId in projectIdsToUnfreeze) { Contract.ThrowIfFalse(trackerMap.TryGetValue(projectId, out var existingTracker)); var replacingItemTracker = (GeneratedFileReplacingCompilationTracker)existingTracker; trackerMap[projectId] = replacingItemTracker.UnderlyingTracker; - mapModified = true; } - - return mapModified; }, - projectIdsToUnfreeze); + projectIdsToUnfreeze, + skipEmptyCallback: projectIdsToUnfreeze.Length == 0); // We pass the same solution state, since this change is only a change of the generated documents -- none of the core // documents or project structure changes in any way. @@ -1102,7 +1098,6 @@ public SolutionCompilationState WithFrozenSourceGeneratedDocuments( this.SolutionState.GetProjectDependencyGraph(), static (trackerMap, arg) => { - var mapModified = false; foreach (var (projectId, documentStatesForProject) in arg.documentStatesByProjectId) { // We want to create a new snapshot with a new compilation tracker that will do this replacement. @@ -1114,12 +1109,10 @@ public SolutionCompilationState WithFrozenSourceGeneratedDocuments( } trackerMap[projectId] = new GeneratedFileReplacingCompilationTracker(existingTracker, new(documentStatesForProject)); - mapModified = true; } - - return mapModified; }, - (documentStatesByProjectId, this.SolutionState)); + (documentStatesByProjectId, this.SolutionState), + skipEmptyCallback: false); // We pass the same solution state, since this change is only a change of the generated documents -- none of the core // documents or project structure changes in any way. From aff251d4cf72d8f84fa16876ae94c30d975b4aaa Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Thu, 21 Mar 2024 14:46:52 -0700 Subject: [PATCH 34/94] Add support for various Copilot Chat related features --- .../PredefinedCodeFixProviderNames.cs | 1 + .../CodeActions/PreviewExceptionTests.cs | 9 +- ....SingleDiagnosticKindPullTaggerProvider.cs | 13 ++ .../Copilot/FlavoredSuggestedAction.cs | 50 ++++++ .../RefineUsingCopilotCodeAction.cs | 110 +++++++++++++ .../RefineUsingCopilotSuggestedAction.cs | 66 ++++++++ .../SuggestedActionWithNestedFlavors.cs | 68 +++++--- .../CodeFixSuggestedAction.cs | 4 +- .../CodeRefactoringSuggestedAction.cs | 4 +- .../SuggestedActionsSource_Async.cs | 14 +- .../Core/Copilot/CopilotTaggerProvider.cs | 91 ++++++++++ .../Core/EditorFeaturesResources.resx | 3 + ...crosoft.CodeAnalysis.EditorFeatures.csproj | 1 + .../Tagging/EventSources/TaggerConstants.cs | 1 + .../Core/Tagging/TaggerDelay.cs | 8 + .../Core/xlf/EditorFeaturesResources.cs.xlf | 5 + .../Core/xlf/EditorFeaturesResources.de.xlf | 5 + .../Core/xlf/EditorFeaturesResources.es.xlf | 5 + .../Core/xlf/EditorFeaturesResources.fr.xlf | 5 + .../Core/xlf/EditorFeaturesResources.it.xlf | 5 + .../Core/xlf/EditorFeaturesResources.ja.xlf | 5 + .../Core/xlf/EditorFeaturesResources.ko.xlf | 5 + .../Core/xlf/EditorFeaturesResources.pl.xlf | 5 + .../xlf/EditorFeaturesResources.pt-BR.xlf | 5 + .../Core/xlf/EditorFeaturesResources.ru.xlf | 5 + .../Core/xlf/EditorFeaturesResources.tr.xlf | 5 + .../xlf/EditorFeaturesResources.zh-Hans.xlf | 5 + .../xlf/EditorFeaturesResources.zh-Hant.xlf | 5 + .../Portable/CSharpFeaturesResources.resx | 12 ++ ...odeFixProvider.DismissChangesCodeAction.cs | 61 +++++++ ...odeFixProvider.DocumentChangeCodeAction.cs | 30 ++++ .../Copilot/CSharpCopilotCodeFixProvider.cs | 137 ++++++++++++++++ .../xlf/CSharpFeaturesResources.cs.xlf | 20 +++ .../xlf/CSharpFeaturesResources.de.xlf | 20 +++ .../xlf/CSharpFeaturesResources.es.xlf | 20 +++ .../xlf/CSharpFeaturesResources.fr.xlf | 20 +++ .../xlf/CSharpFeaturesResources.it.xlf | 20 +++ .../xlf/CSharpFeaturesResources.ja.xlf | 20 +++ .../xlf/CSharpFeaturesResources.ko.xlf | 20 +++ .../xlf/CSharpFeaturesResources.pl.xlf | 20 +++ .../xlf/CSharpFeaturesResources.pt-BR.xlf | 20 +++ .../xlf/CSharpFeaturesResources.ru.xlf | 20 +++ .../xlf/CSharpFeaturesResources.tr.xlf | 20 +++ .../xlf/CSharpFeaturesResources.zh-Hans.xlf | 20 +++ .../xlf/CSharpFeaturesResources.zh-Hant.xlf | 20 +++ .../CodeRefactoringService.cs | 4 +- .../Core/Portable/Common/DelayTimeSpan.cs | 5 + .../Portable/Completion/CompletionService.cs | 10 +- .../CompletionService_GetCompletions.cs | 5 +- .../Core/Portable/Copilot/Extensions.cs | 39 +++++ .../Copilot/ICopilotCodeAnalysisService.cs | 73 +++++++++ .../Core/Portable/FeaturesResources.resx | 6 + .../QuickInfoServiceWithProviders.cs | 10 +- .../Shared/Extensions/DocumentExtensions.cs | 4 - .../Portable/xlf/FeaturesResources.cs.xlf | 10 ++ .../Portable/xlf/FeaturesResources.de.xlf | 10 ++ .../Portable/xlf/FeaturesResources.es.xlf | 10 ++ .../Portable/xlf/FeaturesResources.fr.xlf | 10 ++ .../Portable/xlf/FeaturesResources.it.xlf | 10 ++ .../Portable/xlf/FeaturesResources.ja.xlf | 10 ++ .../Portable/xlf/FeaturesResources.ko.xlf | 10 ++ .../Portable/xlf/FeaturesResources.pl.xlf | 10 ++ .../Portable/xlf/FeaturesResources.pt-BR.xlf | 10 ++ .../Portable/xlf/FeaturesResources.ru.xlf | 10 ++ .../Portable/xlf/FeaturesResources.tr.xlf | 10 ++ .../xlf/FeaturesResources.zh-Hans.xlf | 10 ++ .../xlf/FeaturesResources.zh-Hant.xlf | 10 ++ .../Features/CodeFixes/CodeFixService.cs | 34 +++- .../DocumentDiagnosticSource.cs | 8 + .../AnalyzerRunner/CodeRefactoringRunner.cs | 1 - src/Tools/AnalyzerRunner/Options.cs | 1 - .../Analyzer/CopilotChecksumWrapper.cs | 42 +++++ .../Copilot/Analyzer/CopilotUtilities.cs | 38 +++++ .../IExternalCSharpCopilotAnalyzer.cs | 21 +++ .../AbstractCopilotCodeAnalysisService.cs | 155 ++++++++++++++++++ ...otCodeAnalysisService.ReflectionWrapper.cs | 147 +++++++++++++++++ .../CSharpCopilotCodeAnalysisService.cs | 43 +++++ ...CSharpCopilotCodeAnalysisServiceFactory.cs | 28 ++++ .../VisualStudioCopilotOptionService.cs | 39 +++++ .../CodeMapper/CopilotCSharpMapCodeService.cs | 59 ++++--- .../Copilot/InternalAPI.Unshipped.txt | 16 ++ ...CodeAnalysis.ExternalAccess.Copilot.csproj | 10 +- .../AbstractWorkspaceTelemetryService.cs | 5 + .../Core/Portable/CodeActions/CodeAction.cs | 6 + .../WellKnownDiagnosticCustomTags.cs | 1 + .../IExtensionManagerExtensions.cs | 8 +- .../Shared/TestHooks/FeatureAttribute.cs | 1 + .../Telemetry/IWorkspaceTelemetryService.cs | 5 + .../Services/SyntaxFacts/CSharpSyntaxFacts.cs | 9 +- .../Compiler/Core/Log/FunctionId.cs | 3 + .../Core/Services/SyntaxFacts/ISyntaxFacts.cs | 1 + .../SyntaxFacts/VisualBasicSyntaxFacts.vb | 73 ++++++--- 92 files changed, 1942 insertions(+), 106 deletions(-) create mode 100644 src/EditorFeatures/Core.Wpf/Suggestions/Copilot/FlavoredSuggestedAction.cs create mode 100644 src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotCodeAction.cs create mode 100644 src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotSuggestedAction.cs create mode 100644 src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs create mode 100644 src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs create mode 100644 src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs create mode 100644 src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs create mode 100644 src/Features/Core/Portable/Copilot/Extensions.cs create mode 100644 src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Analyzer/CopilotChecksumWrapper.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Analyzer/CopilotUtilities.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Analyzer/IExternalCSharpCopilotAnalyzer.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisServiceFactory.cs create mode 100644 src/Tools/ExternalAccess/Copilot/Internal/Analyzer/VisualStudioCopilotOptionService.cs diff --git a/src/Analyzers/Core/CodeFixes/PredefinedCodeFixProviderNames.cs b/src/Analyzers/Core/CodeFixes/PredefinedCodeFixProviderNames.cs index e6069cc4b93c4..b9b3280c25209 100644 --- a/src/Analyzers/Core/CodeFixes/PredefinedCodeFixProviderNames.cs +++ b/src/Analyzers/Core/CodeFixes/PredefinedCodeFixProviderNames.cs @@ -43,6 +43,7 @@ internal static class PredefinedCodeFixProviderNames public const string ConvertToRecord = nameof(ConvertToRecord); public const string ConvertToTopLevelStatements = nameof(ConvertToTopLevelStatements); public const string ConvertTypeOfToNameOf = nameof(ConvertTypeOfToNameOf); + public const string CopilotSuggestions = nameof(CopilotSuggestions); public const string CorrectNextControlVariable = nameof(CorrectNextControlVariable); public const string DeclareAsNullable = nameof(DeclareAsNullable); public const string DisambiguateSameVariable = nameof(DisambiguateSameVariable); diff --git a/src/EditorFeatures/CSharpTest/CodeActions/PreviewExceptionTests.cs b/src/EditorFeatures/CSharpTest/CodeActions/PreviewExceptionTests.cs index dec0935e85599..50660fe6f5553 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/PreviewExceptionTests.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/PreviewExceptionTests.cs @@ -95,20 +95,21 @@ private static async Task ActionSets(EditorTestWorkspace workspace, CodeRefactor private static CodeRefactoringSuggestedAction CreateRefactoringSuggestedAction(EditorTestWorkspace workspace, CodeRefactoringProvider provider, out EditorLayerExtensionManager.ExtensionManager extensionManager) { var codeActions = new List(); - RefactoringSetup(workspace, provider, codeActions, out extensionManager, out var textBuffer); + RefactoringSetup(workspace, provider, codeActions, out extensionManager, out var textBuffer, out var document); var suggestedAction = new CodeRefactoringSuggestedAction( workspace.ExportProvider.GetExportedValue(), workspace.ExportProvider.GetExportedValue(), - workspace, workspace.CurrentSolution, textBuffer, provider, codeActions.First(), fixAllFlavors: null); + workspace, document, textBuffer, provider, codeActions.First(), fixAllFlavors: null); return suggestedAction; } private static void RefactoringSetup( EditorTestWorkspace workspace, CodeRefactoringProvider provider, List codeActions, out EditorLayerExtensionManager.ExtensionManager extensionManager, - out VisualStudio.Text.ITextBuffer textBuffer) + out VisualStudio.Text.ITextBuffer textBuffer, + out Document document) { - var document = GetDocument(workspace); + document = GetDocument(workspace); textBuffer = workspace.GetTestDocument(document.Id).GetTextBuffer(); var span = document.GetSyntaxRootAsync().Result.Span; var context = new CodeRefactoringContext(document, span, (a) => codeActions.Add(a), CancellationToken.None); diff --git a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs index 5e7f9c5b5cae9..a0d1d1a348a82 100644 --- a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs +++ b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Preview; @@ -134,6 +135,18 @@ private async Task ProduceTagsAsync( includeSuppressedDiagnostics: true, cancellationToken: cancellationToken).ConfigureAwait(false); + // Copilot code analysis is a special analyzer that reports semantic correctness + // issues in user's code. These diagnostics are computed by a special code analysis + // service in the background. As computing these diagnostics can be expensive, + // we only add cached Copilot diagnostics here. + // Note that we consider Copilot diagnostics as special analyzer semantic diagnostics + // and hence only report them for 'DiagnosticKind.AnalyzerSemantic'. + if (_diagnosticKind == DiagnosticKind.AnalyzerSemantic) + { + var copilotDiagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); + diagnostics = diagnostics.AddRange(copilotDiagnostics); + } + foreach (var diagnosticData in diagnostics) { if (_callback.IncludeDiagnostic(diagnosticData) && !diagnosticData.IsSuppressed) diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/Copilot/FlavoredSuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/Copilot/FlavoredSuggestedAction.cs new file mode 100644 index 0000000000000..db5f020c46022 --- /dev/null +++ b/src/EditorFeatures/Core.Wpf/Suggestions/Copilot/FlavoredSuggestedAction.cs @@ -0,0 +1,50 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#nullable disable + +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; +using Microsoft.VisualStudio.Text; +using Microsoft.CodeAnalysis.CodeActions; + +namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions; + +internal partial class SuggestedActionWithNestedFlavors +{ + /// + /// Suggested action for additional custom hyperlink in the lightbulb preview pane. + /// Each can define custom + /// code actions for adding these custom hyperlinks to the preview, + /// similar to 'Preview Changes' and 'Fix All' hyperlinks that show up for all suggested actions. + /// Note that this suggested action type just wraps the underlying original code action that comes from + /// and gets added to the suggested action set + /// holding all the suggested actions for custom hyperlinks to show in the lightbulb preview pane. + /// + protected sealed class FlavoredSuggestedAction : SuggestedAction + { + private FlavoredSuggestedAction( + IThreadingContext threadingContext, + SuggestedActionsSourceProvider sourceProvider, + Workspace workspace, + Solution originalSolution, + ITextBuffer subjectBuffer, + object provider, + CodeAction originalCodeAction) + : base(threadingContext, sourceProvider, workspace, originalSolution, subjectBuffer, provider, originalCodeAction) + { + } + + public static SuggestedAction Create(SuggestedActionWithNestedFlavors suggestedAction, CodeAction codeAction) + { + return new FlavoredSuggestedAction( + suggestedAction.ThreadingContext, + suggestedAction.SourceProvider, + suggestedAction.Workspace, + suggestedAction.OriginalSolution, + suggestedAction.SubjectBuffer, + suggestedAction.Provider, + codeAction); + } + } +} diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotCodeAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotCodeAction.cs new file mode 100644 index 0000000000000..36c4e5242f34c --- /dev/null +++ b/src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotCodeAction.cs @@ -0,0 +1,110 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CodeActions; +using Microsoft.CodeAnalysis.Copilot; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Roslyn.Utilities; + +namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions; + +internal partial class SuggestedActionWithNestedFlavors +{ + private partial class RefineUsingCopilotSuggestedAction + { + /// + /// Code action that triggers Copilot refinement session to add further + /// code changes on top of the changes from the wrapped . + /// + private sealed class RefineUsingCopilotCodeAction( + Solution originalSolution, + CodeAction originalCodeAction, + DiagnosticData? primaryDiagnostic, + ICopilotCodeAnalysisService copilotCodeAnalysisService) : CodeAction + { + public override string Title => EditorFeaturesResources.Refine_using_Copilot; + + protected override Task> ComputePreviewOperationsAsync(CancellationToken cancellationToken) + { + // Make sure we don't trigger the refinement session for preview operation + return Task.FromResult(SpecializedCollections.EmptyEnumerable()); + } + + protected override async Task> ComputeOperationsAsync(IProgress progress, CancellationToken cancellationToken) + { + // This method is called when the user has clicked on the 'Refine using Copilot' + // hyperlink in the lightbulb preview. + // We want to bring up Copilot refinement session on top of the code changes + // from the underlying code action. Additionally, if the underlying code action + // came from a prior Copilot code fix suggestion, we also want to pass in the Copilot + // diagnostic to the refinement session. This diagnostic would be mapped to the prior + // Copilot session id to ensure that the Copilot refinement session has the historical + // context on the Copilot conversation that produce the underlying diagnostic/code action. + // + // We have a bunch of checks upfront before we bring up the Copilot refinement: + // - Applying the underlying code action produces a non-null newSolution. + // - The underlying code action produces change(s) to exactly one source document. + // + // TODO: Currently, we start a task to spawn a new Copilot refinement session + // at the end of this method, without waiting for the refinement session to complete. + // Consider if there could be better UX/platform support for such flavored actions + // where clicking on the hyperlink needs to bring up another unrelated UI. + + var newSolution = await originalCodeAction.GetChangedSolutionInternalAsync(originalSolution, progress, cancellationToken: cancellationToken).ConfigureAwait(false); + if (newSolution == null) + return []; + + var changes = newSolution.GetChanges(originalSolution); + var changeSummary = new SolutionChangeSummary(originalSolution, newSolution, changes); + if (changeSummary.TotalFilesAffected != 1 + || changeSummary.TotalProjectsAffected != 1 + || changeSummary.NewSolution.GetChangedDocuments(changeSummary.OldSolution).FirstOrDefault() is not { } changedDocumentId) + { + return []; + } + + var oldDocument = changeSummary.OldSolution.GetRequiredDocument(changedDocumentId); + var newDocument = changeSummary.NewSolution.GetRequiredDocument(changedDocumentId); + + var convertedPrimaryDiagnostic = primaryDiagnostic != null + ? await primaryDiagnostic.ToDiagnosticAsync(oldDocument.Project, cancellationToken).ConfigureAwait(false) + : null; + + cancellationToken.ThrowIfCancellationRequested(); + return [new OpenRefinementSessionOperation(oldDocument, newDocument, convertedPrimaryDiagnostic, copilotCodeAnalysisService)]; + } + + /// + /// A code action operation for trigger Copilot Chat inline refinement session. + /// + private sealed class OpenRefinementSessionOperation( + Document oldDocument, + Document newDocument, + Diagnostic? convertedPrimaryDiagnostic, + ICopilotCodeAnalysisService copilotCodeAnalysisService) : CodeActionOperation + { + internal override async Task TryApplyAsync(Workspace workspace, Solution originalSolution, IProgress progressTracker, CancellationToken cancellationToken) + { + // Trigger the Copilot refinement session in background, passing in the old and new document for + // the base code changes on top of which we want to perform further refinement. + // Note that we do not pass in our cancellation token to the StartRefinementSessionAsync + // call as bringing up the refinement session is a quick operation and the refinement session + // has it's own cancellation token source to allow users to dismiss the session. + // Additionally, we do not want cancellation triggered on the token passed into + // GetChangedSolutionAsync to suddenly dismiss the refinement session UI without user explicitly + // dismissing the session. + await copilotCodeAnalysisService.StartRefinementSessionAsync(oldDocument, newDocument, convertedPrimaryDiagnostic, CancellationToken.None).ConfigureAwait(false); + return true; + } + } + } + } +} diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotSuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotSuggestedAction.cs new file mode 100644 index 0000000000000..d70d2d006f161 --- /dev/null +++ b/src/EditorFeatures/Core.Wpf/Suggestions/RefineUsingCopilot/RefineUsingCopilotSuggestedAction.cs @@ -0,0 +1,66 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Copilot; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Microsoft.VisualStudio.Text; + +namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions; + +internal partial class SuggestedActionWithNestedFlavors +{ + /// + /// Suggested action for showing the 'Refine with Copilot' hyperlink in lightbulb preview pane. + /// Note: This hyperlink is shown for **all** suggested actions lightbulb preview, i.e. + /// regular code fixes and refactorings, in addition to Copilot suggested code fixes. + /// It wraps the core that invokes into + /// Copilot service to start a Copilot refinement session on top of the document changes + /// from the original code action corresponding to the lightbulb preview. + /// + private sealed partial class RefineUsingCopilotSuggestedAction : SuggestedAction + { + private RefineUsingCopilotSuggestedAction( + IThreadingContext threadingContext, + SuggestedActionsSourceProvider sourceProvider, + Workspace workspace, + Solution originalSolution, + ITextBuffer subjectBuffer, + object provider, + RefineUsingCopilotCodeAction codeAction) + : base(threadingContext, sourceProvider, workspace, originalSolution, subjectBuffer, provider, codeAction) + { + } + + public static async Task TryCreateAsync(SuggestedActionWithNestedFlavors suggestedAction, CancellationToken cancellationToken) + { + // NOTE: Refine with Copilot functionality is only available for code actions + // that change a source document, such that the option guarding this Refine feature + // is enabled and the Copilot service is available within this VS session. + + if (suggestedAction.OriginalDocument is not Document originalDocument) + return null; + + var copilotService = originalDocument.GetLanguageService(); + if (copilotService == null || !await copilotService.IsRefineOptionEnabledAsync().ConfigureAwait(false)) + return null; + + var isAvailable = await copilotService.IsAvailableAsync(cancellationToken).ConfigureAwait(false); + if (!isAvailable) + return null; + + return new RefineUsingCopilotSuggestedAction( + suggestedAction.ThreadingContext, + suggestedAction.SourceProvider, + suggestedAction.Workspace, + suggestedAction.OriginalSolution, + suggestedAction.SubjectBuffer, + suggestedAction.Provider, + new RefineUsingCopilotCodeAction( + suggestedAction.OriginalSolution, suggestedAction.CodeAction, suggestedAction.GetDiagnostic(), copilotService)); + } + } +} diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionWithNestedFlavors.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionWithNestedFlavors.cs index 932b9c8d73c3c..c1eb73aeb5fca 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionWithNestedFlavors.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionWithNestedFlavors.cs @@ -31,27 +31,30 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions /// internal abstract partial class SuggestedActionWithNestedFlavors : SuggestedAction, ISuggestedActionWithFlavors { - private readonly SuggestedActionSet _additionalFlavors; + private readonly SuggestedActionSet _fixAllFlavors; private ImmutableArray _nestedFlavors; + public TextDocument OriginalDocument { get; } + public SuggestedActionWithNestedFlavors( IThreadingContext threadingContext, SuggestedActionsSourceProvider sourceProvider, Workspace workspace, - Solution originalSolution, + TextDocument originalDocument, ITextBuffer subjectBuffer, object provider, CodeAction codeAction, - SuggestedActionSet additionalFlavors) + SuggestedActionSet fixAllFlavors) : base(threadingContext, sourceProvider, workspace, - originalSolution, + originalDocument.Project.Solution, subjectBuffer, provider, codeAction) { - _additionalFlavors = additionalFlavors; + _fixAllFlavors = fixAllFlavors; + OriginalDocument = originalDocument; } /// @@ -59,7 +62,7 @@ public SuggestedActionWithNestedFlavors( /// public sealed override bool HasActionSets => true; - public sealed override Task> GetActionSetsAsync(CancellationToken cancellationToken) + public sealed override async Task> GetActionSetsAsync(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); @@ -70,34 +73,61 @@ public sealed override Task> GetActionSetsAsync( { var extensionManager = this.Workspace.Services.GetService(); - _nestedFlavors = extensionManager.PerformFunction( - Provider, CreateAllFlavors, - defaultValue: ImmutableArray.Empty); + // Note: We must ensure that CreateAllFlavorsAsync does not perform any expensive + // long running operations as it will be invoked when a lightbulb preview is brought + // up for any code action. Currently, the only async method call within CreateAllFlavorsAsync + // is made within 'RefineUsingCopilotSuggestedAction.TryCreateAsync', which needs to + // check if Copilot service is available using a relatively cheap, but async method call. + _nestedFlavors = await extensionManager.PerformFunctionAsync( + Provider, CreateAllFlavorsAsync, + defaultValue: ImmutableArray.Empty, cancellationToken).ConfigureAwait(false); } Contract.ThrowIfTrue(_nestedFlavors.IsDefault); - return Task.FromResult>(_nestedFlavors); + return _nestedFlavors; } - private ImmutableArray CreateAllFlavors() + private async Task> CreateAllFlavorsAsync(CancellationToken cancellationToken) { var builder = ArrayBuilder.GetInstance(); - var previewChangesSuggestedActionSet = GetPreviewChangesFlavor(); - builder.Add(previewChangesSuggestedActionSet); + var primarySuggestedActionSet = await GetPrimarySuggestedActionSetAsync(cancellationToken).ConfigureAwait(false); + builder.Add(primarySuggestedActionSet); - if (_additionalFlavors != null) + if (_fixAllFlavors != null) { - builder.Add(_additionalFlavors); + builder.Add(_fixAllFlavors); } return builder.ToImmutableAndFree(); } - private SuggestedActionSet GetPreviewChangesFlavor() + private async Task GetPrimarySuggestedActionSetAsync(CancellationToken cancellationToken) { + // In this method we add all the primary flavored suggested actions that need to show up + // as hyperlinks on the lightbulb preview pane for all code actions. + // - We always add the 'Preview Changes' suggested action. + // - We add the 'Refine using Copilot' suggested action, if certain conditions are met. See comments + // inside 'RefineUsingCopilotSuggestedAction.TryCreateAsync' for details. + // - We add the custom suggested actions corresponding to the additional flavored actions defined + // by the underlying code action. + // Note that flavored suggested actions for Fix All operations are added in a separate + // suggested action set by our caller, we don't add them here. + + using var _ = ArrayBuilder.GetInstance(out var suggestedActions); var previewChangesAction = PreviewChangesSuggestedAction.Create(this); - return new SuggestedActionSet(categoryName: null, actions: ImmutableArray.Create(previewChangesAction)); + suggestedActions.Add(previewChangesAction); + + var refineUsingCopilotAction = await RefineUsingCopilotSuggestedAction.TryCreateAsync(this, cancellationToken).ConfigureAwait(false); + if (refineUsingCopilotAction != null) + suggestedActions.Add(refineUsingCopilotAction); + + foreach (var action in this.CodeAction.AdditionalPreviewFlavors) + { + suggestedActions.Add(FlavoredSuggestedAction.Create(this, action)); + } + + return new SuggestedActionSet(categoryName: null, actions: suggestedActions.ToImmutable()); } // HasPreview is called synchronously on the UI thread. In order to avoid blocking the UI thread, @@ -128,7 +158,7 @@ public override async Task GetPreviewAsync(CancellationToken cancellatio var preferredProjectId = preferredDocumentId?.ProjectId; var extensionManager = this.Workspace.Services.GetService(); - var previewContents = await extensionManager.PerformFunctionAsync(Provider, async () => + var previewContents = await extensionManager.PerformFunctionAsync(Provider, async cancellationToken => { // We need to stay on UI thread after GetPreviewResultAsync() so that TakeNextPreviewAsync() // below can execute on UI thread. We use ConfigureAwait(true) to stay on the UI thread. @@ -145,7 +175,7 @@ public override async Task GetPreviewAsync(CancellationToken cancellatio } // GetPreviewPane() below needs to run on UI thread. We use ConfigureAwait(true) to stay on the UI thread. - }, defaultValue: null).ConfigureAwait(true); + }, defaultValue: null, cancellationToken).ConfigureAwait(true); // GetPreviewPane() needs to run on the UI thread. AssertIsForeground(); diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs index 401a5b19750e7..d7cca61547431 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs @@ -26,7 +26,7 @@ public CodeFixSuggestedAction( IThreadingContext threadingContext, SuggestedActionsSourceProvider sourceProvider, Workspace workspace, - Solution originalSolution, + TextDocument originalDocument, ITextBuffer subjectBuffer, CodeFix fix, object provider, @@ -35,7 +35,7 @@ public CodeFixSuggestedAction( : base(threadingContext, sourceProvider, workspace, - originalSolution, + originalDocument, subjectBuffer, provider, action, diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeRefactoringSuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeRefactoringSuggestedAction.cs index 2b179ecd6e5e9..e3ae8658202aa 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeRefactoringSuggestedAction.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeRefactoringSuggestedAction.cs @@ -24,12 +24,12 @@ public CodeRefactoringSuggestedAction( IThreadingContext threadingContext, SuggestedActionsSourceProvider sourceProvider, Workspace workspace, - Solution originalSolution, + TextDocument originalDocument, ITextBuffer subjectBuffer, CodeRefactoringProvider provider, CodeAction codeAction, SuggestedActionSet fixAllFlavors) - : base(threadingContext, sourceProvider, workspace, originalSolution, subjectBuffer, provider, codeAction, fixAllFlavors) + : base(threadingContext, sourceProvider, workspace, originalDocument, subjectBuffer, provider, codeAction, fixAllFlavors) { CodeRefactoringProvider = provider; } diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource_Async.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource_Async.cs index 39602ba5ce6c6..0f3542b71feea 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource_Async.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource_Async.cs @@ -224,7 +224,7 @@ private async IAsyncEnumerable GetCodeFixesAndRefactoringsAs var refactorings = await refactoringsTask.ConfigureAwait(false); var filteredSets = UnifiedSuggestedActionsSource.FilterAndOrderActionSets(fixes, refactorings, selection, currentActionCount); - var convertedSets = filteredSets.Select(s => ConvertToSuggestedActionSet(s)).WhereNotNull().ToImmutableArray(); + var convertedSets = filteredSets.Select(s => ConvertToSuggestedActionSet(s, document)).WhereNotNull().ToImmutableArray(); foreach (var set in convertedSets) yield return set; @@ -280,7 +280,7 @@ async Task> GetRefactoringsAsync() } [return: NotNullIfNotNull(nameof(unifiedSuggestedActionSet))] - SuggestedActionSet? ConvertToSuggestedActionSet(UnifiedSuggestedActionSet? unifiedSuggestedActionSet) + SuggestedActionSet? ConvertToSuggestedActionSet(UnifiedSuggestedActionSet? unifiedSuggestedActionSet, TextDocument originalDocument) { // May be null in cases involving CodeFixSuggestedActions since FixAllFlavors may be null. if (unifiedSuggestedActionSet == null) @@ -299,13 +299,13 @@ ISuggestedAction ConvertToSuggestedAction(IUnifiedSuggestedAction unifiedSuggest => unifiedSuggestedAction switch { UnifiedCodeFixSuggestedAction codeFixAction => new CodeFixSuggestedAction( - ThreadingContext, owner, codeFixAction.Workspace, originalSolution, subjectBuffer, + ThreadingContext, owner, codeFixAction.Workspace, originalDocument, subjectBuffer, codeFixAction.CodeFix, codeFixAction.Provider, codeFixAction.OriginalCodeAction, - ConvertToSuggestedActionSet(codeFixAction.FixAllFlavors)), + ConvertToSuggestedActionSet(codeFixAction.FixAllFlavors, originalDocument)), UnifiedCodeRefactoringSuggestedAction codeRefactoringAction => new CodeRefactoringSuggestedAction( - ThreadingContext, owner, codeRefactoringAction.Workspace, originalSolution, subjectBuffer, + ThreadingContext, owner, codeRefactoringAction.Workspace, originalDocument, subjectBuffer, codeRefactoringAction.CodeRefactoringProvider, codeRefactoringAction.OriginalCodeAction, - ConvertToSuggestedActionSet(codeRefactoringAction.FixAllFlavors)), + ConvertToSuggestedActionSet(codeRefactoringAction.FixAllFlavors, originalDocument)), UnifiedFixAllCodeFixSuggestedAction fixAllAction => new FixAllCodeFixSuggestedAction( ThreadingContext, owner, fixAllAction.Workspace, originalSolution, subjectBuffer, fixAllAction.FixAllState, fixAllAction.Diagnostic, fixAllAction.OriginalCodeAction), @@ -315,7 +315,7 @@ ISuggestedAction ConvertToSuggestedAction(IUnifiedSuggestedAction unifiedSuggest UnifiedSuggestedActionWithNestedActions nestedAction => new SuggestedActionWithNestedActions( ThreadingContext, owner, nestedAction.Workspace, originalSolution, subjectBuffer, nestedAction.Provider ?? this, nestedAction.OriginalCodeAction, - nestedAction.NestedActionSets.SelectAsArray(s => ConvertToSuggestedActionSet(s))), + nestedAction.NestedActionSets.SelectAsArray(s => ConvertToSuggestedActionSet(s, originalDocument))), _ => throw ExceptionUtilities.Unreachable() }; } diff --git a/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs b/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs new file mode 100644 index 0000000000000..1ec2d03fbfd0b --- /dev/null +++ b/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs @@ -0,0 +1,91 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Copilot; +using Microsoft.CodeAnalysis.Editor.Shared.Extensions; +using Microsoft.CodeAnalysis.Editor.Shared.Tagging; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; +using Microsoft.CodeAnalysis.Editor.Tagging; +using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.CodeAnalysis.Options; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Microsoft.CodeAnalysis.Shared.TestHooks; +using Microsoft.CodeAnalysis.Workspaces; +using Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.VisualStudio.Text.Tagging; +using Roslyn.Utilities; + +namespace Microsoft.CodeAnalysis.Editor.Copilot; + +/// +/// A dummy tagger provider to trigger background Copilot code analysis after waiting +/// for user being idle, no documents edits and sufficient delay. +/// This tagger provider does not produce any tags, but is a convenient way to trigger +/// this background analysis with these guardrails to ensure the analysis is executed +/// very sparingly. +/// TODO: We should throttle the number of background analysis queries that are triggered +/// with an appropriately chosen throttle counter. +/// +[Export(typeof(IViewTaggerProvider))] +[VisualStudio.Utilities.Name(nameof(CopilotTaggerProvider))] +[VisualStudio.Utilities.ContentType(ContentTypeNames.RoslynContentType)] +[TagType(typeof(ITextMarkerTag))] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal sealed class CopilotTaggerProvider( + IThreadingContext threadingContext, + IGlobalOptionService globalOptionService, + [Import(AllowDefault = true)] ITextBufferVisibilityTracker? visibilityTracker, + IAsynchronousOperationListenerProvider listenerProvider) + : AsynchronousViewTaggerProvider(threadingContext, globalOptionService, visibilityTracker, listenerProvider.GetListener(FeatureAttribute.CopilotSuggestions)) +{ + protected override TaggerDelay EventChangeDelay => TaggerDelay.OnIdleWithLongDelay; + + protected override ITaggerEventSource CreateEventSource(ITextView textView, ITextBuffer subjectBuffer) + { + // We want to cancel existing Copilot background analysis with change in caret position, + // scrolling the active document or text changes to the active document. + return TaggerEventSources.Compose( + TaggerEventSources.OnCaretPositionChanged(textView, subjectBuffer), + TaggerEventSources.OnViewSpanChanged(ThreadingContext, textView), + TaggerEventSources.OnTextChanged(subjectBuffer)); + } + + protected override IEnumerable GetSpansToTag(ITextView? textView, ITextBuffer subjectBuffer) + { + this.ThreadingContext.ThrowIfNotOnUIThread(); + Contract.ThrowIfNull(textView); + + // We only care about the cases where we have caret. + if (textView.GetCaretPoint(subjectBuffer) is { } caret) + return SpecializedCollections.SingletonEnumerable(new SnapshotSpan(caret, 0)); + + return SpecializedCollections.EmptyEnumerable(); + } + + protected override async Task ProduceTagsAsync(TaggerContext context, DocumentSnapshotSpan spanToTag, int? caretPosition, CancellationToken cancellationToken) + { + if (spanToTag.Document is not { } document + || document.GetLanguageService() is not { } service + || !await service.IsCodeAnalysisOptionEnabledAsync().ConfigureAwait(false)) + { + return; + } + + // Fetch the Copilot code analysis prompt titles, each title can define a separate code analysis prompt. + // Currently, we only support running the primary (first) code analysis prompt. + var prompts = await service.GetAvailablePromptTitlesAsync(document, cancellationToken).ConfigureAwait(false); + if (prompts.Length > 0) + { + // Invoke analysis call into the Copilot service for the containing method's span. + await service.AnalyzeDocumentAsync(document, new(spanToTag.SnapshotSpan.Start, 0), prompts[0], cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/EditorFeatures/Core/EditorFeaturesResources.resx b/src/EditorFeatures/Core/EditorFeaturesResources.resx index b54e034e34b71..6b30388240e00 100644 --- a/src/EditorFeatures/Core/EditorFeaturesResources.resx +++ b/src/EditorFeatures/Core/EditorFeaturesResources.resx @@ -553,6 +553,9 @@ Do you want to proceed? Preview changes + + Refine using Copilot + IntelliSense diff --git a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj index f59ef2b19bdc1..33bbcbef6011a 100644 --- a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj +++ b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj @@ -51,6 +51,7 @@ + diff --git a/src/EditorFeatures/Core/Shared/Tagging/EventSources/TaggerConstants.cs b/src/EditorFeatures/Core/Shared/Tagging/EventSources/TaggerConstants.cs index 2e38ff44c26ba..343e7fa1ae3ac 100644 --- a/src/EditorFeatures/Core/Shared/Tagging/EventSources/TaggerConstants.cs +++ b/src/EditorFeatures/Core/Shared/Tagging/EventSources/TaggerConstants.cs @@ -29,6 +29,7 @@ internal static TimeSpan ComputeTimeDelay(this TaggerDelay behavior) TaggerDelay.Short => DelayTimeSpan.Short, TaggerDelay.Medium => DelayTimeSpan.Medium, TaggerDelay.OnIdle => DelayTimeSpan.Idle, + TaggerDelay.OnIdleWithLongDelay => DelayTimeSpan.IdleWithLongDelay, _ => DelayTimeSpan.NonFocus, }; } diff --git a/src/EditorFeatures/Core/Tagging/TaggerDelay.cs b/src/EditorFeatures/Core/Tagging/TaggerDelay.cs index e4aa0203a759b..d6a1e2757f658 100644 --- a/src/EditorFeatures/Core/Tagging/TaggerDelay.cs +++ b/src/EditorFeatures/Core/Tagging/TaggerDelay.cs @@ -38,6 +38,14 @@ internal enum TaggerDelay /// OnIdle, + /// + /// Indicates that the tagger should run when the user appears to be idle, + /// with an additional long delay after idle (10s of seconds). + /// This delay is useful for taggers which are computationally very expensive + /// and do not need to be up-to-date all the time. + /// + OnIdleWithLongDelay, + /// /// Indicates that the tagger is not view, and should be on a very delayed update cadence. /// diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf index 3c299d6a5a63f..296a70007ea64 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.cs.xlf @@ -257,6 +257,11 @@ Znovu přiřazená proměnná + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Přejmenovat _soubor (typ neodpovídá názvu souboru) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf index b3d26a71bf751..826dbc3dc0ec4 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.de.xlf @@ -257,6 +257,11 @@ Neu zugewiesene Variable + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) _Datei umbenennen (Typ entspricht nicht dem Dateinamen) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf index 103d2a430c468..dd538dd8a5c67 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.es.xlf @@ -257,6 +257,11 @@ Variable reasignada + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Ca_mbiar nombre de archivo (el tipo no coincide con el nombre de archivo) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf index 6711fd1b8d01a..e7a49dbd61378 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.fr.xlf @@ -257,6 +257,11 @@ Variable réaffectée + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Renommer le _fichier (le type ne correspond pas au nom du fichier) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf index 5fa7e40170765..f1fd95dd838d6 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.it.xlf @@ -257,6 +257,11 @@ Variabile riassegnata + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Rinomina _file (il tipo non corrisponde al nome file) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf index 30cef67bccdc3..972db8cfab01a 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ja.xlf @@ -257,6 +257,11 @@ 再割り当てされる変数 + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) ファイル名の変更 (種類がファイル名と一致しません)(_F) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf index 746b17fcaab17..205f935e256fa 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ko.xlf @@ -257,6 +257,11 @@ 다시 할당된 변수 + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) 파일 이름 바꾸기(형식이 파일 이름과 일치하지 않음)(_F) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf index eaf19c26ad021..44844805ab126 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pl.xlf @@ -257,6 +257,11 @@ Ponownie przypisane zmienne + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Zmień nazwę _pliku (typ nie zgadza się z nazwą pliku) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf index e408565f872e2..d4abbbcf97c5f 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.pt-BR.xlf @@ -257,6 +257,11 @@ Reatribuir variável + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Renomear _arquivo (o tipo não corresponde ao nome do arquivo) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf index 9a8f03f5cf324..e16baca18ecbe 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.ru.xlf @@ -257,6 +257,11 @@ Переназначенная переменная + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) Переименовать фай_л (тип не соответствует имени файла) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf index 453990fe9c233..da6365927fcd9 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.tr.xlf @@ -257,6 +257,11 @@ Yeniden atanan değişken + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) _Dosyayı yeniden adlandır (tür, dosya adıyla eşleşmiyor) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf index 474e2ead733dc..877b5031ed46b 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hans.xlf @@ -257,6 +257,11 @@ 重新分配的变量 + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) 重命名文件(类型与文件名不匹配)(_F) diff --git a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf index b2be44ff7c95d..94cf68abd76d5 100644 --- a/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf +++ b/src/EditorFeatures/Core/xlf/EditorFeaturesResources.zh-Hant.xlf @@ -257,6 +257,11 @@ 重新指派的變數 + + Refine using Copilot + Refine using Copilot + + Rename _file (type does not match file name) 重新命名檔案 (類型不符合檔案名稱)(_F) diff --git a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx index 86f5bdb590361..42585a2a7411a 100644 --- a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx +++ b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx @@ -609,4 +609,16 @@ Convert to regular constructor + + Apply '{0}' + + + Apply Copilot suggestion + + + Apply fix from + + + Warning: AI suggestions might be inaccurate. + \ No newline at end of file diff --git a/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs new file mode 100644 index 0000000000000..18aa694d85018 --- /dev/null +++ b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs @@ -0,0 +1,61 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CodeActions; +using Microsoft.CodeAnalysis.Internal.Log; +using Microsoft.CodeAnalysis.Telemetry; + +namespace Microsoft.CodeAnalysis.CSharp.Copilot; + +internal sealed partial class CSharpCopilotCodeFixProvider +{ + /// + /// Code action that triggers the dismissal of the Copilot suggestion. + /// Reports telemetry when the suggestion is dismissed and will be extended to support + /// dismissal of the diagnostic and removal of the suggestion from being shown again. + /// + private sealed class CopilotDismissChangesCodeAction(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeAction + { + public override string Title => FeaturesResources.Dismiss; + + protected override Task> ComputePreviewOperationsAsync(CancellationToken cancellationToken) + => Task.FromResult>(null!); + + protected override Task> ComputeOperationsAsync(CancellationToken cancellationToken) + => Task.FromResult>( + [new TriggerDismissalCodeActionOperation(originalMethodNode, diagnostic)]); + + private sealed class TriggerDismissalCodeActionOperation(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeActionOperation + { + public override void Apply(Workspace workspace, CancellationToken cancellationToken) + { + // TODO: do not show this suggestion again after dismissal + + if (workspace.Services.GetService()?.IsUserMicrosoftInternal is true) + { + Logger.Log(FunctionId.Copilot_Suggestion_Dismissed, KeyValueLogMessage.Create(m => + { + if (diagnostic.Properties.TryGetValue(FixPropertyName, out var fix)) + m["FixedMethod"] = fix; + + if (diagnostic.Properties.TryGetValue(PromptTitlePropertyName, out var promptTitle)) + m["PromptTitle"] = promptTitle; + + m["DiagnosticId"] = diagnostic.Id; + m["Message"] = diagnostic.GetMessage(); + m["OriginalMethod"] = originalMethodNode.ToFullString(); + }, + LogLevel.Information)); + } + else + { + Logger.Log(FunctionId.Copilot_Suggestion_Dismissed); + } + } + } + } +} diff --git a/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs new file mode 100644 index 0000000000000..ceee8147431f9 --- /dev/null +++ b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CodeActions; + +namespace Microsoft.CodeAnalysis.CSharp.Copilot; + +internal sealed partial class CSharpCopilotCodeFixProvider +{ + /// + /// The CodeAction that represents the change that will be made to the document per the Copilot suggestion. + /// It also contains a special that is reported as part + /// of so that the lightbulb preview for this Copilot suggestion + /// shows a 'Dismiss' hyperlink for dismissing bad Copilot suggestions. + /// + private sealed class CopilotDocumentChangeCodeAction( + string title, + Func, CancellationToken, Task> createChangedDocument, + string? equivalenceKey, + CopilotDismissChangesCodeAction dismissChangesCodeAction, + CodeActionPriority priority) : CodeAction.DocumentChangeAction(title, createChangedDocument, equivalenceKey, priority) + { + internal sealed override ImmutableArray AdditionalPreviewFlavors { get; } = [dismissChangesCodeAction]; + } +} diff --git a/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs new file mode 100644 index 0000000000000..1718fea285747 --- /dev/null +++ b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs @@ -0,0 +1,137 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Immutable; +using System.Composition; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CodeActions; +using Microsoft.CodeAnalysis.CodeFixes; +using Microsoft.CodeAnalysis.Copilot; +using Microsoft.CodeAnalysis.CSharp.LanguageService; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Editing; +using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.CodeAnalysis.Shared.Extensions; + +namespace Microsoft.CodeAnalysis.CSharp.Copilot; + +/// +/// Code fix provider which provides fixes for Copilot diagnostics produced by +/// . +/// +[ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.CopilotSuggestions), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal sealed partial class CSharpCopilotCodeFixProvider() : CodeFixProvider +{ + private const string CopilotDiagnosticId = "COPILOT"; + private const string FixPropertyName = "Fix"; + private const string PromptTitlePropertyName = "PromptTitle"; + + private static SyntaxAnnotation WarningAnnotation { get; } + = CodeActions.WarningAnnotation.Create( + CSharpFeaturesResources.Warning_colon_AI_suggestions_might_be_inaccurate); + + /// + /// Ensure that fixes for Copilot diagnostics are always towards the bottom of the lightbulb. + /// + /// + protected sealed override CodeActionRequestPriority ComputeRequestPriority() => CodeActionRequestPriority.Low; + + /// + /// We do not support a FixAll operation for Copilot suggestions. + /// + /// + public sealed override FixAllProvider? GetFixAllProvider() => null; + + public sealed override ImmutableArray FixableDiagnosticIds => [CopilotDiagnosticId]; + + public override async Task RegisterCodeFixesAsync(CodeFixContext context) + { + var document = context.Document; + var cancellationToken = context.CancellationToken; + + var copilotService = document.GetLanguageService(); + if (copilotService is null || !await copilotService.IsCodeAnalysisOptionEnabledAsync().ConfigureAwait(false)) + return; + + var isAvailable = await copilotService.IsAvailableAsync(cancellationToken).ConfigureAwait(false); + if (!isAvailable) + return; + + var promptTitles = await copilotService.GetAvailablePromptTitlesAsync(document, cancellationToken).ConfigureAwait(false); + if (promptTitles.IsEmpty) + return; + + var hasMultiplePrompts = promptTitles.Length > 1; + + // Find the containing method, if any, and also update the fix span to the entire method. + // TODO: count location in doc-comment as part of the method. + var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var containingMethod = CSharpSyntaxFacts.Instance.GetContainingMethodDeclaration(root, context.Span.Start, useFullSpan: false); + if (containingMethod is not BaseMethodDeclarationSyntax) + return; + + foreach (var diagnostic in context.Diagnostics) + { + Debug.Assert(containingMethod.FullSpan.IntersectsWith(diagnostic.Location.SourceSpan)); + + var fix = TryGetFix(document, containingMethod, diagnostic, hasMultiplePrompts); + if (fix != null) + context.RegisterCodeFix(fix, diagnostic); + } + } + + private static CodeAction? TryGetFix( + Document document, + SyntaxNode method, + Diagnostic diagnostic, + bool hasMultiplePrompts) + { + if (!diagnostic.Properties.TryGetValue(FixPropertyName, out var fix) + || fix is null + || !diagnostic.Properties.TryGetValue(PromptTitlePropertyName, out var promptTitle) + || promptTitle is null) + { + return null; + } + + // Parse the proposed Copilot fix into a method declaration. + // Guard against failure cases where the proposed fixed code does not parse into a method declaration. + // TODO: consider do this early when we create the diagnostic and add a flag in the property bag to speedup lightbulb computation + var fixMethodDeclaration = SyntaxFactory.ParseMemberDeclaration(fix, options: method.SyntaxTree.Options); + if (fixMethodDeclaration is null || !fixMethodDeclaration.IsKind(SyntaxKind.MethodDeclaration) || fixMethodDeclaration.GetDiagnostics().Count() > 3) + return null; + + var title = hasMultiplePrompts + ? $"{CSharpFeaturesResources.Apply_fix_from} {promptTitle}" + : CSharpFeaturesResources.Apply_Copilot_suggestion; + + return new CopilotDocumentChangeCodeAction( + title, + createChangedDocument: (_, cancellationToken) => GetFixedDocumentAsync(method, fix, cancellationToken), + equivalenceKey: title, + new CopilotDismissChangesCodeAction(method, diagnostic), + priority: CodeActionPriority.Low); + + async Task GetFixedDocumentAsync(SyntaxNode method, string fix, CancellationToken cancellationToken) + { + var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false); + + // TODO: Replace all the whitespace trivia with elastic trivia, and any other trivia related improvements + var newMethod = fixMethodDeclaration + .WithLeadingTrivia(fixMethodDeclaration.HasLeadingTrivia ? fixMethodDeclaration.GetLeadingTrivia() : method.GetLeadingTrivia()) + .WithTrailingTrivia(fixMethodDeclaration.HasTrailingTrivia ? fixMethodDeclaration.GetTrailingTrivia() : method.GetTrailingTrivia()) + .WithAdditionalAnnotations(Formatter.Annotation, WarningAnnotation); + + editor.ReplaceNode(method, newMethod); + return editor.GetChangedDocument(); + } + } +} diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf index ff279bf7660ee..d6a1f3ed5ce50 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf @@ -22,6 +22,16 @@ Přidat povinné složené závorky pro řídicí příkazy na jeden řádek + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Použít prázdný řádek za dvojtečkou v předvolbách inicializátoru konstruktoru (experimentální) @@ -57,6 +67,11 @@ Použít předvolby pro text výrazu/bloku + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Použít předvolby vložených proměnných out @@ -237,6 +252,11 @@ Upozornění: Vložení dočasné proměnné může změnit význam kódu. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement asynchronní příkaz foreach diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf index 8f439bd30bc62..14491398a0afd 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf @@ -22,6 +22,16 @@ Geschweifte Klammern für einzeilige Steuerungsanweisungen hinzufügen + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Leerzeile nach Doppelpunkt in Konstruktorinitialisierereinstellungen anwenden (experimentell) @@ -57,6 +67,11 @@ Ausdrucks-/Blocktextkörpereinstellungen anwenden + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Einstellungen für out-Inlinevariablen anwenden @@ -237,6 +252,11 @@ Warnung: Durch das Inlining einer temporären Variablen kann sich die Codebedeutung ändern. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement asynchrone foreach-Anweisung diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf index 16049e9a5f0d4..046e19d1f2372 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf @@ -22,6 +22,16 @@ Agregar las llaves necesarias para las instrucciones de control de una sola línea + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Aplicar una línea en blanco después de los dos puntos en las preferencias del inicializador de constructor (experimental) @@ -57,6 +67,11 @@ Aplicar preferencias de cuerpo de la expresión o del bloque + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Aplicar preferencias de variables “out” insertadas @@ -237,6 +252,11 @@ Advertencia: La variable temporal en línea puede cambiar el significado del código. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement instrucción foreach asincrónica diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf index d946c0442f313..03d94573bace4 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf @@ -22,6 +22,16 @@ Ajout des accolades nécessaires pour les instructions de contrôle sur une seule ligne + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Appliquer une ligne vide après le signe deux-points dans les préférences de l’initialiseur de constructeur (expérimental) @@ -57,6 +67,11 @@ Appliquer les préférences de corps d'expression/de bloc + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Appliquer les préférences des variables 'out' inline @@ -237,6 +252,11 @@ Avertissement : L'inlining sur une variable temporaire peut changer la signification du code. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement instruction foreach asynchrone diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf index 45bae0feffabd..e33829f8faa01 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf @@ -22,6 +22,16 @@ Aggiungi/Rimuovi parentesi graffe necessarie per le istruzioni di controllo a riga singola + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Applica preferenze una riga vuota dopo i due punti nell'inizializzatore del costruttore (sperimentale) @@ -57,6 +67,11 @@ Applica le preferenze relative al corpo dell'espressione o del blocco + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Applica le preferenze relative alle variabili 'out' inline @@ -237,6 +252,11 @@ Avviso: l'espansione inline della variabile temporanea potrebbe modificare il significato del codice. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement istruzione foreach asincrona diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf index 46fa52589d4cd..aff6049697ee7 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf @@ -22,6 +22,16 @@ 単一行のコントロール ステートメントに対する必須の波かっこを追加する + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) コンストラクター初期化子のコロンの空白行に関する基本設定を適用する (試験段階) @@ -57,6 +67,11 @@ 式/ブロック本体の基本設定を適用します + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences インラインの 'out' 変数の基本設定を適用します @@ -237,6 +252,11 @@ 警告: 一時変数をインライン化すると、コードの意味が変わる可能性があります。 + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement 非同期の foreach ステートメント diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf index 0f28589d761b9..34dd67a3519c7 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf @@ -22,6 +22,16 @@ 한 줄 컨트롤 문에 필요한 중괄호 추가 + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) 생성자 이니셜라이저에서 콜론 위에 빈 줄 적용 기본 설정(실험적) @@ -57,6 +67,11 @@ 식/블록 본문 기본 설정 적용 + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences 인라인 'out' 변수 기본 설정 적용 @@ -237,6 +252,11 @@ 경고: 임시 변수를 인라인 처리하면 코드 의미가 변경될 수 있습니다. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement 비동기 foreach 문 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf index cbc7b0bd7168c..8dc9e15b0f39e 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf @@ -22,6 +22,16 @@ Dodaj nawiasy klamrowe w przypadku jednowierszowych instrukcji sterowania + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Zastosuj pusty wiersz po dwukropku w preferencjach inicjatora konstruktora (eksperymentalne) @@ -57,6 +67,11 @@ Zastosuj preferencje treści wyrażenia/bloku + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Zastosuj preferencje wstawionych zmiennych „out” @@ -237,6 +252,11 @@ Ostrzeżenie: śródwierszowe użycie zmiennej tymczasowej może zmienić znaczenie kodu. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement asynchroniczna instrukcja foreach diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf index 272ccdd82e79b..b9e63880cd1ba 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf @@ -22,6 +22,16 @@ Adicionar as chaves necessárias para as instruções de controle de linha única + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Aplicar uma linha em branco após dois pontos nas preferências do inicializador do construtor (experimental) @@ -57,6 +67,11 @@ Aplicar as preferências de expressão/corpo do bloco + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Aplicar as preferências de variáveis 'out' embutidas @@ -237,6 +252,11 @@ Aviso: a variável temporária embutida pode alterar o significado do código. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement instrução foreach assíncrona diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf index 1e1619079b728..5681aac9e1314 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf @@ -22,6 +22,16 @@ Добавлять фигурные скобки для однострочных операторов управления + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Применить настройки для пустой строки после двоеточия в инициализаторе конструктора (экспериментальная функция) @@ -57,6 +67,11 @@ Применять предпочтения для выражения или тела блока + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Применять предпочтения для встроенных переменных out @@ -237,6 +252,11 @@ Предупреждение: встраивание временной переменной может изменить значение кода. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement асинхронная инструкция foreach diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf index c6ea9557ae284..98f5ac0813cea 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf @@ -22,6 +22,16 @@ Tek satır denetim deyimleri için gerekli küme ayraçlarını ekle + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) Oluşturucu başlatıcı tercihlerinde iki nokta üst üste işaretinden sonra boş satır uygula (deneysel) @@ -57,6 +67,11 @@ İfade/blok gövdesi tercihlerini uygula + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences Satır içi 'out' değişkenlerine ilişkin tercihleri uygula @@ -237,6 +252,11 @@ Uyarı: Geçici değişkeni satır içinde belirtmek kod anlamını değişebilir. + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement zaman uyumsuz foreach deyimi diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf index 25d81712c0818..596c0cb3532ca 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf @@ -22,6 +22,16 @@ 添加所需的单行控制语句的大括号 + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) 在构造函数初始值设定项中的冒号后应用空白行(实验性) @@ -57,6 +67,11 @@ 应用表达式/块主体首选项 + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences 应用内联 “out” 变量首选项 @@ -237,6 +252,11 @@ 警告: 内联临时变量可能会更改代码含义。 + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement 异步 foreach 语句 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf index f478d1165b697..f0ac9a3cfb1ac 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf @@ -22,6 +22,16 @@ 新增單行控制項陳述式所需的大括弧 + + Apply '{0}' + Apply '{0}' + + + + Apply Copilot suggestion + Apply Copilot suggestion + + Apply blank line after colon in constructor initializer preferences (experimental) 套用在建構函式初始設定式中的冒號後面加上空白行喜好設定 (實驗性) @@ -57,6 +67,11 @@ 套用延伸模組/區塊主體喜好設定 + + Apply fix from + Apply fix from + + Apply inline 'out' variables preferences 套用內嵌 'out' 變數喜好設定 @@ -237,6 +252,11 @@ 警告: 內嵌臨時變數可能會變更程式碼含義。 + + Warning: AI suggestions might be inaccurate. + Warning: AI suggestions might be inaccurate. + + asynchronous foreach statement 非同步 foreach 陳述式 diff --git a/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs b/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs index ef78b92ebcde3..77cffe24feeb2 100644 --- a/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs +++ b/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs @@ -171,7 +171,7 @@ public async Task> GetRefactoringsAsync( { return extensionManager.PerformFunctionAsync( provider, - async () => + async cancellationToken => { cancellationToken.ThrowIfCancellationRequested(); using var _ = ArrayBuilder<(CodeAction action, TextSpan? applicableToSpan)>.GetInstance(out var actions); @@ -205,7 +205,7 @@ public async Task> GetRefactoringsAsync( var fixAllProviderInfo = extensionManager.PerformFunction( provider, () => ImmutableInterlocked.GetOrAdd(ref _fixAllProviderMap, provider, FixAllProviderInfo.Create), defaultValue: null); return new CodeRefactoring(provider, actions.ToImmutable(), fixAllProviderInfo, options); - }, defaultValue: null); + }, defaultValue: null, cancellationToken); } private class ProjectCodeRefactoringProvider diff --git a/src/Features/Core/Portable/Common/DelayTimeSpan.cs b/src/Features/Core/Portable/Common/DelayTimeSpan.cs index 2597b8536666a..c9ac5fbdaca31 100644 --- a/src/Features/Core/Portable/Common/DelayTimeSpan.cs +++ b/src/Features/Core/Portable/Common/DelayTimeSpan.cs @@ -28,6 +28,11 @@ internal static class DelayTimeSpan /// public static readonly TimeSpan Idle = TimeSpan.FromMilliseconds(1500); + /// + /// 10 seconds. + /// + public static readonly TimeSpan IdleWithLongDelay = TimeSpan.FromMilliseconds(10000); + /// /// 3 seconds. /// diff --git a/src/Features/Core/Portable/Completion/CompletionService.cs b/src/Features/Core/Portable/Completion/CompletionService.cs index bcbc67a6dd6b9..6ecbfa300daf4 100644 --- a/src/Features/Core/Portable/Completion/CompletionService.cs +++ b/src/Features/Core/Portable/Completion/CompletionService.cs @@ -218,8 +218,9 @@ public virtual TextSpan GetDefaultCompletionListSpan(SourceText text, int caretP (document, var semanticModel) = await GetDocumentWithFrozenPartialSemanticsAsync(document, cancellationToken).ConfigureAwait(false); var description = await extensionManager.PerformFunctionAsync( provider, - () => provider.GetDescriptionAsync(document, item, options, displayOptions, cancellationToken), - defaultValue: null).ConfigureAwait(false); + cancellationToken => provider.GetDescriptionAsync(document, item, options, displayOptions, cancellationToken), + defaultValue: null, + cancellationToken).ConfigureAwait(false); GC.KeepAlive(semanticModel); return description; } @@ -249,8 +250,9 @@ public virtual async Task GetChangeAsync( var change = await extensionManager.PerformFunctionAsync( provider, - () => provider.GetChangeAsync(document, item, commitCharacter, cancellationToken), - defaultValue: null!).ConfigureAwait(false); + cancellationToken => provider.GetChangeAsync(document, item, commitCharacter, cancellationToken), + defaultValue: null!, + cancellationToken).ConfigureAwait(false); if (change == null) return CompletionChange.Create(new TextChange(new TextSpan(), "")); diff --git a/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs b/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs index 3545f832ab7f8..9c707d7f8cb70 100644 --- a/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs +++ b/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs @@ -158,8 +158,9 @@ static async Task> GetAugmentingProvidersAsyn { var isSyntacticTrigger = await extensionManager.PerformFunctionAsync( provider, - () => provider.IsSyntacticTriggerCharacterAsync(document, caretPosition, trigger, options, cancellationToken), - defaultValue: false).ConfigureAwait(false); + cancellationToken => provider.IsSyntacticTriggerCharacterAsync(document, caretPosition, trigger, options, cancellationToken), + defaultValue: false, + cancellationToken).ConfigureAwait(false); if (!isSyntacticTrigger) additionalAugmentingProviders.Add(provider); } diff --git a/src/Features/Core/Portable/Copilot/Extensions.cs b/src/Features/Core/Portable/Copilot/Extensions.cs new file mode 100644 index 0000000000000..68b39f20e2021 --- /dev/null +++ b/src/Features/Core/Portable/Copilot/Extensions.cs @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.Copilot; + +internal static class Extensions +{ + public static async Task> GetCachedCopilotDiagnosticsAsync(this TextDocument document, TextSpan span, CancellationToken cancellationToken) + { + var diagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); + if (diagnostics.IsEmpty) + return []; + + var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false); + return diagnostics.WhereAsArray(diagnostic => span.IntersectsWith(diagnostic.DataLocation.UnmappedFileSpan.GetClampedTextSpan(text))); + } + + public static async Task> GetCachedCopilotDiagnosticsAsync(this TextDocument document, CancellationToken cancellationToken) + { + if (document is not Document sourceDocument) + return ImmutableArray.Empty; + + var copilotCodeAnalysisService = sourceDocument.GetLanguageService(); + if (copilotCodeAnalysisService is null) + return ImmutableArray.Empty; + + var promptTitles = await copilotCodeAnalysisService.GetAvailablePromptTitlesAsync(sourceDocument, cancellationToken).ConfigureAwait(false); + var copilotDiagnostics = await copilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync(sourceDocument, promptTitles, cancellationToken).ConfigureAwait(false); + return copilotDiagnostics.SelectAsArray(d => DiagnosticData.Create(d, sourceDocument)); + } +} diff --git a/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs b/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs new file mode 100644 index 0000000000000..5d3931a773cf2 --- /dev/null +++ b/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.Copilot; + +/// +/// Service to compute and cache Copilot code analysis suggestions, and also acts as an +/// entry point for other Copilot code analysis features. +/// +internal interface ICopilotCodeAnalysisService : ILanguageService +{ + /// + /// Returns true if we should show 'Refine using Copilot' hyperlink in the lightbulb + /// preview for code actions. + /// + Task IsRefineOptionEnabledAsync(); + + /// + /// Returns true if Copilot background code analysis feature is enabled. + /// + Task IsCodeAnalysisOptionEnabledAsync(); + + /// + /// Returns true if the Copilot service is available for making Copilot code analysis requests. + /// + Task IsAvailableAsync(CancellationToken cancellationToken); + + /// + /// Returns one or more prompt titles for Copilot code analysis. + /// First prompt title is for built-in Copilot code analysis prompt. + /// Copilot analyzer may support additional prompts for different kinds of code analysis. + /// + /// + /// A prompt's title serves as the ID of the prompt, which can be used to selectively trigger analysis and retrive cached results. + /// + Task> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken); + + /// + /// Method to trigger Copilot code analysis on the given , + /// which may be scoped to a specific within the document. + /// indicates the kind of Copilot analysis to execute. + /// + /// + /// A prompt's title serves as the ID of the prompt, which can be used to selectively trigger analysis and retrive cached results. + /// + Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); + + /// + /// Method to fetch already computed and cached Copilot code analysis diagnostics for the + /// given and . + /// This method does not invoke any Copilot code analysis requests, and hence is + /// relatively cheap. + /// + /// + /// A prompt's title serves as the ID of the prompt, which can be used to selectively trigger analysis and retrive cached results. + /// + Task> GetCachedDocumentDiagnosticsAsync(Document document, ImmutableArray promptTitles, CancellationToken cancellationToken); + + /// + /// Method to start a Copilot refinement session on top of the changes between the given + /// and . + /// represents an optional diagnostic where the change is originated, + /// which might be used to provide additional context to Copilot for the refinement session. + /// + Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken); +} diff --git a/src/Features/Core/Portable/FeaturesResources.resx b/src/Features/Core/Portable/FeaturesResources.resx index 647ad76210a32..24903f5221c28 100644 --- a/src/Features/Core/Portable/FeaturesResources.resx +++ b/src/Features/Core/Portable/FeaturesResources.resx @@ -3225,4 +3225,10 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Fix All: {0} + + Built-in Copilot analysis + + + Dismiss + \ No newline at end of file diff --git a/src/Features/Core/Portable/QuickInfo/QuickInfoServiceWithProviders.cs b/src/Features/Core/Portable/QuickInfo/QuickInfoServiceWithProviders.cs index 6c7efdb837c63..cc5dfc39d5125 100644 --- a/src/Features/Core/Portable/QuickInfo/QuickInfoServiceWithProviders.cs +++ b/src/Features/Core/Portable/QuickInfo/QuickInfoServiceWithProviders.cs @@ -57,13 +57,14 @@ private ImmutableArray GetProviders() { var info = await extensionManager.PerformFunctionAsync( provider, - () => + cancellationToken => { var context = new QuickInfoContext(document, position, options, cancellationToken); return provider.GetQuickInfoAsync(context); }, - defaultValue: null).ConfigureAwait(false); + defaultValue: null, + cancellationToken).ConfigureAwait(false); if (info != null) return info; } @@ -80,13 +81,14 @@ private ImmutableArray GetProviders() { var info = await extensionManager.PerformFunctionAsync( provider, - () => + cancellationToken => { var context = new CommonQuickInfoContext(_services.SolutionServices, semanticModel, position, options, cancellationToken); return provider.GetQuickInfoAsync(context); }, - defaultValue: null).ConfigureAwait(false); + defaultValue: null, + cancellationToken).ConfigureAwait(false); if (info != null) return info; } diff --git a/src/Features/Core/Portable/Shared/Extensions/DocumentExtensions.cs b/src/Features/Core/Portable/Shared/Extensions/DocumentExtensions.cs index 93e3819d1d0b7..4e1f9c472db23 100644 --- a/src/Features/Core/Portable/Shared/Extensions/DocumentExtensions.cs +++ b/src/Features/Core/Portable/Shared/Extensions/DocumentExtensions.cs @@ -9,14 +9,10 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeStyle; -using Microsoft.CodeAnalysis.Completion; using Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Formatting; -using Microsoft.CodeAnalysis.Formatting.Rules; using Microsoft.CodeAnalysis.Shared.Naming; -using Microsoft.CodeAnalysis.Simplification; -using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; using static Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles.SymbolSpecification; diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf index a52cf97af5dfc..63516e7fefb3f 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf @@ -320,6 +320,11 @@ Ujistěte se, že specifikátor tt použijete pro jazyky, pro které je nezbytn Základní třídy obsahují nepřístupné nenaimplementované členy. + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Reference pro C# a Visual Basic @@ -650,6 +655,11 @@ Ujistěte se, že specifikátor tt použijete pro jazyky, pro které je nezbytn Direktivy z {0} + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Neměňte tento kód. Kód pro vyčištění vložte do metody {0}. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf index 257cfbee11f0f..62bad2305aebc 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf @@ -320,6 +320,11 @@ Stellen Sie sicher, dass Sie den Bezeichner "tt" für Sprachen verwenden, für d Basisklassen enthalten nicht implementierte Member, auf die nicht zugegriffen werden kann. + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Referenzen zu C# und Visual Basic @@ -650,6 +655,11 @@ Stellen Sie sicher, dass Sie den Bezeichner "tt" für Sprachen verwenden, für d Richtlinien von '{0}' + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Ändern Sie diesen Code nicht. Fügen Sie Bereinigungscode in der Methode "{0}" ein. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf index 93752733daa70..73775a7ad045e 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf @@ -320,6 +320,11 @@ Asegúrese de usar el especificador "tt" para los idiomas para los que es necesa Las clases base contienen miembros no implementados que son inaccesibles. + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Referencias de C# y Visual Basic @@ -650,6 +655,11 @@ Asegúrese de usar el especificador "tt" para los idiomas para los que es necesa Directivas de '{0}' + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method No cambie este código. Coloque el código de limpieza en el método "{0}". diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf index 891c8819d11a2..b079dfae22f47 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf @@ -320,6 +320,11 @@ Veillez à utiliser le spécificateur "tt" pour les langues où il est nécessai Les classes de base contiennent des membres non implémentés inaccessibles + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Références C# et Visual Basic @@ -650,6 +655,11 @@ Veillez à utiliser le spécificateur "tt" pour les langues où il est nécessai Directives de '{0}' + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Ne changez pas ce code. Placez le code de nettoyage dans la méthode '{0}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf index 9990bfc5b2331..d3865a828ff24 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf @@ -320,6 +320,11 @@ Assicurarsi di usare l'identificatore "tt" per le lingue per le quali è necessa Le classi di base contengono membri non implementati inaccessibili + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Riferimenti per C# e Visual Basic @@ -650,6 +655,11 @@ Assicurarsi di usare l'identificatore "tt" per le lingue per le quali è necessa Direttive da '{0}' + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Non modificare questo codice. Inserire il codice di pulizia nel metodo '{0}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf index 012dfaf2ab5a0..5f9b178ff8c9c 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf @@ -320,6 +320,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma アクセス不可能な未実装のメンバーが基底クラスに含まれています + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References C# および Visual Basic の参照 @@ -650,6 +655,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma '{0}' からのディレクティブ + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method このコードを変更しないでください。クリーンアップ コードを '{0}' メソッドに記述します diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf index 36e1a5bc9759a..7412d68328430 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf @@ -320,6 +320,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 기본 클래스에 구현되지 않아 액세스할 수 없는 멤버가 포함되어 있습니다. + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References C# 및 Visual Basic 참조 @@ -650,6 +655,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma '{0}'의 지시문 + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method 이 코드를 변경하지 마세요. '{0}' 메서드에 정리 코드를 입력합니다. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf index 45dd052c352e2..062a32c6cf5d7 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf @@ -320,6 +320,11 @@ Pamiętaj, aby nie używać specyfikatora „tt” dla wszystkich języków, w k Klasy podstawowe zawierają niedostępne niezaimplementowane składowe + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Dokumentacja języków C# i Visual Basic @@ -650,6 +655,11 @@ Pamiętaj, aby nie używać specyfikatora „tt” dla wszystkich języków, w k Dyrektywy z „{0}” + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Nie zmieniaj tego kodu. Umieść kod czyszczący w metodzie „{0}”. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf index f6c9a68b9bc48..8ad5b710974a7 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf @@ -320,6 +320,11 @@ Verifique se o especificador "tt" foi usado para idiomas para os quais é necess As classes base contêm membros não implementados inacessíveis + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Referências do C# e do Visual Basic @@ -650,6 +655,11 @@ Verifique se o especificador "tt" foi usado para idiomas para os quais é necess Diretrizes de '{0}' + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Não altere este código. Coloque o código de limpeza no método '{0}' diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf index 5b659f1bfd234..5b4ac56bd6adb 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf @@ -320,6 +320,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma Базовые классы содержат недоступные нереализованные члены + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References Справочники по C# и Visual Basic @@ -650,6 +655,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma Директивы из "{0}" + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Не изменяйте этот код. Разместите код очистки в методе "{0}". diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf index 59e82662636d9..967adb2829322 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf @@ -320,6 +320,11 @@ AM ve PM arasındaki farkın korunmasının gerekli olduğu diller için "tt" be Temel sınıflarda erişilemeyen, uygulanmamış üyeler var + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References C# ve Visual Basic Başvuruları @@ -650,6 +655,11 @@ AM ve PM arasındaki farkın korunmasının gerekli olduğu diller için "tt" be '{0}' yönergeleri + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method Bu kodu değiştirmeyin. Temizleme kodunu '{0}' metodunun içine yerleştirin. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf index cb054cb1d31d7..0a8cc24393276 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf @@ -320,6 +320,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 基类包含无法访问的未实现成员 + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References C# 和 Visual Basic 参考 @@ -650,6 +655,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 来自'{0}'的指令 + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method 不要更改此代码。请将清理代码放入“{0}”方法中 diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf index 02e569fe0d0d2..f5da4b37f6d34 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf @@ -320,6 +320,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 基底類別包含無法存取的未實作成員 + + Built-in Copilot analysis + Built-in Copilot analysis + + C# and Visual Basic References C# 與 Visual Basic 參考 @@ -650,6 +655,11 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 來自 '{0}' 的指示詞 + + Dismiss + Dismiss + + Do not change this code. Put cleanup code in '{0}' method 請勿變更此程式碼。請將清除程式碼放入 '{0}' 方法 diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs index a04c92c6f5d0f..021e607a10c04 100644 --- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs +++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs @@ -15,6 +15,7 @@ using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes.Suppression; using Microsoft.CodeAnalysis.CodeFixesAndRefactorings; +using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.ErrorLogger; using Microsoft.CodeAnalysis.ErrorReporting; @@ -22,6 +23,7 @@ using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Internal.Log; +using Microsoft.CodeAnalysis.LanguageService; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; @@ -112,6 +114,9 @@ public async Task GetMostSevereFixAsync( includeSuppressedDiagnostics: false, priorityProvider, DiagnosticKind.All, isExplicit: false, cancellationToken).ConfigureAwait(false); } + var copilotDiagnostics = await GetCopilotDiagnosticsAsync(document, range, priorityProvider.Priority, cancellationToken).ConfigureAwait(false); + allDiagnostics = allDiagnostics.AddRange(copilotDiagnostics); + var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService(); allDiagnostics = allDiagnostics.AddRange(buildOnlyDiagnosticsService.GetBuildOnlyDiagnostics(document.Id)); @@ -197,6 +202,9 @@ public async IAsyncEnumerable StreamFixesAsync( addOperationScope, DiagnosticKind.All, isExplicit: true, cancellationToken).ConfigureAwait(false); } + var copilotDiagnostics = await GetCopilotDiagnosticsAsync(document, range, priorityProvider.Priority, cancellationToken).ConfigureAwait(false); + diagnostics = diagnostics.AddRange(copilotDiagnostics); + var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService(); var buildOnlyDiagnostics = buildOnlyDiagnosticsService.GetBuildOnlyDiagnostics(document.Id); @@ -241,6 +249,28 @@ public async IAsyncEnumerable StreamFixesAsync( } } + private static async Task> GetCopilotDiagnosticsAsync( + TextDocument document, + TextSpan range, + CodeActionRequestPriority? priority, + CancellationToken cancellationToken) + { + if (!(priority is null or CodeActionRequestPriority.Low) + || document is not Document sourceDocument) + { + return []; + } + + // Expand the fixable range for Copilot diagnostics to containing method. + // TODO: Share the below code with other places we compute containing method for Copilot analysis. + var root = await sourceDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var syntaxFacts = sourceDocument.GetRequiredLanguageService(); + var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, range.Start, useFullSpan: false); + range = containingMethod?.Span ?? range; + + return await document.GetCachedCopilotDiagnosticsAsync(range, cancellationToken).ConfigureAwait(false); + } + private static SortedDictionary> ConvertToMap( SourceText text, ImmutableArray diagnostics) { @@ -746,8 +776,8 @@ await diagnosticsWithSameSpan.OrderByDescending(d => d.Severity) var extensionManager = textDocument.Project.Solution.Services.GetRequiredService(); var fixes = await extensionManager.PerformFunctionAsync(fixer, - () => getFixes(diagnostics), - defaultValue: []).ConfigureAwait(false); + _ => getFixes(diagnostics), + defaultValue: [], cancellationToken).ConfigureAwait(false); if (fixes.IsDefaultOrEmpty) return null; diff --git a/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs b/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs index 76c1c7475f0a6..637fa491c621f 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs @@ -5,6 +5,7 @@ using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics; @@ -30,6 +31,13 @@ public override async Task> GetDiagnosticsAsync( var allSpanDiagnostics = await diagnosticAnalyzerService.GetDiagnosticsForSpanAsync( Document, range: null, diagnosticKind: this.DiagnosticKind, includeSuppressedDiagnostics: true, cancellationToken: cancellationToken).ConfigureAwait(false); + // Add cached Copilot diagnostics when computing analyzer semantic diagnostics. + if (DiagnosticKind == DiagnosticKind.AnalyzerSemantic) + { + var copilotDiagnostics = await Document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); + allSpanDiagnostics = allSpanDiagnostics.AddRange(copilotDiagnostics); + } + // Drop the source suppressed diagnostics. // https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1824321 tracks // adding LSP support for returning source suppressed diagnostics. diff --git a/src/Tools/AnalyzerRunner/CodeRefactoringRunner.cs b/src/Tools/AnalyzerRunner/CodeRefactoringRunner.cs index 9e528f35e1d79..8997850368363 100644 --- a/src/Tools/AnalyzerRunner/CodeRefactoringRunner.cs +++ b/src/Tools/AnalyzerRunner/CodeRefactoringRunner.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeRefactorings; using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Shared.Utilities; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.Composition; using static AnalyzerRunner.Program; diff --git a/src/Tools/AnalyzerRunner/Options.cs b/src/Tools/AnalyzerRunner/Options.cs index d3b127e33c85a..5a4cb23d42159 100644 --- a/src/Tools/AnalyzerRunner/Options.cs +++ b/src/Tools/AnalyzerRunner/Options.cs @@ -8,7 +8,6 @@ using System.Collections.Immutable; using System.IO; using System.Text.RegularExpressions; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.SolutionCrawler; namespace AnalyzerRunner diff --git a/src/Tools/ExternalAccess/Copilot/Analyzer/CopilotChecksumWrapper.cs b/src/Tools/ExternalAccess/Copilot/Analyzer/CopilotChecksumWrapper.cs new file mode 100644 index 0000000000000..8c78970c45ca5 --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Analyzer/CopilotChecksumWrapper.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Immutable; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot; + +/// +/// Exposed to provide an efficient checksum implementation. +/// Intended usage including cahching responses w/o retaining potentially long strings. +/// +internal sealed class CopilotChecksumWrapper +{ + private readonly Checksum _checksum; + + private CopilotChecksumWrapper(Checksum checksum) + { + _checksum = checksum; + } + + public static CopilotChecksumWrapper Create(ImmutableArray values) + { + return new(Checksum.Create(values)); + } + + public bool Equals(CopilotChecksumWrapper? other) + { + return other != null && _checksum.Equals(other._checksum); + } + + public override bool Equals(object? obj) + { + if (obj is not CopilotChecksumWrapper another) + return false; + + return Equals(another); + } + + public override int GetHashCode() + => _checksum.GetHashCode(); +} diff --git a/src/Tools/ExternalAccess/Copilot/Analyzer/CopilotUtilities.cs b/src/Tools/ExternalAccess/Copilot/Analyzer/CopilotUtilities.cs new file mode 100644 index 0000000000000..3d276e7dcecfe --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Analyzer/CopilotUtilities.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Diagnostics.CodeAnalysis; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.LanguageService; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Roslyn.Utilities; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot; + +internal static class CopilotUtilities +{ + public static string GetCopilotSuggestionDiagnosticTag() + => WellKnownDiagnosticCustomTags.CopilotSuggestion; + + public static bool IsResultantVisibilityPublic(this ISymbol symbol) + { + return symbol.GetResultantVisibility() == Shared.Utilities.SymbolVisibility.Public; + } + + public static bool IsValidIdentifier([NotNullWhen(returnValue: true)] string? name) + { + return UnicodeCharacterUtilities.IsValidIdentifier(name); + } + + public static async Task GetContainingMethodDeclarationAsync(Document document, int position, bool useFullSpan, CancellationToken cancellationToken) + { + if (document.GetLanguageService() is not ISyntaxFactsService service) + return null; + + var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + return service.GetContainingMethodDeclaration(root, position, useFullSpan); + } +} diff --git a/src/Tools/ExternalAccess/Copilot/Analyzer/IExternalCSharpCopilotAnalyzer.cs b/src/Tools/ExternalAccess/Copilot/Analyzer/IExternalCSharpCopilotAnalyzer.cs new file mode 100644 index 0000000000000..c5e36413a3e02 --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Analyzer/IExternalCSharpCopilotAnalyzer.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot; + +internal interface IExternalCopilotCodeAnalysisService : ILanguageService +{ + // mirror the ICopilotCodeAnalysisService interface + Task IsAvailableAsync(CancellationToken cancellation); + Task> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken); + Task> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); + Task> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken); + Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken); +} diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs new file mode 100644 index 0000000000000..140b63cf0eaf2 --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs @@ -0,0 +1,155 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Concurrent; +using System.Collections.Immutable; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Copilot; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.PooledObjects; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot.Internal.Analyzer; + +/// +/// Copilot code analysis service that coordinates triggering Copilot code analysis +/// in the background for a given document. +/// This service caches the computed Copilot suggestion diagnostics by method body to ensure that +/// we do not perform duplicate analysis calls. +/// Additionally, it performs all the option checks and Copilot service availability checks +/// to determine if we should skip analysis or not. +/// +internal abstract class AbstractCopilotCodeAnalysisService( + Lazy lazyExternalCopilotService, + IDiagnosticsRefresher diagnosticsRefresher) : ICopilotCodeAnalysisService +{ + // The _diagnosticsCache is a cache for computed diagnostics via `AnalyzeDocumentAsync`. + // Each document maps to a dictionary, which in tern maps a prompt title to a list of existing Diagnostics and a boolean flag. + // The list of diangostics represents the diagnostics computed for the document under the given prompt title, + // the boolean flag indicates whether the diagnostics result is for the entire document. + // This cache is used to avoid duplicate analysis calls by storing the computed diagnostics for each document and prompt title. + private readonly ConditionalWeakTable Diagnostics, bool IsCompleteResult)>> _diagnosticsCache = new(); + + public abstract Task IsRefineOptionEnabledAsync(); + + public abstract Task IsCodeAnalysisOptionEnabledAsync(); + + public Task IsAvailableAsync(CancellationToken cancellationToken) + => lazyExternalCopilotService.Value.IsAvailableAsync(cancellationToken); + + public async Task> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken) + { + if (!await IsCodeAnalysisOptionEnabledAsync().ConfigureAwait(false)) + return []; + + return await lazyExternalCopilotService.Value.GetAvailablePromptTitlesAsync(document, cancellationToken).ConfigureAwait(false); + } + + private async Task ShouldSkipAnalysisAsync(Document document, CancellationToken cancellationToken) + { + if (!await IsCodeAnalysisOptionEnabledAsync().ConfigureAwait(false)) + return true; + + if (await document.IsGeneratedCodeAsync(cancellationToken).ConfigureAwait(false)) + return true; + + return false; + } + + public async Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) + { + if (await ShouldSkipAnalysisAsync(document, cancellationToken).ConfigureAwait(false)) + return; + + if (FullDocumentDiagnosticsCached(document, promptTitle)) + return; + + if (!await IsAvailableAsync(cancellationToken).ConfigureAwait(false)) + return; + + var isFullDocumentAnalysis = !span.HasValue; + var diagnostics = await lazyExternalCopilotService.Value.AnalyzeDocumentAsync(document, span, promptTitle, cancellationToken).ConfigureAwait(false); + + cancellationToken.ThrowIfCancellationRequested(); + + CacheAndRefreshDiagnosticsIfNeeded(document, promptTitle, diagnostics, isFullDocumentAnalysis); + } + + private bool FullDocumentDiagnosticsCached(Document document, string promptTitle) + => TryGetDiagnosticsFromCache(document, promptTitle, out _, out var isCompleteResult) && isCompleteResult; + + private bool TryGetDiagnosticsFromCache(Document document, string promptTitle, out ImmutableArray diagnostics, out bool isCompleteResult) + { + if (_diagnosticsCache.TryGetValue(document, out var existingDiagnosticsMap) + && existingDiagnosticsMap.TryGetValue(promptTitle, out var value)) + { + diagnostics = value.Diagnostics; + isCompleteResult = value.IsCompleteResult; + return true; + } + + diagnostics = []; + isCompleteResult = false; + return false; + } + + private void CacheAndRefreshDiagnosticsIfNeeded(Document document, string promptTitle, ImmutableArray diagnostics, bool isCompleteResult) + { + lock (_diagnosticsCache) + { + // Nothing to be updated if we have already cached complete diagnostic result. + if (FullDocumentDiagnosticsCached(document, promptTitle)) + return; + + // No cancellation from here. + var diagnosticsMap = _diagnosticsCache.GetOrCreateValue(document); + diagnosticsMap[promptTitle] = (diagnostics, isCompleteResult); + } + + // For LSP pull diagnostics, request a diagnostic workspace refresh. + // We will include the cached copilot diagnostics from this service as part of that pull request. + diagnosticsRefresher.RequestWorkspaceRefresh(); + } + + public async Task> GetCachedDocumentDiagnosticsAsync(Document document, ImmutableArray promptTitles, CancellationToken cancellationToken) + { + if (await ShouldSkipAnalysisAsync(document, cancellationToken).ConfigureAwait(false)) + return []; + + using var _1 = ArrayBuilder.GetInstance(out var diagnostics); + + foreach (var promptTitle in promptTitles) + { + // First, we try to fetch the diagnostics from our local cache. + // If we haven't cached the diagnostics locally, then we fetch the cached diagnostics + // from the core copilot analyzer. Subsequently, we update our local cache to store + // these diagnostics so that future diagnostic requests can be served quickly. + // We also raise diagnostic refresh requests for all our diagnostic clients when + // updating our local diagnostics cache. + + if (TryGetDiagnosticsFromCache(document, promptTitle, out var existingDiagnostics, out _)) + { + diagnostics.AddRange(existingDiagnostics); + } + else + { + var cachedDiagnostics = await lazyExternalCopilotService.Value.GetCachedDiagnosticsAsync(document, promptTitle, cancellationToken).ConfigureAwait(false); + diagnostics.AddRange(cachedDiagnostics); + CacheAndRefreshDiagnosticsIfNeeded(document, promptTitle, cachedDiagnostics, isCompleteResult: false); + } + } + + return diagnostics.ToImmutable(); + } + + public async Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) + { + if (await IsRefineOptionEnabledAsync().ConfigureAwait(false)) + await lazyExternalCopilotService.Value.StartRefinementSessionAsync(oldDocument, newDocument, primaryDiagnostic, cancellationToken).ConfigureAwait(false); + } +} diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs new file mode 100644 index 0000000000000..987c73f48c0ca --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs @@ -0,0 +1,147 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Immutable; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell.ServiceBroker; +using IServiceProvider = System.IServiceProvider; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot.Internal.Analyzer.CSharp; + +using AnalyzeDocumentAsyncDelegateType = Func>>; +using GetAvailablePromptTitlesAsyncDelegateType = Func>>; +using GetCachedDiagnosticsAsyncDelegateType = Func>>; +using IsAvailableAsyncDelegateType = Func>; +using StartRefinementSessionAsyncDelegateType = Func; + +internal sealed partial class CSharpCopilotCodeAnalysisService +{ + // A temporary helper to get access to the implementation of IExternalCopilotCodeAnalysisService, until it can be MEF exported. + private sealed class ReflectionWrapper : IExternalCopilotCodeAnalysisService + { + private const string CopilotRoslynDllName = "Microsoft.VisualStudio.Copilot.Roslyn, Version=0.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + private const string InternalCSharpCopilotAnalyzerTypeFullName = "Microsoft.VisualStudio.Copilot.Roslyn.Analyzer.InternalCSharpCopilotAnalyzer"; + + private const string IsAvailableAsyncMethodName = "IsAvailableAsync"; + private const string GetAvailablePromptTitlesAsyncMethodName = "GetAvailablePromptTitlesAsync"; + private const string AnalyzeDocumentAsyncMethodName = "AnalyzeDocumentAsync"; + private const string GetCachedDiagnosticsAsyncMethodName = "GetCachedDiagnosticsAsync"; + private const string StartRefinementSessionAsyncMethodName = "StartRefinementSessionAsync"; + + // Create and cache closed delegate to ensure we use a singleton object and with better performance. + private readonly Type? _analyzerType; + private readonly object? _analyzerInstance; + private readonly Lazy _lazyIsAvailableAsyncDelegate; + private readonly Lazy _lazyGetAvailablePromptTitlesAsyncDelegate; + private readonly Lazy _lazyAnalyzeDocumentAsyncDelegate; + private readonly Lazy _lazyGetCachedDiagnosticsAsyncDelegate; + private readonly Lazy _lazyStartRefinementSessionAsyncDelegate; + + public ReflectionWrapper(IServiceProvider serviceProvider, IVsService brokeredServiceContainer) + { + try + { + var assembly = Assembly.Load(CopilotRoslynDllName); + var analyzerType = assembly.GetType(InternalCSharpCopilotAnalyzerTypeFullName); + if (analyzerType is not null) + { + var analyzerInstance = Activator.CreateInstance(analyzerType, serviceProvider, brokeredServiceContainer); + if (analyzerInstance is not null) + { + _analyzerType = analyzerType; + _analyzerInstance = analyzerInstance; + } + } + } + catch + { + // Catch all here since failure is expected if user has no copilot chat or an older version of it installed. + } + + _lazyIsAvailableAsyncDelegate = new(CreateIsAvailableAsyncDelegate, LazyThreadSafetyMode.PublicationOnly); + _lazyGetAvailablePromptTitlesAsyncDelegate = new(CreateGetAvailablePromptTitlesAsyncDelegate, LazyThreadSafetyMode.PublicationOnly); + _lazyAnalyzeDocumentAsyncDelegate = new(CreateAnalyzeDocumentAsyncDelegate, LazyThreadSafetyMode.PublicationOnly); + _lazyGetCachedDiagnosticsAsyncDelegate = new(CreateGetCachedDiagnosticsAsyncDelegate, LazyThreadSafetyMode.PublicationOnly); + _lazyStartRefinementSessionAsyncDelegate = new(CreateStartRefinementSessionAsyncDelegate, LazyThreadSafetyMode.PublicationOnly); + } + + private T? CreateDelegate(string methodName, Type[] types) where T : Delegate + { + try + { + if (_analyzerInstance is null || _analyzerType is null) + return null; + + if (_analyzerType.GetMethod(methodName, types) is MethodInfo methodInfo) + return (T)Delegate.CreateDelegate(typeof(T), _analyzerInstance, methodInfo); + } + catch + { + // Catch all here since failure is expected if user has no copilot chat or an older version of it installed + } + + return null; + } + + private IsAvailableAsyncDelegateType? CreateIsAvailableAsyncDelegate() + => CreateDelegate(IsAvailableAsyncMethodName, [typeof(CancellationToken)]); + + private GetAvailablePromptTitlesAsyncDelegateType? CreateGetAvailablePromptTitlesAsyncDelegate() + => CreateDelegate(GetAvailablePromptTitlesAsyncMethodName, [typeof(Document), typeof(CancellationToken)]); + + private AnalyzeDocumentAsyncDelegateType? CreateAnalyzeDocumentAsyncDelegate() + => CreateDelegate(AnalyzeDocumentAsyncMethodName, [typeof(Document), typeof(TextSpan?), typeof(string), typeof(CancellationToken)]); + + private GetCachedDiagnosticsAsyncDelegateType? CreateGetCachedDiagnosticsAsyncDelegate() + => CreateDelegate(GetCachedDiagnosticsAsyncMethodName, [typeof(Document), typeof(string), typeof(CancellationToken)]); + + private StartRefinementSessionAsyncDelegateType? CreateStartRefinementSessionAsyncDelegate() + => CreateDelegate(StartRefinementSessionAsyncMethodName, [typeof(Document), typeof(Document), typeof(Diagnostic), typeof(CancellationToken)]); + + public async Task IsAvailableAsync(CancellationToken cancellationToken) + { + if (_lazyIsAvailableAsyncDelegate.Value is null) + return false; + + return await _lazyIsAvailableAsyncDelegate.Value(cancellationToken).ConfigureAwait(false); + } + + public async Task> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken) + { + if (_lazyGetAvailablePromptTitlesAsyncDelegate.Value is null) + return []; + + return await _lazyGetAvailablePromptTitlesAsyncDelegate.Value(document, cancellationToken).ConfigureAwait(false); + } + + public async Task> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) + { + if (_lazyAnalyzeDocumentAsyncDelegate.Value is null) + return []; + + return await _lazyAnalyzeDocumentAsyncDelegate.Value(document, span, promptTitle, cancellationToken).ConfigureAwait(false); + } + + public async Task> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken) + { + if (_lazyGetCachedDiagnosticsAsyncDelegate.Value is null) + return []; + + return await _lazyGetCachedDiagnosticsAsyncDelegate.Value(document, promptTitle, cancellationToken).ConfigureAwait(false); + } + + public Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) + { + if (_lazyStartRefinementSessionAsyncDelegate.Value is null) + return Task.CompletedTask; + + return _lazyStartRefinementSessionAsyncDelegate.Value(oldDocument, newDocument, primaryDiagnostic, cancellationToken); + } + } +} diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs new file mode 100644 index 0000000000000..3d930e1f562bf --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs @@ -0,0 +1,43 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Host; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.ServiceBroker; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot.Internal.Analyzer.CSharp; + +internal sealed partial class CSharpCopilotCodeAnalysisService( + Lazy lazyExternalCopilotService, + IDiagnosticsRefresher diagnosticsRefresher, + VisualStudioCopilotOptionService copilotOptionService) : AbstractCopilotCodeAnalysisService(lazyExternalCopilotService, diagnosticsRefresher) +{ + private const string CopilotRefineOptionName = "EnableCSharpRefineQuickActionSuggestion"; + private const string CopilotCodeAnalysisOptionName = "EnableCSharpCodeAnalysis"; + + public static CSharpCopilotCodeAnalysisService Create( + HostLanguageServices languageServices, + IDiagnosticsRefresher diagnosticsRefresher, + VisualStudioCopilotOptionService copilotOptionService, + SVsServiceProvider serviceProvider, + IVsService brokeredServiceContainer) + { + var lazyExternalCopilotService = new Lazy(GetExternalService, LazyThreadSafetyMode.PublicationOnly); + return new CSharpCopilotCodeAnalysisService(lazyExternalCopilotService, diagnosticsRefresher, copilotOptionService); + + IExternalCopilotCodeAnalysisService GetExternalService() + => languageServices.GetService() ?? new ReflectionWrapper(serviceProvider, brokeredServiceContainer); + } + + public override Task IsRefineOptionEnabledAsync() + => copilotOptionService.IsCopilotOptionEnabledAsync(CopilotRefineOptionName); + + public override Task IsCodeAnalysisOptionEnabledAsync() + => copilotOptionService.IsCopilotOptionEnabledAsync(CopilotCodeAnalysisOptionName); +} diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisServiceFactory.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisServiceFactory.cs new file mode 100644 index 0000000000000..8a9e3bc248540 --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisServiceFactory.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Composition; +using Microsoft.CodeAnalysis.Copilot; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.ServiceBroker; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot.Internal.Analyzer.CSharp; + +[ExportLanguageServiceFactory(typeof(ICopilotCodeAnalysisService), LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal sealed partial class CSharpCopilotCodeAnalysisServiceFactory( + IDiagnosticsRefresher diagnosticsRefresher, + VisualStudioCopilotOptionService copilotOptionService, + SVsServiceProvider serviceProvider, + IVsService brokeredServiceContainer) : ILanguageServiceFactory +{ + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) + => CSharpCopilotCodeAnalysisService.Create(languageServices, diagnosticsRefresher, copilotOptionService, serviceProvider, brokeredServiceContainer); +} diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/VisualStudioCopilotOptionService.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/VisualStudioCopilotOptionService.cs new file mode 100644 index 0000000000000..89903ca233455 --- /dev/null +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/VisualStudioCopilotOptionService.cs @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Composition; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; +using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.Internal.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Settings; + +namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot.Internal.Analyzer; + +[Export(typeof(VisualStudioCopilotOptionService)), Shared] +internal sealed class VisualStudioCopilotOptionService +{ + private const string CopilotOptionNamePrefix = "Microsoft.VisualStudio.Conversations"; + + private readonly Task _settingsManagerTask; + + [method: ImportingConstructor] + [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] + public VisualStudioCopilotOptionService( + IVsService settingsManagerService, + IThreadingContext threadingContext) + { + _settingsManagerTask = settingsManagerService.GetValueAsync(threadingContext.DisposalToken); + } + + public async Task IsCopilotOptionEnabledAsync(string optionName) + { + var settingManager = await _settingsManagerTask.ConfigureAwait(false); + // The bool setting is persisted as 0=None, 1=True, 2=False, so it needs to be retrieved as an int. + return settingManager.TryGetValue($"{CopilotOptionNamePrefix}.{optionName}", out int isEnabled) == GetValueResult.Success + && isEnabled == 1; + } +} diff --git a/src/Tools/ExternalAccess/Copilot/Internal/CodeMapper/CopilotCSharpMapCodeService.cs b/src/Tools/ExternalAccess/Copilot/Internal/CodeMapper/CopilotCSharpMapCodeService.cs index 35c636bbb59e4..aa8265e7d4dbb 100644 --- a/src/Tools/ExternalAccess/Copilot/Internal/CodeMapper/CopilotCSharpMapCodeService.cs +++ b/src/Tools/ExternalAccess/Copilot/Internal/CodeMapper/CopilotCSharpMapCodeService.cs @@ -16,55 +16,68 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.Copilot.Internal.CodeMapper; +using MapCodeAsyncDelegateType = Func, ImmutableArray<(Document Document, TextSpan TextSpan)>, Dictionary, CancellationToken, Task?>>; + [ExportLanguageService(typeof(IMapCodeService), language: LanguageNames.CSharp), Shared] internal sealed class CSharpMapCodeService : IMapCodeService { - private const string CodeMapperDllName = "Microsoft.VisualStudio.Conversations.CodeMappers.CSharp, Version=0.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - private const string MapCodeServiceTypeFullName = "Microsoft.VisualStudio.Conversations.CodeMappers.CSharp.CSharpMapCodeService"; - private const string MapCodeAsyncMethodName = "MapCodeAsync"; - - private readonly ICSharpCopilotMapCodeService? _service; + private readonly ICSharpCopilotMapCodeService _service; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public CSharpMapCodeService([Import(AllowDefault = true)] ICSharpCopilotMapCodeService? service) { - _service = service; + _service = service ?? new ReflectionWrapper(); } public Task?> MapCodeAsync(Document document, ImmutableArray contents, ImmutableArray<(Document, TextSpan)> focusLocations, CancellationToken cancellationToken) { var options = new Dictionary(); - if (_service is not null) - { - return _service.MapCodeAsync(document, contents, focusLocations, options, cancellationToken); - } + return _service.MapCodeAsync(document, contents, focusLocations, options, cancellationToken); + } + + private sealed class ReflectionWrapper : ICSharpCopilotMapCodeService + { + private const string CodeMapperDllName = "Microsoft.VisualStudio.Copilot.CodeMappers.CSharp, Version=0.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + private const string MapCodeServiceTypeFullName = "Microsoft.VisualStudio.Conversations.CodeMappers.CSharp.CSharpMapCodeService"; + private const string MapCodeAsyncMethodName = "MapCodeAsync"; - return TryLoadAndInvokeViaReflectionAsync(); + // Create and cache the delegate to ensure we use a singleton and better performance. + private readonly Lazy _lazyMapCodeAsyncDelegate = new(CreateDelegate, LazyThreadSafetyMode.PublicationOnly); - // The implementation of ICSharpCopilotMapCodeService is in Copilot Chat repo, which can't reference the EA package - // since it's shipped as a separate vsix and needs to maintain compatibility for older VS versions. So we try to call - // the service via reflection here until they can move to newer Roslyn version. - // https://github.com/dotnet/roslyn/issues/69967 - Task?> TryLoadAndInvokeViaReflectionAsync() + private static MapCodeAsyncDelegateType? CreateDelegate() { try { var assembly = Assembly.Load(CodeMapperDllName); var type = assembly.GetType(MapCodeServiceTypeFullName); - if (type?.GetMethod(MapCodeAsyncMethodName, BindingFlags.Instance | BindingFlags.Public) is MethodInfo method) - { - var instance = Activator.CreateInstance(type); - return (Task?>)method.Invoke(instance, [document, contents, focusLocations, options, cancellationToken])!; - } + if (type is null) + return null; + + var serviceInstance = Activator.CreateInstance(type); + if (serviceInstance is null) + return null; + + if (type.GetMethod(MapCodeAsyncMethodName, [typeof(Document), typeof(ImmutableArray), typeof(ImmutableArray<(Document Document, TextSpan TextSpan)>), typeof(Dictionary), typeof(CancellationToken)]) is not MethodInfo mapCodeAsyncMethod) + return null; + + return (MapCodeAsyncDelegateType)Delegate.CreateDelegate(typeof(MapCodeAsyncDelegateType), serviceInstance, mapCodeAsyncMethod); + } catch { // Catch all here since failure is expected if user has no copilot chat or an older version of it installed. } - return Task.FromResult?>(null); + return null; } - } + public async Task?> MapCodeAsync(Document document, ImmutableArray contents, ImmutableArray<(Document document, TextSpan textSpan)> prioritizedFocusLocations, Dictionary options, CancellationToken cancellationToken) + { + if (_lazyMapCodeAsyncDelegate.Value is null) + return null; + + return await _lazyMapCodeAsyncDelegate.Value(document, contents, prioritizedFocusLocations, options, cancellationToken).ConfigureAwait(false); + } + } } diff --git a/src/Tools/ExternalAccess/Copilot/InternalAPI.Unshipped.txt b/src/Tools/ExternalAccess/Copilot/InternalAPI.Unshipped.txt index c87528badcaa9..c5a3d62f3596d 100644 --- a/src/Tools/ExternalAccess/Copilot/InternalAPI.Unshipped.txt +++ b/src/Tools/ExternalAccess/Copilot/InternalAPI.Unshipped.txt @@ -1,3 +1,19 @@ #nullable enable Microsoft.CodeAnalysis.ExternalAccess.Copilot.CodeMapper.ICSharpCopilotMapCodeService Microsoft.CodeAnalysis.ExternalAccess.Copilot.CodeMapper.ICSharpCopilotMapCodeService.MapCodeAsync(Microsoft.CodeAnalysis.Document! document, System.Collections.Immutable.ImmutableArray contents, System.Collections.Immutable.ImmutableArray<(Microsoft.CodeAnalysis.Document! document, Microsoft.CodeAnalysis.Text.TextSpan textSpan)> prioritizedFocusLocations, System.Collections.Generic.Dictionary! options, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task?>! +Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper +Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper.Equals(Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper? other) -> bool +Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotUtilities +Microsoft.CodeAnalysis.ExternalAccess.Copilot.IExternalCopilotCodeAnalysisService +Microsoft.CodeAnalysis.ExternalAccess.Copilot.IExternalCopilotCodeAnalysisService.AnalyzeDocumentAsync(Microsoft.CodeAnalysis.Document! document, Microsoft.CodeAnalysis.Text.TextSpan? span, string! promptTitle, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>! +Microsoft.CodeAnalysis.ExternalAccess.Copilot.IExternalCopilotCodeAnalysisService.GetAvailablePromptTitlesAsync(Microsoft.CodeAnalysis.Document! document, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>! +Microsoft.CodeAnalysis.ExternalAccess.Copilot.IExternalCopilotCodeAnalysisService.GetCachedDiagnosticsAsync(Microsoft.CodeAnalysis.Document! document, string! promptTitle, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>! +Microsoft.CodeAnalysis.ExternalAccess.Copilot.IExternalCopilotCodeAnalysisService.IsAvailableAsync(System.Threading.CancellationToken cancellation) -> System.Threading.Tasks.Task! +Microsoft.CodeAnalysis.ExternalAccess.Copilot.IExternalCopilotCodeAnalysisService.StartRefinementSessionAsync(Microsoft.CodeAnalysis.Document! oldDocument, Microsoft.CodeAnalysis.Document! newDocument, Microsoft.CodeAnalysis.Diagnostic? primaryDiagnostic, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! +override Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper.Equals(object? obj) -> bool +override Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper.GetHashCode() -> int +static Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper.Create(System.Collections.Immutable.ImmutableArray values) -> Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotChecksumWrapper! +static Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotUtilities.GetContainingMethodDeclarationAsync(Microsoft.CodeAnalysis.Document! document, int position, bool useFullSpan, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! +static Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotUtilities.GetCopilotSuggestionDiagnosticTag() -> string! +static Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotUtilities.IsResultantVisibilityPublic(this Microsoft.CodeAnalysis.ISymbol! symbol) -> bool +static Microsoft.CodeAnalysis.ExternalAccess.Copilot.CopilotUtilities.IsValidIdentifier(string? name) -> bool diff --git a/src/Tools/ExternalAccess/Copilot/Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj b/src/Tools/ExternalAccess/Copilot/Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj index a25d1da15dc60..68099a52a85c6 100644 --- a/src/Tools/ExternalAccess/Copilot/Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj +++ b/src/Tools/ExternalAccess/Copilot/Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj @@ -4,7 +4,7 @@ Library Microsoft.CodeAnalysis.ExternalAccess.Copilot - net472;$(NetVS) + net472 true @@ -19,11 +19,17 @@ - + + + + + + + diff --git a/src/VisualStudio/Core/Def/Telemetry/AbstractWorkspaceTelemetryService.cs b/src/VisualStudio/Core/Def/Telemetry/AbstractWorkspaceTelemetryService.cs index 4ef86e3c7e214..913322da97cb9 100644 --- a/src/VisualStudio/Core/Def/Telemetry/AbstractWorkspaceTelemetryService.cs +++ b/src/VisualStudio/Core/Def/Telemetry/AbstractWorkspaceTelemetryService.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ErrorReporting; @@ -37,9 +38,13 @@ protected virtual void TelemetrySessionInitialized() { } + [MemberNotNullWhen(true, nameof(CurrentSession))] public bool HasActiveSession => CurrentSession != null && CurrentSession.IsOptedIn; + public bool IsUserMicrosoftInternal + => HasActiveSession && CurrentSession.IsUserMicrosoftInternal; + public string? SerializeCurrentSessionSettings() => CurrentSession?.SerializeSettings(); diff --git a/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs b/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs index 9e9b300a91119..360bc91b95a4a 100644 --- a/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs +++ b/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs @@ -157,6 +157,12 @@ protected virtual CodeActionPriority ComputePriority() public virtual ImmutableArray NestedActions => []; + /// + /// Code actions that should be presented as hyperlinks in the code action preview pane, + /// similar to FixAll scopes and Preview Changes but may not apply to ALL CodeAction types. + /// + internal virtual ImmutableArray AdditionalPreviewFlavors => []; + /// /// Bridge method for sdk. https://github.com/dotnet/roslyn-sdk/issues/1136 tracks removing this. /// diff --git a/src/Workspaces/Core/Portable/Diagnostics/WellKnownDiagnosticCustomTags.cs b/src/Workspaces/Core/Portable/Diagnostics/WellKnownDiagnosticCustomTags.cs index fd1d482e6c990..78a6703142be4 100644 --- a/src/Workspaces/Core/Portable/Diagnostics/WellKnownDiagnosticCustomTags.cs +++ b/src/Workspaces/Core/Portable/Diagnostics/WellKnownDiagnosticCustomTags.cs @@ -7,4 +7,5 @@ namespace Microsoft.CodeAnalysis.Diagnostics; internal static class WellKnownDiagnosticCustomTags { public const string DoesNotSupportF1Help = nameof(DoesNotSupportF1Help); + public const string CopilotSuggestion = nameof(CopilotSuggestion); } diff --git a/src/Workspaces/Core/Portable/ExtensionManager/IExtensionManagerExtensions.cs b/src/Workspaces/Core/Portable/ExtensionManager/IExtensionManagerExtensions.cs index 894b0f44b35cc..78d2f27da4aa2 100644 --- a/src/Workspaces/Core/Portable/ExtensionManager/IExtensionManagerExtensions.cs +++ b/src/Workspaces/Core/Portable/ExtensionManager/IExtensionManagerExtensions.cs @@ -9,6 +9,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; +using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -69,15 +70,16 @@ public static async Task PerformActionAsync( public static async Task PerformFunctionAsync( this IExtensionManager extensionManager, object extension, - Func?> function, - T defaultValue) + Func?> function, + T defaultValue, + CancellationToken cancellationToken) { if (extensionManager.IsDisabled(extension)) return defaultValue; try { - var task = function(); + var task = function(cancellationToken); if (task != null) return await task.ConfigureAwait(false); } diff --git a/src/Workspaces/Core/Portable/Shared/TestHooks/FeatureAttribute.cs b/src/Workspaces/Core/Portable/Shared/TestHooks/FeatureAttribute.cs index eb22eca2a7a80..e145e03e49b25 100644 --- a/src/Workspaces/Core/Portable/Shared/TestHooks/FeatureAttribute.cs +++ b/src/Workspaces/Core/Portable/Shared/TestHooks/FeatureAttribute.cs @@ -17,6 +17,7 @@ internal static class FeatureAttribute public const string CodeLens = nameof(CodeLens); public const string CodeModel = nameof(CodeModel); public const string CompletionSet = nameof(CompletionSet); + public const string CopilotSuggestions = nameof(CopilotSuggestions); public const string DesignerAttributes = nameof(DesignerAttributes); public const string DiagnosticService = nameof(DiagnosticService); public const string DocumentOutline = nameof(DocumentOutline); diff --git a/src/Workspaces/Core/Portable/Telemetry/IWorkspaceTelemetryService.cs b/src/Workspaces/Core/Portable/Telemetry/IWorkspaceTelemetryService.cs index eb581c551b7b8..b0d1b3cfd377e 100644 --- a/src/Workspaces/Core/Portable/Telemetry/IWorkspaceTelemetryService.cs +++ b/src/Workspaces/Core/Portable/Telemetry/IWorkspaceTelemetryService.cs @@ -20,6 +20,11 @@ internal interface IWorkspaceTelemetryService : IWorkspaceService /// bool HasActiveSession { get; } + /// + /// True if the active session belongs to a Microsoft internal user. + /// + bool IsUserMicrosoftInternal { get; } + /// /// Serialized the current telemetry settings. Returns if session hasn't started. /// diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs index c755f94409b07..b03846c9f11a5 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs @@ -700,6 +700,13 @@ public bool IsElementAccessExpression(SyntaxNode? node) => node.ConvertToSingleLine(useElasticTrivia); public SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true) + => GetContainingMemberDeclaration(root, position, useFullSpan); + + public SyntaxNode? GetContainingMethodDeclaration(SyntaxNode root, int position, bool useFullSpan = true) + => GetContainingMemberDeclaration(root, position, useFullSpan); + + private static SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true) + where TMemberDeclarationSyntax : MemberDeclarationSyntax { var end = root.FullSpan.End; if (end == 0) @@ -717,7 +724,7 @@ public bool IsElementAccessExpression(SyntaxNode? node) if (useFullSpan || node.Span.Contains(position)) { var kind = node.Kind(); - if ((kind != SyntaxKind.GlobalStatement) && (kind != SyntaxKind.IncompleteMember) && (node is MemberDeclarationSyntax)) + if ((kind != SyntaxKind.GlobalStatement) && (kind != SyntaxKind.IncompleteMember) && (node is TMemberDeclarationSyntax)) { return node; } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Log/FunctionId.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Log/FunctionId.cs index 10f517d82a91f..77d2d04e8bddc 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Log/FunctionId.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Log/FunctionId.cs @@ -621,4 +621,7 @@ internal enum FunctionId LSP_DocumentIdCacheMiss = 746, RemoteWorkspace_SolutionCachingStatistics = 750, + + // 800-850 for Copilot performance logging. + Copilot_Suggestion_Dismissed = 800, } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs index d894dd0069a2a..969b8f3878681 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs @@ -402,6 +402,7 @@ void GetPartsOfTupleExpression(SyntaxNode node, // Violation. This is a feature level API. How 'position' relates to 'containment' is not defined. SyntaxNode? GetContainingTypeDeclaration(SyntaxNode root, int position); SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true); + SyntaxNode? GetContainingMethodDeclaration(SyntaxNode root, int position, bool useFullSpan = true); SyntaxNode? GetContainingVariableDeclaratorOfFieldDeclaration(SyntaxNode? node); // Violation. This is a feature level API. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb index d0a7eaa806e90..0bb0d7c271698 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb @@ -710,6 +710,55 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageService End Function Public Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMemberDeclaration + Dim isApplicableDeclaration = Function(node As SyntaxNode) + If TypeOf node Is MethodBlockBaseSyntax AndAlso Not TypeOf node.Parent Is PropertyBlockSyntax Then + Return True + End If + + If TypeOf node Is MethodBaseSyntax AndAlso Not TypeOf node.Parent Is MethodBlockBaseSyntax Then + Return True + End If + + If TypeOf node Is PropertyStatementSyntax AndAlso Not TypeOf node.Parent Is PropertyBlockSyntax Then + Return True + End If + + If TypeOf node Is EventStatementSyntax AndAlso Not TypeOf node.Parent Is EventBlockSyntax Then + Return True + End If + + If TypeOf node Is PropertyBlockSyntax OrElse + TypeOf node Is TypeBlockSyntax OrElse + TypeOf node Is EnumBlockSyntax OrElse + TypeOf node Is NamespaceBlockSyntax OrElse + TypeOf node Is EventBlockSyntax OrElse + TypeOf node Is FieldDeclarationSyntax Then + Return True + End If + + Return False + End Function + + Return GetContainingMemberDeclaration(root, position, isApplicableDeclaration, useFullSpan) + End Function + + Public Function GetContainingMethodDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMethodDeclaration + Dim isApplicableDeclaration = Function(node As SyntaxNode) + If TypeOf node Is MethodBlockBaseSyntax AndAlso Not TypeOf node.Parent Is PropertyBlockSyntax Then + Return True + End If + + If TypeOf node Is MethodBaseSyntax AndAlso Not TypeOf node.Parent Is MethodBlockBaseSyntax Then + Return True + End If + + Return False + End Function + + Return GetContainingMemberDeclaration(root, position, isApplicableDeclaration, useFullSpan) + End Function + + Private Shared Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, isApplicableDeclaration As Func(Of SyntaxNode, Boolean), Optional useFullSpan As Boolean = True) As SyntaxNode Dim [end] = root.FullSpan.End If [end] = 0 Then ' empty file @@ -722,29 +771,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageService Dim node = root.FindToken(position).Parent While node IsNot Nothing If useFullSpan OrElse node.Span.Contains(position) Then - - If TypeOf node Is MethodBlockBaseSyntax AndAlso Not TypeOf node.Parent Is PropertyBlockSyntax Then - Return node - End If - - If TypeOf node Is MethodBaseSyntax AndAlso Not TypeOf node.Parent Is MethodBlockBaseSyntax Then - Return node - End If - - If TypeOf node Is PropertyStatementSyntax AndAlso Not TypeOf node.Parent Is PropertyBlockSyntax Then - Return node - End If - - If TypeOf node Is EventStatementSyntax AndAlso Not TypeOf node.Parent Is EventBlockSyntax Then - Return node - End If - - If TypeOf node Is PropertyBlockSyntax OrElse - TypeOf node Is TypeBlockSyntax OrElse - TypeOf node Is EnumBlockSyntax OrElse - TypeOf node Is NamespaceBlockSyntax OrElse - TypeOf node Is EventBlockSyntax OrElse - TypeOf node Is FieldDeclarationSyntax Then + If isApplicableDeclaration(node) Then Return node End If End If From e72b56d9079f51766c26c748ed3f8a1c2607731b Mon Sep 17 00:00:00 2001 From: AlekseyTs Date: Thu, 21 Mar 2024 14:58:22 -0700 Subject: [PATCH 35/94] Account for unlowered nodes in CanChangeValueBetweenReads (#72651) Fixes #72626. --- ...ocalRewriter_CompoundAssignmentOperator.cs | 8 ++- .../Semantics/PrimaryConstructorTests.cs | 53 +++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs index 787e7b7138a45..c015096e3b21c 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs @@ -832,6 +832,9 @@ internal static bool CanChangeValueBetweenReads( return !ConstantValueIsTrivial(type); } + // Note, we can get here with a node that hasn't been lowered yet. + // For example, from TransformCompoundAssignmentFieldOrEventAccessReceiver. + switch (expression.Kind) { case BoundKind.ThisReference: @@ -845,8 +848,9 @@ internal static bool CanChangeValueBetweenReads( return !ConstantValueIsTrivial(type); case BoundKind.Parameter: - Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); - return localsMayBeAssignedOrCaptured || ((BoundParameter)expression).ParameterSymbol.RefKind != RefKind.None; + return localsMayBeAssignedOrCaptured || + ((BoundParameter)expression).ParameterSymbol.RefKind != RefKind.None || + IsCapturedPrimaryConstructorParameter(expression); // captured primary constructor parameters should be treated as a field case BoundKind.Local: return localsMayBeAssignedOrCaptured || ((BoundLocal)expression).LocalSymbol.RefKind != RefKind.None; diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs index 04009460a17f4..bd9fcd94491c7 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs @@ -22066,5 +22066,58 @@ public struct S2(string x) Diagnostic(ErrorCode.ERR_UnmanagedConstraintNotSatisfied, "S1").WithArguments("Test", "T", "S1").WithLocation(6, 18) ); } + + [Fact] + [WorkItem("https://github.com/dotnet/roslyn/issues/72626")] + public void CompoundAssignment_CapturedParameterAsReceiverOfTargetField() + { + var source = +@" +using System; +using System.Threading.Tasks; + +internal partial class EditorDocumentManagerListener +{ + internal TestAccessor GetTestAccessor() => new(this); + + internal sealed class TestAccessor(EditorDocumentManagerListener instance) + { + public Task ProjectChangedTask => instance._projectChangedTask; + + public event EventHandler OnChangedOnDisk + { + add => instance._onChangedOnDisk += value; + remove => instance._onChangedOnDisk -= value; + } + + public event EventHandler OnChangedInEditor + { + add => instance._onChangedInEditor += value; + remove => instance._onChangedInEditor -= value; + } + + public event EventHandler OnOpened + { + add => instance._onOpened += value; + remove => instance._onOpened -= value; + } + + public event EventHandler OnClosed + { + add => instance._onClosed += value; + remove => instance._onClosed -= value; + } + } + + private Task _projectChangedTask = Task.CompletedTask; + private EventHandler _onChangedOnDisk; + private EventHandler _onChangedInEditor; + private EventHandler _onOpened; + private EventHandler _onClosed; +} +"; + var comp = CreateCompilation(source, options: TestOptions.ReleaseDll); + comp.VerifyEmitDiagnostics(); + } } } From 30acc76eb511c91d9ce513a24b094016302f2629 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Thu, 21 Mar 2024 15:49:36 -0700 Subject: [PATCH 36/94] Start new compiler test project as Emit2 is reaching text limit (#72649) --- Compilers.slnf | 1 + Roslyn.sln | 7 ++++ .../Microsoft.CodeAnalysis.CSharp.csproj | 1 + ...CodeAnalysis.CSharp.Emit3.UnitTests.csproj | 37 +++++++++++++++++++ .../Portable/Microsoft.CodeAnalysis.csproj | 1 + ...crosoft.CodeAnalysis.Test.Utilities.csproj | 1 + ....CodeAnalysis.CSharp.Test.Utilities.csproj | 1 + ...osoft.CodeAnalysis.CSharp.Scripting.csproj | 1 + .../Roslyn.Test.PdbUtilities.csproj | 1 + 9 files changed, 51 insertions(+) create mode 100644 src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj diff --git a/Compilers.slnf b/Compilers.slnf index 04ccd49c2c5a2..c810adbc006d7 100644 --- a/Compilers.slnf +++ b/Compilers.slnf @@ -5,6 +5,7 @@ "src\\Compilers\\CSharp\\CSharpAnalyzerDriver\\CSharpAnalyzerDriver.shproj", "src\\Compilers\\CSharp\\Portable\\Microsoft.CodeAnalysis.CSharp.csproj", "src\\Compilers\\CSharp\\Test\\CommandLine\\Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests.csproj", + "src\\Compilers\\CSharp\\Test\\Emit3\\Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj", "src\\Compilers\\CSharp\\Test\\Emit2\\Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj", "src\\Compilers\\CSharp\\Test\\Emit\\Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.csproj", "src\\Compilers\\CSharp\\Test\\EndToEnd\\Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests.csproj", diff --git a/Roslyn.sln b/Roslyn.sln index 9492f8eeb33b2..b682dc262a06b 100644 --- a/Roslyn.sln +++ b/Roslyn.sln @@ -554,6 +554,8 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.CommonLanguageSer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CommonLanguageServerProtocol.Framework.Binary", "src\Features\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework.Binary\Microsoft.CommonLanguageServerProtocol.Framework.Binary.csproj", "{730CADBA-701F-4722-9B6F-1FCC0DF2C95D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests", "src\Compilers\CSharp\Test\Emit3\Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj", "{4E273CBC-BB1D-4AC1-91DB-C62FC83E0350}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1364,6 +1366,10 @@ Global {730CADBA-701F-4722-9B6F-1FCC0DF2C95D}.Debug|Any CPU.Build.0 = Debug|Any CPU {730CADBA-701F-4722-9B6F-1FCC0DF2C95D}.Release|Any CPU.ActiveCfg = Release|Any CPU {730CADBA-701F-4722-9B6F-1FCC0DF2C95D}.Release|Any CPU.Build.0 = Release|Any CPU + {4E273CBC-BB1D-4AC1-91DB-C62FC83E0350}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E273CBC-BB1D-4AC1-91DB-C62FC83E0350}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E273CBC-BB1D-4AC1-91DB-C62FC83E0350}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E273CBC-BB1D-4AC1-91DB-C62FC83E0350}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1617,6 +1623,7 @@ Global {DB96C25F-39A9-4A6A-92BC-D1E42717308F} = {47D004BE-F797-430E-8A18-4B0CDFD56643} {64EADED3-4B5D-4431-BBE5-A4ABA1C38C00} = {D449D505-CC6A-4E0B-AF1B-976E2D0AE67A} {730CADBA-701F-4722-9B6F-1FCC0DF2C95D} = {D449D505-CC6A-4E0B-AF1B-976E2D0AE67A} + {4E273CBC-BB1D-4AC1-91DB-C62FC83E0350} = {32A48625-F0AD-419D-828B-A50BDABA38EA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29} diff --git a/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj b/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj index 72aeb1ccbde2c..1611e07e1664b 100644 --- a/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj +++ b/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj @@ -62,6 +62,7 @@ + diff --git a/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj b/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj new file mode 100644 index 0000000000000..3276fae69d6c0 --- /dev/null +++ b/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj @@ -0,0 +1,37 @@ + + + + + Library + Microsoft.CodeAnalysis.CSharp.UnitTests + $(NetRoslyn);net472 + true + + + + + + + + + + + + + Emit\MvidReader.cs + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj b/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj index a2aaf4b76837b..99b7f038eb898 100644 --- a/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj +++ b/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj @@ -62,6 +62,7 @@ + diff --git a/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj b/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj index 3fc35afcd3c36..bdfcfbef906ef 100644 --- a/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj +++ b/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj @@ -21,6 +21,7 @@ + diff --git a/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj b/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj index 357668d44d38f..c332e5d4851d8 100644 --- a/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj +++ b/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj @@ -23,6 +23,7 @@ + diff --git a/src/Scripting/CSharp/Microsoft.CodeAnalysis.CSharp.Scripting.csproj b/src/Scripting/CSharp/Microsoft.CodeAnalysis.CSharp.Scripting.csproj index d44d2b1dbb488..409ea515e5e20 100644 --- a/src/Scripting/CSharp/Microsoft.CodeAnalysis.CSharp.Scripting.csproj +++ b/src/Scripting/CSharp/Microsoft.CodeAnalysis.CSharp.Scripting.csproj @@ -25,6 +25,7 @@ + diff --git a/src/Test/PdbUtilities/Roslyn.Test.PdbUtilities.csproj b/src/Test/PdbUtilities/Roslyn.Test.PdbUtilities.csproj index cb0d871ff502d..78b094b4e5bbf 100644 --- a/src/Test/PdbUtilities/Roslyn.Test.PdbUtilities.csproj +++ b/src/Test/PdbUtilities/Roslyn.Test.PdbUtilities.csproj @@ -13,6 +13,7 @@ + From 7ecf61f6d02b5605c97da1408e0440548f6bf863 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Thu, 21 Mar 2024 17:05:20 -0700 Subject: [PATCH 37/94] Disallow modifiers in local_using_declaration (#72589) --- .../CSharp/Portable/CSharpResources.resx | 3 + .../CSharp/Portable/Errors/ErrorCode.cs | 2 + .../CSharp/Portable/Errors/ErrorFacts.cs | 1 + .../CSharp/Portable/Parser/LanguageParser.cs | 24 +- .../Portable/xlf/CSharpResources.cs.xlf | 5 + .../Portable/xlf/CSharpResources.de.xlf | 5 + .../Portable/xlf/CSharpResources.es.xlf | 5 + .../Portable/xlf/CSharpResources.fr.xlf | 5 + .../Portable/xlf/CSharpResources.it.xlf | 5 + .../Portable/xlf/CSharpResources.ja.xlf | 5 + .../Portable/xlf/CSharpResources.ko.xlf | 5 + .../Portable/xlf/CSharpResources.pl.xlf | 5 + .../Portable/xlf/CSharpResources.pt-BR.xlf | 5 + .../Portable/xlf/CSharpResources.ru.xlf | 5 + .../Portable/xlf/CSharpResources.tr.xlf | 5 + .../Portable/xlf/CSharpResources.zh-Hans.xlf | 5 + .../Portable/xlf/CSharpResources.zh-Hant.xlf | 5 + .../CodeGen/CodeGenUsingDeclarationTests.cs | 476 ++++++++++++++++++ .../Semantics/UsingDeclarationTests.cs | 8 +- .../Syntax/Parsing/StatementParsingTests.cs | 69 +-- .../Parsing/TopLevelStatementsParsingTests.cs | 15 +- .../Parsing/UsingDirectiveParsingTests.cs | 12 +- 22 files changed, 618 insertions(+), 57 deletions(-) diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx index af92f2337fea9..1c597710b3960 100644 --- a/src/Compilers/CSharp/Portable/CSharpResources.resx +++ b/src/Compilers/CSharp/Portable/CSharpResources.resx @@ -7902,4 +7902,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ Non-array params collection type must have an applicable constructor that can be called with no arguments. + + Modifiers cannot be placed on using declarations + \ No newline at end of file diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs index 15e57802f576b..70c3ed6d8b861 100644 --- a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs +++ b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs @@ -2300,6 +2300,8 @@ internal enum ErrorCode ERR_ParamsCollectionExtensionAddMethod = 9227, ERR_ParamsCollectionMissingConstructor = 9228, + ERR_NoModifiersOnUsing = 9229, + #endregion // Note: you will need to do the following after adding warnings: diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs b/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs index cf180f819db62..b4eaef25f8e7a 100644 --- a/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs +++ b/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs @@ -2430,6 +2430,7 @@ internal static bool IsBuildOnlyDiagnostic(ErrorCode code) case ErrorCode.ERR_ParamsCollectionExpressionTree: case ErrorCode.ERR_ParamsCollectionExtensionAddMethod: case ErrorCode.ERR_ParamsCollectionMissingConstructor: + case ErrorCode.ERR_NoModifiersOnUsing: return false; default: // NOTE: All error codes must be explicitly handled in this switch statement diff --git a/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs b/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs index 007aab4bc1859..0d94193097554 100644 --- a/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs +++ b/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs @@ -9575,7 +9575,7 @@ private StatementSyntax ParseLocalDeclarationStatement(SyntaxList(); try @@ -9623,13 +9623,17 @@ private StatementSyntax ParseLocalDeclarationStatement(SyntaxListLogický výraz není platný ve verzi jazyka {0}, protože mezi {1} a {2} se nenašel společný typ. Pokud chcete použít převod na cílový typ, upgradujte na jazykovou verzi {3} nebo vyšší. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Nepovedlo se určit výstupní adresář. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf index 05e1232eec51f..31fdb8ad5d94e 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf @@ -1417,6 +1417,11 @@ Der bedingte Ausdruck ist in der Sprachversion {0} nicht gültig, da zwischen „{1}“ und „{2}“ kein allgemeiner Typ gefunden wurde. Um eine Zielkonvertierung zu verwenden, führen Sie ein Upgrade auf die Sprachversion {3} oder höher aus. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Das Ausgabeverzeichnis konnte nicht bestimmt werden. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf index 4976ae428bbaf..46d2302cf07e3 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf @@ -1417,6 +1417,11 @@ La expresión condicional no es válida en la versión de lenguaje {0}porque no se encontró un tipo común entre "{1}" y "{2}". Para usar una conversión con tipo de destino, actualice a la versión {3} o superior. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined No se pudo determinar el directorio de salida. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf index 00d2ff3dd6476..21d95c543a69c 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf @@ -1417,6 +1417,11 @@ L’expression conditionnelle n’est pas valide dans la version de langage {0}, car il n’existe pas de type commun entre « {1} » et « {2} ». Pour utiliser une conversion de type cible, effectuez une mise à niveau vers la version de langage {3} ou ultérieure. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Impossible de déterminer le répertoire de sortie diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf index 26c21a170f8b4..4b6f9d4393503 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf @@ -1417,6 +1417,11 @@ L'espressione condizionale non è valida nella versione del linguaggio {0} perché non è stato trovato un tipo comune tra '{1}' e '{2}'. Per usare una conversione tipizzata come destinazione, eseguire l'aggiornamento alla versione {3} o a versioni successive del linguaggio. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Non è stato possibile individuare la directory di output diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf index 4fde06e68413c..d22e46da8f2c8 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf @@ -1417,6 +1417,11 @@ '{1}' と '{2}' の間に共通の型が見つからないため、言語バージョン {0} で条件式が無効です。ターゲットにより型指定された変換を使用するには、言語バージョン {3} 以上にアップグレードしてください。 + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined 出力ディレクトリを特定できませんでした diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf index 26586db33e6d7..3c3e4232b34f0 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf @@ -1417,6 +1417,11 @@ '{1}'과(와) '{2}' 사이에 공통 유형이 없기 때문에 조건식이 언어 버전 {0}에서 유효하지 않습니다. 대상 유형 변환을 사용하려면 언어 버전 {3} 이상으로 업그레이드하세요. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined 출력 디렉터리를 확인할 수 없습니다. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf index 3ff3b9f36dd41..236da182cee77 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf @@ -1417,6 +1417,11 @@ Wyrażenie warunkowe nie jest prawidłowe w wersji językowej {0} ponieważ nie znaleziono typu wspólnego między "{1}" i "{2}". Aby użyć konwersji z typem docelowym, uaktualnij do wersji językowej {3} lub nowszej. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Nie można było określić katalogu wyjściowego diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf index 00e333da53042..ed4a82cea33ad 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf @@ -1417,6 +1417,11 @@ A expressão condicional não é válida na versão de linguagem {0} porque não foi encontrado um tipo comum entre '{1}' e '{2}'. Para usar uma conversão com tipo de destino, atualize para a versão de linguagem {3} ou posterior. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Não foi possível determinar o diretório de saída diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf index 33701a6c2282b..197239919e8d6 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf @@ -1417,6 +1417,11 @@ Условное выражение недопустимо в версии языка {0}, поскольку между "{1}" и "{2}" не найден общий тип. Для использования преобразования с целевым типом обновите язык до версии {3} или более поздней. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Не удалось определить выходной каталог diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf index 0993aa1402c69..44f14a30f0b80 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf @@ -1417,6 +1417,11 @@ '{1}' ve '{2}' arasında ortak bir tür bulunamadığından, koşullu ifade {0} dil sürümünde geçerli değil. Hedef türündeki dönüştürmeyi kullanmak için dil sürümü {3} veya daha üstüne yükseltin. + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined Çıkış dizini belirlenemedi diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf index 4577d7e895d82..0983b4f8fc93c 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf @@ -1417,6 +1417,11 @@ 语言版本 {0} 中的条件表达式无效,因为在“{1}”和“{2}”之间未找到通用类型。如需使用目标类型转换,请升级到语言版本 {3} 或更高版本。 + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined 无法确定输出目录 diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf index 85602bb494f65..ac7f52744cd5c 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf @@ -1417,6 +1417,11 @@ 因為在 '{1}' 和 '{2}' 之間找不到通用類型,所以在語言版本 {0} 中條件運算式無效。若要使用以目標為類型的轉換,請升級至語言版本 {3} 或更高版本。 + + Modifiers cannot be placed on using declarations + Modifiers cannot be placed on using declarations + + Output directory could not be determined 無法判斷輸出目錄 diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingDeclarationTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingDeclarationTests.cs index eeb219d30cbc1..7c29ca0f33e1a 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingDeclarationTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingDeclarationTests.cs @@ -1430,5 +1430,481 @@ static async Task Main() CompileAndVerify(compilation, expectedOutput: "Dispose async 0"); } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Const() + { + var source = """ +class C +{ + void M() + { + using const var obj = new object(); + } +} +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (5,9): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using const var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using const var obj = new object();").WithArguments("object").WithLocation(5, 9), + // (5,15): error CS9229: Modifiers cannot be placed on using declarations + // using const var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(5, 15)); + + source = """ +using const var obj = new object(); +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,1): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using const var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using const var obj = new object();").WithArguments("object").WithLocation(1, 1), + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using const var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(1, 7)); + + source = """ +using (const var obj2 = new object()) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,8): error CS1525: Invalid expression term 'const' + // using (const var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "const").WithArguments("const").WithLocation(1, 8), + // (1,8): error CS1026: ) expected + // using (const var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "const").WithLocation(1, 8), + // (1,8): error CS1023: Embedded statement cannot be a declaration or labeled statement + // using (const var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "const var obj2 = new object()) ").WithLocation(1, 8), + // (1,14): error CS0822: Implicitly-typed variables cannot be constant + // using (const var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_ImplicitlyTypedVariableCannotBeConst, "var obj2 = new object()").WithLocation(1, 14), + // (1,37): error CS1003: Syntax error, ',' expected + // using (const var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 37), + // (1,39): error CS1002: ; expected + // using (const var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 39)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Const_Async() + { + var source = """ +await using const var obj = new object(); +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,1): warning CS0028: '' has the wrong signature to be an entry point + // await using const var obj = new object(); + Diagnostic(ErrorCode.WRN_InvalidMainSig, "await using const var obj = new object();").WithArguments("").WithLocation(1, 1), + // error CS5001: Program does not contain a static 'Main' method suitable for an entry point + Diagnostic(ErrorCode.ERR_NoEntryPoint).WithLocation(1, 1), + // (1,1): error CS8410: 'object': type used in an asynchronous using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. + // await using const var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIAsyncDisp, "await using const var obj = new object();").WithArguments("object").WithLocation(1, 1), + // (1,13): error CS9229: Modifiers cannot be placed on using declarations + // await using const var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(1, 13)); + + source = """ +await using (const var obj = new object()) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,1): warning CS0028: '' has the wrong signature to be an entry point + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.WRN_InvalidMainSig, "await using (const var obj = new object()) { }").WithArguments("").WithLocation(1, 1), + // error CS5001: Program does not contain a static 'Main' method suitable for an entry point + Diagnostic(ErrorCode.ERR_NoEntryPoint).WithLocation(1, 1), + // (1,14): error CS1525: Invalid expression term 'const' + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "const").WithArguments("const").WithLocation(1, 14), + // (1,14): error CS1026: ) expected + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "const").WithLocation(1, 14), + // (1,14): error CS1023: Embedded statement cannot be a declaration or labeled statement + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "const var obj = new object()) ").WithLocation(1, 14), + // (1,20): error CS0822: Implicitly-typed variables cannot be constant + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.ERR_ImplicitlyTypedVariableCannotBeConst, "var obj = new object()").WithLocation(1, 20), + // (1,42): error CS1003: Syntax error, ',' expected + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 42), + // (1,44): error CS1002: ; expected + // await using (const var obj = new object()) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 44)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Const_ExplicitType() + { + var source = """ +class C +{ + void M() + { + using const System.IDisposable obj = null; + } +} +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (5,15): error CS9229: Modifiers cannot be placed on using declarations + // using const System.IDisposable obj = null; + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(5, 15), + // (5,40): warning CS0219: The variable 'obj' is assigned but its value is never used + // using const System.IDisposable obj = null; + Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "obj").WithArguments("obj").WithLocation(5, 40)); + + source = """ +using const System.IDisposable obj = null; +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using const System.IDisposable obj = null; + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(1, 7), + // (1,32): warning CS0219: The variable 'obj' is assigned but its value is never used + // using const System.IDisposable obj = null; + Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "obj").WithArguments("obj").WithLocation(1, 32)); + + source = """ +using (const System.IDisposable obj) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,8): error CS1525: Invalid expression term 'const' + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "const").WithArguments("const").WithLocation(1, 8), + // (1,8): error CS1026: ) expected + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "const").WithLocation(1, 8), + // (1,8): error CS1023: Embedded statement cannot be a declaration or labeled statement + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "const System.IDisposable obj) ").WithLocation(1, 8), + // (1,33): error CS0145: A const field requires a value to be provided + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.ERR_ConstValueRequired, "obj").WithLocation(1, 33), + // (1,33): warning CS0168: The variable 'obj' is declared but never used + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.WRN_UnreferencedVar, "obj").WithArguments("obj").WithLocation(1, 33), + // (1,36): error CS1003: Syntax error, ',' expected + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 36), + // (1,38): error CS1002: ; expected + // using (const System.IDisposable obj) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 38)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Const_Async_ExplicitType() + { + var source = """ +await using const System.IAsyncDisposable obj = null; +"""; + var comp = CreateCompilation(source, targetFramework: TargetFramework.Net70); + comp.VerifyEmitDiagnostics( + // (1,1): warning CS0028: '' has the wrong signature to be an entry point + // await using const System.IAsyncDisposable obj = null; + Diagnostic(ErrorCode.WRN_InvalidMainSig, "await using const System.IAsyncDisposable obj = null;").WithArguments("").WithLocation(1, 1), + // error CS5001: Program does not contain a static 'Main' method suitable for an entry point + Diagnostic(ErrorCode.ERR_NoEntryPoint).WithLocation(1, 1), + // (1,13): error CS9229: Modifiers cannot be placed on using declarations + // await using const System.IAsyncDisposable obj = null; + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(1, 13), + // (1,43): warning CS0219: The variable 'obj' is assigned but its value is never used + // await using const System.IAsyncDisposable obj = null; + Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "obj").WithArguments("obj").WithLocation(1, 43)); + + source = """ +await using (const System.IAsyncDisposable obj) { } +"""; + comp = CreateCompilation(source, targetFramework: TargetFramework.Net70); + comp.VerifyEmitDiagnostics( + // (1,1): warning CS0028: '' has the wrong signature to be an entry point + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.WRN_InvalidMainSig, "await using (const System.IAsyncDisposable obj) { }").WithArguments("").WithLocation(1, 1), + // error CS5001: Program does not contain a static 'Main' method suitable for an entry point + Diagnostic(ErrorCode.ERR_NoEntryPoint).WithLocation(1, 1), + // (1,14): error CS1525: Invalid expression term 'const' + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "const").WithArguments("const").WithLocation(1, 14), + // (1,14): error CS1026: ) expected + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "const").WithLocation(1, 14), + // (1,14): error CS1023: Embedded statement cannot be a declaration or labeled statement + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "const System.IAsyncDisposable obj) ").WithLocation(1, 14), + // (1,44): error CS0145: A const field requires a value to be provided + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.ERR_ConstValueRequired, "obj").WithLocation(1, 44), + // (1,44): warning CS0168: The variable 'obj' is declared but never used + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.WRN_UnreferencedVar, "obj").WithArguments("obj").WithLocation(1, 44), + // (1,47): error CS1003: Syntax error, ',' expected + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 47), + // (1,49): error CS1002: ; expected + // await using (const System.IAsyncDisposable obj) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 49)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Readonly() + { + var source = """ +class C +{ + void M() + { + using readonly var obj = new object(); + } +} +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (5,9): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using readonly var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using readonly var obj = new object();").WithArguments("object").WithLocation(5, 9), + // (5,15): error CS9229: Modifiers cannot be placed on using declarations + // using readonly var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "readonly").WithLocation(5, 15)); + + source = """ +using readonly var obj = new object(); +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,1): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using readonly var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using readonly var obj = new object();").WithArguments("object").WithLocation(1, 1), + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using readonly var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "readonly").WithLocation(1, 7)); + + source = """ +using (readonly var obj2 = new object()) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,8): error CS1525: Invalid expression term 'readonly' + // using (readonly var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "readonly").WithArguments("readonly").WithLocation(1, 8), + // (1,8): error CS1026: ) expected + // using (readonly var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "readonly").WithLocation(1, 8), + // (1,8): error CS0106: The modifier 'readonly' is not valid for this item + // using (readonly var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadMemberFlag, "readonly").WithArguments("readonly").WithLocation(1, 8), + // (1,8): error CS1023: Embedded statement cannot be a declaration or labeled statement + // using (readonly var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "readonly var obj2 = new object()) ").WithLocation(1, 8), + // (1,40): error CS1003: Syntax error, ',' expected + // using (readonly var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 40), + // (1,42): error CS1002: ; expected + // using (readonly var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 42)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Static() + { + var source = """ +class C +{ + void M() + { + using static var obj = new object(); + } +} +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (5,9): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using static var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using static var obj = new object();").WithArguments("object").WithLocation(5, 9), + // (5,15): error CS9229: Modifiers cannot be placed on using declarations + // using static var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "static").WithLocation(5, 15)); + + source = """ +using static var obj = new object(); +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,1): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using static var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using static var obj = new object();").WithArguments("object").WithLocation(1, 1), + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using static var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "static").WithLocation(1, 7)); + + source = """ +using (static var obj2 = new object()) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,8): error CS1525: Invalid expression term 'static' + // using (static var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "static").WithArguments("static").WithLocation(1, 8), + // (1,8): error CS1026: ) expected + // using (static var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "static").WithLocation(1, 8), + // (1,8): error CS0106: The modifier 'static' is not valid for this item + // using (static var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadMemberFlag, "static").WithArguments("static").WithLocation(1, 8), + // (1,8): error CS1023: Embedded statement cannot be a declaration or labeled statement + // using (static var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "static var obj2 = new object()) ").WithLocation(1, 8), + // (1,38): error CS1003: Syntax error, ',' expected + // using (static var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 38), + // (1,40): error CS1002: ; expected + // using (static var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 40)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Volatile() + { + var source = """ +class C +{ + void M() + { + using volatile var obj = new object(); + } +} +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (5,9): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using volatile var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using volatile var obj = new object();").WithArguments("object").WithLocation(5, 9), + // (5,15): error CS9229: Modifiers cannot be placed on using declarations + // using volatile var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "volatile").WithLocation(5, 15)); + + source = """ +using volatile var obj = new object(); +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,1): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using volatile var obj = new object(); + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using volatile var obj = new object();").WithArguments("object").WithLocation(1, 1), + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using volatile var obj = new object(); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "volatile").WithLocation(1, 7)); + + source = """ +using (volatile var obj2 = new object()) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (1,8): error CS1525: Invalid expression term 'volatile' + // using (volatile var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_InvalidExprTerm, "volatile").WithArguments("volatile").WithLocation(1, 8), + // (1,8): error CS1026: ) expected + // using (volatile var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_CloseParenExpected, "volatile").WithLocation(1, 8), + // (1,8): error CS0106: The modifier 'volatile' is not valid for this item + // using (volatile var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadMemberFlag, "volatile").WithArguments("volatile").WithLocation(1, 8), + // (1,8): error CS1023: Embedded statement cannot be a declaration or labeled statement + // using (volatile var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "volatile var obj2 = new object()) ").WithLocation(1, 8), + // (1,40): error CS1003: Syntax error, ',' expected + // using (volatile var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SyntaxError, ")").WithArguments(",").WithLocation(1, 40), + // (1,42): error CS1002: ; expected + // using (volatile var obj2 = new object()) { } + Diagnostic(ErrorCode.ERR_SemicolonExpected, "{").WithLocation(1, 42)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Scoped() + { + var source = """ +class C +{ + void M() + { + using scoped var obj = new S(); + } +} +ref struct S { public void Dispose() { } } +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics(); + + source = """ +using scoped var obj = new S(); +ref struct S { public void Dispose() { } } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics(); + + source = """ +using (scoped var obj = new S()) { } +ref struct S { public void Dispose() { } } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72496")] + public void ModifiersInUsingLocalDeclarations_Ref() + { + var source = """ +class C +{ + void M() + { + var x = new object(); + using ref object y = ref x; + } +} +"""; + var comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (6,9): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using ref object y = ref x; + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using ref object y = ref x;").WithArguments("object").WithLocation(6, 9), + // (6,15): error CS1073: Unexpected token 'ref' + // using ref object y = ref x; + Diagnostic(ErrorCode.ERR_UnexpectedToken, "ref").WithArguments("ref").WithLocation(6, 15)); + + source = """ +var x = new object(); +using ref object y = ref x; +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (2,1): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using ref object y = ref x; + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "using ref object y = ref x;").WithArguments("object").WithLocation(2, 1), + // (2,7): error CS1073: Unexpected token 'ref' + // using ref object y = ref x; + Diagnostic(ErrorCode.ERR_UnexpectedToken, "ref").WithArguments("ref").WithLocation(2, 7)); + + source = """ +var x = new object(); +using (ref object y = ref x) { } +"""; + comp = CreateCompilation(source); + comp.VerifyEmitDiagnostics( + // (2,8): error CS1073: Unexpected token 'ref' + // using (ref object y = ref x) { } + Diagnostic(ErrorCode.ERR_UnexpectedToken, "ref").WithArguments("ref").WithLocation(2, 8), + // (2,8): error CS1674: 'object': type used in a using statement must be implicitly convertible to 'System.IDisposable'. + // using (ref object y = ref x) { } + Diagnostic(ErrorCode.ERR_NoConvToIDisp, "ref object y = ref x").WithArguments("object").WithLocation(2, 8)); + } } } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs index da09f7cdd28d2..e3885e0761e42 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs @@ -954,12 +954,12 @@ static void Main() } "; CreateCompilation(source, parseOptions: TestOptions.Regular8).VerifyDiagnostics( - // (7,15): error CS0106: The modifier 'public' is not valid for this item + // (7,15): error CS9229: Modifiers cannot be placed on using declarations // using public readonly var x = (IDisposable)null; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "public").WithArguments("public").WithLocation(7, 15), - // (7,22): error CS0106: The modifier 'readonly' is not valid for this item + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "public").WithLocation(7, 15), + // (7,22): error CS9229: Modifiers cannot be placed on using declarations // using public readonly var x = (IDisposable)null; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "readonly").WithArguments("readonly").WithLocation(7, 22) + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "readonly").WithLocation(7, 22) ); } } diff --git a/src/Compilers/CSharp/Test/Syntax/Parsing/StatementParsingTests.cs b/src/Compilers/CSharp/Test/Syntax/Parsing/StatementParsingTests.cs index b54ec5b4e6364..d94f42dd3cfed 100644 --- a/src/Compilers/CSharp/Test/Syntax/Parsing/StatementParsingTests.cs +++ b/src/Compilers/CSharp/Test/Syntax/Parsing/StatementParsingTests.cs @@ -2515,38 +2515,41 @@ public void TestUsingVarWithVarDeclaration() [WorkItem(36413, "https://github.com/dotnet/roslyn/issues/36413")] public void TestUsingVarWithInvalidDeclaration() { - var text = "using public readonly var a = b;"; - var statement = this.ParseStatement(text, options: TestOptions.Regular8); + UsingStatement("using public readonly var a = b;", TestOptions.Regular8, + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using public readonly var a = b; + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "public").WithLocation(1, 7), + // (1,14): error CS9229: Modifiers cannot be placed on using declarations + // using public readonly var a = b; + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "readonly").WithLocation(1, 14)); - Assert.NotNull(statement); - Assert.Equal(SyntaxKind.LocalDeclarationStatement, statement.Kind()); - Assert.Equal(text, statement.ToString()); - Assert.Equal(2, statement.Errors().Length); - Assert.Equal((int)ErrorCode.ERR_BadMemberFlag, statement.Errors()[0].Code); - Assert.Equal("public", statement.Errors()[0].Arguments[0]); - Assert.Equal((int)ErrorCode.ERR_BadMemberFlag, statement.Errors()[1].Code); - Assert.Equal("readonly", statement.Errors()[1].Arguments[0]); - - var us = (LocalDeclarationStatementSyntax)statement; - Assert.NotEqual(default, us.UsingKeyword); - Assert.Equal(SyntaxKind.UsingKeyword, us.UsingKeyword.Kind()); - - Assert.NotNull(us.Declaration); - Assert.NotNull(us.Declaration.Type); - Assert.Equal("var", us.Declaration.Type.ToString()); - Assert.Equal(SyntaxKind.IdentifierName, us.Declaration.Type.Kind()); - Assert.Equal(SyntaxKind.IdentifierToken, ((IdentifierNameSyntax)us.Declaration.Type).Identifier.Kind()); - Assert.Equal(2, us.Modifiers.Count); - Assert.Equal("public", us.Modifiers[0].ToString()); - Assert.Equal("readonly", us.Modifiers[1].ToString()); - Assert.Equal(1, us.Declaration.Variables.Count); - Assert.NotEqual(default, us.Declaration.Variables[0].Identifier); - Assert.Equal("a", us.Declaration.Variables[0].Identifier.ToString()); - Assert.Null(us.Declaration.Variables[0].ArgumentList); - Assert.NotNull(us.Declaration.Variables[0].Initializer); - Assert.NotEqual(default, us.Declaration.Variables[0].Initializer.EqualsToken); - Assert.NotNull(us.Declaration.Variables[0].Initializer.Value); - Assert.Equal("b", us.Declaration.Variables[0].Initializer.Value.ToString()); + N(SyntaxKind.LocalDeclarationStatement); + { + N(SyntaxKind.UsingKeyword); + N(SyntaxKind.PublicKeyword); + N(SyntaxKind.ReadOnlyKeyword); + N(SyntaxKind.VariableDeclaration); + { + N(SyntaxKind.IdentifierName); + { + N(SyntaxKind.IdentifierToken, "var"); + } + N(SyntaxKind.VariableDeclarator); + { + N(SyntaxKind.IdentifierToken, "a"); + N(SyntaxKind.EqualsValueClause); + { + N(SyntaxKind.EqualsToken); + N(SyntaxKind.IdentifierName); + { + N(SyntaxKind.IdentifierToken, "b"); + } + } + } + } + N(SyntaxKind.SemicolonToken); + } + EOF(); } [Fact] @@ -3286,9 +3289,9 @@ public void TestUsingVarRefVarIsYTree() public void TestUsingVarReadonlyMultipleDeclarations() { UsingStatement("using readonly var x, y = ref z;", TestOptions.Regular8, - // (1,7): error CS0106: The modifier 'readonly' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using readonly var x, y = ref z; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "readonly").WithArguments("readonly").WithLocation(1, 7)); + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "readonly").WithLocation(1, 7)); N(SyntaxKind.LocalDeclarationStatement); { N(SyntaxKind.UsingKeyword); diff --git a/src/Compilers/CSharp/Test/Syntax/Parsing/TopLevelStatementsParsingTests.cs b/src/Compilers/CSharp/Test/Syntax/Parsing/TopLevelStatementsParsingTests.cs index 93da08337b839..04704ed609d31 100644 --- a/src/Compilers/CSharp/Test/Syntax/Parsing/TopLevelStatementsParsingTests.cs +++ b/src/Compilers/CSharp/Test/Syntax/Parsing/TopLevelStatementsParsingTests.cs @@ -1874,9 +1874,9 @@ public void UsingLocalDeclaration_02() var test = "using static type name;"; UsingTree(test, - // (1,7): error CS0106: The modifier 'static' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using static type name; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "static").WithArguments("static").WithLocation(1, 7) + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "static").WithLocation(1, 7) ); N(SyntaxKind.CompilationUnit); @@ -1912,9 +1912,9 @@ public void UsingLocalDeclaration_03() var test = "using volatile;"; UsingTree(test, - // (1,7): error CS0106: The modifier 'volatile' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using volatile; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "volatile").WithArguments("volatile").WithLocation(1, 7), + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "volatile").WithLocation(1, 7), // (1,15): error CS1031: Type expected // using volatile; Diagnostic(ErrorCode.ERR_TypeExpected, ";").WithLocation(1, 15), @@ -1956,6 +1956,9 @@ public void UsingLocalDeclaration_04() var test = "using const;"; UsingTree(test, + // (1,7): error CS9229: Modifiers cannot be placed on using declarations + // using const; + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "const").WithLocation(1, 7), // (1,12): error CS1031: Type expected // using const; Diagnostic(ErrorCode.ERR_TypeExpected, ";").WithLocation(1, 12), @@ -2044,9 +2047,9 @@ public void UsingLocalDeclaration_06() var test = "using readonly;"; UsingTree(test, - // (1,7): error CS0106: The modifier 'readonly' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using readonly; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "readonly").WithArguments("readonly").WithLocation(1, 7), + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "readonly").WithLocation(1, 7), // (1,15): error CS1031: Type expected // using readonly; Diagnostic(ErrorCode.ERR_TypeExpected, ";").WithLocation(1, 15), diff --git a/src/Compilers/CSharp/Test/Syntax/Parsing/UsingDirectiveParsingTests.cs b/src/Compilers/CSharp/Test/Syntax/Parsing/UsingDirectiveParsingTests.cs index 0d57af05ab25c..cdf9fa2dfdaae 100644 --- a/src/Compilers/CSharp/Test/Syntax/Parsing/UsingDirectiveParsingTests.cs +++ b/src/Compilers/CSharp/Test/Syntax/Parsing/UsingDirectiveParsingTests.cs @@ -395,9 +395,9 @@ public void StaticUsingDirectiveFunctionPointer() { UsingTree( @"using static delegate*;", - // (1,7): error CS0106: The modifier 'static' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using static delegate*; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "static").WithArguments("static").WithLocation(1, 7), + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "static").WithLocation(1, 7), // (1,34): error CS1001: Identifier expected // using static delegate*; Diagnostic(ErrorCode.ERR_IdentifierExpected, ";").WithLocation(1, 34)); @@ -455,9 +455,9 @@ public void StaticUsingDirectivePredefinedType() { UsingTree( @"using static int;", - // (1,7): error CS0106: The modifier 'static' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using static int; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "static").WithArguments("static").WithLocation(1, 7), + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "static").WithLocation(1, 7), // (1,17): error CS1001: Identifier expected // using static int; Diagnostic(ErrorCode.ERR_IdentifierExpected, ";").WithLocation(1, 17)); @@ -494,9 +494,9 @@ public void StaticUsingDirectivePredefinedTypePointer() { UsingTree( @"using static int*;", - // (1,7): error CS0106: The modifier 'static' is not valid for this item + // (1,7): error CS9229: Modifiers cannot be placed on using declarations // using static int*; - Diagnostic(ErrorCode.ERR_BadMemberFlag, "static").WithArguments("static").WithLocation(1, 7), + Diagnostic(ErrorCode.ERR_NoModifiersOnUsing, "static").WithLocation(1, 7), // (1,18): error CS1001: Identifier expected // using static int*; Diagnostic(ErrorCode.ERR_IdentifierExpected, ";").WithLocation(1, 18)); From c67283fc6f42ce5cb5523642a9aee8f9f284aa0d Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 19:29:39 -0700 Subject: [PATCH 38/94] Forward diagnostic reanalysis request to be a lsp pull diagnostic refresh instead --- ...nameTrackingTaggerProvider.StateMachine.cs | 6 +---- .../RemoteEditAndContinueServiceTests.cs | 14 +++++------ .../MockDiagnosticAnalyzerService.cs | 6 ++--- .../Diagnostics/IDiagnosticAnalyzerService.cs | 5 ++-- .../Remote/RemoteDebuggingSessionProxy.cs | 8 +++--- .../VSTypeScriptDiagnosticAnalyzerService.cs | 2 +- .../Diagnostics/DiagnosticAnalyzerService.cs | 10 ++++---- ...sticAnalyzerService_IncrementalAnalyzer.cs | 2 +- ...ncrementalAnalyzer_BuildSynchronization.cs | 25 +------------------ .../FSharpDiagnosticAnalyzerService.cs | 4 +-- ...StudioDiagnosticListTableCommandHandler.cs | 9 ++----- .../VisualStudioSuppressionFixService.cs | 6 +---- .../Core/Def/Venus/ContainedLanguage.cs | 2 +- .../ExternalDiagnosticUpdateSourceTests.vb | 2 +- 14 files changed, 31 insertions(+), 70 deletions(-) diff --git a/src/EditorFeatures/Core/RenameTracking/RenameTrackingTaggerProvider.StateMachine.cs b/src/EditorFeatures/Core/RenameTracking/RenameTrackingTaggerProvider.StateMachine.cs index 3691c669f2017..1bf2cf11cc79a 100644 --- a/src/EditorFeatures/Core/RenameTracking/RenameTrackingTaggerProvider.StateMachine.cs +++ b/src/EditorFeatures/Core/RenameTracking/RenameTrackingTaggerProvider.StateMachine.cs @@ -240,11 +240,7 @@ public bool ClearVisibleTrackingSession() // to trigger the diagnostic system to reanalyze, so we trigger it // manually. - _diagnosticAnalyzerService?.Reanalyze( - document.Project.Solution.Workspace, - projectIds: null, - documentIds: SpecializedCollections.SingletonEnumerable(document.Id), - highPriority: true); + _diagnosticAnalyzerService?.RequestDiagnosticRefresh(); } // Disallow the existing TrackingSession from triggering IdentifierFound. diff --git a/src/EditorFeatures/Test/EditAndContinue/RemoteEditAndContinueServiceTests.cs b/src/EditorFeatures/Test/EditAndContinue/RemoteEditAndContinueServiceTests.cs index 91df0b1a8e82d..217259aceb9c0 100644 --- a/src/EditorFeatures/Test/EditAndContinue/RemoteEditAndContinueServiceTests.cs +++ b/src/EditorFeatures/Test/EditAndContinue/RemoteEditAndContinueServiceTests.cs @@ -98,10 +98,10 @@ await localWorkspace.ChangeSolutionAsync(localWorkspace.CurrentSolution var mockDiagnosticService = (MockDiagnosticAnalyzerService)localWorkspace.GetService(); - void VerifyReanalyzeInvocation(ImmutableArray documentIds) + void VerifyReanalyzeInvocation() { - AssertEx.Equal(documentIds, mockDiagnosticService.DocumentsToReanalyze); - mockDiagnosticService.DocumentsToReanalyze.Clear(); + Assert.True(mockDiagnosticService.RequestedRefresh); + mockDiagnosticService.RequestedRefresh = false; } var diagnosticUpdateSource = new EditAndContinueDiagnosticUpdateSource(); @@ -182,7 +182,7 @@ void VerifyReanalyzeInvocation(ImmutableArray documentIds) }; await sessionProxy.BreakStateOrCapabilitiesChangedAsync(mockDiagnosticService, diagnosticUpdateSource, inBreakState: true, CancellationToken.None); - VerifyReanalyzeInvocation(ImmutableArray.Create(documentId)); + VerifyReanalyzeInvocation(); Assert.Equal(1, emitDiagnosticsClearedCount); emitDiagnosticsClearedCount = 0; @@ -240,7 +240,7 @@ void VerifyReanalyzeInvocation(ImmutableArray documentIds) var (updates, _, _, syntaxErrorData) = await sessionProxy.EmitSolutionUpdateAsync(localWorkspace.CurrentSolution, activeStatementSpanProvider, mockDiagnosticService, diagnosticUpdateSource, CancellationToken.None); AssertEx.Equal($"[{projectId}] Error ENC1001: test.cs(0, 1, 0, 2): {string.Format(FeaturesResources.ErrorReadingFile, "doc", "syntax error")}", Inspect(syntaxErrorData!)); - VerifyReanalyzeInvocation(ImmutableArray.Create(documentId)); + VerifyReanalyzeInvocation(); Assert.Equal(ModuleUpdateStatus.Ready, updates.Status); @@ -281,7 +281,7 @@ void VerifyReanalyzeInvocation(ImmutableArray documentIds) }; await sessionProxy.CommitSolutionUpdateAsync(mockDiagnosticService, CancellationToken.None); - VerifyReanalyzeInvocation(ImmutableArray.Create(documentId)); + VerifyReanalyzeInvocation(); // DiscardSolutionUpdate @@ -339,7 +339,7 @@ void VerifyReanalyzeInvocation(ImmutableArray documentIds) }; await sessionProxy.EndDebuggingSessionAsync(solution, diagnosticUpdateSource, mockDiagnosticService, CancellationToken.None); - VerifyReanalyzeInvocation(ImmutableArray.Create(documentId)); + VerifyReanalyzeInvocation(); Assert.Equal(1, emitDiagnosticsClearedCount); emitDiagnosticsClearedCount = 0; Assert.Empty(emitDiagnosticsUpdated); diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs b/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs index cf0f9c741a49f..6bd490efea2e5 100644 --- a/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs +++ b/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs @@ -22,7 +22,7 @@ namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics internal class MockDiagnosticAnalyzerService : IDiagnosticAnalyzerService { private readonly ArrayBuilder<(DiagnosticData Diagnostic, DiagnosticKind KindFilter)> _diagnosticsWithKindFilter; - public readonly List DocumentsToReanalyze = []; + public bool RequestedRefresh; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] @@ -41,8 +41,8 @@ public void AddDiagnostics(ImmutableArray diagnostics, Diagnosti AddDiagnostic(diagnostic, diagnosticKind); } - public void Reanalyze(Workspace workspace, IEnumerable? projectIds, IEnumerable? documentIds, bool highPriority) - => DocumentsToReanalyze.AddRange(documentIds); + public void RequestDiagnosticRefresh() + => RequestedRefresh = true; public DiagnosticAnalyzerInfoCache AnalyzerInfoCache => throw new NotImplementedException(); diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs index 5c85d2e600442..6b7d1a2feef80 100644 --- a/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs +++ b/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs @@ -25,10 +25,9 @@ internal interface IDiagnosticAnalyzerService DiagnosticAnalyzerInfoCache AnalyzerInfoCache { get; } /// - /// Re-analyze given projects and documents. If both and are null, - /// then re-analyzes the entire for the given . + /// Re-analyze all projects and documents. This will cause an LSP diagnostic refresh request to be sent. /// - void Reanalyze(Workspace workspace, IEnumerable? projectIds, IEnumerable? documentIds, bool highPriority); + void RequestDiagnosticRefresh(); /// /// 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. diff --git a/src/Features/Core/Portable/EditAndContinue/Remote/RemoteDebuggingSessionProxy.cs b/src/Features/Core/Portable/EditAndContinue/Remote/RemoteDebuggingSessionProxy.cs index d2b0067d344fb..0a30ca6c987ad 100644 --- a/src/Features/Core/Portable/EditAndContinue/Remote/RemoteDebuggingSessionProxy.cs +++ b/src/Features/Core/Portable/EditAndContinue/Remote/RemoteDebuggingSessionProxy.cs @@ -50,7 +50,7 @@ public async ValueTask BreakStateOrCapabilitiesChangedAsync(IDiagnosticAnalyzerS } // clear all reported rude edits: - diagnosticService.Reanalyze(_workspace, projectIds: null, documentIds: documentsToReanalyze, highPriority: false); + diagnosticService.RequestDiagnosticRefresh(); // clear emit/apply diagnostics reported previously: diagnosticUpdateSource.ClearDiagnostics(isSessionEnding: false); @@ -78,7 +78,7 @@ public async ValueTask EndDebuggingSessionAsync(Solution compileTimeSolution, Ed compileTimeSolution, documentsToReanalyze, designTimeSolution: _workspace.CurrentSolution, cancellationToken).ConfigureAwait(false); // clear all reported rude edits: - diagnosticService.Reanalyze(_workspace, projectIds: null, documentIds: designTimeDocumentsToReanalyze, highPriority: false); + diagnosticService.RequestDiagnosticRefresh(); // clear emit/apply diagnostics reported previously: diagnosticUpdateSource.ClearDiagnostics(isSessionEnding: true); @@ -149,7 +149,7 @@ public async ValueTask EndDebuggingSessionAsync(Solution compileTimeSolution, Ed diagnosticUpdateSource.ClearDiagnostics(isSessionEnding: false); // clear all reported rude edits: - diagnosticService.Reanalyze(_workspace, projectIds: null, documentIds: rudeEdits.Select(d => d.DocumentId), highPriority: false); + diagnosticService.RequestDiagnosticRefresh(); // report emit/apply diagnostics: diagnosticUpdateSource.ReportDiagnostics(_workspace, solution, diagnosticData, rudeEdits); @@ -188,7 +188,7 @@ public async ValueTask CommitSolutionUpdateAsync(IDiagnosticAnalyzerService diag } // clear all reported rude edits: - diagnosticService.Reanalyze(_workspace, projectIds: null, documentIds: documentsToReanalyze, highPriority: false); + diagnosticService.RequestDiagnosticRefresh(); } public async ValueTask DiscardSolutionUpdateAsync(CancellationToken cancellationToken) diff --git a/src/Features/Core/Portable/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticAnalyzerService.cs b/src/Features/Core/Portable/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticAnalyzerService.cs index c7c129b9c41ac..2ef151f4f17d7 100644 --- a/src/Features/Core/Portable/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticAnalyzerService.cs +++ b/src/Features/Core/Portable/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticAnalyzerService.cs @@ -20,5 +20,5 @@ internal sealed class VSTypeScriptAnalyzerService(IDiagnosticAnalyzerService ser private readonly IDiagnosticAnalyzerService _service = service; public void Reanalyze(Workspace workspace, IEnumerable? projectIds = null, IEnumerable? documentIds = null, bool highPriority = false) - => _service.Reanalyze(workspace, projectIds, documentIds, highPriority); + => _service.RequestDiagnosticRefresh(); } diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs index 507922c291017..497c6fcd873a3 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs @@ -39,6 +39,7 @@ internal partial class DiagnosticAnalyzerService : IDiagnosticAnalyzerService private readonly ConditionalWeakTable _map = new(); private readonly ConditionalWeakTable.CreateValueCallback _createIncrementalAnalyzer; + private readonly IDiagnosticsRefresher _diagnosticsRefresher; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] @@ -52,7 +53,7 @@ public DiagnosticAnalyzerService( AnalyzerInfoCache = globalCache.AnalyzerInfoCache; Listener = listenerProvider.GetListener(FeatureAttribute.DiagnosticService); GlobalOptions = globalOptions; - + _diagnosticsRefresher = diagnosticsRefresher; _createIncrementalAnalyzer = CreateIncrementalAnalyzerCallback; _eventQueue = new TaskQueue(Listener, TaskScheduler.Default); @@ -63,7 +64,7 @@ public DiagnosticAnalyzerService( { if (IsGlobalOptionAffectingDiagnostics(e.Option)) { - diagnosticsRefresher.RequestWorkspaceRefresh(); + RequestDiagnosticRefresh(); } }); } @@ -75,9 +76,8 @@ public static bool IsGlobalOptionAffectingDiagnostics(IOption2 option) option == SolutionCrawlerOptionsStorage.SolutionBackgroundAnalysisScopeOption || option == SolutionCrawlerOptionsStorage.CompilerDiagnosticsScopeOption; - public void Reanalyze(Workspace workspace, IEnumerable? projectIds, IEnumerable? documentIds, bool highPriority) - { - } + public void RequestDiagnosticRefresh() + => _diagnosticsRefresher?.RequestWorkspaceRefresh(); public Task<(ImmutableArray diagnostics, bool upToDate)> TryGetDiagnosticsForSpanAsync( TextDocument document, diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs index b52fa731ff259..b400bfe711b5b 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs @@ -27,5 +27,5 @@ private DiagnosticIncrementalAnalyzer CreateIncrementalAnalyzerCallback(Workspac } private void OnDocumentActiveContextChanged(object? sender, DocumentActiveContextChangedEventArgs e) - => Reanalyze(e.Solution.Workspace, projectIds: null, documentIds: SpecializedCollections.SingletonEnumerable(e.NewActiveContextDocumentId), highPriority: true); + => RequestDiagnosticRefresh(); } diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs index eec6bc4234f96..8400a75dbbf32 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs @@ -74,30 +74,7 @@ public async ValueTask SynchronizeWithBuildAsync( // Refresh live diagnostics after solution build completes. if (onBuildCompleted) - { - // Enqueue re-analysis of active document with high-priority right away. - if (_documentTrackingService.GetActiveDocument(solution) is { } activeDocument) - { - AnalyzerService.Reanalyze(Workspace, projectIds: null, documentIds: ImmutableArray.Create(activeDocument.Id), highPriority: true); - } - - // Enqueue remaining re-analysis with normal priority on a separate task queue - // that will execute at the end of all the post build and error list refresh tasks. - _ = postBuildAndErrorListRefreshTaskQueue.ScheduleTask(nameof(SynchronizeWithBuildAsync), () => - { - // Enqueue re-analysis of open documents. - AnalyzerService.Reanalyze(Workspace, projectIds: null, documentIds: Workspace.GetOpenDocumentIds(), highPriority: false); - - // Enqueue re-analysis of projects, if required. - foreach (var projectsByLanguage in solution.Projects.GroupBy(p => p.Language)) - { - if (GlobalOptions.IsFullSolutionAnalysisEnabled(projectsByLanguage.Key)) - { - AnalyzerService.Reanalyze(Workspace, projectsByLanguage.Select(p => p.Id), documentIds: null, highPriority: false); - } - } - }, cancellationToken); - } + AnalyzerService.RequestDiagnosticRefresh(); } } diff --git a/src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpDiagnosticAnalyzerService.cs b/src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpDiagnosticAnalyzerService.cs index f77fd03c4b738..b4fef38d66eef 100644 --- a/src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpDiagnosticAnalyzerService.cs +++ b/src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpDiagnosticAnalyzerService.cs @@ -26,8 +26,6 @@ public FSharpDiagnosticAnalyzerService(Microsoft.CodeAnalysis.Diagnostics.IDiagn } public void Reanalyze(Workspace workspace, IEnumerable projectIds = null, IEnumerable documentIds = null, bool highPriority = false) - { - _delegatee.Reanalyze(workspace, projectIds, documentIds, highPriority); - } + => _delegatee.RequestDiagnosticRefresh(); } } diff --git a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs index f627bc807b105..efcbbc6b94d69 100644 --- a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs +++ b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs @@ -214,14 +214,9 @@ await _editHandlerService.ApplyAsync( scope.GetCodeAnalysisProgress(), context.UserCancellationToken).ConfigureAwait(false); + // Kick off diagnostic re-analysis for affected document so that the configured diagnostic gets refreshed. if (selectedDiagnostic.DocumentId != null) - { - // Kick off diagnostic re-analysis for affected document so that the configured diagnostic gets refreshed. - _ = Task.Run(() => - { - _diagnosticService.Reanalyze(_workspace, projectIds: null, documentIds: SpecializedCollections.SingletonEnumerable(selectedDiagnostic.DocumentId), highPriority: true); - }); - } + _diagnosticService.RequestDiagnosticRefresh(); } catch (OperationCanceledException) { diff --git a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs index 62701ab03fb37..fe87d2561bea2 100644 --- a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs +++ b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs @@ -413,11 +413,7 @@ await _editHandlerService.ApplyAsync( cancellationToken).ConfigureAwait(false); // Kick off diagnostic re-analysis for affected projects so that diagnostics gets refreshed. - _ = Task.Run(() => - { - var reanalyzeDocuments = diagnosticsToFix.Select(d => d.DocumentId).WhereNotNull().Distinct(); - _diagnosticService.Reanalyze(_workspace, projectIds: null, documentIds: reanalyzeDocuments, highPriority: true); - }); + _diagnosticService.RequestDiagnosticRefresh(); } } catch (OperationCanceledException) diff --git a/src/VisualStudio/Core/Def/Venus/ContainedLanguage.cs b/src/VisualStudio/Core/Def/Venus/ContainedLanguage.cs index dbb65c0e55adf..103ffe86eaa94 100644 --- a/src/VisualStudio/Core/Def/Venus/ContainedLanguage.cs +++ b/src/VisualStudio/Core/Def/Venus/ContainedLanguage.cs @@ -171,7 +171,7 @@ private void OnDataBufferChanged(object sender, TextContentChangedEventArgs e) { // we don't actually care what has changed in primary buffer. we just want to re-analyze secondary buffer // when primary buffer has changed to update diagnostic positions. - _diagnosticAnalyzerService.Reanalyze(this.Workspace, projectIds: null, documentIds: SpecializedCollections.SingletonEnumerable(this.ContainedDocument.Id), highPriority: false); + _diagnosticAnalyzerService.RequestDiagnosticRefresh(); } public string GetFilePathFromBuffers() diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb index 3c03a208a23a3..592036bf6f91f 100644 --- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb +++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb @@ -657,7 +657,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics Public Event DiagnosticsUpdated As EventHandler(Of ImmutableArray(Of DiagnosticsUpdatedArgs)) Implements IDiagnosticUpdateSource.DiagnosticsUpdated Public Event DiagnosticsCleared As EventHandler Implements IDiagnosticUpdateSource.DiagnosticsCleared - Public Sub Reanalyze(workspace As Workspace, projectIds As IEnumerable(Of ProjectId), documentIds As IEnumerable(Of DocumentId), highPriority As Boolean) Implements IDiagnosticAnalyzerService.Reanalyze + Public Sub RequestDiagnosticRefresh() Implements IDiagnosticAnalyzerService.RequestDiagnosticRefresh End Sub Public Function GetDiagnosticsForSpanAsync(document As TextDocument, range As TextSpan?, shouldIncludeDiagnostic As Func(Of String, Boolean), includeCompilerDiagnostics As Boolean, includeSuppressedDiagnostics As Boolean, priority As ICodeActionRequestPriorityProvider, addOperationScope As Func(Of String, IDisposable), diagnosticKinds As DiagnosticKind, isExplicit As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForSpanAsync From 7c875d6db802dd2043960e9aa63ee25196e84dd1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 21 Mar 2024 22:08:51 -0700 Subject: [PATCH 39/94] Remove legacy IDiagnosticService --- .../GenerateType/GenerateTypeTests.cs | 4 +- .../CSharpTest/CodeActions/PreviewTests.cs | 2 - .../DiagnosticAnalyzerDriverTests.cs | 5 +- .../VSTypeScriptDiagnosticService.cs | 42 +-- .../AbstractCodeActionOrUserDiagnosticTest.cs | 4 +- ...ctUserDiagnosticTest_GenerateTypeDialog.cs | 2 - .../MoveType/AbstractMoveTypeTest.cs | 4 +- .../Test/Diagnostics/DiagnosticDataTests.cs | 3 - .../Diagnostics/DiagnosticServiceTests.cs | 127 --------- .../Test/Diagnostics/MockDiagnosticService.cs | 28 -- .../Diagnostics/DiagnosticTaggerWrapper.cs | 9 - .../Squiggles/TestDiagnosticTagProducer.cs | 27 -- .../Suppression/SuppressionAllCodeTests.cs | 4 +- .../Suppression/SuppressionTests.cs | 1 - ...agnosticUpdateSourceRegistrationService.cs | 20 -- .../EditAndContinueDiagnosticUpdateSource.cs | 10 +- ...CodeActionOrUserDiagnosticTest_NoEditor.cs | 8 +- .../HostWorkspace/VSCodeAnalyzerLoader.cs | 14 +- .../Diagnostics/DiagnosticAnalyzerService.cs | 3 - .../Features/Diagnostics/DiagnosticService.cs | 269 ------------------ ...Service_UpdateSourceRegistrationService.cs | 28 -- .../Diagnostics/IDiagnosticService.cs | 23 -- ...agnosticUpdateSourceRegistrationService.cs | 30 -- .../TestDiagnosticAnalyzerDriver.cs | 12 +- .../Suppression/SuppressionAllCodeTests.vb | 4 +- .../Razor/RazorTestAnalyzerLoader.cs | 13 +- .../VisualStudioWorkspaceImpl.cs | 1 - .../ExternalErrorDiagnosticUpdateSource.cs | 2 - .../TaskList/HostDiagnosticUpdateSource.cs | 4 +- .../Framework/TestEnvironment.vb | 3 +- 30 files changed, 28 insertions(+), 678 deletions(-) delete mode 100644 src/EditorFeatures/Test/Diagnostics/DiagnosticServiceTests.cs delete mode 100644 src/EditorFeatures/Test/Diagnostics/MockDiagnosticService.cs delete mode 100644 src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSourceRegistrationService.cs delete mode 100644 src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService.cs delete mode 100644 src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService_UpdateSourceRegistrationService.cs delete mode 100644 src/Features/LanguageServer/Protocol/Features/Diagnostics/IDiagnosticService.cs delete mode 100644 src/Features/TestUtilities/Diagnostics/MockDiagnosticUpdateSourceRegistrationService.cs diff --git a/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs b/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs index c3121d826706d..4769604c953b8 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs @@ -39,9 +39,7 @@ protected override ImmutableArray MassageActions(ImmutableArray EditorTestCompositions.EditorFeaturesWpf - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) - .AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)); + => EditorTestCompositions.EditorFeaturesWpf; #region Generate Class diff --git a/src/EditorFeatures/CSharpTest/CodeActions/PreviewTests.cs b/src/EditorFeatures/CSharpTest/CodeActions/PreviewTests.cs index a3e5cace26455..b446ad0f3255f 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/PreviewTests.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/PreviewTests.cs @@ -28,9 +28,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings public partial class PreviewTests : AbstractCSharpCodeActionTest { private static readonly TestComposition s_composition = EditorTestCompositions.EditorFeaturesWpf - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) .AddParts( - typeof(MockDiagnosticUpdateSourceRegistrationService), typeof(MockPreviewPaneService)); private const string AddedDocumentName = "AddedDocument"; diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs b/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs index 36caa60843275..a28b1cacfa431 100644 --- a/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs +++ b/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs @@ -32,11 +32,10 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.UserDiagnos [UseExportProvider] public class DiagnosticAnalyzerDriverTests { - private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = EditorTestCompositions.EditorFeatures - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) - .AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)); + private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = EditorTestCompositions.EditorFeatures; [Fact] + public async Task DiagnosticAnalyzerDriverAllInOne() { var source = TestResource.AllInOneCSharpCode; diff --git a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticService.cs b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticService.cs index 5b9864deafe73..8fb8b95cfd62a 100644 --- a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticService.cs +++ b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptDiagnosticService.cs @@ -3,14 +3,12 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Immutable; +using System.Composition; using System.Threading; using System.Threading.Tasks; -using System.Composition; -using System.Collections.Immutable; -using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Options; +using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript; @@ -18,10 +16,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript; [Export(typeof(IVSTypeScriptDiagnosticService)), Shared] [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] -internal sealed class VSTypeScriptDiagnosticService(IDiagnosticService service) : IVSTypeScriptDiagnosticService +internal sealed class VSTypeScriptDiagnosticService() : IVSTypeScriptDiagnosticService { - private readonly IDiagnosticService _service = service; - public Task> GetPushDiagnosticsAsync(Workspace workspace, ProjectId projectId, DocumentId documentId, object id, bool includeSuppressedDiagnostics, CancellationToken cancellationToken) { // This type is only for push diagnostics, which is now no longer how any of our diagnostic systems work. So @@ -31,41 +27,15 @@ public Task> GetPushDiagnosticsAsync( [Obsolete] public IDisposable RegisterDiagnosticsUpdatedEventHandler(Action action) - => new EventHandlerWrapper(_service, action); + => new EventHandlerWrapper(); public IDisposable RegisterDiagnosticsUpdatedEventHandler(Action> action) - => new EventHandlerWrapper(_service, action); + => new EventHandlerWrapper(); private sealed class EventHandlerWrapper : IDisposable { - private readonly IDiagnosticService _service; - private readonly EventHandler> _handler; - - [Obsolete] - internal EventHandlerWrapper(IDiagnosticService service, Action action) - { - _service = service; - _handler = (sender, argsCollection) => - { - foreach (var args in argsCollection) - action(new VSTypeScriptDiagnosticsUpdatedArgsWrapper(args)); - }; - _service.DiagnosticsUpdated += _handler; - } - - internal EventHandlerWrapper(IDiagnosticService service, Action> action) - { - _service = service; - _handler = (sender, argsCollection) => - { - action(ImmutableArray.CreateRange(argsCollection, static args => new VSTypeScriptDiagnosticsUpdatedArgsWrapper(args))); - }; - _service.DiagnosticsUpdated += _handler; - } - public void Dispose() { - _service.DiagnosticsUpdated -= _handler; } } } diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs index c4c24f20e54ad..ab76c5b379b92 100644 --- a/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs +++ b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs @@ -155,9 +155,7 @@ private protected virtual IDocumentServiceProvider GetDocumentServiceProvider() => null; protected virtual TestComposition GetComposition() - => EditorTestCompositions.EditorFeatures - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) - .AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)); + => EditorTestCompositions.EditorFeatures; protected virtual void InitializeWorkspace(EditorTestWorkspace workspace, TestParameters parameters) { diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs index 23aac48821079..aaf8f45515377 100644 --- a/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs +++ b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs @@ -27,9 +27,7 @@ public abstract partial class AbstractUserDiagnosticTest { // TODO: IInlineRenameService requires WPF (https://github.com/dotnet/roslyn/issues/46153) private static readonly TestComposition s_composition = EditorTestCompositions.EditorFeaturesWpf - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) .AddParts( - typeof(MockDiagnosticUpdateSourceRegistrationService), typeof(TestGenerateTypeOptionsService), typeof(TestProjectManagementService)); diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/MoveType/AbstractMoveTypeTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/MoveType/AbstractMoveTypeTest.cs index dc323d6b78d01..2f8d8892420d4 100644 --- a/src/EditorFeatures/DiagnosticsTestUtilities/MoveType/AbstractMoveTypeTest.cs +++ b/src/EditorFeatures/DiagnosticsTestUtilities/MoveType/AbstractMoveTypeTest.cs @@ -33,9 +33,7 @@ public abstract class AbstractMoveTypeTest : AbstractCodeActionTest // TODO: Requires WPF due to IInlineRenameService dependency (https://github.com/dotnet/roslyn/issues/46153) protected override TestComposition GetComposition() - => EditorTestCompositions.EditorFeaturesWpf - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) - .AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)); + => EditorTestCompositions.EditorFeaturesWpf; protected override CodeRefactoringProvider CreateCodeRefactoringProvider(EditorTestWorkspace workspace, TestParameters parameters) => new MoveTypeCodeRefactoringProvider(); diff --git a/src/EditorFeatures/Test/Diagnostics/DiagnosticDataTests.cs b/src/EditorFeatures/Test/Diagnostics/DiagnosticDataTests.cs index d038755b0263b..e0de118a7a3ad 100644 --- a/src/EditorFeatures/Test/Diagnostics/DiagnosticDataTests.cs +++ b/src/EditorFeatures/Test/Diagnostics/DiagnosticDataTests.cs @@ -4,14 +4,11 @@ #nullable disable -using System; using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; -using System.Xml.Linq; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; diff --git a/src/EditorFeatures/Test/Diagnostics/DiagnosticServiceTests.cs b/src/EditorFeatures/Test/Diagnostics/DiagnosticServiceTests.cs deleted file mode 100644 index bd444dac906fd..0000000000000 --- a/src/EditorFeatures/Test/Diagnostics/DiagnosticServiceTests.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; -using Microsoft.CodeAnalysis.Test.Utilities; -using Xunit; - -namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics -{ - [UseExportProvider] - [Trait(Traits.Feature, Traits.Features.Diagnostics)] - public class DiagnosticServiceTests - { - private static DiagnosticService GetDiagnosticService(TestWorkspace workspace) - { - var diagnosticService = Assert.IsType(workspace.ExportProvider.GetExportedValue()); - - return diagnosticService; - } - - [Fact] - public void TestCleared() - { - using var workspace = new TestWorkspace(composition: EditorTestCompositions.EditorFeatures); - var mutex = new ManualResetEvent(false); - var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", string.Empty); - var document2 = document.Project.AddDocument("TestDocument2", string.Empty); - - var diagnosticService = GetDiagnosticService(workspace); - - var source1 = new TestDiagnosticUpdateSource(); - diagnosticService.Register(source1); - - var source2 = new TestDiagnosticUpdateSource(); - diagnosticService.Register(source2); - - diagnosticService.DiagnosticsUpdated += MarkSet; - - // add bunch of data to the service for both sources - RaiseDiagnosticEvent(mutex, source1, workspace, document.Project.Id, document.Id, Tuple.Create(workspace, document)); - RaiseDiagnosticEvent(mutex, source1, workspace, document.Project.Id, document.Id, Tuple.Create(workspace, document.Project, document)); - RaiseDiagnosticEvent(mutex, source1, workspace, document2.Project.Id, document2.Id, Tuple.Create(workspace, document2)); - - RaiseDiagnosticEvent(mutex, source2, workspace, document.Project.Id, null, Tuple.Create(workspace, document.Project)); - RaiseDiagnosticEvent(mutex, source2, workspace, null, null, Tuple.Create(workspace)); - - diagnosticService.DiagnosticsUpdated -= MarkSet; - - // confirm clear for a source - mutex.Reset(); - var count = 0; - diagnosticService.DiagnosticsUpdated += MarkCalled; - - source1.RaiseDiagnosticsClearedEvent(); - - mutex.WaitOne(); - return; - - void MarkCalled(object sender, ImmutableArray args) - { - foreach (var _ in args) - { - // event is serialized. no concurrent call - if (++count == 3) - { - mutex.Set(); - } - } - } - - void MarkSet(object sender, ImmutableArray args) - { - foreach (var _ in args) - mutex.Set(); - } - } - - private static DiagnosticData RaiseDiagnosticEvent(ManualResetEvent set, TestDiagnosticUpdateSource source, TestWorkspace workspace, ProjectId? projectId, DocumentId? documentId, object id) - { - set.Reset(); - - var diagnostic = CreateDiagnosticData(projectId, documentId); - - source.RaiseDiagnosticsUpdatedEvent( - ImmutableArray.Create(DiagnosticsUpdatedArgs.DiagnosticsCreated(id, workspace, workspace.CurrentSolution, projectId, documentId, ImmutableArray.Create(diagnostic)))); - - set.WaitOne(); - - return diagnostic; - } - - private static DiagnosticData CreateDiagnosticData(ProjectId? projectId, DocumentId? documentId) - { - return new DiagnosticData( - id: "test1", - category: "Test", - message: "test1 message", - severity: DiagnosticSeverity.Info, - defaultSeverity: DiagnosticSeverity.Info, - isEnabledByDefault: false, - warningLevel: 1, - customTags: ImmutableArray.Empty, - properties: ImmutableDictionary.Empty, - projectId, - location: new DiagnosticDataLocation(new("originalFile1", new(10, 10), new(20, 20)), documentId)); - } - - private class TestDiagnosticUpdateSource : IDiagnosticUpdateSource - { - public event EventHandler>? DiagnosticsUpdated; - public event EventHandler? DiagnosticsCleared; - - public void RaiseDiagnosticsUpdatedEvent(ImmutableArray args) - => DiagnosticsUpdated?.Invoke(this, args); - - public void RaiseDiagnosticsClearedEvent() - => DiagnosticsCleared?.Invoke(this, EventArgs.Empty); - } - } -} diff --git a/src/EditorFeatures/Test/Diagnostics/MockDiagnosticService.cs b/src/EditorFeatures/Test/Diagnostics/MockDiagnosticService.cs deleted file mode 100644 index 571b269b2cf55..0000000000000 --- a/src/EditorFeatures/Test/Diagnostics/MockDiagnosticService.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Immutable; -using System.Composition; -using System.Linq; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Host.Mef; -using Xunit; - -namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics -{ - [Export(typeof(IDiagnosticService)), Shared, PartNotDiscoverable] - internal class MockDiagnosticService : IDiagnosticService - { - public const string DiagnosticId = "MockId"; - - public event EventHandler> DiagnosticsUpdated { add { } remove { } } - - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public MockDiagnosticService() - { - } - } -} diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/DiagnosticTaggerWrapper.cs b/src/EditorFeatures/TestUtilities/Diagnostics/DiagnosticTaggerWrapper.cs index 40c80229ce774..b3fd01ef67bb0 100644 --- a/src/EditorFeatures/TestUtilities/Diagnostics/DiagnosticTaggerWrapper.cs +++ b/src/EditorFeatures/TestUtilities/Diagnostics/DiagnosticTaggerWrapper.cs @@ -24,7 +24,6 @@ internal class DiagnosticTaggerWrapper where TTag : ITag { private readonly EditorTestWorkspace _workspace; - public readonly DiagnosticService DiagnosticService; private readonly IThreadingContext _threadingContext; private readonly IAsynchronousOperationListenerProvider _listenerProvider; @@ -33,7 +32,6 @@ internal class DiagnosticTaggerWrapper public DiagnosticTaggerWrapper( EditorTestWorkspace workspace, IReadOnlyDictionary>? analyzerMap = null, - IDiagnosticUpdateSource? updateSource = null, bool createTaggerProvider = true) { _threadingContext = workspace.GetService(); @@ -49,13 +47,6 @@ public DiagnosticTaggerWrapper( _workspace = workspace; - DiagnosticService = (DiagnosticService)workspace.ExportProvider.GetExportedValue(); - - if (updateSource is object) - { - DiagnosticService.Register(updateSource); - } - if (createTaggerProvider) { _ = TaggerProvider; diff --git a/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs b/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs index b18dd1053b470..f9abcbbe7321a 100644 --- a/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs +++ b/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs @@ -5,14 +5,10 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; -using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; -using Microsoft.CodeAnalysis.Text.Shared.Extensions; using Microsoft.VisualStudio.Text.Tagging; using Roslyn.Utilities; @@ -29,29 +25,6 @@ internal sealed class TestDiagnosticTagProducer return SquiggleUtilities.GetDiagnosticsAndErrorSpansAsync(workspace, analyzerMap); } - internal static async Task>> GetErrorsFromUpdateSource(EditorTestWorkspace workspace, DiagnosticsUpdatedArgs updateArgs, DiagnosticKind diagnosticKind) - { - var source = new TestDiagnosticUpdateSource(); - - var wrapper = new DiagnosticTaggerWrapper(workspace, updateSource: source); - - var firstDocument = workspace.Documents.First(); - var tagger = wrapper.TaggerProvider.CreateTagger(firstDocument.GetTextBuffer()); - using var disposable = (IDisposable)tagger; - - var analyzerServer = (MockDiagnosticAnalyzerService)workspace.GetService(); - analyzerServer.AddDiagnostics(updateArgs.Diagnostics, diagnosticKind); - - source.RaiseDiagnosticsUpdated(ImmutableArray.Create(updateArgs)); - - await wrapper.WaitForTags(); - - var snapshot = firstDocument.GetTextBuffer().CurrentSnapshot; - var spans = tagger.GetTags(snapshot.GetSnapshotSpanCollection()).ToImmutableArray(); - - return spans; - } - internal static DiagnosticData CreateDiagnosticData(EditorTestHostDocument document, TextSpan span) { Contract.ThrowIfNull(document.FilePath); diff --git a/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionAllCodeTests.cs b/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionAllCodeTests.cs index c386b7144eb9e..f983bd0388233 100644 --- a/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionAllCodeTests.cs +++ b/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionAllCodeTests.cs @@ -24,9 +24,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.Suppression public class CSharpSuppressionAllCodeTests : AbstractSuppressionAllCodeTests { private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = FeaturesTestCompositions.Features - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) - .AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)) - .AddAssemblies(typeof(DiagnosticService).Assembly); + .AddAssemblies(typeof(DiagnosticAnalyzerService).Assembly); protected override TestWorkspace CreateWorkspaceFromFile(string definition, ParseOptions parseOptions) => TestWorkspace.CreateCSharp(definition, (CSharpParseOptions)parseOptions, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); diff --git a/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs b/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs index 708742131ab72..e49fb03985192 100644 --- a/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs +++ b/src/Features/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs @@ -448,7 +448,6 @@ void Method() var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create(new CSharpCompilerDiagnosticAnalyzer())); workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(new[] { analyzerReference })); - Assert.IsType(workspace.ExportProvider.GetExportedValue()); var diagnosticService = Assert.IsType(workspace.ExportProvider.GetExportedValue()); var incrementalAnalyzer = diagnosticService.CreateIncrementalAnalyzer(workspace); var suppressionProvider = CreateDiagnosticProviderAndFixer(workspace).Item2; diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSourceRegistrationService.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSourceRegistrationService.cs deleted file mode 100644 index 8d8d929ed5d82..0000000000000 --- a/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSourceRegistrationService.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#nullable disable - -namespace Microsoft.CodeAnalysis.Diagnostics; - -/// -/// A service that let people to register new IDiagnosticUpdateSource -/// -internal interface IDiagnosticUpdateSourceRegistrationService -{ - /// - /// Register new IDiagnosticUpdateSource - /// - /// Currently, it doesn't support unregister since our event is asynchronous and unregistering source that deal with asynchronous event is not straight forward. - /// - void Register(IDiagnosticUpdateSource source); -} diff --git a/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs b/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs index 12ef5a0b226ae..23e7d7626eb91 100644 --- a/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs +++ b/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs @@ -16,8 +16,7 @@ namespace Microsoft.CodeAnalysis.EditAndContinue; -[Export(typeof(EditAndContinueDiagnosticUpdateSource))] -[Shared] +[Export(typeof(EditAndContinueDiagnosticUpdateSource)), Shared] internal sealed class EditAndContinueDiagnosticUpdateSource : IDiagnosticUpdateSource { private int _diagnosticsVersion; @@ -32,12 +31,7 @@ internal sealed class EditAndContinueDiagnosticUpdateSource : IDiagnosticUpdateS [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public EditAndContinueDiagnosticUpdateSource(IDiagnosticUpdateSourceRegistrationService registrationService) - => registrationService.Register(this); - - // for testing - [SuppressMessage("RoslynDiagnosticsReliability", "RS0034:Exported parts should have [ImportingConstructor]", Justification = "Used incorrectly by tests")] - internal EditAndContinueDiagnosticUpdateSource() + public EditAndContinueDiagnosticUpdateSource() { } diff --git a/src/Features/DiagnosticsTestUtilities/CodeActionsLegacy/AbstractCodeActionOrUserDiagnosticTest_NoEditor.cs b/src/Features/DiagnosticsTestUtilities/CodeActionsLegacy/AbstractCodeActionOrUserDiagnosticTest_NoEditor.cs index 30b0185c73e23..b0bdf4fd1c942 100644 --- a/src/Features/DiagnosticsTestUtilities/CodeActionsLegacy/AbstractCodeActionOrUserDiagnosticTest_NoEditor.cs +++ b/src/Features/DiagnosticsTestUtilities/CodeActionsLegacy/AbstractCodeActionOrUserDiagnosticTest_NoEditor.cs @@ -22,13 +22,11 @@ using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics; +using Microsoft.CodeAnalysis.Diagnostics.EngineV2; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Remote.Testing; using Microsoft.CodeAnalysis.Shared.Extensions; -using Microsoft.CodeAnalysis.Shared.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; @@ -156,9 +154,7 @@ private protected virtual IDocumentServiceProvider GetDocumentServiceProvider() protected virtual TestComposition GetComposition() => FeaturesTestCompositions.Features - .AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) - .AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)) - .AddAssemblies(typeof(DiagnosticService).Assembly); + .AddAssemblies(typeof(DiagnosticIncrementalAnalyzer).Assembly); protected virtual void InitializeWorkspace(TestWorkspace workspace, TestParameters parameters) { diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/VSCodeAnalyzerLoader.cs b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/VSCodeAnalyzerLoader.cs index 81ad2a04ee55d..d62627d2742e4 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/VSCodeAnalyzerLoader.cs +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/VSCodeAnalyzerLoader.cs @@ -2,14 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Collections.Immutable; using System.Composition; using System.Reflection; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.LanguageServer.Services; -using Microsoft.CodeAnalysis.Options; -using Microsoft.CodeAnalysis.SolutionCrawler; using Microsoft.Extensions.Logging; namespace Microsoft.CodeAnalysis.LanguageServer.HostWorkspace; @@ -17,20 +13,16 @@ namespace Microsoft.CodeAnalysis.LanguageServer.HostWorkspace; [Export(typeof(VSCodeAnalyzerLoader)), Shared] internal class VSCodeAnalyzerLoader { - private readonly IDiagnosticAnalyzerService _analyzerService; - private readonly DiagnosticService _diagnosticService; - [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public VSCodeAnalyzerLoader(IDiagnosticAnalyzerService analyzerService, IDiagnosticService diagnosticService) + public VSCodeAnalyzerLoader() { - _analyzerService = analyzerService; - _diagnosticService = (DiagnosticService)diagnosticService; } +#pragma warning disable CA1822 // Mark members as static public void InitializeDiagnosticsServices() +#pragma warning restore CA1822 // Mark members as static { - _diagnosticService.Register((IDiagnosticUpdateSource)_analyzerService); } public static IAnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader(ExtensionAssemblyManager extensionAssemblyManager, ILogger logger) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs index 507922c291017..9f6d71d64dfb1 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs @@ -43,7 +43,6 @@ internal partial class DiagnosticAnalyzerService : IDiagnosticAnalyzerService [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public DiagnosticAnalyzerService( - IDiagnosticUpdateSourceRegistrationService registrationService, IAsynchronousOperationListenerProvider listenerProvider, DiagnosticAnalyzerInfoCache.SharedGlobalCache globalCache, IGlobalOptionService globalOptions, @@ -57,8 +56,6 @@ public DiagnosticAnalyzerService( _eventQueue = new TaskQueue(Listener, TaskScheduler.Default); - registrationService.Register(this); - globalOptions.AddOptionChangedHandler(this, (_, e) => { if (IsGlobalOptionAffectingDiagnostics(e.Option)) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService.cs deleted file mode 100644 index 38e15e438c93e..0000000000000 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService.cs +++ /dev/null @@ -1,269 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Composition; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Collections; -using Microsoft.CodeAnalysis.Common; -using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Shared.Collections; -using Microsoft.CodeAnalysis.Shared.TestHooks; -using Roslyn.Utilities; - -namespace Microsoft.CodeAnalysis.Diagnostics -{ - [Export(typeof(IDiagnosticService)), Shared] - internal partial class DiagnosticService : IDiagnosticService, IDisposable - { - private const string DiagnosticsUpdatedEventName = "DiagnosticsUpdated"; - - private readonly EventMap _eventMap = new(); - private readonly CancellationTokenSource _eventQueueCancellation = new(); - private readonly AsyncBatchingWorkQueue<(BatchOperation operation, IDiagnosticUpdateSource source, ImmutableArray argsCollection)> _eventQueue; - - private readonly object _gate = new(); - private readonly Dictionary>> _map = []; - - private ImmutableHashSet _updateSources; - - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public DiagnosticService( - IAsynchronousOperationListenerProvider listenerProvider, - [ImportMany] IEnumerable> eventListeners) - { - // we use registry service rather than doing MEF import since MEF import method can have race issue where - // update source gets created before aggregator - diagnostic service - is created and we will lose events - // fired before the aggregator is created. - _updateSources = []; - - // queue to serialize events. - _eventQueue = new AsyncBatchingWorkQueue<(BatchOperation operation, IDiagnosticUpdateSource source, ImmutableArray argsCollection)>( - delay: TimeSpan.Zero, - ProcessEventsBatchAsync, - listenerProvider.GetListener(FeatureAttribute.DiagnosticService), - _eventQueueCancellation.Token); - } - - private enum BatchOperation - { - DiagnosticsUpdated, - DiagnosticsCleared, - } - - public event EventHandler> DiagnosticsUpdated - { - add - { - _eventMap.AddEventHandler(DiagnosticsUpdatedEventName, value); - } - - remove - { - _eventMap.RemoveEventHandler(DiagnosticsUpdatedEventName, value); - } - } - - void IDisposable.Dispose() - { - _eventQueueCancellation.Cancel(); - } - - private ValueTask ProcessEventsBatchAsync(ImmutableSegmentedList<(BatchOperation operation, IDiagnosticUpdateSource source, ImmutableArray argsCollection)> batch, CancellationToken cancellationToken) - { - var ev = _eventMap.GetEventHandlers>>(DiagnosticsUpdatedEventName); - - foreach (var (operation, source, argsCollection) in batch) - { - if (operation == BatchOperation.DiagnosticsUpdated) - { - var updatedArgsCollection = UpdateDataMap(source, argsCollection); - if (updatedArgsCollection.IsEmpty) - { - // there is no change, nothing to raise events for. - continue; - } - - ev.RaiseEvent(static (handler, arg) => handler(arg.source, arg.updatedArgsCollection), (source, updatedArgsCollection)); - } - else if (operation == BatchOperation.DiagnosticsCleared) - { - using var argsBuilder = TemporaryArray.Empty; - - if (!ClearDiagnosticsReportedBySource(source, ref argsBuilder.AsRef())) - { - // there is no change, nothing to raise events for. - continue; - } - - // don't create event listener if it haven't created yet. if there is a diagnostic to remove - // listener should have already created since all events are done in the serialized queue - ev.RaiseEvent(static (handler, arg) => handler(arg.source, arg.args), (source, args: argsBuilder.ToImmutableAndClear())); - } - else - { - throw ExceptionUtilities.UnexpectedValue(operation); - } - } - - return ValueTaskFactory.CompletedTask; - } - - private void RaiseDiagnosticsUpdated(IDiagnosticUpdateSource source, ImmutableArray argsCollection) - { - _eventQueue.AddWork((BatchOperation.DiagnosticsUpdated, source, argsCollection)); - } - - private void RaiseDiagnosticsCleared(IDiagnosticUpdateSource source) - { - _eventQueue.AddWork((BatchOperation.DiagnosticsCleared, source, ImmutableArray.Empty)); - } - - private ImmutableArray UpdateDataMap(IDiagnosticUpdateSource source, ImmutableArray argsCollection) - { - // we expect source who uses this ability to have small number of diagnostics. - lock (_gate) - { - var result = argsCollection.WhereAsArray(args => - { - Debug.Assert(_updateSources.Contains(source)); - - var diagnostics = args.Diagnostics; - - // check cheap early bail out - if (diagnostics.Length == 0 && !_map.ContainsKey(source)) - { - // no new diagnostic, and we don't have update source for it. - return false; - } - - // 2 different workspaces (ex, PreviewWorkspaces) can return same Args.Id, we need to - // distinguish them. so we separate diagnostics per workspace map. - var workspaceMap = _map.GetOrAdd(source, _ => []); - - if (diagnostics.Length == 0 && !workspaceMap.ContainsKey(args.Workspace)) - { - // no new diagnostic, and we don't have workspace for it. - return false; - } - - var diagnosticDataMap = workspaceMap.GetOrAdd(args.Workspace, _ => []); - - diagnosticDataMap.Remove(args.Id); - if (diagnosticDataMap.Count == 0 && diagnostics.Length == 0) - { - workspaceMap.Remove(args.Workspace); - - if (workspaceMap.Count == 0) - { - _map.Remove(source); - } - - return true; - } - - if (diagnostics.Length > 0) - { - var data = new Data(args, diagnostics); - diagnosticDataMap.Add(args.Id, data); - } - - return true; - }); - - return result; - } - } - - private bool ClearDiagnosticsReportedBySource(IDiagnosticUpdateSource source, ref TemporaryArray removed) - { - // we expect source who uses this ability to have small number of diagnostics. - lock (_gate) - { - Debug.Assert(_updateSources.Contains(source)); - - // 2 different workspaces (ex, PreviewWorkspaces) can return same Args.Id, we need to - // distinguish them. so we separate diagnostics per workspace map. - if (!_map.TryGetValue(source, out var workspaceMap)) - { - return false; - } - - foreach (var (workspace, map) in workspaceMap) - { - foreach (var (id, data) in map) - { - removed.Add(DiagnosticsUpdatedArgs.DiagnosticsRemoved(id, data.Workspace, solution: null, data.ProjectId, data.DocumentId)); - } - } - - // all diagnostics from the source is cleared - _map.Remove(source); - return true; - } - } - - private void OnDiagnosticsUpdated(object? sender, ImmutableArray e) - { - AssertIfNull(e.SelectManyAsArray(e => e.Diagnostics)); - - // all events are serialized by async event handler - RaiseDiagnosticsUpdated((IDiagnosticUpdateSource)sender!, e); - } - - private void OnCleared(object? sender, EventArgs e) - { - // all events are serialized by async event handler - RaiseDiagnosticsCleared((IDiagnosticUpdateSource)sender!); - } - - [Conditional("DEBUG")] - private static void AssertIfNull(ImmutableArray diagnostics) - { - for (var i = 0; i < diagnostics.Length; i++) - { - AssertIfNull(diagnostics[i]); - } - } - - [Conditional("DEBUG")] - private static void AssertIfNull(T obj) - where T : class - { - if (obj == null) - { - Debug.Assert(false, "who returns invalid data?"); - } - } - - private readonly struct Data - { - public readonly Workspace Workspace; - public readonly ProjectId? ProjectId; - public readonly DocumentId? DocumentId; - public readonly object Id; - public readonly ImmutableArray Diagnostics; - - public Data(UpdatedEventArgs args) - : this(args, []) - { - } - - public Data(UpdatedEventArgs args, ImmutableArray diagnostics) - { - Workspace = args.Workspace; - ProjectId = args.ProjectId; - DocumentId = args.DocumentId; - Id = args.Id; - Diagnostics = diagnostics; - } - } - } -} diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService_UpdateSourceRegistrationService.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService_UpdateSourceRegistrationService.cs deleted file mode 100644 index f586248984e64..0000000000000 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService_UpdateSourceRegistrationService.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Composition; - -namespace Microsoft.CodeAnalysis.Diagnostics -{ - [Export(typeof(IDiagnosticUpdateSourceRegistrationService))] - internal partial class DiagnosticService : IDiagnosticUpdateSourceRegistrationService - { - public void Register(IDiagnosticUpdateSource source) - { - lock (_gate) - { - if (_updateSources.Contains(source)) - { - return; - } - - _updateSources = _updateSources.Add(source); - - source.DiagnosticsUpdated += OnDiagnosticsUpdated; - source.DiagnosticsCleared += OnCleared; - } - } - } -} diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/IDiagnosticService.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/IDiagnosticService.cs deleted file mode 100644 index 43521b1561ee9..0000000000000 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/IDiagnosticService.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Immutable; - -namespace Microsoft.CodeAnalysis.Diagnostics -{ - /// - /// Aggregates events from various diagnostic sources. - /// - internal interface IDiagnosticService - { - /// - /// Event to get notified as new diagnostics are discovered by IDiagnosticUpdateSource - /// - /// Notifications for this event are serialized to preserve order. - /// However, individual event notifications may occur on any thread. - /// - event EventHandler> DiagnosticsUpdated; - } -} diff --git a/src/Features/TestUtilities/Diagnostics/MockDiagnosticUpdateSourceRegistrationService.cs b/src/Features/TestUtilities/Diagnostics/MockDiagnosticUpdateSourceRegistrationService.cs deleted file mode 100644 index 73f9dca4b215d..0000000000000 --- a/src/Features/TestUtilities/Diagnostics/MockDiagnosticUpdateSourceRegistrationService.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#nullable disable - -using System; -using System.Composition; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Host.Mef; - -namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics -{ - [Export(typeof(IDiagnosticUpdateSourceRegistrationService))] - [Shared] - [PartNotDiscoverable] - internal class MockDiagnosticUpdateSourceRegistrationService : IDiagnosticUpdateSourceRegistrationService - { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public MockDiagnosticUpdateSourceRegistrationService() - { - } - - public void Register(IDiagnosticUpdateSource source) - { - // do nothing - } - } -} diff --git a/src/Features/TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs b/src/Features/TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs index 7990005d425ea..8419a40314bd9 100644 --- a/src/Features/TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs +++ b/src/Features/TestUtilities/Diagnostics/TestDiagnosticAnalyzerDriver.cs @@ -8,19 +8,14 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics; -using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.CodeAnalysis.Options; +using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Test.Utilities; -using Microsoft.CodeAnalysis.PooledObjects; -using Microsoft.CodeAnalysis.Remote; -using Microsoft.CodeAnalysis.Serialization; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; using Xunit; -using Microsoft.CodeAnalysis.Options; -using Microsoft.CodeAnalysis.CodeActions; -using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.UnitTests.Diagnostics { @@ -37,7 +32,6 @@ public TestDiagnosticAnalyzerDriver(Workspace workspace, bool includeSuppressedD { var mefServices = workspace.Services.SolutionServices.ExportProvider; - Assert.IsType(mefServices.GetExportedValue()); _diagnosticAnalyzerService = Assert.IsType(mefServices.GetExportedValue()); GlobalOptions = mefServices.GetExportedValue(); diff --git a/src/Features/VisualBasicTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb b/src/Features/VisualBasicTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb index 99cf92d7ad2a7..3d5e494cae508 100644 --- a/src/Features/VisualBasicTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb +++ b/src/Features/VisualBasicTest/Diagnostics/Suppression/SuppressionAllCodeTests.vb @@ -17,9 +17,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics.Suppre Inherits AbstractSuppressionAllCodeTests Private Shared ReadOnly s_compositionWithMockDiagnosticUpdateSourceRegistrationService As TestComposition = FeaturesTestCompositions.Features _ - .AddExcludedPartTypes(GetType(IDiagnosticUpdateSourceRegistrationService)) _ - .AddParts(GetType(MockDiagnosticUpdateSourceRegistrationService)) _ - .AddAssemblies(GetType(DiagnosticService).Assembly) + .AddAssemblies(GetType(DiagnosticAnalyzerService).Assembly) Protected Overrides Function CreateWorkspaceFromFile(definition As String, parseOptions As ParseOptions) As TestWorkspace Return TestWorkspace.CreateVisualBasic(definition, DirectCast(parseOptions, VisualBasicParseOptions), composition:=s_compositionWithMockDiagnosticUpdateSourceRegistrationService) diff --git a/src/Tools/ExternalAccess/Razor/RazorTestAnalyzerLoader.cs b/src/Tools/ExternalAccess/Razor/RazorTestAnalyzerLoader.cs index b27bd3359fed1..03b807c66d944 100644 --- a/src/Tools/ExternalAccess/Razor/RazorTestAnalyzerLoader.cs +++ b/src/Tools/ExternalAccess/Razor/RazorTestAnalyzerLoader.cs @@ -4,32 +4,25 @@ using System; using System.Composition; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Options; -using Microsoft.CodeAnalysis.SolutionCrawler; namespace Microsoft.CodeAnalysis.ExternalAccess.Razor; [Export(typeof(RazorTestAnalyzerLoader)), Shared] internal class RazorTestAnalyzerLoader { - private readonly IDiagnosticAnalyzerService _analyzerService; - private readonly DiagnosticService _diagnosticService; - [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public RazorTestAnalyzerLoader(IDiagnosticAnalyzerService analyzerService, IDiagnosticService diagnosticService) + public RazorTestAnalyzerLoader() { - _analyzerService = analyzerService; - _diagnosticService = (DiagnosticService)diagnosticService; } #pragma warning disable IDE0060 // Remove unused parameter +#pragma warning disable CA1822 // Mark members as static public void InitializeDiagnosticsServices(Workspace workspace) +#pragma warning restore CA1822 // Mark members as static #pragma warning restore IDE0060 // Remove unused parameter { - _diagnosticService.Register((IDiagnosticUpdateSource)_analyzerService); } public static IAnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader() diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs index 9f3d95eaca706..51630499d6b7a 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs @@ -135,7 +135,6 @@ public VisualStudioWorkspaceImpl(ExportProvider exportProvider, IAsyncServicePro new ExternalErrorDiagnosticUpdateSource( this, exportProvider.GetExportedValue(), - exportProvider.GetExportedValue(), exportProvider.GetExportedValue(), exportProvider.GetExportedValue(), _threadingContext), diff --git a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs index 4510c3f95c160..0fff37b5061c0 100644 --- a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs +++ b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs @@ -76,13 +76,11 @@ internal sealed class ExternalErrorDiagnosticUpdateSource : IDiagnosticUpdateSou public ExternalErrorDiagnosticUpdateSource( VisualStudioWorkspace workspace, IDiagnosticAnalyzerService diagnosticService, - IDiagnosticUpdateSourceRegistrationService registrationService, IGlobalOperationNotificationService notificationService, IAsynchronousOperationListenerProvider listenerProvider, IThreadingContext threadingContext) : this(workspace, diagnosticService, notificationService, listenerProvider.GetListener(FeatureAttribute.ErrorList), threadingContext.DisposalToken) { - registrationService.Register(this); } /// diff --git a/src/VisualStudio/Core/Def/TaskList/HostDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/TaskList/HostDiagnosticUpdateSource.cs index 5cac4a34d944e..cdbb2890b07bb 100644 --- a/src/VisualStudio/Core/Def/TaskList/HostDiagnosticUpdateSource.cs +++ b/src/VisualStudio/Core/Def/TaskList/HostDiagnosticUpdateSource.cs @@ -29,11 +29,9 @@ internal sealed class HostDiagnosticUpdateSource : AbstractHostDiagnosticUpdateS [ImportingConstructor] [SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")] - public HostDiagnosticUpdateSource(Lazy workspace, IDiagnosticUpdateSourceRegistrationService registrationService) + public HostDiagnosticUpdateSource(Lazy workspace) { _workspace = workspace; - - registrationService.Register(this); } public override Workspace Workspace diff --git a/src/VisualStudio/TestUtilities2/ProjectSystemShim/Framework/TestEnvironment.vb b/src/VisualStudio/TestUtilities2/ProjectSystemShim/Framework/TestEnvironment.vb index fd973ec00660e..47445887c90b9 100644 --- a/src/VisualStudio/TestUtilities2/ProjectSystemShim/Framework/TestEnvironment.vb +++ b/src/VisualStudio/TestUtilities2/ProjectSystemShim/Framework/TestEnvironment.vb @@ -50,7 +50,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Fr ' GetType(MockWorkspaceEventListenerProvider)) Private Shared ReadOnly s_composition As TestComposition = EditorTestCompositions.EditorFeaturesWpf _ - .AddExcludedPartTypes(GetType(IDiagnosticUpdateSourceRegistrationService)) _ .AddParts( GetType(FileChangeWatcherProvider), GetType(MockVisualStudioWorkspace), @@ -68,7 +67,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Fr GetType(MockWorkspaceEventListenerProvider), GetType(HostDiagnosticUpdateSource), GetType(HierarchyItemToProjectIdMap), - GetType(DiagnosticService)) + GetType(DiagnosticAnalyzerService)) Private ReadOnly _workspace As VisualStudioWorkspaceImpl Private ReadOnly _projectFilePaths As New List(Of String) From 67ef1ee0146852a0171aa4be06c64235cd2e1888 Mon Sep 17 00:00:00 2001 From: AlekseyTs Date: Thu, 21 Mar 2024 22:11:48 -0700 Subject: [PATCH 40/94] Introduce a concept of internal special types, move all members defined in special types to the SpecialMember set. (#72646) Closes #72102. Closes #72280. --- .../CSharp/Portable/Binder/Binder_Symbols.cs | 7 +- .../Portable/Compilation/CSharpCompilation.cs | 6 +- .../LocalStateTracingInstrumenter.cs | 5 +- .../Lowering/LocalRewriter/LocalRewriter.cs | 2 +- .../LocalRewriter/LocalRewriter_Call.cs | 2 +- .../LocalRewriter_FixedStatement.cs | 2 +- .../Lowering/SyntheticBoundNodeFactory.cs | 56 ++++- .../AnonymousTypeManager.SymbolCollection.cs | 4 +- .../CSharp/Portable/Symbols/AssemblySymbol.cs | 6 +- .../Symbols/Compilation_WellKnownMembers.cs | 8 +- .../Symbols/Metadata/PE/PENamedTypeSymbol.cs | 6 +- .../Symbols/MetadataOrSourceAssemblySymbol.cs | 12 +- .../Portable/Symbols/MissingAssemblySymbol.cs | 2 +- .../Symbols/MissingCorLibrarySymbol.cs | 4 +- .../Symbols/MissingMetadataTypeSymbol.cs | 14 +- .../Symbols/NativeIntegerTypeSymbol.cs | 2 +- .../Retargeting/RetargetingAssemblySymbol.cs | 2 +- .../Source/SourceMemberContainerSymbol.cs | 20 +- .../SynthesizedReadOnlyListTypeSymbol.cs | 60 ++--- .../CSharp/Portable/Symbols/TypeSymbol.cs | 6 +- .../CSharp/Test/Emit/CodeGen/CodeGenTests.cs | 37 +-- .../Semantics/CollectionExpressionTests.cs | 30 +-- .../Compilation/GetSemanticInfoTests.cs | 2 +- .../Symbol/Compilation/UsedAssembliesTests.cs | 4 +- .../Symbols/CompilationCreationTests.cs | 3 +- .../Symbol/Symbols/CorLibrary/CorTypes.cs | 48 +++- .../Symbols/Metadata/PE/LoadingFields.cs | 4 +- .../Symbol/Symbols/MissingSpecialMember.cs | 18 +- .../Test/Symbol/Symbols/MockAssemblySymbol.cs | 2 +- .../Symbols/Source/ClsComplianceTests.cs | 1 - .../Core/CodeAnalysisTest/CorLibTypesTests.cs | 6 +- .../Core/Portable/Compilation/Compilation.cs | 9 +- .../Core/Portable/ExtendedSpecialType.cs | 64 ++++++ .../Core/Portable/InternalSpecialType.cs | 72 ++++++ .../Core/Portable/MemberDescriptor.cs | 31 ++- .../Core/Portable/PublicAPI.Shipped.txt | 2 +- .../Core/Portable/PublicAPI.Unshipped.txt | 1 - src/Compilers/Core/Portable/SpecialMember.cs | 24 ++ src/Compilers/Core/Portable/SpecialMembers.cs | 216 +++++++++++++++++- src/Compilers/Core/Portable/SpecialType.cs | 12 +- .../Core/Portable/SpecialTypeExtensions.cs | 1 - src/Compilers/Core/Portable/SpecialTypes.cs | 22 +- .../Core/Portable/WellKnownMember.cs | 24 -- .../Core/Portable/WellKnownMembers.cs | 214 ++--------------- src/Compilers/Core/Portable/WellKnownTypes.cs | 39 ++-- .../Test/Utilities/VisualBasic/MockSymbols.vb | 2 +- .../Portable/BoundTree/BoundNodes.xml | 1 + .../Portable/CodeGen/EmitExpression.vb | 13 +- .../Compilation/VisualBasicCompilation.vb | 4 +- .../Generated/BoundNodes.xml.Generated.vb | 24 +- .../ExpressionLambdaRewriter.vb | 51 +++-- ...ExpressionLambdaRewriter_BinaryOperator.vb | 12 +- ...sionLambdaRewriter_ConditionalExpresion.vb | 2 +- .../ExpressionLambdaRewriter_Conversion.vb | 10 +- .../ExpressionLambdaRewriter_UnaryOperator.vb | 6 +- .../LocalRewriter_AddRemoveHandler.vb | 2 +- .../LocalRewriter/LocalRewriter_Conversion.vb | 4 +- .../MethodToClassRewriter.vb | 2 +- .../Lowering/SyntheticBoundNodeFactory.vb | 73 +++--- .../AnonymousType_SymbolCollection.vb | 17 +- .../Portable/Symbols/AssemblySymbol.vb | 10 +- ...NamedTypeSymbolWithEmittedNamespaceName.vb | 6 +- .../Symbols/MetadataOrSourceAssemblySymbol.vb | 20 +- .../Portable/Symbols/MissingAssemblySymbol.vb | 12 +- .../Symbols/MissingMetadataTypeSymbol.vb | 20 +- .../Retargeting/RetargetingAssemblySymbol.vb | 2 +- .../Symbols/Source/SourceNamedTypeSymbol.vb | 6 +- .../Portable/Symbols/SpecialMembers.vb | 2 +- .../Portable/Symbols/TypeSymbol.vb | 10 +- .../Portable/Symbols/WellKnownMembers.vb | 8 +- .../Emit/ExpressionTrees/CodeGenExprLambda.vb | 6 + .../Compilation/CompilationAPITests.vb | 2 +- .../Semantics/GetSemanticInfoTests.vb | 2 +- .../SymbolsTests/CompilationCreationTests.vb | 3 +- .../SymbolsTests/CorLibrary/CorTypes.vb | 53 ++++- .../SymbolsTests/Metadata/PE/LoadingFields.vb | 4 +- .../WellKnownTypeValidationTests.vb | 12 +- .../Test/Symbol/UsedAssembliesTests.vb | 6 +- 78 files changed, 929 insertions(+), 590 deletions(-) create mode 100644 src/Compilers/Core/Portable/ExtendedSpecialType.cs create mode 100644 src/Compilers/Core/Portable/InternalSpecialType.cs diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs index 791e5cc5027cc..c35c4512565cd 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs @@ -1654,9 +1654,14 @@ internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, Sp /// member isn't found. /// internal Symbol GetSpecialTypeMember(SpecialMember member, BindingDiagnosticBag diagnostics, SyntaxNode syntax) + { + return GetSpecialTypeMember(this.Compilation, member, diagnostics, syntax); + } + + internal static Symbol GetSpecialTypeMember(CSharpCompilation compilation, SpecialMember member, BindingDiagnosticBag diagnostics, SyntaxNode syntax) { Symbol memberSymbol; - return TryGetSpecialTypeMember(this.Compilation, member, syntax, diagnostics, out memberSymbol) + return TryGetSpecialTypeMember(compilation, member, syntax, diagnostics, out memberSymbol) ? memberSymbol : null; } diff --git a/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs b/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs index 16a451b1d9bf5..f71459b318246 100644 --- a/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs +++ b/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs @@ -1629,9 +1629,9 @@ internal AliasSymbol GlobalNamespaceAlias /// /// Get the symbol for the predefined type from the COR Library referenced by this compilation. /// - internal new NamedTypeSymbol GetSpecialType(SpecialType specialType) + internal NamedTypeSymbol GetSpecialType(ExtendedSpecialType specialType) { - if (specialType <= SpecialType.None || specialType > SpecialType.Count) + if ((int)specialType <= (int)SpecialType.None || (int)specialType >= (int)InternalSpecialType.NextAvailable) { throw new ArgumentOutOfRangeException(nameof(specialType), $"Unexpected SpecialType: '{(int)specialType}'."); } @@ -1647,7 +1647,7 @@ internal AliasSymbol GlobalNamespaceAlias result = Assembly.GetSpecialType(specialType); } - Debug.Assert(result.SpecialType == specialType); + Debug.Assert(result.ExtendedSpecialType == specialType); return result; } diff --git a/src/Compilers/CSharp/Portable/Lowering/Instrumentation/LocalStateTracingInstrumenter.cs b/src/Compilers/CSharp/Portable/Lowering/Instrumentation/LocalStateTracingInstrumenter.cs index 2cb55cea8027a..352fb6eab69f3 100644 --- a/src/Compilers/CSharp/Portable/Lowering/Instrumentation/LocalStateTracingInstrumenter.cs +++ b/src/Compilers/CSharp/Portable/Lowering/Instrumentation/LocalStateTracingInstrumenter.cs @@ -266,6 +266,9 @@ static bool hasOverriddenToString(TypeSymbol variableType) private MethodSymbol? GetWellKnownMethodSymbol(WellKnownMember overload, SyntaxNode syntax) => (MethodSymbol?)Binder.GetWellKnownTypeMember(_factory.Compilation, overload, _diagnostics, syntax: syntax, isOptional: false); + private MethodSymbol? GetSpecialMethodSymbol(SpecialMember overload, SyntaxNode syntax) + => (MethodSymbol?)Binder.GetSpecialTypeMember(_factory.Compilation, overload, _diagnostics, syntax: syntax); + public override void PreInstrumentBlock(BoundBlock original, LocalRewriter rewriter) { Previous.PreInstrumentBlock(original, rewriter); @@ -456,7 +459,7 @@ private ImmutableArray MakeStoreLoggerArguments( if (parameter.Type.SpecialType == SpecialType.System_String && targetType.SpecialType != SpecialType.System_String) { - var toStringMethod = GetWellKnownMethodSymbol(WellKnownMember.System_Object__ToString, value.Syntax); + var toStringMethod = GetSpecialMethodSymbol(SpecialMember.System_Object__ToString, value.Syntax); BoundExpression toString; if (toStringMethod is null) diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.cs index b97db610386a9..6dda3cb81f2f4 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.cs @@ -626,7 +626,7 @@ private static MethodSymbol UnsafeGetSpecialTypeMethod(SyntaxNode syntax, Specia else { MemberDescriptor descriptor = SpecialMembers.GetDescriptor(specialMember); - SpecialType type = (SpecialType)descriptor.DeclaringTypeId; + ExtendedSpecialType type = descriptor.DeclaringSpecialType; TypeSymbol container = compilation.Assembly.GetSpecialType(type); TypeSymbol returnType = new ExtendedErrorTypeSymbol(compilation: compilation, name: descriptor.Name, errorInfo: null, arity: descriptor.Arity); return new ErrorMethodSymbol(container, returnType, "Missing"); diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs index 0b93498251cd9..7e7c8d253ac70 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs @@ -1404,7 +1404,7 @@ private BoundExpression CreateEmptyArray(SyntaxNode syntax, ArrayTypeSymbol arra return null; } - MethodSymbol? arrayEmpty = _compilation.GetWellKnownTypeMember(WellKnownMember.System_Array__Empty) as MethodSymbol; + MethodSymbol? arrayEmpty = _compilation.GetSpecialTypeMember(SpecialMember.System_Array__Empty) as MethodSymbol; if (arrayEmpty is null) // will be null if Array.Empty doesn't exist in reference assemblies { return null; diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs index 669f89e230748..892a1ba24ef29 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs @@ -535,7 +535,7 @@ private BoundStatement InitializeFixedStatementArrayLocal( else { MethodSymbol? lengthMethod; - if (TryGetWellKnownTypeMember(fixedInitializer.Syntax, WellKnownMember.System_Array__get_Length, out lengthMethod)) + if (TryGetSpecialTypeMethod(fixedInitializer.Syntax, SpecialMember.System_Array__get_Length, out lengthMethod)) { lengthCall = factory.Call(factory.Local(pinnedTemp), lengthMethod); } diff --git a/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs b/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs index 0dbaf36416b82..801b09e5d39da 100644 --- a/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs +++ b/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs @@ -397,22 +397,56 @@ public MethodSymbol WellKnownMethod(WellKnownMember wm) /// The desired special member /// A symbol for the special member. public Symbol SpecialMember(SpecialMember sm) + { + var result = SpecialMember(sm, isOptional: false); + Debug.Assert(result is not null); + return result; + } + + public Symbol? SpecialMember(SpecialMember sm, bool isOptional = false) { Symbol specialMember = Compilation.GetSpecialTypeMember(sm); if (specialMember is null) { + if (isOptional) + { + return null; + } + RuntimeMembers.MemberDescriptor memberDescriptor = SpecialMembers.GetDescriptor(sm); var diagnostic = new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, memberDescriptor.DeclaringTypeMetadataName, memberDescriptor.Name), Syntax.Location); throw new MissingPredefinedMember(diagnostic); } - Binder.ReportUseSite(specialMember, Diagnostics, Syntax); + UseSiteInfo useSiteInfo = specialMember.GetUseSiteInfo(); + + if (isOptional) + { + if (useSiteInfo.DiagnosticInfo?.DefaultSeverity == DiagnosticSeverity.Error) + { + return null; + } + + // Not interested in warnings + } + else + { + Diagnostics.Add(useSiteInfo, Syntax); + } + return specialMember; } public MethodSymbol SpecialMethod(SpecialMember sm) { - return (MethodSymbol)SpecialMember(sm); + var result = (MethodSymbol?)SpecialMember(sm, isOptional: false); + Debug.Assert(result is not null); + return result; + } + + public MethodSymbol? SpecialMethod(SpecialMember sm, bool isOptional) + { + return (MethodSymbol?)SpecialMember(sm, isOptional); } public PropertySymbol SpecialProperty(SpecialMember sm) @@ -1287,12 +1321,18 @@ public BoundExpression Sizeof(TypeSymbol type) internal BoundExpression ConstructorInfo(MethodSymbol ctor) { - return new BoundMethodInfo( + var result = new BoundMethodInfo( Syntax, ctor, GetMethodFromHandleMethod(ctor.ContainingType), WellKnownType(Microsoft.CodeAnalysis.WellKnownType.System_Reflection_ConstructorInfo)) { WasCompilerGenerated = true }; + +#if DEBUG + var discardedUseSiteInfo = CompoundUseSiteInfo.Discarded; + Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo)); +#endif + return result; } public BoundExpression MethodDefIndex(MethodSymbol method) @@ -1388,12 +1428,18 @@ public BoundExpression MethodInfo(MethodSymbol method) method = method.GetConstructedLeastOverriddenMethod(this.CompilationState.Type, requireSameReturnType: true); } - return new BoundMethodInfo( + var result = new BoundMethodInfo( Syntax, method, GetMethodFromHandleMethod(method.ContainingType), WellKnownType(Microsoft.CodeAnalysis.WellKnownType.System_Reflection_MethodInfo)) { WasCompilerGenerated = true }; + +#if DEBUG + var discardedUseSiteInfo = CompoundUseSiteInfo.Discarded; + Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo)); +#endif + return result; } public BoundExpression FieldInfo(FieldSymbol field) @@ -1486,7 +1532,7 @@ public BoundExpression ArrayOrEmpty(TypeSymbol elementType, ImmutableArray /// The symbol for the pre-defined type or an error type if the type is not defined in the core library. - internal abstract NamedTypeSymbol GetDeclaredSpecialType(SpecialType type); + internal abstract NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type); /// /// Register declaration of predefined CorLib type in this Assembly. @@ -480,7 +480,7 @@ internal bool RuntimeSupportsInlineArrayTypes protected bool RuntimeSupportsFeature(SpecialMember feature) { // Keep in sync with VB's AssemblySymbol.RuntimeSupportsFeature - Debug.Assert((SpecialType)SpecialMembers.GetDescriptor(feature).DeclaringTypeId == SpecialType.System_Runtime_CompilerServices_RuntimeFeature); + Debug.Assert(SpecialMembers.GetDescriptor(feature).DeclaringSpecialType == SpecialType.System_Runtime_CompilerServices_RuntimeFeature); return GetSpecialType(SpecialType.System_Runtime_CompilerServices_RuntimeFeature) is { TypeKind: TypeKind.Class, IsStatic: true } && GetSpecialTypeMember(feature) is object; } @@ -584,7 +584,7 @@ bool IAssemblySymbolInternal.AreInternalsVisibleToThisAssembly(IAssemblySymbolIn /// Gets the symbol for the pre-defined type from core library associated with this assembly. /// /// The symbol for the pre-defined type or an error type if the type is not defined in the core library. - internal NamedTypeSymbol GetSpecialType(SpecialType type) + internal NamedTypeSymbol GetSpecialType(ExtendedSpecialType type) { return CorLibrary.GetDeclaredSpecialType(type); } diff --git a/src/Compilers/CSharp/Portable/Symbols/Compilation_WellKnownMembers.cs b/src/Compilers/CSharp/Portable/Symbols/Compilation_WellKnownMembers.cs index b3796f4ed27ca..65292086a7814 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Compilation_WellKnownMembers.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Compilation_WellKnownMembers.cs @@ -96,9 +96,9 @@ private void SetUsesNullableAttributes() } MemberDescriptor descriptor = WellKnownMembers.GetDescriptor(member); - NamedTypeSymbol type = descriptor.DeclaringTypeId <= (int)SpecialType.Count - ? this.GetSpecialType((SpecialType)descriptor.DeclaringTypeId) - : this.GetWellKnownType((WellKnownType)descriptor.DeclaringTypeId); + NamedTypeSymbol type = descriptor.IsSpecialTypeMember + ? this.GetSpecialType(descriptor.DeclaringSpecialType) + : this.GetWellKnownType(descriptor.DeclaringWellKnownType); Symbol? result = null; if (!type.IsErrorType()) @@ -1223,7 +1223,7 @@ protected override bool MatchArrayRank(TypeSymbol type, int countOfDimensions) protected override bool MatchTypeToTypeId(TypeSymbol type, int typeId) { - if ((int)type.OriginalDefinition.SpecialType == typeId) + if ((int)type.OriginalDefinition.ExtendedSpecialType == typeId) { if (type.IsDefinition) { diff --git a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs index dc4c06cecd0a2..ea2cd5b3dbaa5 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PENamedTypeSymbol.cs @@ -34,7 +34,7 @@ internal abstract class PENamedTypeSymbol : NamedTypeSymbol private readonly TypeDefinitionHandle _handle; private readonly string _name; private readonly TypeAttributes _flags; - private readonly SpecialType _corTypeId; + private readonly ExtendedSpecialType _corTypeId; /// /// A set of all the names of the members in this type. @@ -356,7 +356,7 @@ private PENamedTypeSymbol( } } - public override SpecialType SpecialType + public override ExtendedSpecialType ExtendedSpecialType { get { @@ -2136,7 +2136,7 @@ protected virtual DiagnosticInfo GetUseSiteDiagnosticImpl() if ((object)missingType != null && missingType.Arity == 0) { string emittedName = MetadataHelpers.BuildQualifiedName(missingType.NamespaceName, missingType.MetadataName); - switch (SpecialTypes.GetTypeFromMetadataName(emittedName)) + switch ((SpecialType)SpecialTypes.GetTypeFromMetadataName(emittedName)) { case SpecialType.System_Enum: case SpecialType.System_MulticastDelegate: diff --git a/src/Compilers/CSharp/Portable/Symbols/MetadataOrSourceAssemblySymbol.cs b/src/Compilers/CSharp/Portable/Symbols/MetadataOrSourceAssemblySymbol.cs index b428cbefcd912..f9598b0f2e433 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MetadataOrSourceAssemblySymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MetadataOrSourceAssemblySymbol.cs @@ -42,7 +42,7 @@ internal abstract class MetadataOrSourceAssemblySymbol /// /// /// - internal sealed override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type) + internal sealed override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) { #if DEBUG foreach (var module in this.Modules) @@ -79,7 +79,7 @@ internal sealed override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type /// internal sealed override void RegisterDeclaredSpecialType(NamedTypeSymbol corType) { - SpecialType typeId = corType.SpecialType; + ExtendedSpecialType typeId = corType.ExtendedSpecialType; Debug.Assert(typeId != SpecialType.None); Debug.Assert(ReferenceEquals(corType.ContainingAssembly, this)); Debug.Assert(corType.ContainingModule.Ordinal == 0); @@ -88,7 +88,7 @@ internal sealed override void RegisterDeclaredSpecialType(NamedTypeSymbol corTyp if (_lazySpecialTypes == null) { Interlocked.CompareExchange(ref _lazySpecialTypes, - new NamedTypeSymbol[(int)SpecialType.Count + 1], null); + new NamedTypeSymbol[(int)InternalSpecialType.NextAvailable], null); } if ((object)Interlocked.CompareExchange(ref _lazySpecialTypes[(int)typeId], corType, null) != null) @@ -100,7 +100,7 @@ internal sealed override void RegisterDeclaredSpecialType(NamedTypeSymbol corTyp else { Interlocked.Increment(ref _cachedSpecialTypes); - Debug.Assert(_cachedSpecialTypes > 0 && _cachedSpecialTypes <= (int)SpecialType.Count); + Debug.Assert(_cachedSpecialTypes > 0 && _cachedSpecialTypes < (int)InternalSpecialType.NextAvailable); } } @@ -112,7 +112,7 @@ internal override bool KeepLookingForDeclaredSpecialTypes { get { - return ReferenceEquals(this.CorLibrary, this) && _cachedSpecialTypes < (int)SpecialType.Count; + return ReferenceEquals(this.CorLibrary, this) && _cachedSpecialTypes < (int)InternalSpecialType.NextAvailable - 1; } } @@ -202,7 +202,7 @@ internal override Symbol GetDeclaredSpecialTypeMember(SpecialMember member) } var descriptor = SpecialMembers.GetDescriptor(member); - NamedTypeSymbol type = GetDeclaredSpecialType((SpecialType)descriptor.DeclaringTypeId); + NamedTypeSymbol type = GetDeclaredSpecialType(descriptor.DeclaringSpecialType); Symbol result = null; if (!type.IsErrorType()) diff --git a/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs b/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs index d4d76cbab951f..91cb0f329d381 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MissingAssemblySymbol.cs @@ -179,7 +179,7 @@ internal override NamedTypeSymbol LookupDeclaredOrForwardedTopLevelMetadataType( #nullable disable - internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type) + internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) { throw ExceptionUtilities.Unreachable(); } diff --git a/src/Compilers/CSharp/Portable/Symbols/MissingCorLibrarySymbol.cs b/src/Compilers/CSharp/Portable/Symbols/MissingCorLibrarySymbol.cs index d9d5005291028..0210e04ae4d12 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MissingCorLibrarySymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MissingCorLibrarySymbol.cs @@ -57,7 +57,7 @@ internal override TypeConversions TypeConversions /// called if it is know that this is the Cor Library (mscorlib). /// /// - internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type) + internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) { #if DEBUG foreach (var module in this.Modules) @@ -69,7 +69,7 @@ internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type) if (_lazySpecialTypes == null) { Interlocked.CompareExchange(ref _lazySpecialTypes, - new NamedTypeSymbol[(int)SpecialType.Count + 1], null); + new NamedTypeSymbol[(int)InternalSpecialType.NextAvailable], null); } if ((object)_lazySpecialTypes[(int)type] == null) diff --git a/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs index 4eb2298265afe..59443d5665548 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs @@ -146,7 +146,7 @@ internal sealed class TopLevel : MissingMetadataTypeSymbol private NamespaceSymbol? _lazyContainingNamespace; /// - /// Either , , or -1 if not initialized. + /// Either , , , or -1 if not initialized. /// private int _lazyTypeId; @@ -160,7 +160,7 @@ public TopLevel(ModuleSymbol module, ref MetadataTypeName fullName, DiagnosticIn { } - public TopLevel(ModuleSymbol module, ref MetadataTypeName fullName, SpecialType specialType, DiagnosticInfo? errorInfo = null) + public TopLevel(ModuleSymbol module, ref MetadataTypeName fullName, ExtendedSpecialType specialType, DiagnosticInfo? errorInfo = null) : this(module, ref fullName, (int)specialType, errorInfo) { } @@ -287,7 +287,7 @@ private int TypeId { if (_lazyTypeId == -1) { - SpecialType typeId = SpecialType.None; + ExtendedSpecialType typeId = default; AssemblySymbol containingAssembly = _containingModule.ContainingAssembly; @@ -305,12 +305,12 @@ private int TypeId } } - public override SpecialType SpecialType + public override ExtendedSpecialType ExtendedSpecialType { get { int typeId = TypeId; - return (typeId >= (int)WellKnownType.First) ? SpecialType.None : (SpecialType)_lazyTypeId; + return (typeId >= (int)WellKnownType.First) ? SpecialType.None : (ExtendedSpecialType)typeId; } } @@ -434,11 +434,11 @@ public override Symbol ContainingSymbol } } - public override SpecialType SpecialType + public override ExtendedSpecialType ExtendedSpecialType { get { - return SpecialType.None; // do not have nested types among CORE types yet. + return default; // do not have nested types among CORE types yet. } } diff --git a/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs index eab38790cbb67..4bf3c91ad7608 100644 --- a/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/NativeIntegerTypeSymbol.cs @@ -47,7 +47,7 @@ internal NativeIntegerTypeSymbol(NamedTypeSymbol underlyingType) : base(underlyi internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => _underlyingType.BaseTypeNoUseSiteDiagnostics; - public override SpecialType SpecialType => _underlyingType.SpecialType; + public override ExtendedSpecialType ExtendedSpecialType => _underlyingType.ExtendedSpecialType; public override IEnumerable MemberNames => GetMembers().Select(m => m.Name); diff --git a/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingAssemblySymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingAssemblySymbol.cs index 51bcaa770622a..72e7e23ba7ad5 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingAssemblySymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Retargeting/RetargetingAssemblySymbol.cs @@ -218,7 +218,7 @@ public override ImmutableArray GetAttributes() /// /// /// - internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type) + internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) { // Cor library should not have any references and, therefore, should never be // wrapped by a RetargetingAssemblySymbol. diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs index dce4856200ae3..97628686b76fa 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs @@ -80,9 +80,9 @@ private struct Flags private const int HasPrimaryConstructorBit = 1 << HasPrimaryConstructorOffset; - public SpecialType SpecialType + public ExtendedSpecialType ExtendedSpecialType { - get { return (SpecialType)((_flags >> SpecialTypeOffset) & SpecialTypeMask); } + get { return (ExtendedSpecialType)((_flags >> SpecialTypeOffset) & SpecialTypeMask); } } public ManagedKind ManagedKind @@ -110,12 +110,14 @@ public TypeKind TypeKind static Flags() { // Verify masks are sufficient for values. + _ = new int[SpecialTypeMask - (int)InternalSpecialType.NextAvailable + 1]; Debug.Assert(EnumUtilities.ContainsAllValues(SpecialTypeMask)); + Debug.Assert(EnumUtilities.ContainsAllValues(SpecialTypeMask)); //This assert might false fail in the future, we don't really need to be able to represent NextAvailable Debug.Assert(EnumUtilities.ContainsAllValues(NullableContextMask)); } #endif - public Flags(SpecialType specialType, TypeKind typeKind, bool hasPrimaryConstructor) + public Flags(ExtendedSpecialType specialType, TypeKind typeKind, bool hasPrimaryConstructor) { int specialTypeInt = ((int)specialType & SpecialTypeMask) << SpecialTypeOffset; int typeKindInt = ((int)typeKind & TypeKindMask) << TypeKindOffset; @@ -251,8 +253,8 @@ internal SourceMemberContainerTypeSymbol( _declModifiers = modifiers; var specialType = access == (int)DeclarationModifiers.Public - ? MakeSpecialType() - : SpecialType.None; + ? MakeExtendedSpecialType() + : default; _flags = new Flags(specialType, typeKind, declaration.HasPrimaryConstructor); Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); @@ -266,7 +268,7 @@ internal SourceMemberContainerTypeSymbol( state.NotePartComplete(CompletionPart.TypeArguments); // type arguments need not be computed separately } - private SpecialType MakeSpecialType() + private ExtendedSpecialType MakeExtendedSpecialType() { // check if this is one of the COR library types if (ContainingSymbol.Kind == SymbolKind.Namespace && @@ -280,7 +282,7 @@ private SpecialType MakeSpecialType() } else { - return SpecialType.None; + return default; } } @@ -770,11 +772,11 @@ public sealed override Symbol ContainingSymbol #region Flags Encoded Properties - public override SpecialType SpecialType + public override ExtendedSpecialType ExtendedSpecialType { get { - return _flags.SpecialType; + return _flags.ExtendedSpecialType; } } diff --git a/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs index 7f6f67303b585..bf7b4599dc6e0 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Synthesized/ReadOnlyListType/SynthesizedReadOnlyListTypeSymbol.cs @@ -76,6 +76,17 @@ internal sealed class SynthesizedReadOnlyListTypeSymbol : NamedTypeSymbol { SpecialMember.System_Collections_IEnumerable__GetEnumerator, SpecialMember.System_Collections_Generic_IEnumerable_T__GetEnumerator, + SpecialMember.System_Collections_Generic_ICollection_T__Count, + SpecialMember.System_Collections_Generic_ICollection_T__IsReadOnly, + SpecialMember.System_Collections_Generic_ICollection_T__Add, + SpecialMember.System_Collections_Generic_ICollection_T__Clear, + SpecialMember.System_Collections_Generic_ICollection_T__Contains, + SpecialMember.System_Collections_Generic_ICollection_T__CopyTo, + SpecialMember.System_Collections_Generic_ICollection_T__Remove, + SpecialMember.System_Collections_Generic_IList_T__get_Item, + SpecialMember.System_Collections_Generic_IList_T__IndexOf, + SpecialMember.System_Collections_Generic_IList_T__Insert, + SpecialMember.System_Collections_Generic_IList_T__RemoveAt, }; private static readonly WellKnownMember[] s_requiredWellKnownMembers = new[] @@ -94,24 +105,13 @@ internal sealed class SynthesizedReadOnlyListTypeSymbol : NamedTypeSymbol WellKnownMember.System_Collections_IList__Insert, WellKnownMember.System_Collections_IList__Remove, WellKnownMember.System_Collections_IList__RemoveAt, - WellKnownMember.System_Collections_Generic_ICollection_T__Count, - WellKnownMember.System_Collections_Generic_ICollection_T__IsReadOnly, - WellKnownMember.System_Collections_Generic_ICollection_T__Add, - WellKnownMember.System_Collections_Generic_ICollection_T__Clear, - WellKnownMember.System_Collections_Generic_ICollection_T__Contains, - WellKnownMember.System_Collections_Generic_ICollection_T__CopyTo, - WellKnownMember.System_Collections_Generic_ICollection_T__Remove, - WellKnownMember.System_Collections_Generic_IList_T__get_Item, - WellKnownMember.System_Collections_Generic_IList_T__IndexOf, - WellKnownMember.System_Collections_Generic_IList_T__Insert, - WellKnownMember.System_Collections_Generic_IList_T__RemoveAt, WellKnownMember.System_NotSupportedException__ctor, }; - private static readonly WellKnownMember[] s_readOnlyInterfacesWellKnownMembers = new[] + private static readonly SpecialMember[] s_readOnlyInterfacesWellKnownMembers = new[] { - WellKnownMember.System_Collections_Generic_IReadOnlyCollection_T__Count, - WellKnownMember.System_Collections_Generic_IReadOnlyList_T__get_Item, + SpecialMember.System_Collections_Generic_IReadOnlyCollection_T__Count, + SpecialMember.System_Collections_Generic_IReadOnlyList_T__get_Item, }; private static readonly WellKnownMember[] s_requiredWellKnownMembersUnknownLength = new[] @@ -193,7 +193,7 @@ internal static NamedTypeSymbol Create(SourceModuleSymbol containingModule, stri { foreach (var member in s_readOnlyInterfacesWellKnownMembers) { - diagnosticInfo = getWellKnownTypeMemberDiagnosticInfo(compilation, member); + diagnosticInfo = getSpecialTypeMemberDiagnosticInfo(compilation, member); if (diagnosticInfo is { }) { break; @@ -400,69 +400,69 @@ private SynthesizedReadOnlyListTypeSymbol(SourceModuleSymbol containingModule, s addProperty(membersBuilder, new SynthesizedReadOnlyListProperty( this, - ((PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_IReadOnlyCollection_T__Count)!).AsMember(iReadOnlyCollectionT), + ((PropertySymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IReadOnlyCollection_T__Count)!).AsMember(iReadOnlyCollectionT), generateCount)); addProperty(membersBuilder, new SynthesizedReadOnlyListProperty( this, - ((PropertySymbol)((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_IReadOnlyList_T__get_Item)!).AssociatedSymbol).AsMember(iReadOnlyListT), + ((PropertySymbol)((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IReadOnlyList_T__get_Item)!).AssociatedSymbol).AsMember(iReadOnlyListT), generateIndexer)); } addProperty(membersBuilder, new SynthesizedReadOnlyListProperty( this, - ((PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__Count)!).AsMember(iCollectionT), + ((PropertySymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__Count)!).AsMember(iCollectionT), generateCount)); addProperty(membersBuilder, new SynthesizedReadOnlyListProperty( this, - ((PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__IsReadOnly)!).AsMember(iCollectionT), + ((PropertySymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__IsReadOnly)!).AsMember(iCollectionT), generateIsReadOnly)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__Add)!).AsMember(iCollectionT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__Add)!).AsMember(iCollectionT), generateNotSupportedException)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__Clear)!).AsMember(iCollectionT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__Clear)!).AsMember(iCollectionT), generateNotSupportedException)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__Contains)!).AsMember(iCollectionT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__Contains)!).AsMember(iCollectionT), generateContains)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__CopyTo)!).AsMember(iCollectionT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__CopyTo)!).AsMember(iCollectionT), generateCopyTo)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_ICollection_T__Remove)!).AsMember(iCollectionT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__Remove)!).AsMember(iCollectionT), generateNotSupportedException)); addProperty(membersBuilder, new SynthesizedReadOnlyListProperty( this, - ((PropertySymbol)((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_IList_T__get_Item)!).AssociatedSymbol).AsMember(iListT), + ((PropertySymbol)((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IList_T__get_Item)!).AssociatedSymbol).AsMember(iListT), generateIndexer, generateNotSupportedException)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_IList_T__IndexOf)!).AsMember(iListT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IList_T__IndexOf)!).AsMember(iListT), generateIndexOf)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_IList_T__Insert)!).AsMember(iListT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IList_T__Insert)!).AsMember(iListT), generateNotSupportedException)); membersBuilder.Add( new SynthesizedReadOnlyListMethod( this, - ((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_IList_T__RemoveAt)!).AsMember(iListT), + ((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IList_T__RemoveAt)!).AsMember(iListT), generateNotSupportedException)); _members = membersBuilder.ToImmutableAndFree(); @@ -599,7 +599,7 @@ static BoundStatement generateCopyTo(SyntheticBoundNodeFactory f, MethodSymbol m { if (!interfaceMethod.ContainingType.IsGenericType) { - var arraySetValueMethod = (MethodSymbol)method.DeclaringCompilation.GetWellKnownTypeMember(WellKnownMember.System_Array__SetValue)!; + var arraySetValueMethod = (MethodSymbol)method.DeclaringCompilation.GetSpecialTypeMember(SpecialMember.System_Array__SetValue)!; // param0.SetValue((object)_item, param1) statement = f.ExpressionStatement( @@ -780,7 +780,7 @@ public static bool CanCreateSingleElement(CSharpCompilation compilation) return compilation.GetWellKnownType(WellKnownType.System_IndexOutOfRangeException) is not MissingMetadataTypeSymbol && compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_EqualityComparer_T) is not MissingMetadataTypeSymbol && compilation.GetWellKnownTypeMember(WellKnownMember.System_IndexOutOfRangeException__ctor) is not null - && compilation.GetWellKnownTypeMember(WellKnownMember.System_Array__SetValue) is not null + && compilation.GetSpecialTypeMember(SpecialMember.System_Array__SetValue) is not null && compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_EqualityComparer_T__get_Default) is not null && compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_EqualityComparer_T__Equals) is not null && compilation.GetSpecialType(SpecialType.System_IDisposable) is not MissingMetadataTypeSymbol diff --git a/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs index 713a45870fe39..4b875082e4b5f 100644 --- a/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs @@ -490,14 +490,16 @@ internal TypeSymbol() /// /// Not preserved in types constructed from this one. /// - public virtual SpecialType SpecialType + public virtual ExtendedSpecialType ExtendedSpecialType { get { - return SpecialType.None; + return default; } } + public SpecialType SpecialType => (SpecialType)ExtendedSpecialType; + /// /// Gets corresponding primitive type code for this type declaration. /// diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs index f88aaf7a63080..d427589e7c5dd 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs @@ -4312,20 +4312,6 @@ .maxstack 5 public void ParamCallUsesCachedArray() { var verifier = CompileAndVerify(@" -namespace System -{ - public class Object { } - public class ValueType { } - public struct Int32 { } - public class String { } - public class Attribute { } - public struct Void { } - public class ParamArrayAttribute { } - public abstract class Array { - public static T[] Empty() { return new T[0]; } - } -} - public class Program { public static void Callee1(params object[] values) { } @@ -4365,7 +4351,7 @@ public static void M() Callee3(default(T), default(T)); } } -", verify: Verification.FailsPEVerify, options: TestOptions.ReleaseExe); +", options: TestOptions.ReleaseExe); verifier.VerifyIL("Program.M()", @"{ // Code size 297 (0x129) @@ -4470,19 +4456,7 @@ .maxstack 4 } "); - verifier = CompileAndVerify(@" -namespace System -{ - public class Object { } - public class ValueType { } - public struct Int32 { } - public class String { } - public class Attribute { } - public struct Void { } - public class ParamArrayAttribute { } - public abstract class Array { } -} - + var comp = CreateCompilation(@" public class Program { public static void Callee1(params object[] values) { } @@ -4498,7 +4472,12 @@ public static void M() Callee3(); } } -", verify: Verification.FailsPEVerify, options: TestOptions.ReleaseExe); +", options: TestOptions.ReleaseExe); + + comp.MakeMemberMissing(SpecialMember.System_Array__Empty); + + verifier = CompileAndVerify(comp); + verifier.VerifyIL("Program.M()", @"{ // Code size 34 (0x22) diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/CollectionExpressionTests.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/CollectionExpressionTests.cs index 892925207389d..370de764509c3 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/CollectionExpressionTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/CollectionExpressionTests.cs @@ -10892,7 +10892,7 @@ .locals init (System.Collections.Generic.IEnumerable V_0) //y """); comp = CreateCompilation(new[] { source, s_collectionExtensions }, options: TestOptions.ReleaseExe); - comp.MakeMemberMissing(WellKnownMember.System_Array__Empty); + comp.MakeMemberMissing(SpecialMember.System_Array__Empty); verifier = CompileAndVerify(comp, expectedOutput: "[], [], "); verifier.VerifyIL("Program.Main", """ @@ -12186,6 +12186,19 @@ void verifyInterfaces(ModuleSymbol module, string typeName) [Theory] [InlineData((int)SpecialMember.System_Collections_IEnumerable__GetEnumerator, "System.Collections.IEnumerable", "GetEnumerator")] [InlineData((int)SpecialMember.System_Collections_Generic_IEnumerable_T__GetEnumerator, "System.Collections.Generic.IEnumerable`1", "GetEnumerator")] + [InlineData((int)SpecialMember.System_Collections_Generic_IReadOnlyCollection_T__Count, "System.Collections.Generic.IReadOnlyCollection`1", "Count")] + [InlineData((int)SpecialMember.System_Collections_Generic_IReadOnlyList_T__get_Item, "System.Collections.Generic.IReadOnlyList`1", "get_Item")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__Count, "System.Collections.Generic.ICollection`1", "Count")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__IsReadOnly, "System.Collections.Generic.ICollection`1", "IsReadOnly")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__Add, "System.Collections.Generic.ICollection`1", "Add")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__Clear, "System.Collections.Generic.ICollection`1", "Clear")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__Contains, "System.Collections.Generic.ICollection`1", "Contains")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__CopyTo, "System.Collections.Generic.ICollection`1", "CopyTo")] + [InlineData((int)SpecialMember.System_Collections_Generic_ICollection_T__Remove, "System.Collections.Generic.ICollection`1", "Remove")] + [InlineData((int)SpecialMember.System_Collections_Generic_IList_T__get_Item, "System.Collections.Generic.IList`1", "get_Item")] + [InlineData((int)SpecialMember.System_Collections_Generic_IList_T__IndexOf, "System.Collections.Generic.IList`1", "IndexOf")] + [InlineData((int)SpecialMember.System_Collections_Generic_IList_T__Insert, "System.Collections.Generic.IList`1", "Insert")] + [InlineData((int)SpecialMember.System_Collections_Generic_IList_T__RemoveAt, "System.Collections.Generic.IList`1", "RemoveAt")] public void SynthesizedReadOnlyList_MissingSpecialMembers(int missingMember, string missingMemberTypeName, string missingMemberName) { string source = """ @@ -12295,19 +12308,6 @@ static void Main() [InlineData((int)WellKnownMember.System_Collections_IList__Insert, "System.Collections.IList", "Insert")] [InlineData((int)WellKnownMember.System_Collections_IList__Remove, "System.Collections.IList", "Remove")] [InlineData((int)WellKnownMember.System_Collections_IList__RemoveAt, "System.Collections.IList", "RemoveAt")] - [InlineData((int)WellKnownMember.System_Collections_Generic_IReadOnlyCollection_T__Count, "System.Collections.Generic.IReadOnlyCollection`1", "Count")] - [InlineData((int)WellKnownMember.System_Collections_Generic_IReadOnlyList_T__get_Item, "System.Collections.Generic.IReadOnlyList`1", "get_Item")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__Count, "System.Collections.Generic.ICollection`1", "Count")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__IsReadOnly, "System.Collections.Generic.ICollection`1", "IsReadOnly")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__Add, "System.Collections.Generic.ICollection`1", "Add")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__Clear, "System.Collections.Generic.ICollection`1", "Clear")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__Contains, "System.Collections.Generic.ICollection`1", "Contains")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__CopyTo, "System.Collections.Generic.ICollection`1", "CopyTo")] - [InlineData((int)WellKnownMember.System_Collections_Generic_ICollection_T__Remove, "System.Collections.Generic.ICollection`1", "Remove")] - [InlineData((int)WellKnownMember.System_Collections_Generic_IList_T__get_Item, "System.Collections.Generic.IList`1", "get_Item")] - [InlineData((int)WellKnownMember.System_Collections_Generic_IList_T__IndexOf, "System.Collections.Generic.IList`1", "IndexOf")] - [InlineData((int)WellKnownMember.System_Collections_Generic_IList_T__Insert, "System.Collections.Generic.IList`1", "Insert")] - [InlineData((int)WellKnownMember.System_Collections_Generic_IList_T__RemoveAt, "System.Collections.Generic.IList`1", "RemoveAt")] [InlineData((int)WellKnownMember.System_NotSupportedException__ctor, "System.NotSupportedException", ".ctor")] public void SynthesizedReadOnlyList_MissingWellKnownMembers(int missingMember, string missingMemberTypeName, string missingMemberName) { @@ -34469,7 +34469,6 @@ void verify(string memberName, string sourceName = null) [Theory] [InlineData((int)WellKnownMember.System_IndexOutOfRangeException__ctor)] - [InlineData((int)WellKnownMember.System_Array__SetValue)] [InlineData((int)WellKnownMember.System_Collections_Generic_EqualityComparer_T__get_Default)] [InlineData((int)WellKnownMember.System_Collections_Generic_EqualityComparer_T__Equals)] public void SynthesizedReadOnlyList_SingleElement_MissingMembers(int missingMember) @@ -34506,6 +34505,7 @@ public void SynthesizedReadOnlyList_SingleElement_MissingTypes(int missingType) [InlineData((int)SpecialMember.System_Collections_IEnumerator__Current)] [InlineData((int)SpecialMember.System_Collections_IEnumerator__MoveNext)] [InlineData((int)SpecialMember.System_Collections_IEnumerator__Reset)] + [InlineData((int)SpecialMember.System_Array__SetValue)] public void SynthesizedReadOnlyList_SingleElement_MissingSpecialMembers(int missingMember) { string source = """ diff --git a/src/Compilers/CSharp/Test/Symbol/Compilation/GetSemanticInfoTests.cs b/src/Compilers/CSharp/Test/Symbol/Compilation/GetSemanticInfoTests.cs index e9f6d34062d2d..6ad935d3702cc 100644 --- a/src/Compilers/CSharp/Test/Symbol/Compilation/GetSemanticInfoTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Compilation/GetSemanticInfoTests.cs @@ -5943,7 +5943,7 @@ public void GetSpecialType_ThrowsOnLessThanZero() public void GetSpecialType_ThrowsOnGreaterThanCount() { var source = "class C1 { }"; - var comp = CreateCompilation(source); + var comp = (Compilation)CreateCompilation(source); var specialType = SpecialType.Count + 1; diff --git a/src/Compilers/CSharp/Test/Symbol/Compilation/UsedAssembliesTests.cs b/src/Compilers/CSharp/Test/Symbol/Compilation/UsedAssembliesTests.cs index dff6ce2c6815a..3c87eff8928de 100644 --- a/src/Compilers/CSharp/Test/Symbol/Compilation/UsedAssembliesTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Compilation/UsedAssembliesTests.cs @@ -5451,6 +5451,8 @@ namespace System public class Object {} public class ValueType {} public struct Void {} + + public struct RuntimeTypeHandle {} } "; var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); @@ -5466,8 +5468,6 @@ public class Type { public static Type GetTypeFromHandle(RuntimeTypeHandle handle) => default; } - - public struct RuntimeTypeHandle {} } "; var comp1 = CreateEmptyCompilation(source1, references: new[] { comp0Ref }, parseOptions: parseOptions); diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/CompilationCreationTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/CompilationCreationTests.cs index eabbebd3818b7..a16c746ef12fc 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/CompilationCreationTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/CompilationCreationTests.cs @@ -80,8 +80,7 @@ public void CorLibTypes() NamedTypeSymbol type = c1.GetSpecialType((SpecialType)i); if (i is (int)SpecialType.System_Runtime_CompilerServices_RuntimeFeature or (int)SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute or - (int)SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute or - (int)SpecialType.System_ReadOnlySpan_T) + (int)SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute) { Assert.True(type.IsErrorType()); // Not available } diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs index 503d43d3e923b..f43eeeb797768 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/CorLibrary/CorTypes.cs @@ -63,6 +63,24 @@ public void PresentCorLib() { var t = msCorLibRef.GetSpecialType((SpecialType)i); Assert.Equal((SpecialType)i, t.SpecialType); + Assert.Equal((ExtendedSpecialType)i, t.ExtendedSpecialType); + Assert.Same(msCorLibRef, t.ContainingAssembly); + if (knownMissingTypes.Contains(i)) + { + // not present on dotnet core 3.1 + Assert.Equal(TypeKind.Error, t.TypeKind); + } + else + { + Assert.NotEqual(TypeKind.Error, t.TypeKind); + } + } + + for (int i = (int)InternalSpecialType.First; i < (int)InternalSpecialType.NextAvailable; i++) + { + var t = msCorLibRef.GetSpecialType((InternalSpecialType)i); + Assert.Equal(SpecialType.None, t.SpecialType); + Assert.Equal((ExtendedSpecialType)i, t.ExtendedSpecialType); Assert.Same(msCorLibRef, t.ContainingAssembly); if (knownMissingTypes.Contains(i)) { @@ -125,6 +143,7 @@ public void FakeCorLib() Assert.True(msCorLibRef.KeepLookingForDeclaredSpecialTypes); var t = msCorLibRef.GetSpecialType((SpecialType)i); Assert.Equal((SpecialType)i, t.SpecialType); + Assert.Equal((ExtendedSpecialType)i, t.ExtendedSpecialType); if (t.SpecialType == SpecialType.System_Object) { @@ -133,12 +152,22 @@ public void FakeCorLib() else { Assert.Equal(TypeKind.Error, t.TypeKind); - Assert.Same(msCorLibRef, t.ContainingAssembly); } Assert.Same(msCorLibRef, t.ContainingAssembly); } + for (int i = (int)InternalSpecialType.First; i < (int)InternalSpecialType.NextAvailable; i++) + { + Assert.True(msCorLibRef.KeepLookingForDeclaredSpecialTypes); + var t = msCorLibRef.GetSpecialType((InternalSpecialType)i); + Assert.Equal(SpecialType.None, t.SpecialType); + Assert.Equal((ExtendedSpecialType)i, t.ExtendedSpecialType); + + Assert.Equal(TypeKind.Error, t.TypeKind); + Assert.Same(msCorLibRef, t.ContainingAssembly); + } + Assert.False(msCorLibRef.KeepLookingForDeclaredSpecialTypes); } @@ -167,23 +196,38 @@ public class Object Assert.True(msCorLibRef.KeepLookingForDeclaredSpecialTypes); var t = c1.GetSpecialType((SpecialType)i); Assert.Equal((SpecialType)i, t.SpecialType); + Assert.Equal((ExtendedSpecialType)i, t.ExtendedSpecialType); Assert.Equal(TypeKind.Error, t.TypeKind); Assert.Same(msCorLibRef, t.ContainingAssembly); } } + for (int i = (int)InternalSpecialType.First; i < (int)InternalSpecialType.NextAvailable; i++) + { + Assert.True(msCorLibRef.KeepLookingForDeclaredSpecialTypes); + var t = c1.GetSpecialType((InternalSpecialType)i); + Assert.Equal(SpecialType.None, t.SpecialType); + Assert.Equal((ExtendedSpecialType)i, t.ExtendedSpecialType); + + Assert.Equal(TypeKind.Error, t.TypeKind); + Assert.Same(msCorLibRef, t.ContainingAssembly); + } + var system_object = msCorLibRef.Modules[0].GlobalNamespace.GetMembers("System"). Select(m => (NamespaceSymbol)m).Single().GetTypeMembers("Object").Single(); Assert.Equal(SpecialType.System_Object, system_object.SpecialType); + Assert.Equal((ExtendedSpecialType)SpecialType.System_Object, system_object.ExtendedSpecialType); Assert.False(msCorLibRef.KeepLookingForDeclaredSpecialTypes); Assert.Same(system_object, c1.GetSpecialType(SpecialType.System_Object)); Assert.Throws(() => c1.GetSpecialType(SpecialType.None)); - Assert.Throws(() => c1.GetSpecialType(SpecialType.Count + 1)); + Assert.Throws(() => ((Compilation)c1).GetSpecialType(SpecialType.None)); + Assert.Throws(() => c1.GetSpecialType(InternalSpecialType.NextAvailable)); + Assert.Throws(() => ((Compilation)c1).GetSpecialType(SpecialType.Count + 1)); } [WorkItem(697521, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/697521")] diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs index 6b426817b160f..5130bdd3eefc2 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/Metadata/PE/LoadingFields.cs @@ -146,8 +146,10 @@ public void TestLoadFieldsOfReadOnlySpanFromCorlib() { var comp = CreateCompilation("", targetFramework: TargetFramework.Net60); - var readOnlySpanType = comp.GetSpecialType(SpecialType.System_ReadOnlySpan_T); + var readOnlySpanType = comp.GetSpecialType(InternalSpecialType.System_ReadOnlySpan_T); Assert.False(readOnlySpanType.IsErrorType()); + Assert.Equal(SpecialType.None, readOnlySpanType.SpecialType); + Assert.Equal((ExtendedSpecialType)InternalSpecialType.System_ReadOnlySpan_T, readOnlySpanType.ExtendedSpecialType); var fields = readOnlySpanType.GetMembers().OfType(); Assert.NotEmpty(fields); diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/MissingSpecialMember.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/MissingSpecialMember.cs index 645100119fac1..132f3bcfa02b7 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/MissingSpecialMember.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/MissingSpecialMember.cs @@ -532,8 +532,7 @@ public void AllSpecialTypes() if (special is SpecialType.System_Runtime_CompilerServices_RuntimeFeature or SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute or - SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute or - SpecialType.System_ReadOnlySpan_T) + SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute) { Assert.Equal(SymbolKind.ErrorType, symbol.Kind); // Not available } @@ -567,7 +566,8 @@ public void AllSpecialTypeMembers() || special == SpecialMember.System_Runtime_CompilerServices_RuntimeFeature__ByRefFields || special == SpecialMember.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute__ctor || special == SpecialMember.System_Runtime_CompilerServices_InlineArrayAttribute__ctor - || special == SpecialMember.System_ReadOnlySpan_T__ctor_Reference) + || special == SpecialMember.System_ReadOnlySpan_T__ctor_Reference + || special == SpecialMember.System_Array__Empty) { Assert.Null(symbol); // Not available } @@ -692,7 +692,6 @@ public void AllWellKnownTypesBeforeCSharp7() { foreach (var type in new[] { WellKnownType.System_Math, - WellKnownType.System_Array, WellKnownType.System_Attribute, WellKnownType.System_CLSCompliantAttribute, WellKnownType.System_Convert, @@ -702,9 +701,6 @@ public void AllWellKnownTypesBeforeCSharp7() WellKnownType.System_FormattableString, WellKnownType.System_Guid, WellKnownType.System_IFormattable, - WellKnownType.System_RuntimeTypeHandle, - WellKnownType.System_RuntimeFieldHandle, - WellKnownType.System_RuntimeMethodHandle, WellKnownType.System_MarshalByRefObject, WellKnownType.System_Type, WellKnownType.System_Reflection_AssemblyKeyFileAttribute, @@ -912,15 +908,14 @@ public void AllWellKnownTypesBeforeCSharp7() WellKnownType.System_Environment, - WellKnownType.System_Runtime_GCLatencyMode, - WellKnownType.System_IFormatProvider } + WellKnownType.System_Runtime_GCLatencyMode} ) { Assert.True(type <= WellKnownType.CSharp7Sentinel); } - // There were 205 well-known types prior to CSharp7 - Assert.Equal(205, (int)(WellKnownType.CSharp7Sentinel - WellKnownType.First)); + // There were 200 well-known types prior to CSharp7 + Assert.Equal(200, (int)(WellKnownType.CSharp7Sentinel - WellKnownType.First)); } [Fact] @@ -952,7 +947,6 @@ public void AllWellKnownTypeMembers() case WellKnownMember.Microsoft_VisualBasic_CompilerServices_EmbeddedOperators__CompareStringStringStringBoolean: // C# can't embed VB core. continue; - case WellKnownMember.System_Array__Empty: case WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorByte: case WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorTransformFlags: case WellKnownMember.System_Runtime_CompilerServices_NullableContextAttribute__ctor: diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/MockAssemblySymbol.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/MockAssemblySymbol.cs index a196e4e488465..42d03387f3ce3 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/MockAssemblySymbol.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/MockAssemblySymbol.cs @@ -50,7 +50,7 @@ public override ImmutableArray Locations get { return ImmutableArray.Create(); } } - internal override NamedTypeSymbol GetDeclaredSpecialType(SpecialType type) + internal override NamedTypeSymbol GetDeclaredSpecialType(ExtendedSpecialType type) { throw new NotImplementedException(); } diff --git a/src/Compilers/CSharp/Test/Symbol/Symbols/Source/ClsComplianceTests.cs b/src/Compilers/CSharp/Test/Symbol/Symbols/Source/ClsComplianceTests.cs index 6b409bd315dd5..3a8e532ab7d36 100644 --- a/src/Compilers/CSharp/Test/Symbol/Symbols/Source/ClsComplianceTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Symbols/Source/ClsComplianceTests.cs @@ -3165,7 +3165,6 @@ public class C case SpecialType.System_Runtime_CompilerServices_RuntimeFeature: // static and not available case SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute: // not available case SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute: // not available - case SpecialType.System_ReadOnlySpan_T: // not available continue; } diff --git a/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs b/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs index 98714bf0588b6..a2822f4fb80de 100644 --- a/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs +++ b/src/Compilers/Core/CodeAnalysisTest/CorLibTypesTests.cs @@ -17,10 +17,10 @@ public class CorLibTypesAndConstantTests : TestBase [Fact] public void IntegrityTest() { - for (int i = 1; i <= (int)SpecialType.Count; i++) + for (int i = 1; i < (int)InternalSpecialType.NextAvailable; i++) { - string name = SpecialTypes.GetMetadataName((SpecialType)i); - Assert.Equal((SpecialType)i, SpecialTypes.GetTypeFromMetadataName(name)); + string name = SpecialTypes.GetMetadataName((ExtendedSpecialType)i); + Assert.Equal((ExtendedSpecialType)i, SpecialTypes.GetTypeFromMetadataName(name)); } for (int i = 0; i <= (int)SpecialType.Count; i++) diff --git a/src/Compilers/Core/Portable/Compilation/Compilation.cs b/src/Compilers/Core/Portable/Compilation/Compilation.cs index 9d5d592c2f0e4..e5af04c78c4d1 100644 --- a/src/Compilers/Core/Portable/Compilation/Compilation.cs +++ b/src/Compilers/Core/Portable/Compilation/Compilation.cs @@ -955,6 +955,11 @@ public Compilation ReplaceReference(MetadataReference oldReference, MetadataRefe /// public INamedTypeSymbol GetSpecialType(SpecialType specialType) { + if (specialType <= SpecialType.None || specialType > SpecialType.Count) + { + throw new ArgumentOutOfRangeException(nameof(specialType), $"Unexpected SpecialType: '{(int)specialType}'."); + } + return (INamedTypeSymbol)CommonGetSpecialType(specialType).GetITypeSymbol(); } @@ -3688,7 +3693,7 @@ private bool IsMemberMissing(int member) return _lazyMakeMemberMissingMap != null && _lazyMakeMemberMissingMap.ContainsKey(member); } - internal void MakeTypeMissing(SpecialType type) + internal void MakeTypeMissing(ExtendedSpecialType type) { MakeTypeMissing((int)type); } @@ -3708,7 +3713,7 @@ private void MakeTypeMissing(int type) _lazyMakeWellKnownTypeMissingMap[(int)type] = true; } - internal bool IsTypeMissing(SpecialType type) + internal bool IsTypeMissing(ExtendedSpecialType type) { return IsTypeMissing((int)type); } diff --git a/src/Compilers/Core/Portable/ExtendedSpecialType.cs b/src/Compilers/Core/Portable/ExtendedSpecialType.cs new file mode 100644 index 0000000000000..0010ff28aa3d9 --- /dev/null +++ b/src/Compilers/Core/Portable/ExtendedSpecialType.cs @@ -0,0 +1,64 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace Microsoft.CodeAnalysis +{ + /// + /// A structure meant to represent a union of and values + /// + [StructLayout(LayoutKind.Explicit, Size = 1)] + internal readonly struct ExtendedSpecialType + { + [FieldOffset(0)] + private readonly sbyte _value; + + private ExtendedSpecialType(int value) + { + Debug.Assert(value >= sbyte.MinValue && value <= sbyte.MaxValue); + _value = (sbyte)value; + } + + public static implicit operator ExtendedSpecialType(SpecialType value) => new ExtendedSpecialType((int)value); + public static explicit operator SpecialType(ExtendedSpecialType value) => value._value < (int)InternalSpecialType.First ? (SpecialType)value._value : SpecialType.None; + + public static implicit operator ExtendedSpecialType(InternalSpecialType value) => new ExtendedSpecialType((int)value); + + public static explicit operator ExtendedSpecialType(int value) => new ExtendedSpecialType(value); + public static explicit operator int(ExtendedSpecialType value) => value._value; + + public static bool operator ==(ExtendedSpecialType left, ExtendedSpecialType right) => left._value == right._value; + public static bool operator !=(ExtendedSpecialType left, ExtendedSpecialType right) => !(left == right); + + public override bool Equals(object? obj) + { + switch (obj) + { + case ExtendedSpecialType other: + return this == other; + + case SpecialType other: + return this == other; + + case InternalSpecialType other: + return this == other; + + default: + return false; + } + } + + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + public override string ToString() + { + return _value.ToString(); + } + } +} diff --git a/src/Compilers/Core/Portable/InternalSpecialType.cs b/src/Compilers/Core/Portable/InternalSpecialType.cs new file mode 100644 index 0000000000000..c43af826d71e1 --- /dev/null +++ b/src/Compilers/Core/Portable/InternalSpecialType.cs @@ -0,0 +1,72 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.CodeAnalysis +{ + /// + /// Specifies the Ids of types that are expected to be defined in core library. + /// Unlike ids in enum, these ids are not meant for public consumption + /// and are meant for internal usage in compilers. + /// + internal enum InternalSpecialType : sbyte + { + // Value 0 represents an unknown type + Unknown = SpecialType.None, + + First = SpecialType.Count + 1, + + /// + /// Indicates that the type is from the COR library. + /// + /// + /// Check for this special type cannot be used to find the "canonical" definition of + /// since it is fully legal for it to come from sources other than the COR library, e.g. from `System.Memory` package. + /// The should be used for that purpose instead + /// This entry mostly exists so that compiler can tell this type apart when resolving other members of the COR library + /// + System_ReadOnlySpan_T = First, + + System_IFormatProvider, + + /// + /// Indicates that the type is from the COR library. + /// + /// + /// Check for this special type cannot be used to find the "canonical" definition of + /// since it is fully legal for it to come from sources other than the COR library. + /// The should be used for that purpose instead + /// This entry mostly exists so that compiler can tell this type apart when resolving other members of the COR library + /// + System_Type, + + /// + /// Indicates that the type is from the COR library. + /// + /// + /// Check for this special type cannot be used to find the "canonical" definition of + /// since it is fully legal for it to come from sources other than the COR library. + /// The should be used for that purpose instead + /// This entry mostly exists so that compiler can tell this type apart when resolving other members of the COR library + /// + System_Reflection_MethodBase, + + /// + /// Indicates that the type is from the COR library. + /// + /// + /// Check for this special type cannot be used to find the "canonical" definition of + /// since it is fully legal for it to come from sources other than the COR library. + /// The should be used for that purpose instead + /// This entry mostly exists so that compiler can tell this type apart when resolving other members of the COR library + /// + System_Reflection_MethodInfo, + + /// + /// This item should be kept last and it doesn't represent any specific type. + /// + NextAvailable + } +} diff --git a/src/Compilers/Core/Portable/MemberDescriptor.cs b/src/Compilers/Core/Portable/MemberDescriptor.cs index 4428e1143ea9d..b9d932f072818 100644 --- a/src/Compilers/Core/Portable/MemberDescriptor.cs +++ b/src/Compilers/Core/Portable/MemberDescriptor.cs @@ -5,6 +5,7 @@ using Roslyn.Utilities; using System; using System.Collections.Immutable; +using System.Diagnostics; using System.IO; using System.Reflection.Metadata; @@ -44,15 +45,35 @@ internal readonly struct MemberDescriptor /// (either for the VB runtime classes, or types like System.Task etc.) will need /// to use IDs that are all mutually disjoint. /// - public readonly short DeclaringTypeId; + private readonly short _declaringTypeId; + + public bool IsSpecialTypeMember => _declaringTypeId < (int)InternalSpecialType.NextAvailable; + + public ExtendedSpecialType DeclaringSpecialType + { + get + { + Debug.Assert(_declaringTypeId < (int)InternalSpecialType.NextAvailable); + return (ExtendedSpecialType)_declaringTypeId; + } + } + + public WellKnownType DeclaringWellKnownType + { + get + { + Debug.Assert(_declaringTypeId >= (int)WellKnownType.First); + return (WellKnownType)_declaringTypeId; + } + } public string DeclaringTypeMetadataName { get { - return DeclaringTypeId <= (int)SpecialType.Count - ? ((SpecialType)DeclaringTypeId).GetMetadataName()! - : ((WellKnownType)DeclaringTypeId).GetMetadataName(); + return IsSpecialTypeMember + ? DeclaringSpecialType.GetMetadataName()! + : DeclaringWellKnownType.GetMetadataName(); } } @@ -101,7 +122,7 @@ public MemberDescriptor( ushort Arity = 0) { this.Flags = Flags; - this.DeclaringTypeId = DeclaringTypeId; + this._declaringTypeId = DeclaringTypeId; this.Name = Name; this.Arity = Arity; this.Signature = Signature; diff --git a/src/Compilers/Core/Portable/PublicAPI.Shipped.txt b/src/Compilers/Core/Portable/PublicAPI.Shipped.txt index c7de3bf377049..496cc20f14b21 100644 --- a/src/Compilers/Core/Portable/PublicAPI.Shipped.txt +++ b/src/Compilers/Core/Portable/PublicAPI.Shipped.txt @@ -2542,7 +2542,7 @@ Microsoft.CodeAnalysis.SourceProductionContext.SourceProductionContext() -> void Microsoft.CodeAnalysis.SourceReferenceResolver Microsoft.CodeAnalysis.SourceReferenceResolver.SourceReferenceResolver() -> void Microsoft.CodeAnalysis.SpecialType -Microsoft.CodeAnalysis.SpecialType.Count = 47 -> Microsoft.CodeAnalysis.SpecialType +Microsoft.CodeAnalysis.SpecialType.Count = 46 -> Microsoft.CodeAnalysis.SpecialType Microsoft.CodeAnalysis.SpecialType.None = 0 -> Microsoft.CodeAnalysis.SpecialType Microsoft.CodeAnalysis.SpecialType.System_ArgIterator = 37 -> Microsoft.CodeAnalysis.SpecialType Microsoft.CodeAnalysis.SpecialType.System_Array = 23 -> Microsoft.CodeAnalysis.SpecialType diff --git a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt index f2e84ea506234..e5fe82d74f013 100644 --- a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt +++ b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt @@ -13,7 +13,6 @@ Microsoft.CodeAnalysis.Operations.ISpreadOperation Microsoft.CodeAnalysis.Operations.ISpreadOperation.ElementConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion Microsoft.CodeAnalysis.Operations.ISpreadOperation.ElementType.get -> Microsoft.CodeAnalysis.ITypeSymbol? Microsoft.CodeAnalysis.Operations.ISpreadOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation! -Microsoft.CodeAnalysis.SpecialType.System_ReadOnlySpan_T = 47 -> Microsoft.CodeAnalysis.SpecialType Microsoft.CodeAnalysis.SeparatedSyntaxList Microsoft.CodeAnalysis.SyntaxList static Microsoft.CodeAnalysis.SeparatedSyntaxList.Create(System.ReadOnlySpan nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList diff --git a/src/Compilers/Core/Portable/SpecialMember.cs b/src/Compilers/Core/Portable/SpecialMember.cs index b75843664d326..fd79b8c0988de 100644 --- a/src/Compilers/Core/Portable/SpecialMember.cs +++ b/src/Compilers/Core/Portable/SpecialMember.cs @@ -28,6 +28,7 @@ internal enum SpecialMember System_String__Length, System_String__Chars, System_String__Format, + System_String__Format_IFormatProvider, System_String__Substring, System_String__op_Implicit_ToReadOnlySpanOfChar, @@ -39,6 +40,8 @@ internal enum SpecialMember System_Delegate__Remove, System_Delegate__op_Equality, System_Delegate__op_Inequality, + System_Delegate__CreateDelegate, + System_Delegate__CreateDelegate4, System_Decimal__Zero, System_Decimal__MinusOne, @@ -167,6 +170,27 @@ internal enum SpecialMember System_ReadOnlySpan_T__ctor_Reference, + System_Collections_Generic_IReadOnlyCollection_T__Count, + System_Collections_Generic_IReadOnlyList_T__get_Item, + System_Collections_Generic_ICollection_T__Count, + System_Collections_Generic_ICollection_T__IsReadOnly, + System_Collections_Generic_ICollection_T__Add, + System_Collections_Generic_ICollection_T__Clear, + System_Collections_Generic_ICollection_T__Contains, + System_Collections_Generic_ICollection_T__CopyTo, + System_Collections_Generic_ICollection_T__Remove, + System_Collections_Generic_IList_T__get_Item, + System_Collections_Generic_IList_T__IndexOf, + System_Collections_Generic_IList_T__Insert, + System_Collections_Generic_IList_T__RemoveAt, + + System_Reflection_MethodBase__GetMethodFromHandle, + System_Reflection_MethodBase__GetMethodFromHandle2, + + System_Array__get_Length, + System_Array__Empty, + System_Array__SetValue, + Count } } diff --git a/src/Compilers/Core/Portable/SpecialMembers.cs b/src/Compilers/Core/Portable/SpecialMembers.cs index 776dfbb7d5b0b..956e4c643c1dd 100644 --- a/src/Compilers/Core/Portable/SpecialMembers.cs +++ b/src/Compilers/Core/Portable/SpecialMembers.cs @@ -103,10 +103,10 @@ static SpecialMembers() 0, // Arity 2, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, @@ -116,13 +116,13 @@ static SpecialMembers() 0, // Arity 3, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, @@ -132,16 +132,16 @@ static SpecialMembers() 0, // Arity 4, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, @@ -187,6 +187,16 @@ static SpecialMembers() (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, + // System_String__Format_IFormatProvider + (byte)(MemberFlags.Method | MemberFlags.Static), // Flags + (byte)SpecialType.System_String, // DeclaringTypeId + 0, // Arity + 3, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_IFormatProvider, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, + (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, + // System_String__Substring (byte)MemberFlags.Method, // Flags (byte)SpecialType.System_String, // DeclaringTypeId @@ -201,7 +211,7 @@ static SpecialMembers() (byte)SpecialType.System_String, // DeclaringTypeId 0, // Arity 1, // Method Signature - (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_ReadOnlySpan_T, + (byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_ReadOnlySpan_T, 1, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Char, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, @@ -258,6 +268,27 @@ static SpecialMembers() (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Delegate, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Delegate, + // System_Delegate__CreateDelegate + (byte)(MemberFlags.Method | MemberFlags.Static), // Flags + (byte)SpecialType.System_Delegate, // DeclaringTypeId + 0, // Arity + 3, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Delegate, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_Type, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_Reflection_MethodInfo, + + // System_Delegate__CreateDelegate4 + (byte)(MemberFlags.Method | MemberFlags.Static), // Flags + (byte)SpecialType.System_Delegate, // DeclaringTypeId + 0, // Arity + 4, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Delegate, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_Type, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_Reflection_MethodInfo, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, + // System_Decimal__Zero (byte)(MemberFlags.Field | MemberFlags.Static), // Flags (byte)SpecialType.System_Decimal, // DeclaringTypeId @@ -1121,11 +1152,153 @@ static SpecialMembers() // System_ReadOnlySpan_T__ctor_Reference (byte)MemberFlags.Constructor, // Flags - (byte)SpecialType.System_ReadOnlySpan_T, // DeclaringTypeId + (byte)InternalSpecialType.System_ReadOnlySpan_T, // DeclaringTypeId 0, // Arity 1, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type (byte)SignatureTypeCode.ByReference, (byte)SignatureTypeCode.GenericTypeParameter, 0, + + // System_Collections_Generic_IReadOnlyCollection_T__Count + (byte)(MemberFlags.Property | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_IReadOnlyCollection_T, // DeclaringTypeId + 0, // Arity + 0, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type + + // System_Collections_Generic_IReadOnlyList_T__get_Item + (byte)(MemberFlags.PropertyGet | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_IReadOnlyList_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.GenericTypeParameter, 0, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, + + // System_Collections_Generic_ICollection_T__Count + (byte)(MemberFlags.Property | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 0, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type + + // System_Collections_Generic_ICollection_T__IsReadOnly + (byte)(MemberFlags.Property | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 0, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, // Return Type + + // System_Collections_Generic_ICollection_T__Add + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type + (byte)SignatureTypeCode.GenericTypeParameter, 0, + + // System_Collections_Generic_ICollection_T__Clear + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 0, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type + + // System_Collections_Generic_ICollection_T__Contains + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, // Return Type + (byte)SignatureTypeCode.GenericTypeParameter, 0, + + // System_Collections_Generic_ICollection_T__CopyTo + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 2, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type + (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.GenericTypeParameter, 0, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, + + // System_Collections_Generic_ICollection_T__Remove + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, // Return Type + (byte)SignatureTypeCode.GenericTypeParameter, 0, + + // System_Collections_Generic_IList_T__get_Item + (byte)(MemberFlags.PropertyGet | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.GenericTypeParameter, 0, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, + + // System_Collections_Generic_IList_T__IndexOf + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type + (byte)SignatureTypeCode.GenericTypeParameter, 0, + + // System_Collections_Generic_IList_T__Insert + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId + 0, // Arity + 2, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, + (byte)SignatureTypeCode.GenericTypeParameter, 0, + + // System_Collections_Generic_IList_T__RemoveAt + (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags + (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, + + // System_Reflection_MethodBase__GetMethodFromHandle + (byte)(MemberFlags.Method | MemberFlags.Static), // Flags + (byte)InternalSpecialType.System_Reflection_MethodBase, // DeclaringTypeId + 0, // Arity + 1, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_Reflection_MethodBase, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeMethodHandle, + + // System_Reflection_MethodBase__GetMethodFromHandle2 + (byte)(MemberFlags.Method | MemberFlags.Static), // Flags + (byte)InternalSpecialType.System_Reflection_MethodBase, // DeclaringTypeId + 0, // Arity + 2, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)InternalSpecialType.System_Reflection_MethodBase, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeMethodHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeTypeHandle, + + // System_Array__get_Length + (byte)MemberFlags.PropertyGet, // Flags + (byte)SpecialType.System_Array, // DeclaringTypeId + 0, // Arity + 0, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type + + // System_Array__Empty + (byte)(MemberFlags.Method | MemberFlags.Static), // Flags + (byte)SpecialType.System_Array, // DeclaringTypeId + 1, // Arity + 0, // Method Signature + (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.GenericMethodParameter, 0, // Return Type + + // System_Array__SetValue + (byte)MemberFlags.Method, // Flags + (byte)SpecialType.System_Array, // DeclaringTypeId + 0, // Arity + 2, // Method Signature + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, }; string[] allNames = new string[(int)SpecialMember.Count] @@ -1147,6 +1320,7 @@ static SpecialMembers() "get_Length", // System_String__Length "get_Chars", // System_String__Chars "Format", // System_String__Format + "Format", // System_String__Format_IFormatProvider "Substring", // System_String__Substring "op_Implicit", // System_String__op_Implicit_ToReadOnlySpanOfChar "IsNaN", // System_Double__IsNaN @@ -1155,6 +1329,8 @@ static SpecialMembers() "Remove", // System_Delegate__Remove "op_Equality", // System_Delegate__op_Equality "op_Inequality", // System_Delegate__op_Inequality + "CreateDelegate", // System_Delegate__CreateDelegate + "CreateDelegate", // System_Delegate__CreateDelegate4 "Zero", // System_Decimal__Zero "MinusOne", // System_Decimal__MinusOne "One", // System_Decimal__One @@ -1264,6 +1440,24 @@ static SpecialMembers() ".ctor", // System_Runtime_CompilerServices_PreserveBaseOverridesAttribute__ctor ".ctor", // System_Runtime_CompilerServices_InlineArrayAttribute__ctor ".ctor", // System_ReadOnlySpan_T__ctor_Reference + "Count", // System_Collections_Generic_IReadOnlyCollection_T__Count, + "get_Item", // System_Collections_Generic_IReadOnlyList_T__get_Item, + "Count", // System_Collections_Generic_ICollection_T__Count, + "IsReadOnly", // System_Collections_Generic_ICollection_T__IsReadOnly, + "Add", // System_Collections_Generic_ICollection_T__Add, + "Clear", // System_Collections_Generic_ICollection_T__Clear, + "Contains", // System_Collections_Generic_ICollection_T__Contains, + "CopyTo", // System_Collections_Generic_ICollection_T__CopyTo, + "Remove", // System_Collections_Generic_ICollection_T__Remove, + "get_Item", // System_Collections_Generic_IList_T__get_Item, + "IndexOf", // System_Collections_Generic_IList_T__IndexOf, + "Insert", // System_Collections_Generic_IList_T__Insert, + "RemoveAt", // System_Collections_Generic_IList_T__RemoveAt, + "GetMethodFromHandle", // System_Reflection_MethodBase__GetMethodFromHandle + "GetMethodFromHandle", // System_Reflection_MethodBase__GetMethodFromHandle2 + "get_Length", // System_Array__get_Length + "Empty", // System_Array__Empty + "SetValue", // System_Array__SetValue }; s_descriptors = MemberDescriptor.InitializeFromStream(new System.IO.MemoryStream(initializationBytes, writable: false), allNames); diff --git a/src/Compilers/Core/Portable/SpecialType.cs b/src/Compilers/Core/Portable/SpecialType.cs index aa98a07955669..94d6c4866c5d4 100644 --- a/src/Compilers/Core/Portable/SpecialType.cs +++ b/src/Compilers/Core/Portable/SpecialType.cs @@ -263,22 +263,12 @@ public enum SpecialType : sbyte /// System_Runtime_CompilerServices_InlineArrayAttribute = 46, - /// - /// Indicates that the type is from the COR library. - /// - /// - /// Check for this special type cannot be used to find the "canonical" definition of - /// since it is fully legal for it to come from sources other than the COR library, e.g. from `System.Memory` package. - /// The special type entry mostly exist so that compiler can tell this type apart when resolving other members of the COR library - /// - System_ReadOnlySpan_T = 47, - /// /// Count of special types. This is not a count of enum members. /// /// /// The underlying numeric value of this member is expected to change every time a new special type is added /// - Count = System_ReadOnlySpan_T + Count = System_Runtime_CompilerServices_InlineArrayAttribute } } diff --git a/src/Compilers/Core/Portable/SpecialTypeExtensions.cs b/src/Compilers/Core/Portable/SpecialTypeExtensions.cs index afa94c7888812..553126db2e869 100644 --- a/src/Compilers/Core/Portable/SpecialTypeExtensions.cs +++ b/src/Compilers/Core/Portable/SpecialTypeExtensions.cs @@ -87,7 +87,6 @@ public static bool IsValueType(this SpecialType specialType) case SpecialType.System_RuntimeFieldHandle: case SpecialType.System_RuntimeMethodHandle: case SpecialType.System_RuntimeTypeHandle: - case SpecialType.System_ReadOnlySpan_T: return true; default: return false; diff --git a/src/Compilers/Core/Portable/SpecialTypes.cs b/src/Compilers/Core/Portable/SpecialTypes.cs index 0d1ae1dd58ab7..d4bca2aef4b50 100644 --- a/src/Compilers/Core/Portable/SpecialTypes.cs +++ b/src/Compilers/Core/Portable/SpecialTypes.cs @@ -16,10 +16,10 @@ internal static class SpecialTypes /// that we could use ids to index into the array /// /// - private static readonly string?[] s_emittedNames = new string?[(int)SpecialType.Count + 1] + private static readonly string?[] s_emittedNames = new string?[(int)InternalSpecialType.NextAvailable] { // The following things should be in sync: - // 1) SpecialType enum + // 1) SpecialType/InternalSpecialType enum // 2) names in SpecialTypes.EmittedNames array. // 3) languageNames in SemanticFacts.cs // 4) languageNames in SemanticFacts.vb @@ -71,16 +71,20 @@ internal static class SpecialTypes "System.Runtime.CompilerServices.PreserveBaseOverridesAttribute", "System.Runtime.CompilerServices.InlineArrayAttribute", "System.ReadOnlySpan`1", + "System.IFormatProvider", + "System.Type", + "System.Reflection.MethodBase", + "System.Reflection.MethodInfo", }; - private static readonly Dictionary s_nameToTypeIdMap; + private static readonly Dictionary s_nameToTypeIdMap; private static readonly Microsoft.Cci.PrimitiveTypeCode[] s_typeIdToTypeCodeMap; private static readonly SpecialType[] s_typeCodeToTypeIdMap; static SpecialTypes() { - s_nameToTypeIdMap = new Dictionary((int)SpecialType.Count); + s_nameToTypeIdMap = new Dictionary((int)InternalSpecialType.NextAvailable - 1); int i; @@ -89,7 +93,7 @@ static SpecialTypes() string? name = s_emittedNames[i]; RoslynDebug.Assert(name is object); Debug.Assert(name.IndexOf('+') < 0); // Compilers aren't prepared to lookup for a nested special type. - s_nameToTypeIdMap.Add(name, (SpecialType)i); + s_nameToTypeIdMap.Add(name, (ExtendedSpecialType)i); } s_typeIdToTypeCodeMap = new Microsoft.Cci.PrimitiveTypeCode[(int)SpecialType.Count + 1]; @@ -144,21 +148,21 @@ static SpecialTypes() /// /// Gets the name of the special type as it would appear in metadata. /// - public static string? GetMetadataName(this SpecialType id) + public static string? GetMetadataName(this ExtendedSpecialType id) { return s_emittedNames[(int)id]; } - public static SpecialType GetTypeFromMetadataName(string metadataName) + public static ExtendedSpecialType GetTypeFromMetadataName(string metadataName) { - SpecialType id; + ExtendedSpecialType id; if (s_nameToTypeIdMap.TryGetValue(metadataName, out id)) { return id; } - return SpecialType.None; + return default; } public static SpecialType GetTypeFromMetadataName(Microsoft.Cci.PrimitiveTypeCode typeCode) diff --git a/src/Compilers/Core/Portable/WellKnownMember.cs b/src/Compilers/Core/Portable/WellKnownMember.cs index 2c453ce897083..dbcb737b52e09 100644 --- a/src/Compilers/Core/Portable/WellKnownMember.cs +++ b/src/Compilers/Core/Portable/WellKnownMember.cs @@ -7,15 +7,9 @@ namespace Microsoft.CodeAnalysis // Members of well known types internal enum WellKnownMember { - System_Object__ToString, - System_Math__RoundDouble, System_Math__PowDoubleDouble, - System_Array__get_Length, - System_Array__Empty, - System_Array__SetValue, - System_Convert__ToBooleanDecimal, System_Convert__ToBooleanInt32, System_Convert__ToBooleanUInt32, @@ -65,8 +59,6 @@ internal enum WellKnownMember System_Reflection_MethodBase__GetMethodFromHandle, System_Reflection_MethodBase__GetMethodFromHandle2, System_Reflection_MethodInfo__CreateDelegate, - System_Delegate__CreateDelegate, - System_Delegate__CreateDelegate4, System_Reflection_FieldInfo__GetFieldFromHandle, System_Reflection_FieldInfo__GetFieldFromHandle2, @@ -431,8 +423,6 @@ internal enum WellKnownMember System_Runtime_CompilerServices_TupleElementNamesAttribute__ctorTransformNames, - System_String__Format_IFormatProvider, - Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningSingleFile, Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningMultipleFiles, @@ -608,20 +598,6 @@ internal enum WellKnownMember System_Collections_IList__Remove, System_Collections_IList__RemoveAt, - System_Collections_Generic_IReadOnlyCollection_T__Count, - System_Collections_Generic_IReadOnlyList_T__get_Item, - System_Collections_Generic_ICollection_T__Count, - System_Collections_Generic_ICollection_T__IsReadOnly, - System_Collections_Generic_ICollection_T__Add, - System_Collections_Generic_ICollection_T__Clear, - System_Collections_Generic_ICollection_T__Contains, - System_Collections_Generic_ICollection_T__CopyTo, - System_Collections_Generic_ICollection_T__Remove, - System_Collections_Generic_IList_T__get_Item, - System_Collections_Generic_IList_T__IndexOf, - System_Collections_Generic_IList_T__Insert, - System_Collections_Generic_IList_T__RemoveAt, - System_Collections_Generic_List_T__ctor, System_Collections_Generic_List_T__ctorInt32, System_Collections_Generic_List_T__Add, diff --git a/src/Compilers/Core/Portable/WellKnownMembers.cs b/src/Compilers/Core/Portable/WellKnownMembers.cs index 5bd237bc8f986..351d772afc467 100644 --- a/src/Compilers/Core/Portable/WellKnownMembers.cs +++ b/src/Compilers/Core/Portable/WellKnownMembers.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Immutable; +using System.Diagnostics; using System.Reflection.Metadata; using Microsoft.CodeAnalysis.RuntimeMembers; @@ -16,13 +17,6 @@ static WellKnownMembers() { byte[] initializationBytes = new byte[] { - // System_Object__ToString - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Object, // DeclaringTypeId - 0, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, // Return Type - // System_Math__RoundDouble (byte)(MemberFlags.Method | MemberFlags.Static), // Flags (byte)WellKnownType.System_Math, // DeclaringTypeId @@ -40,29 +34,6 @@ static WellKnownMembers() (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Double, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Double, - // System_Array__get_Length - (byte)MemberFlags.PropertyGet, // Flags - (byte)WellKnownType.System_Array, // DeclaringTypeId - 0, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type - - // System_Array__Empty - (byte)(MemberFlags.Method | MemberFlags.Static), // Flags - (byte)WellKnownType.System_Array, // DeclaringTypeId - 1, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.GenericMethodParameter, 0, // Return Type - - // System_Array__SetValue - (byte)MemberFlags.Method, // Flags - (byte)WellKnownType.System_Array, // DeclaringTypeId - 0, // Arity - 2, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - // System_Convert__ToBooleanDecimal (byte)(MemberFlags.Method | MemberFlags.Static), // Flags (byte)WellKnownType.System_Convert, // DeclaringTypeId @@ -364,7 +335,7 @@ static WellKnownMembers() 0, // Arity 1, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Type, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeTypeHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeTypeHandle, // System_Type__Missing (byte)(MemberFlags.Field | MemberFlags.Static), // Flags @@ -403,7 +374,7 @@ static WellKnownMembers() 0, // Arity 1, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Reflection_MethodBase, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeMethodHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeMethodHandle, // System_Reflection_MethodBase__GetMethodFromHandle2 (byte)(MemberFlags.Method | MemberFlags.Static), // Flags @@ -411,8 +382,8 @@ static WellKnownMembers() 0, // Arity 2, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Reflection_MethodBase, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeMethodHandle, - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeTypeHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeMethodHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeTypeHandle, // System_Reflection_MethodInfo__CreateDelegate (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags @@ -423,34 +394,13 @@ static WellKnownMembers() (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Type, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, - // System_Delegate__CreateDelegate - (byte)(MemberFlags.Method | MemberFlags.Static), // Flags - (byte)SpecialType.System_Delegate, // DeclaringTypeId - 0, // Arity - 3, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Delegate, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Type, - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Reflection_MethodInfo, - - // System_Delegate__CreateDelegate4 - (byte)(MemberFlags.Method | MemberFlags.Static), // Flags - (byte)SpecialType.System_Delegate, // DeclaringTypeId - 0, // Arity - 4, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Delegate, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Type, - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Reflection_MethodInfo, - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, - // System_Reflection_FieldInfo__GetFieldFromHandle (byte)(MemberFlags.Method | MemberFlags.Static), // Flags (byte)WellKnownType.System_Reflection_FieldInfo, // DeclaringTypeId 0, // Arity 1, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Reflection_FieldInfo, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeFieldHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeFieldHandle, // System_Reflection_FieldInfo__GetFieldFromHandle2 (byte)(MemberFlags.Method | MemberFlags.Static), // Flags @@ -458,8 +408,8 @@ static WellKnownMembers() 0, // Arity 2, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_Reflection_FieldInfo, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeFieldHandle, - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeTypeHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeFieldHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeTypeHandle, // System_Reflection_Missing__Value (byte)(MemberFlags.Field | MemberFlags.Static), // Flags @@ -1041,7 +991,7 @@ static WellKnownMembers() (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.ExtSentinel, (byte)(WellKnownType.System_ReadOnlySpan_T - WellKnownType.ExtSentinel), 1, (byte)SignatureTypeCode.GenericMethodParameter, 0, - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeFieldHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeFieldHandle, // System_Runtime_CompilerServices_RuntimeHelpers__GetObjectValueObject (byte)(MemberFlags.Method | MemberFlags.Static), // Flags @@ -1058,7 +1008,7 @@ static WellKnownMembers() 2, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Array, - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_RuntimeFieldHandle, + (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_RuntimeFieldHandle, // System_Runtime_CompilerServices_RuntimeHelpers__get_OffsetToStringData (byte)(MemberFlags.PropertyGet | MemberFlags.Static), // Flags @@ -2663,7 +2613,7 @@ static WellKnownMembers() // System_ValueTuple_T1__Item1 (byte)MemberFlags.Field, // Flags - (byte)WellKnownType.ExtSentinel, (byte)(WellKnownType.System_ValueTuple_T1 - WellKnownType.ExtSentinel), // DeclaringTypeId + (byte)WellKnownType.System_ValueTuple_T1, // DeclaringTypeId 0, // Arity (byte)SignatureTypeCode.GenericTypeParameter, 0, // Field Signature @@ -2879,7 +2829,7 @@ static WellKnownMembers() // System_ValueTuple_T1__ctor (byte)MemberFlags.Constructor, // Flags - (byte)WellKnownType.ExtSentinel, (byte)(WellKnownType.System_ValueTuple_T1 - WellKnownType.ExtSentinel), // DeclaringTypeId + (byte)WellKnownType.System_ValueTuple_T1, // DeclaringTypeId 0, // Arity 1, // Method Signature (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type @@ -2978,16 +2928,6 @@ static WellKnownMembers() (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, - // System_String__Format_IFormatProvider - (byte)(MemberFlags.Method | MemberFlags.Static), // Flags - (byte)SpecialType.System_String, // DeclaringTypeId - 0, // Arity - 3, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)WellKnownType.System_IFormatProvider, - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_String, - (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Object, - // Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningSingleFile (byte)(MemberFlags.Method | MemberFlags.Static), // Flags (byte)WellKnownType.ExtSentinel, (byte)(WellKnownType.Microsoft_CodeAnalysis_Runtime_Instrumentation - WellKnownType.ExtSentinel), // DeclaringTypeId @@ -4201,108 +4141,6 @@ static WellKnownMembers() (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - // System_Collections_Generic_IReadOnlyCollection_T__Count - (byte)(MemberFlags.Property | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_IReadOnlyCollection_T, // DeclaringTypeId - 0, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type - - // System_Collections_Generic_IReadOnlyList_T__get_Item - (byte)(MemberFlags.PropertyGet | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_IReadOnlyList_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.GenericTypeParameter, 0, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - - // System_Collections_Generic_ICollection_T__Count - (byte)(MemberFlags.Property | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type - - // System_Collections_Generic_ICollection_T__IsReadOnly - (byte)(MemberFlags.Property | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, // Return Type - - // System_Collections_Generic_ICollection_T__Add - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type - (byte)SignatureTypeCode.GenericTypeParameter, 0, - - // System_Collections_Generic_ICollection_T__Clear - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 0, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type - - // System_Collections_Generic_ICollection_T__Contains - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, // Return Type - (byte)SignatureTypeCode.GenericTypeParameter, 0, - - // System_Collections_Generic_ICollection_T__CopyTo - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 2, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type - (byte)SignatureTypeCode.SZArray, (byte)SignatureTypeCode.GenericTypeParameter, 0, - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - - // System_Collections_Generic_ICollection_T__Remove - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_ICollection_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Boolean, // Return Type - (byte)SignatureTypeCode.GenericTypeParameter, 0, - - // System_Collections_Generic_IList_T__get_Item - (byte)(MemberFlags.PropertyGet | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.GenericTypeParameter, 0, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - - // System_Collections_Generic_IList_T__IndexOf - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, // Return Type - (byte)SignatureTypeCode.GenericTypeParameter, 0, - - // System_Collections_Generic_IList_T__Insert - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId - 0, // Arity - 2, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - (byte)SignatureTypeCode.GenericTypeParameter, 0, - - // System_Collections_Generic_IList_T__RemoveAt - (byte)(MemberFlags.Method | MemberFlags.Virtual), // Flags - (byte)SpecialType.System_Collections_Generic_IList_T, // DeclaringTypeId - 0, // Arity - 1, // Method Signature - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Void, // Return Type - (byte)SignatureTypeCode.TypeHandle, (byte)SpecialType.System_Int32, - // System_Collections_Generic_List_T__ctor (byte)MemberFlags.Constructor, // Flags (byte)WellKnownType.System_Collections_Generic_List_T, // DeclaringTypeId @@ -4477,12 +4315,8 @@ static WellKnownMembers() string[] allNames = new string[(int)WellKnownMember.Count] { - "ToString", // System_Object__ToString "Round", // System_Math__RoundDouble "Pow", // System_Math__PowDoubleDouble - "get_Length", // System_Array__get_Length - "Empty", // System_Array__Empty - "SetValue", // System_Array__SetValue "ToBoolean", // System_Convert__ToBooleanDecimal "ToBoolean", // System_Convert__ToBooleanInt32 "ToBoolean", // System_Convert__ToBooleanUInt32 @@ -4528,8 +4362,6 @@ static WellKnownMembers() "GetMethodFromHandle", // System_Reflection_MethodBase__GetMethodFromHandle "GetMethodFromHandle", // System_Reflection_MethodBase__GetMethodFromHandle2 "CreateDelegate", // System_Reflection_MethodInfo__CreateDelegate - "CreateDelegate", // System_Delegate__CreateDelegate - "CreateDelegate", // System_Delegate__CreateDelegate4 "GetFieldFromHandle", // System_Reflection_FieldInfo__GetFieldFromHandle "GetFieldFromHandle", // System_Reflection_FieldInfo__GetFieldFromHandle2 "Value", // System_Reflection_Missing__Value @@ -4842,8 +4674,6 @@ static WellKnownMembers() ".ctor", // System_Runtime_CompilerServices_TupleElementNamesAttribute__ctorTransformNames - "Format", // System_String__Format_IFormatProvider - "CreatePayload", // Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningSingleFile "CreatePayload", // Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningMultipleFiles @@ -4994,19 +4824,6 @@ static WellKnownMembers() "Insert", // System_Collections_IList__Insert, "Remove", // System_Collections_IList__Remove, "RemoveAt", // System_Collections_IList__RemoveAt, - "Count", // System_Collections_Generic_IReadOnlyCollection_T__Count, - "get_Item", // System_Collections_Generic_IReadOnlyList_T__get_Item, - "Count", // System_Collections_Generic_ICollection_T__Count, - "IsReadOnly", // System_Collections_Generic_ICollection_T__IsReadOnly, - "Add", // System_Collections_Generic_ICollection_T__Add, - "Clear", // System_Collections_Generic_ICollection_T__Clear, - "Contains", // System_Collections_Generic_ICollection_T__Contains, - "CopyTo", // System_Collections_Generic_ICollection_T__CopyTo, - "Remove", // System_Collections_Generic_ICollection_T__Remove, - "get_Item", // System_Collections_Generic_IList_T__get_Item, - "IndexOf", // System_Collections_Generic_IList_T__IndexOf, - "Insert", // System_Collections_Generic_IList_T__Insert, - "RemoveAt", // System_Collections_Generic_IList_T__RemoveAt, ".ctor", // System_Collections_Generic_List_T__ctor, ".ctor", // System_Collections_Generic_List_T__ctorInt32, "Add", // System_Collections_Generic_List_T__Add @@ -5029,6 +4846,13 @@ static WellKnownMembers() }; s_descriptors = MemberDescriptor.InitializeFromStream(new System.IO.MemoryStream(initializationBytes, writable: false), allNames); + +#if DEBUG + foreach (var descriptor in s_descriptors) + { + Debug.Assert(!descriptor.IsSpecialTypeMember); // Members of types from core library should be in the SpecialMember set instead. + } +#endif } public static MemberDescriptor GetDescriptor(WellKnownMember member) diff --git a/src/Compilers/Core/Portable/WellKnownTypes.cs b/src/Compilers/Core/Portable/WellKnownTypes.cs index 2b93fedb5b26a..c9ecb5758d173 100644 --- a/src/Compilers/Core/Portable/WellKnownTypes.cs +++ b/src/Compilers/Core/Portable/WellKnownTypes.cs @@ -17,11 +17,10 @@ internal enum WellKnownType // Value 0 represents an unknown type Unknown = SpecialType.None, - First = SpecialType.Count + 1, + First = InternalSpecialType.NextAvailable, // The following type ids should be in sync with names in WellKnownTypes.metadataNames array. System_Math = First, - System_Array, System_Attribute, System_CLSCompliantAttribute, System_Convert, @@ -30,9 +29,6 @@ internal enum WellKnownType System_FormattableString, System_Guid, System_IFormattable, - System_RuntimeTypeHandle, - System_RuntimeFieldHandle, - System_RuntimeMethodHandle, System_MarshalByRefObject, System_Type, System_Reflection_AssemblyKeyFileAttribute, @@ -246,15 +242,15 @@ internal enum WellKnownType System_Environment, System_Runtime_GCLatencyMode, - System_IFormatProvider, - CSharp7Sentinel = System_IFormatProvider, // all types that were known before CSharp7 should remain above this sentinel + CSharp7Sentinel = System_Runtime_GCLatencyMode, // all types that were known before CSharp7 should remain above this sentinel System_ValueTuple, + System_ValueTuple_T1, + ExtSentinel, // Not a real type, just a marker for types above 255 and strictly below 512 - System_ValueTuple_T1, System_ValueTuple_T2, System_ValueTuple_T3, System_ValueTuple_T4, @@ -357,10 +353,9 @@ internal static class WellKnownTypes /// that we could use ids to index into the array /// /// - private static readonly string[] s_metadataNames = new string[] + private static readonly string[] s_metadataNames = new string[Count] { "System.Math", - "System.Array", "System.Attribute", "System.CLSCompliantAttribute", "System.Convert", @@ -369,9 +364,6 @@ internal static class WellKnownTypes "System.FormattableString", "System.Guid", "System.IFormattable", - "System.RuntimeTypeHandle", - "System.RuntimeFieldHandle", - "System.RuntimeMethodHandle", "System.MarshalByRefObject", "System.Type", "System.Reflection.AssemblyKeyFileAttribute", @@ -581,13 +573,11 @@ internal static class WellKnownTypes "System.Runtime.GCLatencyMode", - "System.IFormatProvider", - "System.ValueTuple", + "System.ValueTuple`1", - "", // extension marker + "", // WellKnownType.ExtSentinel extension marker - "System.ValueTuple`1", "System.ValueTuple`2", "System.ValueTuple`3", "System.ValueTuple`4", @@ -702,7 +692,7 @@ private static void AssertEnumAndTableInSync() typeIdName = "Microsoft.VisualBasic.CompilerServices.ObjectFlowControl+ForLoopControl"; break; case WellKnownType.CSharp7Sentinel: - typeIdName = "System.IFormatProvider"; + typeIdName = "System.Runtime.GCLatencyMode"; break; case WellKnownType.ExtSentinel: typeIdName = ""; @@ -723,8 +713,17 @@ private static void AssertEnumAndTableInSync() Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}"); } - Debug.Assert((int)WellKnownType.ExtSentinel == 255); - Debug.Assert((int)WellKnownType.NextAvailable <= 512, "Time for a new sentinel"); +#if DEBUG + // Some compile time asserts + { + // The WellKnownType.ExtSentinel value must be 255 + _ = new int[(int)WellKnownType.ExtSentinel - 255]; + _ = new int[255 - (int)WellKnownType.ExtSentinel]; + + // Once the last real id minus WellKnownType.ExtSentinel cannot fit into a byte, it is time to add a new sentinel. + _ = new int[255 - ((int)WellKnownType.NextAvailable - 1 - (int)WellKnownType.ExtSentinel)]; + } +#endif } public static bool IsWellKnownType(this WellKnownType typeId) diff --git a/src/Compilers/Test/Utilities/VisualBasic/MockSymbols.vb b/src/Compilers/Test/Utilities/VisualBasic/MockSymbols.vb index 0e0ad8b47a49d..ef58a60eb2802 100644 --- a/src/Compilers/Test/Utilities/VisualBasic/MockSymbols.vb +++ b/src/Compilers/Test/Utilities/VisualBasic/MockSymbols.vb @@ -800,7 +800,7 @@ Friend Class MockAssemblySymbol End Get End Property - Friend Overrides Function GetDeclaredSpecialType(type As SpecialType) As NamedTypeSymbol + Friend Overrides Function GetDeclaredSpecialType(type As ExtendedSpecialType) As NamedTypeSymbol Throw New NotImplementedException() End Function diff --git a/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml b/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml index 27e579c00e454..53fa1217665e8 100644 --- a/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml +++ b/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml @@ -196,6 +196,7 @@ + - + https://github.com/dotnet/arcade - 5c3fdd3b5aaaa32b24383ec12a60b37ebff13079 + 8e3e00a76f467cc262dc14f6466ab884b2c4eb96 @@ -144,9 +144,9 @@ https://github.com/dotnet/roslyn 5d10d428050c0d6afef30a072c4ae68776621877 - + https://github.com/dotnet/arcade - 5c3fdd3b5aaaa32b24383ec12a60b37ebff13079 + 8e3e00a76f467cc262dc14f6466ab884b2c4eb96 https://github.com/dotnet/roslyn-analyzers diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 647e3f92e5f37..a2709d10562ca 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -206,9 +206,11 @@ jobs: continueOnError: true condition: always() - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - - publish: artifacts/log - artifact: ${{ coalesce(parameters.artifacts.publish.logs.name, 'Logs_Build_$(Agent.Os)_$(_BuildConfig)') }} - displayName: Publish logs + - task: 1ES.PublishPipelineArtifact@1 + inputs: + targetPath: 'artifacts/log' + artifactName: ${{ coalesce(parameters.artifacts.publish.logs.name, 'Logs_Build_$(Agent.Os)_$(_BuildConfig)') }} + displayName: 'Publish logs' continueOnError: true condition: always() @@ -253,7 +255,9 @@ jobs: IgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} - ${{ if eq(parameters.enableBuildRetry, 'true') }}: - - publish: $(Build.SourcesDirectory)\eng\common\BuildConfiguration - artifact: BuildConfiguration - displayName: Publish build retry configuration - continueOnError: true + - task: 1ES.PublishPipelineArtifact@1 + inputs: + targetPath: '$(Build.SourcesDirectory)\eng\common\BuildConfiguration' + artifactName: 'BuildConfiguration' + displayName: 'Publish build retry configuration' + continueOnError: true \ No newline at end of file diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index ea5104625fac5..53138622fe7a3 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -94,14 +94,16 @@ jobs: inputs: targetType: inline script: | - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) + New-Item -Path "$(Build.StagingDirectory)/ReleaseConfigs" -ItemType Directory -Force + $filePath = "$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt" + Add-Content -Path $filePath -Value $(BARBuildId) + Add-Content -Path $filePath -Value "$(DefaultChannels)" + Add-Content -Path $filePath -Value $(IsStableBuild) - task: 1ES.PublishBuildArtifacts@1 displayName: Publish ReleaseConfigs Artifact inputs: - PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' + PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs' PublishLocation: Container ArtifactName: ReleaseConfigs diff --git a/global.json b/global.json index f323d2b0bb65e..eaffc964f8ea0 100644 --- a/global.json +++ b/global.json @@ -12,8 +12,8 @@ "xcopy-msbuild": "17.8.1-2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24161.1", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24161.1", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24170.6", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24170.6", "Microsoft.Build.Traversal": "3.4.0" } } From 00c20fc41f1a80a7ad0f2aa29e91fdcdccbb6bea Mon Sep 17 00:00:00 2001 From: Alireza Habibi Date: Fri, 22 Mar 2024 20:13:59 +0330 Subject: [PATCH 46/94] Avoid creating result temp for is-expressions (#72273) Closes #59615 Closes #55334 --- .../BoundLoweredIsPatternExpression.cs | 16 + .../CSharp/Portable/BoundTree/BoundNodes.xml | 8 + .../CSharp/Portable/CodeGen/EmitExpression.cs | 52 +- .../CSharp/Portable/CodeGen/EmitOperators.cs | 21 +- .../CSharp/Portable/CodeGen/EmitStatement.cs | 28 +- .../CSharp/Portable/CodeGen/Optimizer.cs | 33 +- .../Portable/FlowAnalysis/AbstractFlowPass.cs | 20 +- .../Generated/BoundNodes.xml.Generated.cs | 91 +- .../LocalRewriter_IsPatternOperator.cs | 37 +- .../Portable/Lowering/SpillSequenceSpiller.cs | 10 + .../Test/Emit/CodeGen/CodeGenAsyncTests.cs | 42 + .../CSharp/Test/Emit/CodeGen/PatternTests.cs | 240 ++--- .../CSharp/Test/Emit/CodeGen/SwitchTests.cs | 2 +- .../Emit2/Semantics/PatternMatchingTests.cs | 832 +++++++++--------- .../Emit2/Semantics/PatternMatchingTests3.cs | 70 +- .../Emit2/Semantics/PatternMatchingTests5.cs | 199 ++++- .../Core/Portable/CodeGen/ILBuilder.cs | 10 + 17 files changed, 1046 insertions(+), 665 deletions(-) create mode 100644 src/Compilers/CSharp/Portable/BoundTree/BoundLoweredIsPatternExpression.cs diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundLoweredIsPatternExpression.cs b/src/Compilers/CSharp/Portable/BoundTree/BoundLoweredIsPatternExpression.cs new file mode 100644 index 0000000000000..68fed229791af --- /dev/null +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundLoweredIsPatternExpression.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Diagnostics; + +namespace Microsoft.CodeAnalysis.CSharp; + +partial class BoundLoweredIsPatternExpression +{ + private partial void Validate() + { + // Ensure fall-through is unreachable + Debug.Assert(this.Statements is [.., BoundGotoStatement or BoundSwitchDispatch]); + } +} diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml b/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml index 54fadfbd7872f..44f8f7eacde5b 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml @@ -2358,6 +2358,7 @@ 'is not Type t') will need to compensate for negated patterns. IsNegated is set if Pattern is the negated form of the inner pattern represented by DecisionDag. --> + @@ -2366,6 +2367,13 @@ + + + + + + + diff --git a/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs b/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs index 1a4fae886824a..bc5aaaf5b90fb 100644 --- a/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs +++ b/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs @@ -325,6 +325,10 @@ private void EmitExpressionCore(BoundExpression expression, bool used) EmitRefValueOperator((BoundRefValueOperator)expression, used); break; + case BoundKind.LoweredIsPatternExpression: + EmitLoweredIsPatternExpression((BoundLoweredIsPatternExpression)expression, used); + break; + case BoundKind.LoweredConditionalAccess: EmitLoweredConditionalAccessExpression((BoundLoweredConditionalAccess)expression, used); break; @@ -362,6 +366,42 @@ private void EmitExpressionCore(BoundExpression expression, bool used) } } + private void EmitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node, bool used, bool sense = true) + { + EmitSideEffects(node.Statements); + + if (!used) + { + _builder.MarkLabel(node.WhenTrueLabel); + _builder.MarkLabel(node.WhenFalseLabel); + } + else + { + var doneLabel = new object(); + _builder.MarkLabel(node.WhenTrueLabel); + _builder.EmitBoolConstant(sense); + _builder.EmitBranch(ILOpCode.Br, doneLabel); + _builder.AdjustStack(-1); + _builder.MarkLabel(node.WhenFalseLabel); + _builder.EmitBoolConstant(!sense); + _builder.MarkLabel(doneLabel); + } + } + + private void EmitSideEffects(ImmutableArray statements) + { +#if DEBUG + int prevStack = _expectedStackDepth; + int origStack = _builder.GetStackDepth(); + _expectedStackDepth = origStack; +#endif + EmitStatements(statements); +#if DEBUG + Debug.Assert(_expectedStackDepth == origStack); + _expectedStackDepth = prevStack; +#endif + } + private void EmitThrowExpression(BoundThrowExpression node, bool used) { this.EmitThrow(node.Expression); @@ -840,7 +880,7 @@ private void EmitSequencePoint(BoundSequencePointExpression node) } } - private void EmitSequenceExpression(BoundSequence sequence, bool used) + private void EmitSequenceExpression(BoundSequence sequence, bool used, bool sense = true) { DefineLocals(sequence); EmitSideEffects(sequence); @@ -854,7 +894,15 @@ private void EmitSequenceExpression(BoundSequence sequence, bool used) Debug.Assert(sequence.Value.Kind != BoundKind.TypeExpression || !used); if (sequence.Value.Kind != BoundKind.TypeExpression) { - EmitExpression(sequence.Value, used); + if (used && sequence.Type.SpecialType == SpecialType.System_Boolean) + { + EmitCondExpr(sequence.Value, sense: sense); + } + else + { + Debug.Assert(sense); + EmitExpression(sequence.Value, used: used); + } } // sequence is used as a value, can release all locals diff --git a/src/Compilers/CSharp/Portable/CodeGen/EmitOperators.cs b/src/Compilers/CSharp/Portable/CodeGen/EmitOperators.cs index 80ca057d83076..ee3f158d49eca 100644 --- a/src/Compilers/CSharp/Portable/CodeGen/EmitOperators.cs +++ b/src/Compilers/CSharp/Portable/CodeGen/EmitOperators.cs @@ -484,14 +484,25 @@ private void EmitCondExpr(BoundExpression condition, bool sense) return; } - if (condition.Kind == BoundKind.BinaryOperator) + switch (condition.Kind) { - var binOp = (BoundBinaryOperator)condition; - if (IsConditional(binOp.OperatorKind)) - { + case BoundKind.BinaryOperator: + var binOp = (BoundBinaryOperator)condition; + if (!IsConditional(binOp.OperatorKind)) + { + break; + } + EmitBinaryCondOperator(binOp, sense); return; - } + + case BoundKind.Sequence: + EmitSequenceExpression((BoundSequence)condition, used: true, sense); + return; + + case BoundKind.LoweredIsPatternExpression: + EmitLoweredIsPatternExpression((BoundLoweredIsPatternExpression)condition, used: true, sense); + return; } EmitExpression(condition, true); diff --git a/src/Compilers/CSharp/Portable/CodeGen/EmitStatement.cs b/src/Compilers/CSharp/Portable/CodeGen/EmitStatement.cs index 107a8f02f2481..a7a6d10585731 100644 --- a/src/Compilers/CSharp/Portable/CodeGen/EmitStatement.cs +++ b/src/Compilers/CSharp/Portable/CodeGen/EmitStatement.cs @@ -24,6 +24,10 @@ namespace Microsoft.CodeAnalysis.CSharp.CodeGen { internal partial class CodeGenerator { +#if DEBUG + private int _expectedStackDepth = 0; +#endif + private void EmitStatement(BoundStatement statement) { switch (statement.Kind) @@ -108,7 +112,7 @@ private void EmitStatement(BoundStatement statement) #if DEBUG if (_stackLocals == null || _stackLocals.Count == 0) { - _builder.AssertStackEmpty(); + _builder.AssertStackDepth(_expectedStackDepth); } #endif @@ -572,6 +576,28 @@ top.condition is BoundBinaryOperator binary && } return; + case BoundKind.LoweredIsPatternExpression: + { + var loweredIs = (BoundLoweredIsPatternExpression)condition; + dest ??= new object(); + + EmitSideEffects(loweredIs.Statements); + + if (sense) + { + _builder.MarkLabel(loweredIs.WhenTrueLabel); + _builder.EmitBranch(ILOpCode.Br, dest); + _builder.MarkLabel(loweredIs.WhenFalseLabel); + } + else + { + _builder.MarkLabel(loweredIs.WhenFalseLabel); + _builder.EmitBranch(ILOpCode.Br, dest); + _builder.MarkLabel(loweredIs.WhenTrueLabel); + } + } + return; + case BoundKind.UnaryOperator: var unOp = (BoundUnaryOperator)condition; if (unOp.OperatorKind == UnaryOperatorKind.BoolLogicalNegation) diff --git a/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs b/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs index a704cc630aa4e..7f2f6797a29a0 100644 --- a/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs +++ b/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs @@ -415,6 +415,10 @@ internal sealed class StackOptimizerPass1 : BoundTreeRewriter private int _recursionDepth; +#if DEBUG + private int _expectedStackDepth = 0; +#endif + private StackOptimizerPass1(Dictionary locals, ArrayBuilder> evalStack, bool debugFriendly) @@ -565,10 +569,27 @@ private void PopEvalStack() public BoundNode VisitStatement(BoundNode node) { - Debug.Assert(node == null || EvalStackIsEmpty()); +#if DEBUG + Debug.Assert(node == null || StackDepth() == _expectedStackDepth); +#endif return VisitSideEffect(node); } + public ImmutableArray VisitSideEffects(ImmutableArray statements) + { +#if DEBUG + int prevStack = _expectedStackDepth; + int origStack = StackDepth(); + _expectedStackDepth = origStack; +#endif + var result = this.VisitList(statements); +#if DEBUG + Debug.Assert(_expectedStackDepth == origStack); + _expectedStackDepth = prevStack; +#endif + return result; + } + public BoundNode VisitSideEffect(BoundNode node) { var origStack = StackDepth(); @@ -1417,8 +1438,6 @@ public override BoundNode VisitConditionalGoto(BoundConditionalGoto node) public override BoundNode VisitSwitchDispatch(BoundSwitchDispatch node) { - Debug.Assert(EvalStackIsEmpty()); - // switch dispatch needs a byval local or a parameter as a key. // if this is already a fitting local, let's keep it that way BoundExpression boundExpression = node.Expression; @@ -1448,6 +1467,14 @@ public override BoundNode VisitSwitchDispatch(BoundSwitchDispatch node) return node.Update(boundExpression, node.Cases, node.DefaultLabel, node.LengthBasedStringSwitchDataOpt); } + public override BoundNode VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node) + { + var statements = VisitSideEffects(node.Statements); + RecordLabel(node.WhenTrueLabel); + RecordLabel(node.WhenFalseLabel); + return node.Update(statements, node.WhenTrueLabel, node.WhenFalseLabel, VisitType(node.Type)); + } + public override BoundNode VisitConditionalOperator(BoundConditionalOperator node) { var origStack = StackDepth(); diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs index 9d4bef8a46fe0..2d383caf5fccb 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/AbstractFlowPass.cs @@ -3044,6 +3044,17 @@ public override BoundNode VisitConditionalReceiver(BoundConditionalReceiver node return null; } + public override BoundNode VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node) + { + VisitStatements(node.Statements); + VisitLabelCore(node.WhenTrueLabel); + var stateWhenTrue = this.State.Clone(); + SetUnreachable(); + VisitLabelCore(node.WhenFalseLabel); + Join(ref this.State, ref stateWhenTrue); + return null; + } + public override BoundNode VisitComplexConditionalReceiver(BoundComplexConditionalReceiver node) { var savedState = this.State.Clone(); @@ -3244,13 +3255,18 @@ public override BoundNode VisitGotoStatement(BoundGotoStatement node) return null; } - protected void VisitLabel(LabelSymbol label, BoundStatement node) + private void VisitLabelCore(LabelSymbol label, BoundStatement node = null) { - node.AssertIsLabeledStatementWithLabel(label); ResolveBranches(label, node); var state = LabelState(label); Join(ref this.State, ref state); _labels[label] = this.State.Clone(); + } + + protected void VisitLabel(LabelSymbol label, BoundStatement node) + { + node.AssertIsLabeledStatementWithLabel(label); + VisitLabelCore(label, node); _labelsSeen.Add(node); } diff --git a/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs b/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs index 068867b6d2678..631541624abc9 100644 --- a/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs +++ b/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs @@ -228,6 +228,7 @@ internal enum BoundKind : byte InterpolatedStringArgumentPlaceholder, StringInsert, IsPatternExpression, + LoweredIsPatternExpression, ConstantPattern, DiscardPattern, DeclarationPattern, @@ -7907,7 +7908,7 @@ public BoundStringInsert Update(BoundExpression value, BoundExpression? alignmen internal sealed partial class BoundIsPatternExpression : BoundExpression { - public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) + public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol type, bool hasErrors = false) : base(BoundKind.IsPatternExpression, syntax, type, hasErrors || expression.HasErrors() || pattern.HasErrors() || reachabilityDecisionDag.HasErrors()) { @@ -7916,6 +7917,7 @@ public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, B RoslynDebug.Assert(reachabilityDecisionDag is object, "Field 'reachabilityDecisionDag' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); RoslynDebug.Assert(whenTrueLabel is object, "Field 'whenTrueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); RoslynDebug.Assert(whenFalseLabel is object, "Field 'whenFalseLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); + RoslynDebug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); this.Expression = expression; this.Pattern = pattern; @@ -7925,6 +7927,7 @@ public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, B this.WhenFalseLabel = whenFalseLabel; } + public new TypeSymbol Type => base.Type!; public BoundExpression Expression { get; } public BoundPattern Pattern { get; } public bool IsNegated { get; } @@ -7935,7 +7938,7 @@ public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, B [DebuggerStepThrough] public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitIsPatternExpression(this); - public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) + public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol type) { if (expression != this.Expression || pattern != this.Pattern || isNegated != this.IsNegated || reachabilityDecisionDag != this.ReachabilityDecisionDag || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(whenTrueLabel, this.WhenTrueLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(whenFalseLabel, this.WhenFalseLabel) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) { @@ -7947,6 +7950,46 @@ public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern } } + internal sealed partial class BoundLoweredIsPatternExpression : BoundExpression + { + public BoundLoweredIsPatternExpression(SyntaxNode syntax, ImmutableArray statements, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol type, bool hasErrors = false) + : base(BoundKind.LoweredIsPatternExpression, syntax, type, hasErrors || statements.HasErrors()) + { + + RoslynDebug.Assert(!statements.IsDefault, "Field 'statements' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)"); + RoslynDebug.Assert(whenTrueLabel is object, "Field 'whenTrueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); + RoslynDebug.Assert(whenFalseLabel is object, "Field 'whenFalseLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); + RoslynDebug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)"); + + this.Statements = statements; + this.WhenTrueLabel = whenTrueLabel; + this.WhenFalseLabel = whenFalseLabel; + Validate(); + } + + [Conditional("DEBUG")] + private partial void Validate(); + + public new TypeSymbol Type => base.Type!; + public ImmutableArray Statements { get; } + public LabelSymbol WhenTrueLabel { get; } + public LabelSymbol WhenFalseLabel { get; } + + [DebuggerStepThrough] + public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLoweredIsPatternExpression(this); + + public BoundLoweredIsPatternExpression Update(ImmutableArray statements, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol type) + { + if (statements != this.Statements || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(whenTrueLabel, this.WhenTrueLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(whenFalseLabel, this.WhenFalseLabel) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) + { + var result = new BoundLoweredIsPatternExpression(this.Syntax, statements, whenTrueLabel, whenFalseLabel, type, this.HasErrors); + result.CopyAttributes(this); + return result; + } + return this; + } + } + internal abstract partial class BoundPattern : BoundNode { protected BoundPattern(BoundKind kind, SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors) @@ -9208,6 +9251,8 @@ internal R VisitInternal(BoundNode node, A arg) return VisitStringInsert((BoundStringInsert)node, arg); case BoundKind.IsPatternExpression: return VisitIsPatternExpression((BoundIsPatternExpression)node, arg); + case BoundKind.LoweredIsPatternExpression: + return VisitLoweredIsPatternExpression((BoundLoweredIsPatternExpression)node, arg); case BoundKind.ConstantPattern: return VisitConstantPattern((BoundConstantPattern)node, arg); case BoundKind.DiscardPattern: @@ -9470,6 +9515,7 @@ internal abstract partial class BoundTreeVisitor public virtual R VisitInterpolatedStringArgumentPlaceholder(BoundInterpolatedStringArgumentPlaceholder node, A arg) => this.DefaultVisit(node, arg); public virtual R VisitStringInsert(BoundStringInsert node, A arg) => this.DefaultVisit(node, arg); public virtual R VisitIsPatternExpression(BoundIsPatternExpression node, A arg) => this.DefaultVisit(node, arg); + public virtual R VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node, A arg) => this.DefaultVisit(node, arg); public virtual R VisitConstantPattern(BoundConstantPattern node, A arg) => this.DefaultVisit(node, arg); public virtual R VisitDiscardPattern(BoundDiscardPattern node, A arg) => this.DefaultVisit(node, arg); public virtual R VisitDeclarationPattern(BoundDeclarationPattern node, A arg) => this.DefaultVisit(node, arg); @@ -9705,6 +9751,7 @@ internal abstract partial class BoundTreeVisitor public virtual BoundNode? VisitInterpolatedStringArgumentPlaceholder(BoundInterpolatedStringArgumentPlaceholder node) => this.DefaultVisit(node); public virtual BoundNode? VisitStringInsert(BoundStringInsert node) => this.DefaultVisit(node); public virtual BoundNode? VisitIsPatternExpression(BoundIsPatternExpression node) => this.DefaultVisit(node); + public virtual BoundNode? VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node) => this.DefaultVisit(node); public virtual BoundNode? VisitConstantPattern(BoundConstantPattern node) => this.DefaultVisit(node); public virtual BoundNode? VisitDiscardPattern(BoundDiscardPattern node) => this.DefaultVisit(node); public virtual BoundNode? VisitDeclarationPattern(BoundDeclarationPattern node) => this.DefaultVisit(node); @@ -10632,6 +10679,11 @@ internal abstract partial class BoundTreeWalker : BoundTreeVisitor this.Visit(node.Pattern); return null; } + public override BoundNode? VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node) + { + this.VisitList(node.Statements); + return null; + } public override BoundNode? VisitConstantPattern(BoundConstantPattern node) { this.Visit(node.Value); @@ -11998,6 +12050,12 @@ internal abstract partial class BoundTreeRewriter : BoundTreeVisitor TypeSymbol? type = this.VisitType(node.Type); return node.Update(expression, pattern, node.IsNegated, reachabilityDecisionDag, node.WhenTrueLabel, node.WhenFalseLabel, type); } + public override BoundNode? VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node) + { + ImmutableArray statements = this.VisitList(node.Statements); + TypeSymbol? type = this.VisitType(node.Type); + return node.Update(statements, node.WhenTrueLabel, node.WhenFalseLabel, type); + } public override BoundNode? VisitConstantPattern(BoundConstantPattern node) { BoundExpression value = (BoundExpression)this.Visit(node.Value); @@ -14628,7 +14686,7 @@ public NullabilityRewriter(ImmutableDictionary statements = this.VisitList(node.Statements); + BoundLoweredIsPatternExpression updatedNode; + + if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) + { + updatedNode = node.Update(statements, node.WhenTrueLabel, node.WhenFalseLabel, infoAndType.Type!); + updatedNode.TopLevelNullability = infoAndType.Info; + } + else + { + updatedNode = node.Update(statements, node.WhenTrueLabel, node.WhenFalseLabel, node.Type); + } + return updatedNode; + } + public override BoundNode? VisitConstantPattern(BoundConstantPattern node) { TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType); @@ -16824,6 +16899,16 @@ private BoundTreeDumperNodeProducer() new TreeDumperNode("hasErrors", node.HasErrors, null) } ); + public override TreeDumperNode VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node, object? arg) => new TreeDumperNode("loweredIsPatternExpression", null, new TreeDumperNode[] + { + new TreeDumperNode("statements", null, from x in node.Statements select Visit(x, null)), + new TreeDumperNode("whenTrueLabel", node.WhenTrueLabel, null), + new TreeDumperNode("whenFalseLabel", node.WhenFalseLabel, null), + new TreeDumperNode("type", node.Type, null), + new TreeDumperNode("isSuppressed", node.IsSuppressed, null), + new TreeDumperNode("hasErrors", node.HasErrors, null) + } + ); public override TreeDumperNode VisitConstantPattern(BoundConstantPattern node, object? arg) => new TreeDumperNode("constantPattern", null, new TreeDumperNode[] { new TreeDumperNode("value", null, new TreeDumperNode[] { Visit(node.Value, null) }), diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IsPatternOperator.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IsPatternOperator.cs index 753a242ab44fc..22976a079b0f9 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IsPatternOperator.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IsPatternOperator.cs @@ -108,29 +108,30 @@ public IsPatternExpressionGeneralLocalRewriter( internal BoundExpression LowerGeneralIsPattern(BoundIsPatternExpression node, BoundDecisionDag decisionDag) { + Debug.Assert(node.Type is { SpecialType: SpecialType.System_Boolean }); + _factory.Syntax = node.Syntax; - var resultBuilder = ArrayBuilder.GetInstance(); var inputExpression = _localRewriter.VisitExpression(node.Expression); - decisionDag = ShareTempsIfPossibleAndEvaluateInput(decisionDag, inputExpression, resultBuilder, out _); + var sideEffectsBuilder = ArrayBuilder.GetInstance(); + + // The optimization of sharing pattern-matching temps with user variables can always apply to + // an is-pattern expression because there is no when clause that could possibly intervene during + // the execution of the pattern-matching automaton and change one of those variables. + decisionDag = ShareTempsAndEvaluateInput(inputExpression, decisionDag, sideEffectsBuilder.Add, out _); // lower the decision dag. ImmutableArray loweredDag = LowerDecisionDagCore(decisionDag); - resultBuilder.Add(_factory.Block(loweredDag)); - Debug.Assert(node.Type is { SpecialType: SpecialType.System_Boolean }); - LocalSymbol resultTemp = _factory.SynthesizedLocal(node.Type, node.Syntax, kind: SynthesizedLocalKind.LoweringTemp); - LabelSymbol afterIsPatternExpression = _factory.GenerateLabel("afterIsPatternExpression"); - LabelSymbol trueLabel = node.WhenTrueLabel; - LabelSymbol falseLabel = node.WhenFalseLabel; - if (_statements.Count != 0) - resultBuilder.Add(_factory.Block(_statements.ToArray())); - resultBuilder.Add(_factory.Label(trueLabel)); - resultBuilder.Add(_factory.Assignment(_factory.Local(resultTemp), _factory.Literal(true))); - resultBuilder.Add(_factory.Goto(afterIsPatternExpression)); - resultBuilder.Add(_factory.Label(falseLabel)); - resultBuilder.Add(_factory.Assignment(_factory.Local(resultTemp), _factory.Literal(false))); - resultBuilder.Add(_factory.Label(afterIsPatternExpression)); - _localRewriter._needsSpilling = true; - return _factory.SpillSequence(_tempAllocator.AllTemps().Add(resultTemp), resultBuilder.ToImmutableAndFree(), _factory.Local(resultTemp)); + + return _factory.Sequence( + _tempAllocator.AllTemps(), + sideEffectsBuilder.ToImmutableAndFree(), + new BoundLoweredIsPatternExpression( + node.Syntax, + // Note: it is not expected for this node to trigger spilling + loweredDag.AddRange(_statements), + node.WhenTrueLabel, + node.WhenFalseLabel, + node.Type)); } } diff --git a/src/Compilers/CSharp/Portable/Lowering/SpillSequenceSpiller.cs b/src/Compilers/CSharp/Portable/Lowering/SpillSequenceSpiller.cs index 5f5eae68a4cf5..e7e37a01f8a69 100644 --- a/src/Compilers/CSharp/Portable/Lowering/SpillSequenceSpiller.cs +++ b/src/Compilers/CSharp/Portable/Lowering/SpillSequenceSpiller.cs @@ -737,6 +737,16 @@ public override BoundNode DefaultVisit(BoundNode node) #region Expression Visitors +#if DEBUG + public override BoundNode VisitLoweredIsPatternExpression(BoundLoweredIsPatternExpression node) + { + // Ensure this node won't trigger spilling + var result = base.VisitLoweredIsPatternExpression(node); + Debug.Assert(result == node); + return result; + } +#endif + public override BoundNode VisitAwaitExpression(BoundAwaitExpression node) { // An await expression has already been wrapped in a BoundSpillSequence if not at the top level, so diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs index fa39f561f1e8b..af26ea33be967 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs @@ -6053,5 +6053,47 @@ public async Task M(object o) var comp = CSharpTestBase.CreateCompilation(source); comp.VerifyEmitDiagnostics(); } + + [ConditionalFact(typeof(CoreClrOnly))] + public void IsPatternExpressionInAsyncMethodShouldNotAffectHoistedLocals() + { + var source = """ + using System; + using System.Threading.Tasks; + using System.Collections.Immutable; + + await M(ImmutableArray.Create("", new('a', 10), new('a', 20), new('a', 30))); + Console.WriteLine("done"); + + public partial class Program + { + public static void M1(bool b) + { + Console.WriteLine(b); + } + + public static async Task M(ImmutableArray a) + { + await Task.Yield(); + foreach (var i in a) + { + M1(i.Length is 10 or 20 or 30); + await Task.Delay(1).ConfigureAwait(false); + } + } + } + """; + + // ImmutableArray is only available when we specify a targetFramework + string expectedOutput = """ + False + True + True + True + done + """; + var comp = CompileAndVerify(source, expectedOutput: expectedOutput, options: TestOptions.ReleaseExe, targetFramework: TargetFramework.NetCoreApp); + comp.VerifyDiagnostics(); + } } } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs index 86e1ed704dbc7..a6085f5fdb588 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs @@ -3003,7 +3003,7 @@ public class NotPossibleException : System.Exception { } var compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("ConsoleApp1.TestHelper.IsValueTypeT(ConsoleApp1.Result)", @"{ - // Code size 31 (0x1f) + // Code size 28 (0x1c) .maxstack 2 .locals init (T V_0, //v bool V_1) @@ -3014,15 +3014,13 @@ .locals init (T V_0, //v IL_0008: ldloc.0 IL_0009: box ""T"" IL_000e: ldnull - IL_000f: cgt.un - IL_0011: ldc.i4.0 - IL_0012: ceq - IL_0014: stloc.1 - IL_0015: ldloc.1 - IL_0016: brfalse.s IL_001e - IL_0018: newobj ""ConsoleApp1.NotPossibleException..ctor()"" - IL_001d: throw - IL_001e: ret + IL_000f: ceq + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: brfalse.s IL_001b + IL_0015: newobj ""ConsoleApp1.NotPossibleException..ctor()"" + IL_001a: throw + IL_001b: ret }"); } @@ -5510,23 +5508,19 @@ public static void Main() var compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", """ { - // Code size 26 (0x1a) + // Code size 23 (0x17) .maxstack 1 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: isinst "int" IL_0006: brtrue.s IL_0012 IL_0008: ldarg.0 IL_0009: isinst "long" IL_000e: brtrue.s IL_0012 - IL_0010: br.s IL_0016 + IL_0010: br.s IL_0015 IL_0012: ldc.i4.1 - IL_0013: stloc.0 - IL_0014: br.s IL_0018 - IL_0016: ldc.i4.0 - IL_0017: stloc.0 - IL_0018: ldloc.0 - IL_0019: ret + IL_0013: br.s IL_0016 + IL_0015: ldc.i4.0 + IL_0016: ret } """); compVerifier.VerifyIL("C.M2", """ @@ -5551,22 +5545,18 @@ .maxstack 2 compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", """ { - // Code size 24 (0x18) + // Code size 20 (0x14) .maxstack 1 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: isinst "int" IL_0006: brtrue.s IL_0010 IL_0008: ldarg.0 IL_0009: isinst "long" - IL_000e: brfalse.s IL_0014 + IL_000e: brfalse.s IL_0012 IL_0010: ldc.i4.1 - IL_0011: stloc.0 - IL_0012: br.s IL_0016 - IL_0014: ldc.i4.0 - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: ret + IL_0011: ret + IL_0012: ldc.i4.0 + IL_0013: ret } """); compVerifier.VerifyIL("C.M2", @" @@ -5610,27 +5600,20 @@ public static void Main() var compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", """ { - // Code size 40 (0x28) + // Code size 33 (0x21) .maxstack 1 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: isinst "int" IL_0006: brtrue.s IL_0012 IL_0008: ldarg.0 IL_0009: isinst "long" IL_000e: brtrue.s IL_0012 - IL_0010: br.s IL_0016 - IL_0012: ldc.i4.1 - IL_0013: stloc.0 - IL_0014: br.s IL_0018 - IL_0016: ldc.i4.0 - IL_0017: stloc.0 - IL_0018: ldloc.0 - IL_0019: brtrue.s IL_0022 - IL_001b: ldstr "False" - IL_0020: br.s IL_0027 - IL_0022: ldstr "True" - IL_0027: ret + IL_0010: br.s IL_0014 + IL_0012: br.s IL_001b + IL_0014: ldstr "False" + IL_0019: br.s IL_0020 + IL_001b: ldstr "True" + IL_0020: ret } """); compVerifier.VerifyIL("C.M2", """ @@ -5655,26 +5638,18 @@ .maxstack 1 compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", """ { - // Code size 37 (0x25) + // Code size 28 (0x1c) .maxstack 1 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: isinst "int" - IL_0006: brtrue.s IL_0010 + IL_0006: brtrue.s IL_0016 IL_0008: ldarg.0 IL_0009: isinst "long" - IL_000e: brfalse.s IL_0014 - IL_0010: ldc.i4.1 - IL_0011: stloc.0 - IL_0012: br.s IL_0016 - IL_0014: ldc.i4.0 - IL_0015: stloc.0 - IL_0016: ldloc.0 - IL_0017: brtrue.s IL_001f - IL_0019: ldstr "False" - IL_001e: ret - IL_001f: ldstr "True" - IL_0024: ret + IL_000e: brtrue.s IL_0016 + IL_0010: ldstr "False" + IL_0015: ret + IL_0016: ldstr "True" + IL_001b: ret } """); compVerifier.VerifyIL("C.M2", @" @@ -5718,13 +5693,12 @@ public static void Main() var compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", @" { - // Code size 47 (0x2f) + // Code size 44 (0x2c) .maxstack 2 - .locals init (char V_0, - bool V_1) + .locals init (char V_0) IL_0000: ldarg.0 IL_0001: isinst ""char"" - IL_0006: brfalse.s IL_002b + IL_0006: brfalse.s IL_002a IL_0008: ldarg.0 IL_0009: unbox.any ""char"" IL_000e: stloc.0 @@ -5734,21 +5708,18 @@ .locals init (char V_0, IL_0014: ldloc.0 IL_0015: ldc.i4.s 122 IL_0017: ble.s IL_0027 - IL_0019: br.s IL_002b + IL_0019: br.s IL_002a IL_001b: ldloc.0 IL_001c: ldc.i4.s 65 - IL_001e: blt.s IL_002b + IL_001e: blt.s IL_002a IL_0020: ldloc.0 IL_0021: ldc.i4.s 90 IL_0023: ble.s IL_0027 - IL_0025: br.s IL_002b + IL_0025: br.s IL_002a IL_0027: ldc.i4.1 - IL_0028: stloc.1 - IL_0029: br.s IL_002d - IL_002b: ldc.i4.0 - IL_002c: stloc.1 - IL_002d: ldloc.1 - IL_002e: ret + IL_0028: br.s IL_002b + IL_002a: ldc.i4.0 + IL_002b: ret } "); compVerifier.VerifyIL("C.M2", @" @@ -5791,13 +5762,12 @@ .locals init (char V_0) //c compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", @" { - // Code size 45 (0x2d) + // Code size 41 (0x29) .maxstack 2 - .locals init (char V_0, - bool V_1) + .locals init (char V_0) IL_0000: ldarg.0 IL_0001: isinst ""char"" - IL_0006: brfalse.s IL_0029 + IL_0006: brfalse.s IL_0027 IL_0008: ldarg.0 IL_0009: unbox.any ""char"" IL_000e: stloc.0 @@ -5807,20 +5777,17 @@ .locals init (char V_0, IL_0014: ldloc.0 IL_0015: ldc.i4.s 122 IL_0017: ble.s IL_0025 - IL_0019: br.s IL_0029 + IL_0019: br.s IL_0027 IL_001b: ldloc.0 IL_001c: ldc.i4.s 65 - IL_001e: blt.s IL_0029 + IL_001e: blt.s IL_0027 IL_0020: ldloc.0 IL_0021: ldc.i4.s 90 - IL_0023: bgt.s IL_0029 + IL_0023: bgt.s IL_0027 IL_0025: ldc.i4.1 - IL_0026: stloc.1 - IL_0027: br.s IL_002b - IL_0029: ldc.i4.0 - IL_002a: stloc.1 - IL_002b: ldloc.1 - IL_002c: ret + IL_0026: ret + IL_0027: ldc.i4.0 + IL_0028: ret } "); compVerifier.VerifyIL("C.M2", @" @@ -5882,34 +5849,27 @@ public static void Main() var compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", @" { - // Code size 38 (0x26) + // Code size 31 (0x1f) .maxstack 2 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: ldc.i4.s 97 IL_0003: blt.s IL_000c IL_0005: ldarg.0 IL_0006: ldc.i4.s 122 IL_0008: ble.s IL_0018 - IL_000a: br.s IL_001c + IL_000a: br.s IL_001a IL_000c: ldarg.0 IL_000d: ldc.i4.s 65 - IL_000f: blt.s IL_001c + IL_000f: blt.s IL_001a IL_0011: ldarg.0 IL_0012: ldc.i4.s 90 IL_0014: ble.s IL_0018 - IL_0016: br.s IL_001c - IL_0018: ldc.i4.1 - IL_0019: stloc.0 - IL_001a: br.s IL_001e - IL_001c: ldc.i4.0 - IL_001d: stloc.0 - IL_001e: ldloc.0 - IL_001f: brtrue.s IL_0024 - IL_0021: ldc.i4.0 - IL_0022: br.s IL_0025 - IL_0024: ldc.i4.1 - IL_0025: ret + IL_0016: br.s IL_001a + IL_0018: br.s IL_001d + IL_001a: ldc.i4.0 + IL_001b: br.s IL_001e + IL_001d: ldc.i4.1 + IL_001e: ret } "); compVerifier.VerifyIL("C.M2", @" @@ -5940,31 +5900,27 @@ .maxstack 2 compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", @" { - // Code size 33 (0x21) + // Code size 30 (0x1e) .maxstack 2 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: ldc.i4.s 97 IL_0003: blt.s IL_000c IL_0005: ldarg.0 IL_0006: ldc.i4.s 122 IL_0008: ble.s IL_0016 - IL_000a: br.s IL_001a + IL_000a: br.s IL_0019 IL_000c: ldarg.0 IL_000d: ldc.i4.s 65 - IL_000f: blt.s IL_001a + IL_000f: blt.s IL_0019 IL_0011: ldarg.0 IL_0012: ldc.i4.s 90 - IL_0014: bgt.s IL_001a + IL_0014: bgt.s IL_0019 IL_0016: ldc.i4.1 - IL_0017: stloc.0 - IL_0018: br.s IL_001c + IL_0017: br.s IL_001a + IL_0019: ldc.i4.0 IL_001a: ldc.i4.0 - IL_001b: stloc.0 - IL_001c: ldloc.0 - IL_001d: ldc.i4.0 - IL_001e: cgt.un - IL_0020: ret + IL_001b: cgt.un + IL_001d: ret } "); compVerifier.VerifyIL("C.M2", @" @@ -6026,11 +5982,10 @@ public static void Main() var compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", @" { - // Code size 46 (0x2e) + // Code size 43 (0x2b) .maxstack 2 .locals init (bool V_0, - bool V_1, - int V_2) + int V_1) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.s 97 @@ -6038,31 +5993,28 @@ .locals init (bool V_0, IL_0006: ldarg.0 IL_0007: ldc.i4.s 122 IL_0009: ble.s IL_0019 - IL_000b: br.s IL_001d + IL_000b: br.s IL_001c IL_000d: ldarg.0 IL_000e: ldc.i4.s 65 - IL_0010: blt.s IL_001d + IL_0010: blt.s IL_001c IL_0012: ldarg.0 IL_0013: ldc.i4.s 90 IL_0015: ble.s IL_0019 - IL_0017: br.s IL_001d + IL_0017: br.s IL_001c IL_0019: ldc.i4.1 - IL_001a: stloc.0 - IL_001b: br.s IL_001f - IL_001d: ldc.i4.0 - IL_001e: stloc.0 - IL_001f: ldloc.0 - IL_0020: stloc.1 - IL_0021: ldloc.1 - IL_0022: brfalse.s IL_0028 - IL_0024: ldc.i4.1 - IL_0025: stloc.2 - IL_0026: br.s IL_002c - IL_0028: ldc.i4.0 - IL_0029: stloc.2 - IL_002a: br.s IL_002c - IL_002c: ldloc.2 - IL_002d: ret + IL_001a: br.s IL_001d + IL_001c: ldc.i4.0 + IL_001d: stloc.0 + IL_001e: ldloc.0 + IL_001f: brfalse.s IL_0025 + IL_0021: ldc.i4.1 + IL_0022: stloc.1 + IL_0023: br.s IL_0029 + IL_0025: ldc.i4.0 + IL_0026: stloc.1 + IL_0027: br.s IL_0029 + IL_0029: ldloc.1 + IL_002a: ret } "); compVerifier.VerifyIL("C.M2", @" @@ -6109,33 +6061,25 @@ .locals init (bool V_0, compVerifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); compVerifier.VerifyIL("C.M1", @" { - // Code size 35 (0x23) + // Code size 26 (0x1a) .maxstack 2 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: ldc.i4.s 97 IL_0003: blt.s IL_000c IL_0005: ldarg.0 IL_0006: ldc.i4.s 122 IL_0008: ble.s IL_0016 - IL_000a: br.s IL_001a + IL_000a: br.s IL_0018 IL_000c: ldarg.0 IL_000d: ldc.i4.s 65 - IL_000f: blt.s IL_001a + IL_000f: blt.s IL_0018 IL_0011: ldarg.0 IL_0012: ldc.i4.s 90 - IL_0014: bgt.s IL_001a + IL_0014: bgt.s IL_0018 IL_0016: ldc.i4.1 - IL_0017: stloc.0 - IL_0018: br.s IL_001c - IL_001a: ldc.i4.0 - IL_001b: stloc.0 - IL_001c: ldloc.0 - IL_001d: brfalse.s IL_0021 - IL_001f: ldc.i4.1 - IL_0020: ret - IL_0021: ldc.i4.0 - IL_0022: ret + IL_0017: ret + IL_0018: ldc.i4.0 + IL_0019: ret } "); compVerifier.VerifyIL("C.M2", @" diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs index f3e87f6d8dee1..c038526b59fb5 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs @@ -7125,7 +7125,7 @@ .maxstack 2 IL_0760: ret }"; compVerifier.VerifyIL("ConsoleApplication24.Program.IsWarning", codeForSwitchStatement); - compVerifier.VerifyIL("ConsoleApplication24.Program.IsWarning_IsExpression", codeForExpression); + compVerifier.VerifyIL("ConsoleApplication24.Program.IsWarning_IsExpression", codeForSwitchStatement); compVerifier.VerifyIL("ConsoleApplication24.Program.IsWarning_SwitchExpression", codeForExpression); } diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests.cs index ac537827d6664..8102fe7157794 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests.cs @@ -8354,64 +8354,63 @@ static void Test(ReadOnlySpan chars) not: True") .VerifyIL("C.Test", """ { - // Code size 167 (0xa7) + // Code size 166 (0xa6) .maxstack 3 .locals init (bool V_0) IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldstr "string 1" - IL_0007: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_000c: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" - IL_0011: brtrue.s IL_0027 - IL_0013: ldarg.0 - IL_0014: ldstr "string 2" - IL_0019: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_001e: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" - IL_0023: brtrue.s IL_0027 - IL_0025: br.s IL_002b - IL_0027: ldc.i4.1 - IL_0028: stloc.0 - IL_0029: br.s IL_002d - IL_002b: ldc.i4.0 - IL_002c: stloc.0 - IL_002d: ldstr "or: " - IL_0032: ldloca.s V_0 - IL_0034: call "string bool.ToString()" - IL_0039: call "string string.Concat(string, string)" - IL_003e: call "void System.Console.WriteLine(string)" - IL_0043: nop - IL_0044: ldstr "and: " - IL_0049: ldarg.0 - IL_004a: ldstr "string 1" - IL_004f: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_0054: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" - IL_0059: brfalse.s IL_0067 - IL_005b: ldarga.s V_0 - IL_005d: call "int System.ReadOnlySpan.Length.get" - IL_0062: ldc.i4.7 - IL_0063: ceq - IL_0065: br.s IL_0068 - IL_0067: ldc.i4.0 - IL_0068: stloc.0 - IL_0069: ldloca.s V_0 - IL_006b: call "string bool.ToString()" - IL_0070: call "string string.Concat(string, string)" - IL_0075: call "void System.Console.WriteLine(string)" - IL_007a: nop - IL_007b: ldstr "not: " - IL_0080: ldarg.0 - IL_0081: ldstr "string 1" - IL_0086: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_008b: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" - IL_0090: ldc.i4.0 - IL_0091: ceq - IL_0093: stloc.0 - IL_0094: ldloca.s V_0 - IL_0096: call "string bool.ToString()" - IL_009b: call "string string.Concat(string, string)" - IL_00a0: call "void System.Console.WriteLine(string)" - IL_00a5: nop - IL_00a6: ret + IL_0001: ldstr "or: " + IL_0006: ldarg.0 + IL_0007: ldstr "string 1" + IL_000c: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_0011: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" + IL_0016: brtrue.s IL_002c + IL_0018: ldarg.0 + IL_0019: ldstr "string 2" + IL_001e: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_0023: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" + IL_0028: brtrue.s IL_002c + IL_002a: br.s IL_002f + IL_002c: ldc.i4.1 + IL_002d: br.s IL_0030 + IL_002f: ldc.i4.0 + IL_0030: stloc.0 + IL_0031: ldloca.s V_0 + IL_0033: call "string bool.ToString()" + IL_0038: call "string string.Concat(string, string)" + IL_003d: call "void System.Console.WriteLine(string)" + IL_0042: nop + IL_0043: ldstr "and: " + IL_0048: ldarg.0 + IL_0049: ldstr "string 1" + IL_004e: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_0053: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" + IL_0058: brfalse.s IL_0066 + IL_005a: ldarga.s V_0 + IL_005c: call "int System.ReadOnlySpan.Length.get" + IL_0061: ldc.i4.7 + IL_0062: ceq + IL_0064: br.s IL_0067 + IL_0066: ldc.i4.0 + IL_0067: stloc.0 + IL_0068: ldloca.s V_0 + IL_006a: call "string bool.ToString()" + IL_006f: call "string string.Concat(string, string)" + IL_0074: call "void System.Console.WriteLine(string)" + IL_0079: nop + IL_007a: ldstr "not: " + IL_007f: ldarg.0 + IL_0080: ldstr "string 1" + IL_0085: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_008a: call "bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)" + IL_008f: ldc.i4.0 + IL_0090: ceq + IL_0092: stloc.0 + IL_0093: ldloca.s V_0 + IL_0095: call "string bool.ToString()" + IL_009a: call "string string.Concat(string, string)" + IL_009f: call "void System.Console.WriteLine(string)" + IL_00a4: nop + IL_00a5: ret } """); } @@ -8920,14 +8919,14 @@ .locals init (bool V_0) IL_0066: call ""string bool.ToString()"" IL_006b: call ""string string.Concat(string, string)"" IL_0070: call ""void System.Console.WriteLine(string)"" - IL_0075: ldarg.0 - IL_0076: ldstr """" - IL_007b: call ""System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)"" - IL_0080: call ""bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)"" - IL_0085: pop - IL_0086: ldc.i4.1 - IL_0087: stloc.0 - IL_0088: ldstr ""4."" + IL_0075: ldstr ""4."" + IL_007a: ldarg.0 + IL_007b: ldstr """" + IL_0080: call ""System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)"" + IL_0085: call ""bool System.MemoryExtensions.SequenceEqual(System.ReadOnlySpan, System.ReadOnlySpan)"" + IL_008a: pop + IL_008b: ldc.i4.1 + IL_008c: stloc.0 IL_008d: ldloca.s V_0 IL_008f: call ""string bool.ToString()"" IL_0094: call ""string string.Concat(string, string)"" @@ -9952,64 +9951,63 @@ static void Test(Span chars) not: True") .VerifyIL("C.Test", """ { - // Code size 167 (0xa7) + // Code size 166 (0xa6) .maxstack 3 .locals init (bool V_0) IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldstr "string 1" - IL_0007: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_000c: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" - IL_0011: brtrue.s IL_0027 - IL_0013: ldarg.0 - IL_0014: ldstr "string 2" - IL_0019: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_001e: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" - IL_0023: brtrue.s IL_0027 - IL_0025: br.s IL_002b - IL_0027: ldc.i4.1 - IL_0028: stloc.0 - IL_0029: br.s IL_002d - IL_002b: ldc.i4.0 - IL_002c: stloc.0 - IL_002d: ldstr "or: " - IL_0032: ldloca.s V_0 - IL_0034: call "string bool.ToString()" - IL_0039: call "string string.Concat(string, string)" - IL_003e: call "void System.Console.WriteLine(string)" - IL_0043: nop - IL_0044: ldstr "and: " - IL_0049: ldarg.0 - IL_004a: ldstr "string 1" - IL_004f: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_0054: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" - IL_0059: brfalse.s IL_0067 - IL_005b: ldarga.s V_0 - IL_005d: call "int System.Span.Length.get" - IL_0062: ldc.i4.7 - IL_0063: ceq - IL_0065: br.s IL_0068 - IL_0067: ldc.i4.0 - IL_0068: stloc.0 - IL_0069: ldloca.s V_0 - IL_006b: call "string bool.ToString()" - IL_0070: call "string string.Concat(string, string)" - IL_0075: call "void System.Console.WriteLine(string)" - IL_007a: nop - IL_007b: ldstr "not: " - IL_0080: ldarg.0 - IL_0081: ldstr "string 1" - IL_0086: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" - IL_008b: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" - IL_0090: ldc.i4.0 - IL_0091: ceq - IL_0093: stloc.0 - IL_0094: ldloca.s V_0 - IL_0096: call "string bool.ToString()" - IL_009b: call "string string.Concat(string, string)" - IL_00a0: call "void System.Console.WriteLine(string)" - IL_00a5: nop - IL_00a6: ret + IL_0001: ldstr "or: " + IL_0006: ldarg.0 + IL_0007: ldstr "string 1" + IL_000c: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_0011: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" + IL_0016: brtrue.s IL_002c + IL_0018: ldarg.0 + IL_0019: ldstr "string 2" + IL_001e: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_0023: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" + IL_0028: brtrue.s IL_002c + IL_002a: br.s IL_002f + IL_002c: ldc.i4.1 + IL_002d: br.s IL_0030 + IL_002f: ldc.i4.0 + IL_0030: stloc.0 + IL_0031: ldloca.s V_0 + IL_0033: call "string bool.ToString()" + IL_0038: call "string string.Concat(string, string)" + IL_003d: call "void System.Console.WriteLine(string)" + IL_0042: nop + IL_0043: ldstr "and: " + IL_0048: ldarg.0 + IL_0049: ldstr "string 1" + IL_004e: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_0053: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" + IL_0058: brfalse.s IL_0066 + IL_005a: ldarga.s V_0 + IL_005c: call "int System.Span.Length.get" + IL_0061: ldc.i4.7 + IL_0062: ceq + IL_0064: br.s IL_0067 + IL_0066: ldc.i4.0 + IL_0067: stloc.0 + IL_0068: ldloca.s V_0 + IL_006a: call "string bool.ToString()" + IL_006f: call "string string.Concat(string, string)" + IL_0074: call "void System.Console.WriteLine(string)" + IL_0079: nop + IL_007a: ldstr "not: " + IL_007f: ldarg.0 + IL_0080: ldstr "string 1" + IL_0085: call "System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)" + IL_008a: call "bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)" + IL_008f: ldc.i4.0 + IL_0090: ceq + IL_0092: stloc.0 + IL_0093: ldloca.s V_0 + IL_0095: call "string bool.ToString()" + IL_009a: call "string string.Concat(string, string)" + IL_009f: call "void System.Console.WriteLine(string)" + IL_00a4: nop + IL_00a5: ret } """); } @@ -10523,14 +10521,14 @@ .locals init (bool V_0) IL_0066: call ""string bool.ToString()"" IL_006b: call ""string string.Concat(string, string)"" IL_0070: call ""void System.Console.WriteLine(string)"" - IL_0075: ldarg.0 - IL_0076: ldstr """" - IL_007b: call ""System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)"" - IL_0080: call ""bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)"" - IL_0085: pop - IL_0086: ldc.i4.1 - IL_0087: stloc.0 - IL_0088: ldstr ""4."" + IL_0075: ldstr ""4."" + IL_007a: ldarg.0 + IL_007b: ldstr """" + IL_0080: call ""System.ReadOnlySpan System.MemoryExtensions.AsSpan(string)"" + IL_0085: call ""bool System.MemoryExtensions.SequenceEqual(System.Span, System.ReadOnlySpan)"" + IL_008a: pop + IL_008b: ldc.i4.1 + IL_008c: stloc.0 IL_008d: ldloca.s V_0 IL_008f: call ""string bool.ToString()"" IL_0094: call ""string string.Concat(string, string)"" @@ -11591,16 +11589,16 @@ public static async Task ExceptionFilterBroken() // in the exception filter (at IL_00b6) before accessing `.InnerException` on it. verifier.VerifyIL("C.d__1.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @" { - // Code size 471 (0x1d7) + // Code size 460 (0x1cc) .maxstack 3 .locals init (int V_0, bool V_1, - System.Exception V_2, - string V_3, - bool V_4, - System.Runtime.CompilerServices.TaskAwaiter V_5, - C.d__1 V_6, - System.Exception V_7, + System.Runtime.CompilerServices.TaskAwaiter V_2, + C.d__1 V_3, + System.Exception V_4, + bool V_5, + System.Exception V_6, + string V_7, int V_8, System.Runtime.CompilerServices.TaskAwaiter V_9) IL_0000: ldarg.0 @@ -11616,7 +11614,7 @@ .locals init (int V_0, IL_000e: beq.s IL_0014 IL_0010: br.s IL_0019 IL_0012: br.s IL_0021 - IL_0014: br IL_0166 + IL_0014: br IL_0159 IL_0019: nop IL_001a: ldarg.0 IL_001b: ldc.i4.0 @@ -11627,193 +11625,188 @@ .locals init (int V_0, IL_0022: ldloc.0 IL_0023: brfalse.s IL_0027 IL_0025: br.s IL_0029 - IL_0027: br.s IL_0068 + IL_0027: br.s IL_0065 IL_0029: nop IL_002a: call ""System.Threading.Tasks.Task C.ThrowException()"" IL_002f: callvirt ""System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task.GetAwaiter()"" - IL_0034: stloc.s V_5 - IL_0036: ldloca.s V_5 - IL_0038: call ""bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get"" - IL_003d: brtrue.s IL_0085 - IL_003f: ldarg.0 - IL_0040: ldc.i4.0 - IL_0041: dup - IL_0042: stloc.0 - IL_0043: stfld ""int C.d__1.<>1__state"" - IL_0048: ldarg.0 - IL_0049: ldloc.s V_5 - IL_004b: stfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" + IL_0034: stloc.2 + IL_0035: ldloca.s V_2 + IL_0037: call ""bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get"" + IL_003c: brtrue.s IL_0081 + IL_003e: ldarg.0 + IL_003f: ldc.i4.0 + IL_0040: dup + IL_0041: stloc.0 + IL_0042: stfld ""int C.d__1.<>1__state"" + IL_0047: ldarg.0 + IL_0048: ldloc.2 + IL_0049: stfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" + IL_004e: ldarg.0 + IL_004f: stloc.3 IL_0050: ldarg.0 - IL_0051: stloc.s V_6 - IL_0053: ldarg.0 - IL_0054: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_0059: ldloca.s V_5 - IL_005b: ldloca.s V_6 - IL_005d: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompletedd__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" - IL_0062: nop - IL_0063: leave IL_01d6 - IL_0068: ldarg.0 - IL_0069: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" - IL_006e: stloc.s V_5 - IL_0070: ldarg.0 - IL_0071: ldflda ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" - IL_0076: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_007c: ldarg.0 - IL_007d: ldc.i4.m1 - IL_007e: dup - IL_007f: stloc.0 - IL_0080: stfld ""int C.d__1.<>1__state"" - IL_0085: ldloca.s V_5 - IL_0087: call ""void System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" - IL_008c: nop - IL_008d: ldc.i4.1 - IL_008e: stloc.1 - IL_008f: leave IL_01c1 + IL_0051: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_0056: ldloca.s V_2 + IL_0058: ldloca.s V_3 + IL_005a: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompletedd__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" + IL_005f: nop + IL_0060: leave IL_01cb + IL_0065: ldarg.0 + IL_0066: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" + IL_006b: stloc.2 + IL_006c: ldarg.0 + IL_006d: ldflda ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" + IL_0072: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_0078: ldarg.0 + IL_0079: ldc.i4.m1 + IL_007a: dup + IL_007b: stloc.0 + IL_007c: stfld ""int C.d__1.<>1__state"" + IL_0081: ldloca.s V_2 + IL_0083: call ""void System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" + IL_0088: nop + IL_0089: ldc.i4.1 + IL_008a: stloc.1 + IL_008b: leave IL_01b6 } filter { - IL_0094: isinst ""System.Exception"" - IL_0099: dup - IL_009a: brtrue.s IL_00a0 - IL_009c: pop - IL_009d: ldc.i4.0 - IL_009e: br.s IL_0106 - IL_00a0: stloc.s V_7 - IL_00a2: ldarg.0 - IL_00a3: ldloc.s V_7 - IL_00a5: stfld ""object C.d__1.<>s__1"" - IL_00aa: ldarg.0 - IL_00ab: ldarg.0 - IL_00ac: ldfld ""object C.d__1.<>s__1"" - IL_00b1: castclass ""System.Exception"" - IL_00b6: stfld ""System.Exception C.d__1.5__3"" - IL_00bb: ldarg.0 - IL_00bc: ldfld ""System.Exception C.d__1.5__3"" - IL_00c1: callvirt ""System.Exception System.Exception.InnerException.get"" - IL_00c6: stloc.2 - IL_00c7: ldloc.2 - IL_00c8: brfalse.s IL_00f2 - IL_00ca: ldloc.2 - IL_00cb: callvirt ""string System.Exception.Message.get"" - IL_00d0: stloc.3 - IL_00d1: ldloc.3 - IL_00d2: ldstr ""bad dog"" - IL_00d7: call ""bool string.op_Equality(string, string)"" - IL_00dc: brtrue.s IL_00ed - IL_00de: ldloc.3 - IL_00df: ldstr ""dog bad"" - IL_00e4: call ""bool string.op_Equality(string, string)"" - IL_00e9: brtrue.s IL_00ed - IL_00eb: br.s IL_00f2 - IL_00ed: ldc.i4.1 - IL_00ee: stloc.s V_4 - IL_00f0: br.s IL_00f5 + IL_0090: isinst ""System.Exception"" + IL_0095: dup + IL_0096: brtrue.s IL_009c + IL_0098: pop + IL_0099: ldc.i4.0 + IL_009a: br.s IL_00fa + IL_009c: stloc.s V_4 + IL_009e: ldarg.0 + IL_009f: ldloc.s V_4 + IL_00a1: stfld ""object C.d__1.<>s__1"" + IL_00a6: ldarg.0 + IL_00a7: ldarg.0 + IL_00a8: ldfld ""object C.d__1.<>s__1"" + IL_00ad: castclass ""System.Exception"" + IL_00b2: stfld ""System.Exception C.d__1.5__3"" + IL_00b7: ldarg.0 + IL_00b8: ldfld ""System.Exception C.d__1.5__3"" + IL_00bd: callvirt ""System.Exception System.Exception.InnerException.get"" + IL_00c2: stloc.s V_6 + IL_00c4: ldloc.s V_6 + IL_00c6: brfalse.s IL_00f2 + IL_00c8: ldloc.s V_6 + IL_00ca: callvirt ""string System.Exception.Message.get"" + IL_00cf: stloc.s V_7 + IL_00d1: ldloc.s V_7 + IL_00d3: ldstr ""bad dog"" + IL_00d8: call ""bool string.op_Equality(string, string)"" + IL_00dd: brtrue.s IL_00ef + IL_00df: ldloc.s V_7 + IL_00e1: ldstr ""dog bad"" + IL_00e6: call ""bool string.op_Equality(string, string)"" + IL_00eb: brtrue.s IL_00ef + IL_00ed: br.s IL_00f2 + IL_00ef: ldc.i4.1 + IL_00f0: br.s IL_00f3 IL_00f2: ldc.i4.0 - IL_00f3: stloc.s V_4 - IL_00f5: ldarg.0 - IL_00f6: ldloc.s V_4 - IL_00f8: stfld ""bool C.d__1.<>s__4"" - IL_00fd: ldarg.0 - IL_00fe: ldfld ""bool C.d__1.<>s__4"" - IL_0103: ldc.i4.0 - IL_0104: cgt.un - IL_0106: endfilter + IL_00f3: stloc.s V_5 + IL_00f5: ldloc.s V_5 + IL_00f7: ldc.i4.0 + IL_00f8: cgt.un + IL_00fa: endfilter } // end filter { // handler - IL_0108: pop - IL_0109: ldarg.0 - IL_010a: ldc.i4.1 - IL_010b: stfld ""int C.d__1.<>s__2"" - IL_0110: leave.s IL_011b + IL_00fc: pop + IL_00fd: ldarg.0 + IL_00fe: ldc.i4.1 + IL_00ff: stfld ""int C.d__1.<>s__2"" + IL_0104: leave.s IL_010f } catch object { - IL_0112: pop - IL_0113: nop - IL_0114: ldc.i4.0 - IL_0115: stloc.1 - IL_0116: leave IL_01c1 - } - IL_011b: ldarg.0 - IL_011c: ldfld ""int C.d__1.<>s__2"" - IL_0121: stloc.s V_8 - IL_0123: ldloc.s V_8 - IL_0125: ldc.i4.1 - IL_0126: beq.s IL_012a - IL_0128: br.s IL_0199 - IL_012a: nop - IL_012b: call ""System.Threading.Tasks.Task C.TrueAsync()"" - IL_0130: callvirt ""System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task.GetAwaiter()"" - IL_0135: stloc.s V_9 - IL_0137: ldloca.s V_9 - IL_0139: call ""bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get"" - IL_013e: brtrue.s IL_0183 - IL_0140: ldarg.0 - IL_0141: ldc.i4.1 - IL_0142: dup - IL_0143: stloc.0 - IL_0144: stfld ""int C.d__1.<>1__state"" - IL_0149: ldarg.0 - IL_014a: ldloc.s V_9 - IL_014c: stfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" - IL_0151: ldarg.0 - IL_0152: stloc.s V_6 - IL_0154: ldarg.0 - IL_0155: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_015a: ldloca.s V_9 - IL_015c: ldloca.s V_6 - IL_015e: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompleted, C.d__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" - IL_0163: nop - IL_0164: leave.s IL_01d6 - IL_0166: ldarg.0 - IL_0167: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" - IL_016c: stloc.s V_9 - IL_016e: ldarg.0 - IL_016f: ldflda ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" - IL_0174: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_017a: ldarg.0 - IL_017b: ldc.i4.m1 - IL_017c: dup - IL_017d: stloc.0 - IL_017e: stfld ""int C.d__1.<>1__state"" + IL_0106: pop + IL_0107: nop + IL_0108: ldc.i4.0 + IL_0109: stloc.1 + IL_010a: leave IL_01b6 + } + IL_010f: ldarg.0 + IL_0110: ldfld ""int C.d__1.<>s__2"" + IL_0115: stloc.s V_8 + IL_0117: ldloc.s V_8 + IL_0119: ldc.i4.1 + IL_011a: beq.s IL_011e + IL_011c: br.s IL_018c + IL_011e: nop + IL_011f: call ""System.Threading.Tasks.Task C.TrueAsync()"" + IL_0124: callvirt ""System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task.GetAwaiter()"" + IL_0129: stloc.s V_9 + IL_012b: ldloca.s V_9 + IL_012d: call ""bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get"" + IL_0132: brtrue.s IL_0176 + IL_0134: ldarg.0 + IL_0135: ldc.i4.1 + IL_0136: dup + IL_0137: stloc.0 + IL_0138: stfld ""int C.d__1.<>1__state"" + IL_013d: ldarg.0 + IL_013e: ldloc.s V_9 + IL_0140: stfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" + IL_0145: ldarg.0 + IL_0146: stloc.3 + IL_0147: ldarg.0 + IL_0148: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_014d: ldloca.s V_9 + IL_014f: ldloca.s V_3 + IL_0151: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompleted, C.d__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" + IL_0156: nop + IL_0157: leave.s IL_01cb + IL_0159: ldarg.0 + IL_015a: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" + IL_015f: stloc.s V_9 + IL_0161: ldarg.0 + IL_0162: ldflda ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" + IL_0167: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_016d: ldarg.0 + IL_016e: ldc.i4.m1 + IL_016f: dup + IL_0170: stloc.0 + IL_0171: stfld ""int C.d__1.<>1__state"" + IL_0176: ldarg.0 + IL_0177: ldloca.s V_9 + IL_0179: call ""bool System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" + IL_017e: stfld ""bool C.d__1.<>s__4"" IL_0183: ldarg.0 - IL_0184: ldloca.s V_9 - IL_0186: call ""bool System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" - IL_018b: stfld ""bool C.d__1.<>s__5"" - IL_0190: ldarg.0 - IL_0191: ldfld ""bool C.d__1.<>s__5"" - IL_0196: stloc.1 - IL_0197: leave.s IL_01c1 - IL_0199: ldarg.0 - IL_019a: ldnull - IL_019b: stfld ""object C.d__1.<>s__1"" - IL_01a0: ldarg.0 - IL_01a1: ldnull - IL_01a2: stfld ""System.Exception C.d__1.5__3"" - IL_01a7: leave.s IL_01c1 + IL_0184: ldfld ""bool C.d__1.<>s__4"" + IL_0189: stloc.1 + IL_018a: leave.s IL_01b6 + IL_018c: ldarg.0 + IL_018d: ldnull + IL_018e: stfld ""object C.d__1.<>s__1"" + IL_0193: ldarg.0 + IL_0194: ldnull + IL_0195: stfld ""System.Exception C.d__1.5__3"" + IL_019a: leave.s IL_01b6 } catch System.Exception { - IL_01a9: stloc.2 - IL_01aa: ldarg.0 - IL_01ab: ldc.i4.s -2 - IL_01ad: stfld ""int C.d__1.<>1__state"" - IL_01b2: ldarg.0 - IL_01b3: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_01b8: ldloc.2 - IL_01b9: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)"" - IL_01be: nop - IL_01bf: leave.s IL_01d6 + IL_019c: stloc.s V_6 + IL_019e: ldarg.0 + IL_019f: ldc.i4.s -2 + IL_01a1: stfld ""int C.d__1.<>1__state"" + IL_01a6: ldarg.0 + IL_01a7: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_01ac: ldloc.s V_6 + IL_01ae: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)"" + IL_01b3: nop + IL_01b4: leave.s IL_01cb } - IL_01c1: ldarg.0 - IL_01c2: ldc.i4.s -2 - IL_01c4: stfld ""int C.d__1.<>1__state"" - IL_01c9: ldarg.0 - IL_01ca: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_01cf: ldloc.1 - IL_01d0: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult(bool)"" - IL_01d5: nop - IL_01d6: ret + IL_01b6: ldarg.0 + IL_01b7: ldc.i4.s -2 + IL_01b9: stfld ""int C.d__1.<>1__state"" + IL_01be: ldarg.0 + IL_01bf: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_01c4: ldloc.1 + IL_01c5: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult(bool)"" + IL_01ca: nop + IL_01cb: ret } "); } @@ -11940,8 +11933,8 @@ public static async Task ExceptionFilterBroken() comp.VerifyDiagnostics(); var verifier = CompileAndVerify(comp, expectedOutput: "True"); verifier.VerifyIL("C.d__1.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", @" - { - // Code size 527 (0x20f) +{ + // Code size 513 (0x201) .maxstack 3 .locals init (int V_0, bool V_1, @@ -11950,9 +11943,9 @@ .locals init (int V_0, System.Exception V_4, int V_5, System.Exception V_6, - string V_7, - bool V_8, - System.Exception V_9, + bool V_7, + System.Exception V_8, + string V_9, System.Runtime.CompilerServices.TaskAwaiter V_10) IL_0000: ldarg.0 IL_0001: ldfld ""int C.d__1.<>1__state"" @@ -11967,7 +11960,7 @@ .locals init (int V_0, IL_000e: beq.s IL_0014 IL_0010: br.s IL_0019 IL_0012: br.s IL_0021 - IL_0014: br IL_0192 + IL_0014: br IL_0184 IL_0019: nop IL_001a: ldarg.0 IL_001b: ldc.i4.0 @@ -12002,7 +11995,7 @@ .locals init (int V_0, IL_0058: ldloca.s V_3 IL_005a: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompletedd__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" IL_005f: nop - IL_0060: leave IL_020e + IL_0060: leave IL_0200 IL_0065: ldarg.0 IL_0066: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__1"" IL_006b: stloc.2 @@ -12019,7 +12012,7 @@ .locals init (int V_0, IL_0088: nop IL_0089: ldc.i4.1 IL_008a: stloc.1 - IL_008b: leave IL_01f9 + IL_008b: leave IL_01eb } catch System.Exception { @@ -12038,7 +12031,7 @@ .locals init (int V_0, IL_00ab: ldloc.s V_5 IL_00ad: ldc.i4.1 IL_00ae: beq.s IL_00b5 - IL_00b0: br IL_01d6 + IL_00b0: br IL_01c8 IL_00b5: ldarg.0 IL_00b6: ldarg.0 IL_00b7: ldfld ""object C.d__1.<>s__1"" @@ -12061,135 +12054,130 @@ .locals init (int V_0, IL_00db: brtrue.s IL_00e1 IL_00dd: pop IL_00de: ldc.i4.0 - IL_00df: br.s IL_013c - IL_00e1: stloc.s V_9 + IL_00df: br.s IL_012e + IL_00e1: stloc.s V_6 IL_00e3: ldarg.0 - IL_00e4: ldloc.s V_9 + IL_00e4: ldloc.s V_6 IL_00e6: stfld ""object C.d__1.<>s__4"" IL_00eb: ldarg.0 IL_00ec: ldfld ""System.Exception C.d__1.5__3"" IL_00f1: callvirt ""System.Exception System.Exception.InnerException.get"" - IL_00f6: stloc.s V_6 - IL_00f8: ldloc.s V_6 - IL_00fa: brfalse.s IL_0128 - IL_00fc: ldloc.s V_6 + IL_00f6: stloc.s V_8 + IL_00f8: ldloc.s V_8 + IL_00fa: brfalse.s IL_0126 + IL_00fc: ldloc.s V_8 IL_00fe: callvirt ""string System.Exception.Message.get"" - IL_0103: stloc.s V_7 - IL_0105: ldloc.s V_7 + IL_0103: stloc.s V_9 + IL_0105: ldloc.s V_9 IL_0107: ldstr ""bad dog"" IL_010c: call ""bool string.op_Equality(string, string)"" IL_0111: brtrue.s IL_0123 - IL_0113: ldloc.s V_7 + IL_0113: ldloc.s V_9 IL_0115: ldstr ""dog bad"" IL_011a: call ""bool string.op_Equality(string, string)"" IL_011f: brtrue.s IL_0123 - IL_0121: br.s IL_0128 + IL_0121: br.s IL_0126 IL_0123: ldc.i4.1 - IL_0124: stloc.s V_8 - IL_0126: br.s IL_012b - IL_0128: ldc.i4.0 - IL_0129: stloc.s V_8 - IL_012b: ldarg.0 - IL_012c: ldloc.s V_8 - IL_012e: stfld ""bool C.d__1.<>s__6"" - IL_0133: ldarg.0 - IL_0134: ldfld ""bool C.d__1.<>s__6"" - IL_0139: ldc.i4.0 - IL_013a: cgt.un - IL_013c: endfilter + IL_0124: br.s IL_0127 + IL_0126: ldc.i4.0 + IL_0127: stloc.s V_7 + IL_0129: ldloc.s V_7 + IL_012b: ldc.i4.0 + IL_012c: cgt.un + IL_012e: endfilter } // end filter { // handler - IL_013e: pop - IL_013f: ldarg.0 - IL_0140: ldc.i4.1 - IL_0141: stfld ""int C.d__1.<>s__5"" - IL_0146: leave.s IL_0148 - } - IL_0148: ldarg.0 - IL_0149: ldfld ""int C.d__1.<>s__5"" - IL_014e: stloc.s V_5 - IL_0150: ldloc.s V_5 - IL_0152: ldc.i4.1 - IL_0153: beq.s IL_0157 - IL_0155: br.s IL_01c5 - IL_0157: nop - IL_0158: call ""System.Threading.Tasks.Task C.TrueAsync()"" - IL_015d: callvirt ""System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task.GetAwaiter()"" - IL_0162: stloc.s V_10 - IL_0164: ldloca.s V_10 - IL_0166: call ""bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get"" - IL_016b: brtrue.s IL_01af - IL_016d: ldarg.0 - IL_016e: ldc.i4.1 - IL_016f: dup - IL_0170: stloc.0 - IL_0171: stfld ""int C.d__1.<>1__state"" - IL_0176: ldarg.0 - IL_0177: ldloc.s V_10 - IL_0179: stfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" - IL_017e: ldarg.0 - IL_017f: stloc.3 - IL_0180: ldarg.0 - IL_0181: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_0186: ldloca.s V_10 - IL_0188: ldloca.s V_3 - IL_018a: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompleted, C.d__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" - IL_018f: nop - IL_0190: leave.s IL_020e - IL_0192: ldarg.0 - IL_0193: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" - IL_0198: stloc.s V_10 - IL_019a: ldarg.0 - IL_019b: ldflda ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" - IL_01a0: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_01a6: ldarg.0 - IL_01a7: ldc.i4.m1 - IL_01a8: dup - IL_01a9: stloc.0 - IL_01aa: stfld ""int C.d__1.<>1__state"" - IL_01af: ldarg.0 - IL_01b0: ldloca.s V_10 - IL_01b2: call ""bool System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" - IL_01b7: stfld ""bool C.d__1.<>s__7"" - IL_01bc: ldarg.0 - IL_01bd: ldfld ""bool C.d__1.<>s__7"" - IL_01c2: stloc.1 - IL_01c3: leave.s IL_01f9 - IL_01c5: ldarg.0 - IL_01c6: ldnull - IL_01c7: stfld ""object C.d__1.<>s__4"" - IL_01cc: nop - IL_01cd: ldarg.0 - IL_01ce: ldnull - IL_01cf: stfld ""System.Exception C.d__1.5__3"" - IL_01d4: br.s IL_01d6 - IL_01d6: ldarg.0 - IL_01d7: ldnull - IL_01d8: stfld ""object C.d__1.<>s__1"" - IL_01dd: leave.s IL_01f9 + IL_0130: pop + IL_0131: ldarg.0 + IL_0132: ldc.i4.1 + IL_0133: stfld ""int C.d__1.<>s__5"" + IL_0138: leave.s IL_013a + } + IL_013a: ldarg.0 + IL_013b: ldfld ""int C.d__1.<>s__5"" + IL_0140: stloc.s V_5 + IL_0142: ldloc.s V_5 + IL_0144: ldc.i4.1 + IL_0145: beq.s IL_0149 + IL_0147: br.s IL_01b7 + IL_0149: nop + IL_014a: call ""System.Threading.Tasks.Task C.TrueAsync()"" + IL_014f: callvirt ""System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task.GetAwaiter()"" + IL_0154: stloc.s V_10 + IL_0156: ldloca.s V_10 + IL_0158: call ""bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get"" + IL_015d: brtrue.s IL_01a1 + IL_015f: ldarg.0 + IL_0160: ldc.i4.1 + IL_0161: dup + IL_0162: stloc.0 + IL_0163: stfld ""int C.d__1.<>1__state"" + IL_0168: ldarg.0 + IL_0169: ldloc.s V_10 + IL_016b: stfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" + IL_0170: ldarg.0 + IL_0171: stloc.3 + IL_0172: ldarg.0 + IL_0173: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_0178: ldloca.s V_10 + IL_017a: ldloca.s V_3 + IL_017c: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompleted, C.d__1>(ref System.Runtime.CompilerServices.TaskAwaiter, ref C.d__1)"" + IL_0181: nop + IL_0182: leave.s IL_0200 + IL_0184: ldarg.0 + IL_0185: ldfld ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" + IL_018a: stloc.s V_10 + IL_018c: ldarg.0 + IL_018d: ldflda ""System.Runtime.CompilerServices.TaskAwaiter C.d__1.<>u__2"" + IL_0192: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_0198: ldarg.0 + IL_0199: ldc.i4.m1 + IL_019a: dup + IL_019b: stloc.0 + IL_019c: stfld ""int C.d__1.<>1__state"" + IL_01a1: ldarg.0 + IL_01a2: ldloca.s V_10 + IL_01a4: call ""bool System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" + IL_01a9: stfld ""bool C.d__1.<>s__6"" + IL_01ae: ldarg.0 + IL_01af: ldfld ""bool C.d__1.<>s__6"" + IL_01b4: stloc.1 + IL_01b5: leave.s IL_01eb + IL_01b7: ldarg.0 + IL_01b8: ldnull + IL_01b9: stfld ""object C.d__1.<>s__4"" + IL_01be: nop + IL_01bf: ldarg.0 + IL_01c0: ldnull + IL_01c1: stfld ""System.Exception C.d__1.5__3"" + IL_01c6: br.s IL_01c8 + IL_01c8: ldarg.0 + IL_01c9: ldnull + IL_01ca: stfld ""object C.d__1.<>s__1"" + IL_01cf: leave.s IL_01eb } catch System.Exception { - IL_01df: stloc.s V_6 - IL_01e1: ldarg.0 - IL_01e2: ldc.i4.s -2 - IL_01e4: stfld ""int C.d__1.<>1__state"" - IL_01e9: ldarg.0 - IL_01ea: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_01ef: ldloc.s V_6 - IL_01f1: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)"" - IL_01f6: nop - IL_01f7: leave.s IL_020e + IL_01d1: stloc.s V_8 + IL_01d3: ldarg.0 + IL_01d4: ldc.i4.s -2 + IL_01d6: stfld ""int C.d__1.<>1__state"" + IL_01db: ldarg.0 + IL_01dc: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_01e1: ldloc.s V_8 + IL_01e3: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)"" + IL_01e8: nop + IL_01e9: leave.s IL_0200 } - IL_01f9: ldarg.0 - IL_01fa: ldc.i4.s -2 - IL_01fc: stfld ""int C.d__1.<>1__state"" - IL_0201: ldarg.0 - IL_0202: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" - IL_0207: ldloc.1 - IL_0208: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult(bool)"" - IL_020d: nop - IL_020e: ret + IL_01eb: ldarg.0 + IL_01ec: ldc.i4.s -2 + IL_01ee: stfld ""int C.d__1.<>1__state"" + IL_01f3: ldarg.0 + IL_01f4: ldflda ""System.Runtime.CompilerServices.AsyncTaskMethodBuilder C.d__1.<>t__builder"" + IL_01f9: ldloc.1 + IL_01fa: call ""void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult(bool)"" + IL_01ff: nop + IL_0200: ret } "); } diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests3.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests3.cs index 27bd784d69384..1be33c211fbeb 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests3.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests3.cs @@ -6420,25 +6420,60 @@ class C {{ static void Main() {{ - object o = 42; - M(o); + M1(41); + M1(42); + M1(43); + WriteLine(M2(41)); + WriteLine(M2(42)); + WriteLine(M2(43)); }} - static void M(object o) + static void M1(object o) {{ if ({pattern}) return; WriteLine(o); }} + static bool M2(object o) + {{ + return ({pattern}); + }} }}"; - var verifier = CompileAndVerify(source, expectedOutput: "42"); - verifier.VerifyIL("C.M", + string expectedOutput = """ +41 +42 +False +False +True +"""; + var verifier = CompileAndVerify(source, expectedOutput: expectedOutput); + verifier.VerifyIL("C.M1", @"{ - // Code size 39 (0x27) + // Code size 30 (0x1e) .maxstack 2 - .locals init (int V_0, - bool V_1) + .locals init (int V_0) + IL_0000: ldarg.0 + IL_0001: isinst ""int"" + IL_0006: brfalse.s IL_0016 + IL_0008: ldarg.0 + IL_0009: unbox.any ""int"" + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.s 41 + IL_0012: sub + IL_0013: ldc.i4.1 + IL_0014: ble.un.s IL_0017 + IL_0016: ret + IL_0017: ldarg.0 + IL_0018: call ""void System.Console.WriteLine(object)"" + IL_001d: ret +}"); + verifier.VerifyIL("C.M2", +@"{ + // Code size 26 (0x1a) + .maxstack 2 + .locals init (int V_0) IL_0000: ldarg.0 IL_0001: isinst ""int"" - IL_0006: brfalse.s IL_001a + IL_0006: brfalse.s IL_0018 IL_0008: ldarg.0 IL_0009: unbox.any ""int"" IL_000e: stloc.0 @@ -6446,18 +6481,11 @@ .locals init (int V_0, IL_0010: ldc.i4.s 41 IL_0012: sub IL_0013: ldc.i4.1 - IL_0014: bgt.un.s IL_001a - IL_0016: ldc.i4.1 - IL_0017: stloc.1 - IL_0018: br.s IL_001c - IL_001a: ldc.i4.0 - IL_001b: stloc.1 - IL_001c: ldloc.1 - IL_001d: brtrue.s IL_0020 - IL_001f: ret - IL_0020: ldarg.0 - IL_0021: call ""void System.Console.WriteLine(object)"" - IL_0026: ret + IL_0014: bgt.un.s IL_0018 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldc.i4.1 + IL_0019: ret }"); } diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests5.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests5.cs index 0120dc6e33d29..cd99ca9ea6484 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests5.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/PatternMatchingTests5.cs @@ -3178,21 +3178,17 @@ public static bool Test(int a) var compilation = CompileAndVerify(source, expectedOutput: "True"); compilation.VerifyIL("C.Test", """ { - // Code size 14 (0xe) + // Code size 10 (0xa) .maxstack 2 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: ldc.i4.1 IL_0002: sub IL_0003: ldc.i4.7 - IL_0004: bgt.un.s IL_000a + IL_0004: bgt.un.s IL_0008 IL_0006: ldc.i4.1 - IL_0007: stloc.0 - IL_0008: br.s IL_000c - IL_000a: ldc.i4.0 - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ret + IL_0007: ret + IL_0008: ldc.i4.0 + IL_0009: ret } """); } @@ -3227,9 +3223,8 @@ public static bool Test(int a, object b) var compilation = CompileAndVerify(source, expectedOutput: "True"); compilation.VerifyIL("C.Test", """ { - // Code size 72 (0x48) + // Code size 68 (0x44) .maxstack 2 - .locals init (bool V_0) IL_0000: ldarg.0 IL_0001: ldc.i4.1 IL_0002: sub @@ -3238,29 +3233,26 @@ .locals init (bool V_0) IL_0024, IL_002e, IL_0038) - IL_0018: br.s IL_0044 + IL_0018: br.s IL_0042 IL_001a: ldarg.1 IL_001b: isinst "int" IL_0020: brtrue.s IL_0040 - IL_0022: br.s IL_0044 + IL_0022: br.s IL_0042 IL_0024: ldarg.1 IL_0025: isinst "bool" IL_002a: brtrue.s IL_0040 - IL_002c: br.s IL_0044 + IL_002c: br.s IL_0042 IL_002e: ldarg.1 IL_002f: isinst "double" IL_0034: brtrue.s IL_0040 - IL_0036: br.s IL_0044 + IL_0036: br.s IL_0042 IL_0038: ldarg.1 IL_0039: isinst "long" - IL_003e: brfalse.s IL_0044 + IL_003e: brfalse.s IL_0042 IL_0040: ldc.i4.1 - IL_0041: stloc.0 - IL_0042: br.s IL_0046 - IL_0044: ldc.i4.0 - IL_0045: stloc.0 - IL_0046: ldloc.0 - IL_0047: ret + IL_0041: ret + IL_0042: ldc.i4.0 + IL_0043: ret } """); } @@ -3294,24 +3286,23 @@ public static bool Test(string a) var compilation = CompileAndVerify(source, expectedOutput: "True"); compilation.VerifyIL("C.Test", """ { - // Code size 73 (0x49) + // Code size 69 (0x45) .maxstack 2 - .locals init (bool V_0, - int V_1, - char V_2) + .locals init (int V_0, + char V_1) IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0045 + IL_0001: brfalse.s IL_0043 IL_0003: ldarg.0 IL_0004: call "int string.Length.get" - IL_0009: stloc.1 - IL_000a: ldloc.1 + IL_0009: stloc.0 + IL_000a: ldloc.0 IL_000b: ldc.i4.1 - IL_000c: bne.un.s IL_0045 + IL_000c: bne.un.s IL_0043 IL_000e: ldarg.0 IL_000f: ldc.i4.0 IL_0010: call "char string.this[int].get" - IL_0015: stloc.2 - IL_0016: ldloc.2 + IL_0015: stloc.1 + IL_0016: ldloc.1 IL_0017: ldc.i4.s 49 IL_0019: sub IL_001a: switch ( @@ -3323,14 +3314,11 @@ .locals init (bool V_0, IL_0041, IL_0041, IL_0041) - IL_003f: br.s IL_0045 + IL_003f: br.s IL_0043 IL_0041: ldc.i4.1 - IL_0042: stloc.0 - IL_0043: br.s IL_0047 - IL_0045: ldc.i4.0 - IL_0046: stloc.0 - IL_0047: ldloc.0 - IL_0048: ret + IL_0042: ret + IL_0043: ldc.i4.0 + IL_0044: ret } """); } @@ -3356,5 +3344,138 @@ bool M0({type} x0) Diagnostic(ErrorCode.ERR_ConstantExpected, expression).WithLocation(6, 22) ); } + + [Fact] + public void IsPatternExpressionWithAwait() + { + var source = """ +using System; +using System.Threading.Tasks; + +Console.WriteLine(await Async1(30)); +Console.WriteLine(await Async1(40)); +Console.WriteLine(await Async1(50)); + +Console.WriteLine(await Async2(30)); +Console.WriteLine(await Async2(40)); +Console.WriteLine(await Async2(50)); + +Console.WriteLine(await Async3(30)); +Console.WriteLine(await Async3(40)); +Console.WriteLine(await Async3(50)); + +static async Task Async1(int i) { + // sub-expression + return await Task.FromResult(false) || i is 30 or 40; +} +static async Task Async2(int i) { + // input-expression + return await Task.FromResult(i) is 30 or 40; +} +static async Task Async3(int i) { + // expression-list + return (await Task.FromResult(0), i is 30 or 40).Item2; +} +"""; + var expectedOutput = """ +True +True +False +True +True +False +True +True +False +"""; + var verifier = CompileAndVerify(source, expectedOutput: expectedOutput); + // await in input-expression + verifier.VerifyIL("Program.<<
$>g__Async2|0_1>d.System.Runtime.CompilerServices.IAsyncStateMachine.MoveNext()", """ +{ + // Code size 167 (0xa7) + .maxstack 3 + .locals init (int V_0, + bool V_1, + int V_2, + System.Runtime.CompilerServices.TaskAwaiter V_3, + System.Exception V_4) + IL_0000: ldarg.0 + IL_0001: ldfld "int Program.<<
$>g__Async2|0_1>d.<>1__state" + IL_0006: stloc.0 + .try + { + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0044 + IL_000a: ldarg.0 + IL_000b: ldfld "int Program.<<
$>g__Async2|0_1>d.i" + IL_0010: call "System.Threading.Tasks.Task System.Threading.Tasks.Task.FromResult(int)" + IL_0015: callvirt "System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task.GetAwaiter()" + IL_001a: stloc.3 + IL_001b: ldloca.s V_3 + IL_001d: call "bool System.Runtime.CompilerServices.TaskAwaiter.IsCompleted.get" + IL_0022: brtrue.s IL_0060 + IL_0024: ldarg.0 + IL_0025: ldc.i4.0 + IL_0026: dup + IL_0027: stloc.0 + IL_0028: stfld "int Program.<<
$>g__Async2|0_1>d.<>1__state" + IL_002d: ldarg.0 + IL_002e: ldloc.3 + IL_002f: stfld "System.Runtime.CompilerServices.TaskAwaiter Program.<<
$>g__Async2|0_1>d.<>u__1" + IL_0034: ldarg.0 + IL_0035: ldflda "System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program.<<
$>g__Async2|0_1>d.<>t__builder" + IL_003a: ldloca.s V_3 + IL_003c: ldarg.0 + IL_003d: call "void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.AwaitUnsafeOnCompleted, Program.<<
$>g__Async2|0_1>d>(ref System.Runtime.CompilerServices.TaskAwaiter, ref Program.<<
$>g__Async2|0_1>d)" + IL_0042: leave.s IL_00a6 + IL_0044: ldarg.0 + IL_0045: ldfld "System.Runtime.CompilerServices.TaskAwaiter Program.<<
$>g__Async2|0_1>d.<>u__1" + IL_004a: stloc.3 + IL_004b: ldarg.0 + IL_004c: ldflda "System.Runtime.CompilerServices.TaskAwaiter Program.<<
$>g__Async2|0_1>d.<>u__1" + IL_0051: initobj "System.Runtime.CompilerServices.TaskAwaiter" + IL_0057: ldarg.0 + IL_0058: ldc.i4.m1 + IL_0059: dup + IL_005a: stloc.0 + IL_005b: stfld "int Program.<<
$>g__Async2|0_1>d.<>1__state" + IL_0060: ldloca.s V_3 + IL_0062: call "int System.Runtime.CompilerServices.TaskAwaiter.GetResult()" + IL_0067: stloc.2 + IL_0068: ldloc.2 + IL_0069: ldc.i4.s 30 + IL_006b: beq.s IL_0072 + IL_006d: ldloc.2 + IL_006e: ldc.i4.s 40 + IL_0070: bne.un.s IL_0075 + IL_0072: ldc.i4.1 + IL_0073: br.s IL_0076 + IL_0075: ldc.i4.0 + IL_0076: stloc.1 + IL_0077: leave.s IL_0092 + } + catch System.Exception + { + IL_0079: stloc.s V_4 + IL_007b: ldarg.0 + IL_007c: ldc.i4.s -2 + IL_007e: stfld "int Program.<<
$>g__Async2|0_1>d.<>1__state" + IL_0083: ldarg.0 + IL_0084: ldflda "System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program.<<
$>g__Async2|0_1>d.<>t__builder" + IL_0089: ldloc.s V_4 + IL_008b: call "void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception)" + IL_0090: leave.s IL_00a6 + } + IL_0092: ldarg.0 + IL_0093: ldc.i4.s -2 + IL_0095: stfld "int Program.<<
$>g__Async2|0_1>d.<>1__state" + IL_009a: ldarg.0 + IL_009b: ldflda "System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program.<<
$>g__Async2|0_1>d.<>t__builder" + IL_00a0: ldloc.1 + IL_00a1: call "void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult(bool)" + IL_00a6: ret +} +"""); + } } } diff --git a/src/Compilers/Core/Portable/CodeGen/ILBuilder.cs b/src/Compilers/Core/Portable/CodeGen/ILBuilder.cs index 6c07a0e211d7b..b06c36e7e4e34 100644 --- a/src/Compilers/Core/Portable/CodeGen/ILBuilder.cs +++ b/src/Compilers/Core/Portable/CodeGen/ILBuilder.cs @@ -1096,6 +1096,16 @@ internal void AssertStackEmpty() Debug.Assert(_emitState.CurStack == 0); } + [Conditional("DEBUG")] + internal void AssertStackDepth(int stack) + { + Debug.Assert(_emitState.CurStack == stack); + } + +#if DEBUG + internal int GetStackDepth() => _emitState.CurStack; +#endif + // true if there may have been a label generated with no subsequent code internal bool IsJustPastLabel() { From 37bdfe323ed1f78406154d16c183428c4fbef7ed Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 22 Mar 2024 13:07:33 -0400 Subject: [PATCH 47/94] Create API docs feedback template (#72670) * Create API docs feedback template This adds the issue template that will be configured for roslyn-api-docs feedback published on docs.microsoft.com. Many of the fields will be applied from the query string of the referrer URL. * Update .github/ISSUE_TEMPLATE/z-apidocs-feedback.yml Co-authored-by: Fred Silberberg --------- Co-authored-by: Fred Silberberg --- .github/ISSUE_TEMPLATE/z-apidocs-feedback.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/z-apidocs-feedback.yml diff --git a/.github/ISSUE_TEMPLATE/z-apidocs-feedback.yml b/.github/ISSUE_TEMPLATE/z-apidocs-feedback.yml new file mode 100644 index 0000000000000..4ebe78e3dfa34 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/z-apidocs-feedback.yml @@ -0,0 +1,46 @@ +name: Learn feedback control. +description: | + ⛔ This template is hooked into the feedback control on Roslyn API documentation on docs.microsoft.com. It automatically fills in several fields for you. Don't use for other purposes. ⛔ +body: + - type: markdown + attributes: + value: "## Issue information" + - type: markdown + attributes: + value: Select the issue type, and describe the issue in the text box below. Add as much detail as needed to help us resolve the issue. + - type: dropdown + id: issue-type + attributes: + label: Type of issue + options: + - Typo + - Code doesn't work + - Missing information + - Outdated article + - Other (describe below) + validations: + required: true + - type: textarea + id: feedback + validations: + required: true + attributes: + label: Description + - type: markdown + attributes: + value: "## 🚧 Article information 🚧" + - type: markdown + attributes: + value: "*Don't modify the following fields*. They are automatically filled in for you. Doing so will disconnect your issue from the affected article. *Don't edit them*." + - type: input + id: pageUrl + validations: + required: true + attributes: + label: Page URL + - type: input + id: contentSourceUrl + validations: + required: true + attributes: + label: Content source URL From f4061d5101917a2ff4a42d926e5eb4459d8f8476 Mon Sep 17 00:00:00 2001 From: DoctorKrolic Date: Fri, 22 Mar 2024 20:09:07 +0300 Subject: [PATCH 48/94] Do not generate obsolete `Exception` constructor --- .../GenerateType/GenerateTypeTests.cs | 50 ++++++++++++++++++- ...sis.CSharp.EditorFeatures.UnitTests.csproj | 1 + ...ctGenerateTypeService.GenerateNamedType.cs | 2 +- .../TestWorkspace_XmlConsumption.cs | 9 ++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs b/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs index c3121d826706d..bcdd72d0e7407 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/GenerateType/GenerateTypeTests.cs @@ -9,8 +9,8 @@ using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CodeStyle; using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.CodeStyle; using Microsoft.CodeAnalysis.CSharp.CodeFixes.GenerateType; +using Microsoft.CodeAnalysis.CSharp.CodeStyle; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editor.UnitTests; @@ -901,6 +901,54 @@ protected ExType(SerializationInfo info, StreamingContext context) : base(info, index: 2); } + [Fact] + public async Task TestGenerateClassFromThrowStatementOnModernDotNet_NoObsoleteConstructor() + { + var source = """ + class Class + { + void Method() + { + throw new [|ExType|](); + } + } + """; + + await TestInRegularAndScriptAsync($""" + + + {source} + + + """, """ + using System; + + class Class + { + void Method() + { + throw new ExType(); + } + + [Serializable] + private class ExType : Exception + { + public ExType() + { + } + + public ExType(string message) : base(message) + { + } + + public ExType(string message, Exception innerException) : base(message, innerException) + { + } + } + } + """, index: 2); + } + [Fact] public async Task TestAbsenceOfGenerateIntoInvokingTypeForBaseList() { diff --git a/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj b/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj index 8cd4779bdf502..2d839832ddbbe 100644 --- a/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj +++ b/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj @@ -45,6 +45,7 @@ + diff --git a/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.GenerateNamedType.cs b/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.GenerateNamedType.cs index c1e832b84c41f..a38ed48c9e31e 100644 --- a/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.GenerateNamedType.cs +++ b/src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.GenerateNamedType.cs @@ -236,7 +236,7 @@ private void AddExceptionConstructors(ArrayBuilder members) var exceptionType = _semanticDocument.SemanticModel.Compilation.ExceptionType(); var constructors = exceptionType.InstanceConstructors - .Where(c => c.DeclaredAccessibility is Accessibility.Public or Accessibility.Protected) + .Where(c => c.DeclaredAccessibility is Accessibility.Public or Accessibility.Protected && !c.IsObsolete()) .Select(c => CodeGenerationSymbolFactory.CreateConstructorSymbol( attributes: default, accessibility: c.DeclaredAccessibility, diff --git a/src/Workspaces/CoreTestUtilities/Workspaces/TestWorkspace_XmlConsumption.cs b/src/Workspaces/CoreTestUtilities/Workspaces/TestWorkspace_XmlConsumption.cs index dc823e1820886..ef18057196fcd 100644 --- a/src/Workspaces/CoreTestUtilities/Workspaces/TestWorkspace_XmlConsumption.cs +++ b/src/Workspaces/CoreTestUtilities/Workspaces/TestWorkspace_XmlConsumption.cs @@ -67,6 +67,7 @@ public partial class TestWorkspace private const string CommonReferencesNetCoreAppName = "CommonReferencesNetCoreApp"; private const string CommonReferencesNet6Name = "CommonReferencesNet6"; private const string CommonReferencesNet7Name = "CommonReferencesNet7"; + private const string CommonReferencesNet8Name = "CommonReferencesNet8"; private const string CommonReferencesNetStandard20Name = "CommonReferencesNetStandard20"; private const string CommonReferencesMinCorlibName = "CommonReferencesMinCorlib"; private const string ReferencesOnDiskAttributeName = "ReferencesOnDisk"; @@ -928,6 +929,14 @@ private IList CreateCommonReferences(XElement element) references = TargetFrameworkUtil.GetReferences(TargetFramework.Net70).ToList(); } + var net8 = element.Attribute(CommonReferencesNet8Name); + if (net8 != null && + ((bool?)net8).HasValue && + ((bool?)net8).Value) + { + references = TargetFrameworkUtil.GetReferences(TargetFramework.Net80).ToList(); + } + var mincorlib = element.Attribute(CommonReferencesMinCorlibName); if (mincorlib != null && ((bool?)mincorlib).HasValue && From 8e5d7784ecb9d37e07a9a30abf6d10d05c1124b2 Mon Sep 17 00:00:00 2001 From: Oleg Tkachenko Date: Fri, 22 Mar 2024 11:04:42 -0700 Subject: [PATCH 49/94] Update AI rename UI to make suggestion button more button-like --- .../UI/Adornment/RenameFlyout.xaml | 4 +- .../SmartRenameUserInputComboBox.xaml | 153 ++++++++++++------ 2 files changed, 103 insertions(+), 54 deletions(-) diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml b/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml index cb01f2428b6ef..f87aa6fab3d94 100644 --- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml +++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml @@ -7,6 +7,7 @@ xmlns:rename="clr-namespace:Microsoft.CodeAnalysis.Editor.Implementation.InlineRename" xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging" xmlns:imagecatalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog" + xmlns:platformimaging="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging" xmlns:utils="clr-namespace:Microsoft.CodeAnalysis.Utilities" xmlns:vsui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0" mc:Ignorable="d" @@ -32,7 +33,8 @@ Background="{DynamicResource {x:Static vsui:EnvironmentColors.ToolWindowBackgroundBrushKey}}" BorderBrush="{DynamicResource {x:Static vsui:EnvironmentColors.ToolWindowBorderBrushKey}}" BorderThickness="1" - x:Name="Outline"> + x:Name="Outline" + platformimaging:ImageThemingUtilities.ImageBackgroundColor="{Binding Path=Background, RelativeSource={RelativeSource Self}, Converter={StaticResource BrushToColorConverter}}"> diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml index 5e9b0784a5a30..7fcd8edf3ee37 100644 --- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml +++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml @@ -25,6 +25,31 @@ + + + + + + + + + + + + + + + + + + @@ -60,52 +91,59 @@ - + - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + - - - + + + - + - + - - - - - + @@ -214,4 +251,14 @@ VirtualizationMode="{Binding RelativeSource={RelativeSource TemplatedParent},Path=(VirtualizingStackPanel.VirtualizationMode)}" /> + + + From ad07803b5c1a40efe6f73f60fae27d48c9f5e5b7 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 11:05:38 -0700 Subject: [PATCH 50/94] Create stronger type to expression compilation tracker internal policy --- ...pilationTracker.CompilationTrackerState.cs | 43 +++++++------ ...tionCompilationState.CompilationTracker.cs | 63 ++++++++++--------- ...tionState.CompilationTracker_Generators.cs | 4 +- ...SolutionCompilationState.CreationPolicy.cs | 54 ++++++++++++++++ 4 files changed, 115 insertions(+), 49 deletions(-) create mode 100644 src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs index bf93c6484c821..abffc060a6830 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs @@ -35,8 +35,11 @@ private abstract class CompilationTrackerState /// whether we even have references -- it's pretty likely that running a generator might produce worse results /// than what we originally had. /// + /// This also controls if we will generate skeleton references for cross-language P2P references when + /// creating the compilation for a particular project. When entirely frozen, we do not want to do this due + /// to the enormous cost of emitting ref assemblies for cross language cases. /// - public readonly bool IsFrozen; + public readonly CreationPolicy CreationPolicy; /// /// The best compilation that is available that source generators have not ran on. May be an @@ -47,10 +50,10 @@ private abstract class CompilationTrackerState public CompilationTrackerGeneratorInfo GeneratorInfo { get; } protected CompilationTrackerState( - bool isFrozen, + CreationPolicy creationPolicy, CompilationTrackerGeneratorInfo generatorInfo) { - IsFrozen = isFrozen; + CreationPolicy = creationPolicy; GeneratorInfo = generatorInfo; } } @@ -80,12 +83,12 @@ private sealed class InProgressState : CompilationTrackerState public override Compilation CompilationWithoutGeneratedDocuments => LazyCompilationWithoutGeneratedDocuments.Value; public InProgressState( - bool isFrozen, + CreationPolicy creationPolicy, Lazy compilationWithoutGeneratedDocuments, CompilationTrackerGeneratorInfo generatorInfo, Lazy staleCompilationWithGeneratedDocuments, ImmutableList pendingTranslationActions) - : base(isFrozen, generatorInfo) + : base(creationPolicy, generatorInfo) { // Note: Intermediate projects can be empty. Contract.ThrowIfTrue(pendingTranslationActions is null); @@ -105,13 +108,13 @@ public InProgressState( } public InProgressState( - bool isFrozen, + CreationPolicy creationPolicy, Compilation compilationWithoutGeneratedDocuments, CompilationTrackerGeneratorInfo generatorInfo, Compilation? staleCompilationWithGeneratedDocuments, ImmutableList pendingTranslationActions) : this( - isFrozen, + creationPolicy, new Lazy(() => compilationWithoutGeneratedDocuments), generatorInfo, // Extracted as a method call to prevent captures. @@ -164,20 +167,20 @@ private sealed class FinalCompilationTrackerState : CompilationTrackerState public override Compilation CompilationWithoutGeneratedDocuments { get; } private FinalCompilationTrackerState( - bool isFrozen, + CreationPolicy creationPolicy, Compilation finalCompilationWithGeneratedDocuments, Compilation compilationWithoutGeneratedDocuments, bool hasSuccessfullyLoaded, CompilationTrackerGeneratorInfo generatorInfo, UnrootedSymbolSet unrootedSymbolSet) - : base(isFrozen, generatorInfo) + : base(creationPolicy, generatorInfo) { Contract.ThrowIfNull(finalCompilationWithGeneratedDocuments); // As a policy, all partial-state projects are said to have incomplete references, since the // state has no guarantees. this.CompilationWithoutGeneratedDocuments = compilationWithoutGeneratedDocuments; - HasSuccessfullyLoaded = hasSuccessfullyLoaded && !isFrozen; + HasSuccessfullyLoaded = hasSuccessfullyLoaded; FinalCompilationWithGeneratedDocuments = finalCompilationWithGeneratedDocuments; UnrootedSymbolSet = unrootedSymbolSet; @@ -202,7 +205,7 @@ private FinalCompilationTrackerState( /// Not held onto /// Not held onto public static FinalCompilationTrackerState Create( - bool isFrozen, + CreationPolicy creationPolicy, Compilation finalCompilationWithGeneratedDocuments, Compilation compilationWithoutGeneratedDocuments, bool hasSuccessfullyLoaded, @@ -217,7 +220,7 @@ public static FinalCompilationTrackerState Create( RecordAssemblySymbols(projectId, finalCompilationWithGeneratedDocuments, metadataReferenceToProjectId); return new FinalCompilationTrackerState( - isFrozen, + creationPolicy, finalCompilationWithGeneratedDocuments, compilationWithoutGeneratedDocuments, hasSuccessfullyLoaded, @@ -225,13 +228,15 @@ public static FinalCompilationTrackerState Create( unrootedSymbolSet); } - public FinalCompilationTrackerState WithIsFrozen() - => new(isFrozen: true, - FinalCompilationWithGeneratedDocuments, - CompilationWithoutGeneratedDocuments, - HasSuccessfullyLoaded, - GeneratorInfo, - UnrootedSymbolSet); + public FinalCompilationTrackerState WithCreationPolicy(CreationPolicy creationPolicy) + => creationPolicy == this.CreationPolicy + ? this + : new(creationPolicy, + FinalCompilationWithGeneratedDocuments, + CompilationWithoutGeneratedDocuments, + HasSuccessfullyLoaded, + GeneratorInfo, + UnrootedSymbolSet); private static void RecordAssemblySymbols(ProjectId projectId, Compilation compilation, Dictionary? metadataReferenceToProjectId) { diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs index 4134f3996f5ce..6c5d530ee27db 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs @@ -152,7 +152,7 @@ public ICompilationTracker Fork( }; var newState = new InProgressState( - state.IsFrozen, + state.CreationPolicy, compilationWithoutGeneratedDocuments, state.GeneratorInfo, staleCompilationWithGeneratedDocuments, @@ -334,12 +334,13 @@ InProgressState BuildInProgressStateFromNoCompilationState() var compilationWithoutGeneratedDocuments = CreateEmptyCompilation(); - // We only got here when we had no compilation state at all. So we couldn't have gotten - // here from a frozen state (as a frozen state always ensures we have a - // WithCompilationTrackerState). As such, we can safely still preserve that we're not - // frozen here. + // We only got here when we had no compilation state at all. So we couldn't have gotten here + // from a frozen state (as a frozen state always ensures we have a WithCompilationTrackerState). + // As such, we want to start initially in the state where we will both run generators and create + // skeleton references for p2p references. That will ensure the most correct state for our + // compilation the first time we create it. var allSyntaxTreesParsedState = new InProgressState( - isFrozen: false, + CreationPolicy.Create, new Lazy(CreateEmptyCompilation), CompilationTrackerGeneratorInfo.Empty, staleCompilationWithGeneratedDocuments: s_lazyNullCompilation, @@ -380,7 +381,7 @@ async Task CollapseInProgressStateAsync(InProgressState initial // generator docs back to the uncomputed state from that point onwards. We'll just keep // whateverZ generated docs we have. currentState = new InProgressState( - currentState.IsFrozen, + currentState.CreationPolicy, compilationWithoutGeneratedDocuments, generatorInfo, staleCompilationWithGeneratedDocuments, @@ -472,7 +473,7 @@ async Task FinalizeCompilationWorkerAsync(InProgre Contract.ThrowIfTrue(inProgressState.PendingTranslationActions.Count > 0); // The final state we produce will be frozen or not depending on if a frozen state was passed into it. - var isFrozen = inProgressState.IsFrozen; + var creationPolicy = inProgressState.CreationPolicy; var generatorInfo = inProgressState.GeneratorInfo; var compilationWithoutGeneratedDocuments = inProgressState.CompilationWithoutGeneratedDocuments; var staleCompilationWithGeneratedDocuments = inProgressState.LazyStaleCompilationWithGeneratedDocuments.Value; @@ -524,27 +525,33 @@ await compilationState.GetCompilationAsync( { // Not a submission. Add as a metadata reference. - if (isFrozen) + if (creationPolicy.SkeletonReferenceCreationPolicy is SkeletonReferenceCreationPolicy.Create) { - // In the frozen case, attempt to get a partial reference, or fallback to the last - // successful reference for this project if we can find one. - var metadataReference = compilationState.GetPartialMetadataReference(projectReference, this.ProjectState); + var metadataReference = await compilationState.GetMetadataReferenceAsync(projectReference, this.ProjectState, cancellationToken).ConfigureAwait(false); + AddMetadataReference(projectReference, metadataReference); + } + else + { + Contract.ThrowIfFalse(creationPolicy.SkeletonReferenceCreationPolicy is SkeletonReferenceCreationPolicy.CreateIfAbsent or SkeletonReferenceCreationPolicy.DoNotCreate); + // If not asked to explicit create an up to date skeleton, attempt to get a partial + // reference, or fallback to the last successful reference for this project if we can + // find one. + var metadataReference = compilationState.GetPartialMetadataReference(projectReference, this.ProjectState); if (metadataReference is null) { - // if we failed to get the metadata and we were frozen, check to see if we - // previously had existing metadata and reuse it instead. var inProgressCompilationNotRef = staleCompilationWithGeneratedDocuments ?? compilationWithoutGeneratedDocuments; metadataReference = inProgressCompilationNotRef.ExternalReferences.FirstOrDefault( r => GetProjectId(inProgressCompilationNotRef.GetAssemblyOrModuleSymbol(r) as IAssemblySymbol) == projectReference.ProjectId); } - AddMetadataReference(projectReference, metadataReference); - } - else - { - // For the non-frozen case, attempt to get the full metadata reference. - var metadataReference = await compilationState.GetMetadataReferenceAsync(projectReference, this.ProjectState, cancellationToken).ConfigureAwait(false); + // If we still failed, but our policy is to create when absent, then do the work to + // create a real skeleton here. + if (metadataReference is null && creationPolicy.SkeletonReferenceCreationPolicy is SkeletonReferenceCreationPolicy.CreateIfAbsent) + { + metadataReference = await compilationState.GetMetadataReferenceAsync(projectReference, this.ProjectState, cancellationToken).ConfigureAwait(false); + } + AddMetadataReference(projectReference, metadataReference); } } @@ -563,7 +570,7 @@ await compilationState.GetCompilationAsync( // We will finalize the compilation by adding full contents here. var (compilationWithGeneratedDocuments, generatedDocuments, generatorDriver) = await AddExistingOrComputeNewGeneratorInfoAsync( - isFrozen, + creationPolicy, compilationState, compilationWithoutGeneratedDocuments, generatorInfo, @@ -574,7 +581,7 @@ await compilationState.GetCompilationAsync( var nextGeneratorInfo = new CompilationTrackerGeneratorInfo(generatedDocuments, generatorDriver); var finalState = FinalCompilationTrackerState.Create( - isFrozen, + creationPolicy, compilationWithGeneratedDocuments, compilationWithoutGeneratedDocuments, hasSuccessfullyLoaded, @@ -669,11 +676,11 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke if (state is FinalCompilationTrackerState finalState) { - // If we're finalized and already frozen, we can just use ourselves. Otherwise, flip the frozen bit - // so that any future forks keep things frozen. - return finalState.IsFrozen + // Attempt to transition our state to one where we do not run generators or create skeleton references. + var newFinalState = finalState.WithCreationPolicy(CreationPolicy.DoNotCreate); + return newFinalState == finalState ? this - : new CompilationTracker(this.ProjectState, finalState.WithIsFrozen(), skeletonReferenceCacheToClone: _skeletonReferenceCache); + : new CompilationTracker(this.ProjectState, newFinalState, skeletonReferenceCacheToClone: _skeletonReferenceCache); } // Non-final state currently. Produce an in-progress-state containing the forked change. Note: we @@ -722,7 +729,7 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke return new CompilationTracker( frozenProjectState, new InProgressState( - isFrozen: true, + CreationPolicy.DoNotCreate, lazyCompilationWithoutGeneratedDocuments, CompilationTrackerGeneratorInfo.Empty, lazyCompilationWithGeneratedDocuments, @@ -748,7 +755,7 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke return new CompilationTracker( frozenProjectState, new InProgressState( - isFrozen: true, + CreationPolicy.DoNotCreate, compilationWithoutGeneratedDocuments, generatorInfo, compilationWithGeneratedDocuments, diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker_Generators.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker_Generators.cs index 73fbee3c5a223..ecb953cc80b3d 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker_Generators.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker_Generators.cs @@ -27,14 +27,14 @@ internal partial class SolutionCompilationState private partial class CompilationTracker : ICompilationTracker { private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates generatedDocuments, GeneratorDriver? generatorDriver)> AddExistingOrComputeNewGeneratorInfoAsync( - bool isFrozen, + CreationPolicy creationPolicy, SolutionCompilationState compilationState, Compilation compilationWithoutGeneratedFiles, CompilationTrackerGeneratorInfo generatorInfo, Compilation? compilationWithStaleGeneratedTrees, CancellationToken cancellationToken) { - if (isFrozen) + if (creationPolicy.GeneratedDocumentCreationPolicy is GeneratedDocumentCreationPolicy.DoNotCreate) { // We're frozen. So we do not want to go through the expensive cost of running generators. Instead, we // just whatever prior generated docs we have. diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs new file mode 100644 index 0000000000000..90fbfdf68cc7b --- /dev/null +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs @@ -0,0 +1,54 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CodeAnalysis; + +internal partial class SolutionCompilationState +{ + /// + /// Flags controlling if generator documents should be created or not. + /// + private enum GeneratedDocumentCreationPolicy + { + /// + /// Source generators should be run and should produce up to date results. + /// + Create, + + /// + /// Source generators should not run. Whatever results were previously computed should be reused. + /// + DoNotCreate, + } + + /// + /// Flags controlling if skeleton references should be created or not. + /// + private enum SkeletonReferenceCreationPolicy + { + /// + /// Skeleton references should be created, and should be up to date with the project they are created for. + /// + Create, + + /// + /// Skeleton references should only be created for a compilation if no existing skeleton exists for their + /// project from some point in the past. + /// + CreateIfAbsent, + + /// + /// Skeleton references should not be created at all. + /// + DoNotCreate, + } + + private readonly record struct CreationPolicy( + GeneratedDocumentCreationPolicy GeneratedDocumentCreationPolicy, + SkeletonReferenceCreationPolicy SkeletonReferenceCreationPolicy) + { + public static readonly CreationPolicy Create = new(GeneratedDocumentCreationPolicy.Create, SkeletonReferenceCreationPolicy.Create); + public static readonly CreationPolicy DoNotCreate = new(GeneratedDocumentCreationPolicy.DoNotCreate, SkeletonReferenceCreationPolicy.DoNotCreate); + } +} From aed1da109779a2b491f01427149898cc76501cfe Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 11:07:27 -0700 Subject: [PATCH 51/94] Fix comment --- .../Solution/SolutionCompilationState.CompilationTracker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs index 6c5d530ee27db..5dcbf200836a8 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs @@ -335,7 +335,7 @@ InProgressState BuildInProgressStateFromNoCompilationState() var compilationWithoutGeneratedDocuments = CreateEmptyCompilation(); // We only got here when we had no compilation state at all. So we couldn't have gotten here - // from a frozen state (as a frozen state always ensures we have a WithCompilationTrackerState). + // from a frozen state (as a frozen state always ensures we have at least an InProgressState). // As such, we want to start initially in the state where we will both run generators and create // skeleton references for p2p references. That will ensure the most correct state for our // compilation the first time we create it. From 7bf8603dc91f946dc18b97f7496117292ca5d51b Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 11:08:54 -0700 Subject: [PATCH 52/94] Docs --- .../Solution/SolutionCompilationState.CreationPolicy.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs index 90fbfdf68cc7b..ff61c5044a6a4 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CreationPolicy.cs @@ -48,7 +48,15 @@ private readonly record struct CreationPolicy( GeneratedDocumentCreationPolicy GeneratedDocumentCreationPolicy, SkeletonReferenceCreationPolicy SkeletonReferenceCreationPolicy) { + /// + /// Create up to date source generator docs and create up to date skeleton references when needed. + /// public static readonly CreationPolicy Create = new(GeneratedDocumentCreationPolicy.Create, SkeletonReferenceCreationPolicy.Create); + + /// + /// Do not create up to date source generator docs and do not create up to date skeleton references for P2P + /// references. For both, use whatever has been generated most recently. + /// public static readonly CreationPolicy DoNotCreate = new(GeneratedDocumentCreationPolicy.DoNotCreate, SkeletonReferenceCreationPolicy.DoNotCreate); } } From 450625c974b6feff79c11c2b4ded105a6b326896 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 11:10:24 -0700 Subject: [PATCH 53/94] Docs --- .../SolutionCompilationState.CompilationTracker.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs index 5dcbf200836a8..1ba446df1396d 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.CompilationTracker.cs @@ -674,10 +674,15 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke { var state = this.ReadState(); + // We're freezing the solution for features where latency performance is parameter. Do not run SGs or + // create skeleton references at this point. Just use whatever we've already generated for each in the + // past. + var desiredCreationPolicy = CreationPolicy.DoNotCreate; + if (state is FinalCompilationTrackerState finalState) { // Attempt to transition our state to one where we do not run generators or create skeleton references. - var newFinalState = finalState.WithCreationPolicy(CreationPolicy.DoNotCreate); + var newFinalState = finalState.WithCreationPolicy(desiredCreationPolicy); return newFinalState == finalState ? this : new CompilationTracker(this.ProjectState, newFinalState, skeletonReferenceCacheToClone: _skeletonReferenceCache); @@ -729,7 +734,7 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke return new CompilationTracker( frozenProjectState, new InProgressState( - CreationPolicy.DoNotCreate, + desiredCreationPolicy, lazyCompilationWithoutGeneratedDocuments, CompilationTrackerGeneratorInfo.Empty, lazyCompilationWithGeneratedDocuments, @@ -755,7 +760,7 @@ public ICompilationTracker FreezePartialState(CancellationToken cancellationToke return new CompilationTracker( frozenProjectState, new InProgressState( - CreationPolicy.DoNotCreate, + desiredCreationPolicy, compilationWithoutGeneratedDocuments, generatorInfo, compilationWithGeneratedDocuments, From c72ad8611b9c942e590222b6bd2a0273ce6ce303 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Fri, 22 Mar 2024 11:19:52 -0700 Subject: [PATCH 54/94] Remove unnecessary string[] allocations (#72642) The result of the `GetAllItems` call was a fresh `string[]` that was being copied via collection initializer into a `List`. That produces unnecessary allocations. This is particularly problematic because these allocations tend to end up in the LOH. Changed the API to be more explicit and consumer to not do the unnecessary allocations. This saved 73MB in LOH allocations. --- src/Compilers/Core/Portable/CodeGen/ItemTokenMap.cs | 2 +- src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs | 6 +++--- src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Compilers/Core/Portable/CodeGen/ItemTokenMap.cs b/src/Compilers/Core/Portable/CodeGen/ItemTokenMap.cs index f0cdc1483e780..7d387f9def7ea 100644 --- a/src/Compilers/Core/Portable/CodeGen/ItemTokenMap.cs +++ b/src/Compilers/Core/Portable/CodeGen/ItemTokenMap.cs @@ -62,7 +62,7 @@ public T GetItem(uint token) } } - public IEnumerable GetAllItems() + public T[] CopyItems() { lock (_items) { diff --git a/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs b/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs index 1bc7079e2a2d8..cd10a5c8a8eca 100644 --- a/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs +++ b/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs @@ -368,11 +368,11 @@ public Cci.IAssemblyReference GetContainingAssembly(EmitContext context) } /// - /// Returns User Strings referenced from the IL in the module. + /// Returns copy of User Strings referenced from the IL in the module. /// - public IEnumerable GetStrings() + public string[] CopyStrings() { - return _stringsInILMap.GetAllItems(); + return _stringsInILMap.CopyItems(); } public uint GetFakeSymbolTokenForIL(Cci.IReference symbol, SyntaxNode syntaxNode, DiagnosticBag diagnostics) diff --git a/src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs b/src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs index efc9fa1db1573..e3791fc94ce01 100644 --- a/src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs +++ b/src/Compilers/Core/Portable/PEWriter/MetadataWriter.cs @@ -424,7 +424,7 @@ private bool IsMinimalDelta private object[] _pseudoSymbolTokenToReferenceMap; private UserStringHandle[] _pseudoStringTokenToTokenMap; private bool _userStringTokenOverflow; - private List _pseudoStringTokenToStringMap; + private string[] _pseudoStringTokenToStringMap; private ReferenceIndexer _referenceVisitor; protected readonly MetadataBuilder metadata; @@ -489,8 +489,8 @@ private void CreateIndices() private void CreateUserStringIndices() { - _pseudoStringTokenToStringMap = [.. module.GetStrings()]; - _pseudoStringTokenToTokenMap = new UserStringHandle[_pseudoStringTokenToStringMap.Count]; + _pseudoStringTokenToStringMap = module.CopyStrings(); + _pseudoStringTokenToTokenMap = new UserStringHandle[_pseudoStringTokenToStringMap.Length]; } private void CreateIndicesForModule() From 2fd85109d1ddf3affa9e194609e106de0deccca8 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Fri, 22 Mar 2024 11:53:42 -0700 Subject: [PATCH 55/94] Fix exception for non-cs/vb document --- .../Core/Portable/Copilot/Extensions.cs | 10 ------- .../Features/CodeFixes/CodeFixService.cs | 27 +++++++++++-------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/Features/Core/Portable/Copilot/Extensions.cs b/src/Features/Core/Portable/Copilot/Extensions.cs index 68b39f20e2021..2a2ce622bd9de 100644 --- a/src/Features/Core/Portable/Copilot/Extensions.cs +++ b/src/Features/Core/Portable/Copilot/Extensions.cs @@ -13,16 +13,6 @@ namespace Microsoft.CodeAnalysis.Copilot; internal static class Extensions { - public static async Task> GetCachedCopilotDiagnosticsAsync(this TextDocument document, TextSpan span, CancellationToken cancellationToken) - { - var diagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); - if (diagnostics.IsEmpty) - return []; - - var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false); - return diagnostics.WhereAsArray(diagnostic => span.IntersectsWith(diagnostic.DataLocation.UnmappedFileSpan.GetClampedTextSpan(text))); - } - public static async Task> GetCachedCopilotDiagnosticsAsync(this TextDocument document, CancellationToken cancellationToken) { if (document is not Document sourceDocument) diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs index 021e607a10c04..dee4670065e4c 100644 --- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs +++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs @@ -255,20 +255,25 @@ private static async Task> GetCopilotDiagnosticsA CodeActionRequestPriority? priority, CancellationToken cancellationToken) { - if (!(priority is null or CodeActionRequestPriority.Low) - || document is not Document sourceDocument) - { + if (!(priority is null or CodeActionRequestPriority.Low) || document is not Document sourceDocument) + return []; + + var diagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); + if (diagnostics.IsEmpty) return []; - } - // Expand the fixable range for Copilot diagnostics to containing method. - // TODO: Share the below code with other places we compute containing method for Copilot analysis. - var root = await sourceDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var syntaxFacts = sourceDocument.GetRequiredLanguageService(); - var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, range.Start, useFullSpan: false); - range = containingMethod?.Span ?? range; + if (sourceDocument.SupportsSyntaxTree) + { + // Expand the fixable range for Copilot diagnostics to containing method. + // TODO: Share the below code with other places we compute containing method for Copilot analysis. + var root = await sourceDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var syntaxFacts = sourceDocument.GetRequiredLanguageService(); + var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, range.Start, useFullSpan: false); + range = containingMethod?.Span ?? range; + } - return await document.GetCachedCopilotDiagnosticsAsync(range, cancellationToken).ConfigureAwait(false); + var text = await sourceDocument.GetTextAsync(cancellationToken).ConfigureAwait(false); + return diagnostics.WhereAsArray(diagnostic => range.IntersectsWith(diagnostic.DataLocation.UnmappedFileSpan.GetClampedTextSpan(text))); } private static SortedDictionary> ConvertToMap( From b9cac05b2f0c14f96d8e4f4fdea1f7f9cdb1c4a2 Mon Sep 17 00:00:00 2001 From: Oleg Tkachenko Date: Fri, 22 Mar 2024 12:21:53 -0700 Subject: [PATCH 56/94] Fix command name --- .../UI/SmartRename/SmartRenameUserInputComboBox.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml index 7fcd8edf3ee37..d0b10c03c4c36 100644 --- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml +++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml @@ -163,7 +163,7 @@ Grid.Column="1" Style="{StaticResource GetSuggestionButtonStyle}" ToolTip="{x:Static sr:SmartRenameViewModel.GetSuggestionsTooltip}" - Command="{Binding CopilotCommand}"> + Command="{Binding GetSuggestionsCommand}"> From 45f16cb047791277ce0888b6b8fa7c5c1db83ce9 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 12:47:57 -0700 Subject: [PATCH 57/94] Remove unused fields --- ...gnosticAnalyzerService_IncrementalAnalyzer.cs | 2 +- .../EngineV2/DiagnosticIncrementalAnalyzer.cs | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs index b400bfe711b5b..800e83981ebc5 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs @@ -23,7 +23,7 @@ private DiagnosticIncrementalAnalyzer CreateIncrementalAnalyzerCallback(Workspac // subscribe to active context changed event for new workspace workspace.DocumentActiveContextChanged += OnDocumentActiveContextChanged; - return new DiagnosticIncrementalAnalyzer(this, CorrelationIdFactory.GetNextId(), workspace, AnalyzerInfoCache); + return new DiagnosticIncrementalAnalyzer(this, workspace, AnalyzerInfoCache); } private void OnDocumentActiveContextChanged(object? sender, DocumentActiveContextChangedEventArgs e) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs index 4ee7e585fd01f..8fdb81ec0d807 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs @@ -27,11 +27,9 @@ namespace Microsoft.CodeAnalysis.Diagnostics.EngineV2 /// internal partial class DiagnosticIncrementalAnalyzer { - private readonly int _correlationId; private readonly DiagnosticAnalyzerTelemetry _telemetry = new(); private readonly StateManager _stateManager; private readonly InProcOrRemoteHostAnalyzerRunner _diagnosticAnalyzerRunner; - private readonly IDocumentTrackingService _documentTrackingService; private readonly IncrementalMemberEditAnalyzer _incrementalMemberEditAnalyzer = new(); #if NETSTANDARD @@ -46,7 +44,6 @@ internal partial class DiagnosticIncrementalAnalyzer [Obsolete(MefConstruction.FactoryMethodMessage, error: true)] public DiagnosticIncrementalAnalyzer( DiagnosticAnalyzerService analyzerService, - int correlationId, Workspace workspace, DiagnosticAnalyzerInfoCache analyzerInfoCache) { @@ -55,10 +52,6 @@ public DiagnosticIncrementalAnalyzer( AnalyzerService = analyzerService; Workspace = workspace; - _documentTrackingService = workspace.Services.GetRequiredService(); - - _correlationId = correlationId; - _stateManager = new StateManager(workspace, analyzerInfoCache); _stateManager.ProjectAnalyzerReferenceChanged += OnProjectAnalyzerReferenceChanged; @@ -202,16 +195,7 @@ private static string GetDocumentLogMessage(string title, TextDocument document, private static string GetProjectLogMessage(Project project, ImmutableArray stateSets) => $"project: ({project.Id}), ({string.Join(Environment.NewLine, stateSets.Select(s => s.Analyzer.ToString()))})"; - private static string GetResetLogMessage(TextDocument document) - => $"document close/reset: ({document.FilePath ?? document.Name})"; - private static string GetOpenLogMessage(TextDocument document) => $"document open: ({document.FilePath ?? document.Name})"; - - private static string GetRemoveLogMessage(DocumentId id) - => $"document remove: {id.ToString()}"; - - private static string GetRemoveLogMessage(ProjectId id) - => $"project remove: {id.ToString()}"; } } From 8c4121c63ff3207cfadcc9a50d2bf2afe7757ccc Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 12:48:13 -0700 Subject: [PATCH 58/94] Remove unused fields --- .../DiagnosticAnalyzerService_IncrementalAnalyzer.cs | 2 -- .../Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs | 6 ------ 2 files changed, 8 deletions(-) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs index 800e83981ebc5..99d9760bc40ca 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs @@ -5,8 +5,6 @@ using System; using Microsoft.CodeAnalysis.Diagnostics.EngineV2; using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Internal.Log; -using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs index 8fdb81ec0d807..d722e8b9951ab 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs @@ -32,12 +32,6 @@ internal partial class DiagnosticIncrementalAnalyzer private readonly InProcOrRemoteHostAnalyzerRunner _diagnosticAnalyzerRunner; private readonly IncrementalMemberEditAnalyzer _incrementalMemberEditAnalyzer = new(); -#if NETSTANDARD - private ConditionalWeakTable _projectCompilationsWithAnalyzers = new(); -#else - private readonly ConditionalWeakTable _projectCompilationsWithAnalyzers = []; -#endif - internal DiagnosticAnalyzerService AnalyzerService { get; } internal Workspace Workspace { get; } From 1b24cc9cb6c990944de0698a4fb627a7855bc45a Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 22 Mar 2024 13:08:53 -0700 Subject: [PATCH 59/94] Skip failing test Opened https://github.com/dotnet/roslyn/issues/72678 for investigation. --- src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs b/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs index ccc34c3e368d9..64cc4a4f131e7 100644 --- a/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs +++ b/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs @@ -172,7 +172,7 @@ void M2() { // This test is a canary attempting to make sure that we don't regress the # of fluent calls that // the compiler can handle. - [Fact, WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1874763")] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/72678"), WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1874763")] public void OverflowOnFluentCall_ExtensionMethods() { int numberFluentCalls = (IntPtr.Size, ExecutionConditionUtil.Configuration, RuntimeUtilities.IsDesktopRuntime, RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) switch From 6e5fc9bdd871f3b0a19e3a5700df4e82cbaa08bc Mon Sep 17 00:00:00 2001 From: Rich Lander Date: Fri, 22 Mar 2024 13:18:36 -0700 Subject: [PATCH 60/94] Update EOL versions (#72623) * Update EOL versions * Apply suggestions from code review Co-authored-by: Michael Simons --------- Co-authored-by: Michael Simons --- azure-pipelines.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 08aa4304783ab..57258ee73c93d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,9 +55,9 @@ variables: - name: UbuntuQueueName ${{ if eq(variables['System.TeamProject'], 'public') }}: - value: Build.Ubuntu.1804.Amd64.Open + value: Build.Ubuntu.2004.Amd64.Open ${{ else }}: - value: Build.Ubuntu.1804.Amd64 + value: Build.Ubuntu.2004.Amd64 - name: WindowsQueueName ${{ if eq(variables['System.TeamProject'], 'public') }}: @@ -79,9 +79,9 @@ variables: - name: HelixUbuntuQueueName ${{ if eq(variables['System.TeamProject'], 'public') }}: - value: Ubuntu.1804.Amd64.Open + value: Ubuntu.2004.Amd64.Open ${{ else }}: - value: Ubuntu.1804.Amd64 + value: Ubuntu.2004.Amd64 - name: HelixMacOsQueueName ${{ if eq(variables['System.TeamProject'], 'public') }}: @@ -148,15 +148,15 @@ stages: # Like template `eng/common/templates/jobs/source-build.yml` - job: Source_Build_Managed displayName: Source-Build (Managed) - container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open + demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore1ESPool-Svc-Internal'), False, 'NetCore1ESPool-Internal')] - demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 + demands: ImageOverride -equals Build.Ubuntu.2204.Amd64 workspace: clean: all steps: @@ -164,7 +164,7 @@ stages: parameters: platform: name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' - stage: Windows_Debug_Desktop dependsOn: Windows_Debug_Build From 7a55fa87ee75b66aeb7b86441a53209aa507b781 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Fri, 22 Mar 2024 21:19:09 +0100 Subject: [PATCH 61/94] Add status of feature "ref/unsafe in iterators/async" (#72663) --- docs/Language Feature Status.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Language Feature Status.md b/docs/Language Feature Status.md index 4fbf571e12e5b..27f4a1a304cb5 100644 --- a/docs/Language Feature Status.md +++ b/docs/Language Feature Status.md @@ -10,6 +10,7 @@ efforts behind them. | Feature | Branch | State | Developer | Reviewer | IDE Buddy | LDM Champ | | ------- | ------ | ----- | --------- | -------- | --------- | --------- | +| Ref/unsafe in iterators/async | [RefInAsync](https://github.com/dotnet/roslyn/tree/features/RefInAsync) | [In Progress](https://github.com/dotnet/roslyn/issues/72662) | [jjonescz](https://github.com/jjonescz) | [AlekseyTs](https://github.com/AlekseyTs), [cston](https://github.com/cston) | | | | [Ref Struct Interfaces](https://github.com/dotnet/csharplang/issues/7608) | [RefStructInterfaces](https://github.com/dotnet/roslyn/tree/features/RefStructInterfaces) | [In Progress](https://github.com/dotnet/roslyn/issues/72124) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [jjonescz](https://github.com/jjonescz) | | [agocke](https://github.com/agocke), [jaredpar](https://github.com/jaredpar) | | [Semi-auto-properties](https://github.com/dotnet/csharplang/issues/140) | [semi-auto-props](https://github.com/dotnet/roslyn/tree/features/semi-auto-props) | [In Progress](https://github.com/dotnet/roslyn/issues/57012) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | | [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [In Progress](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | | [jcouv](https://github.com/jcouv) | From 6f0c1d94a5b36175b2472fb3cd48ea61dc467d5c Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 13:20:22 -0700 Subject: [PATCH 62/94] downstream fallout --- .../DiagnosticAnalyzerServiceTests.cs | 1 - ...ticAnalyzerService_BuildSynchronization.cs | 3 +- .../DiagnosticIncrementalAnalyzer.Executor.cs | 153 ------------------ ...ncrementalAnalyzer_BuildSynchronization.cs | 1 - .../ExternalErrorDiagnosticUpdateSource.cs | 48 ++---- 5 files changed, 16 insertions(+), 190 deletions(-) diff --git a/src/EditorFeatures/Test/Diagnostics/DiagnosticAnalyzerServiceTests.cs b/src/EditorFeatures/Test/Diagnostics/DiagnosticAnalyzerServiceTests.cs index ec4590845f359..7683eb02260ca 100644 --- a/src/EditorFeatures/Test/Diagnostics/DiagnosticAnalyzerServiceTests.cs +++ b/src/EditorFeatures/Test/Diagnostics/DiagnosticAnalyzerServiceTests.cs @@ -404,7 +404,6 @@ await service.SynchronizeWithBuildAsync( ImmutableDictionary>.Empty.Add( document.Project.Id, ImmutableArray.Create(DiagnosticData.Create(document.Project.Solution, Diagnostic.Create(NoNameAnalyzer.s_syntaxRule, location, properties), document.Project))), - new TaskQueue(service.Listener, TaskScheduler.Default), onBuildCompleted: true, CancellationToken.None); diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_BuildSynchronization.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_BuildSynchronization.cs index 62a6da55c689b..5208a84df00f8 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_BuildSynchronization.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_BuildSynchronization.cs @@ -20,12 +20,11 @@ public ValueTask SynchronizeWithBuildAsync( Workspace workspace, ImmutableDictionary> diagnostics, - TaskQueue postBuildAndErrorListRefreshTaskQueue, bool onBuildCompleted, CancellationToken cancellationToken) { return _map.TryGetValue(workspace, out var analyzer) - ? analyzer.SynchronizeWithBuildAsync(diagnostics, postBuildAndErrorListRefreshTaskQueue, onBuildCompleted, cancellationToken) + ? analyzer.SynchronizeWithBuildAsync(diagnostics, onBuildCompleted, cancellationToken) : default; } } diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs index a2fd206083a6a..e8c44e86da6bb 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs @@ -22,159 +22,6 @@ namespace Microsoft.CodeAnalysis.Diagnostics.EngineV2 { internal partial class DiagnosticIncrementalAnalyzer { - /// - /// Return all cached local diagnostics (syntax, semantic) that belong to given document for the given StateSet (analyzer). - /// Otherwise, return null. - /// For the latter case, indicates if the analyzer is suppressed - /// for the given document/project. If suppressed, the caller does not need to compute the diagnostics for the given - /// analyzer. Otherwise, diagnostics need to be computed. - /// - private (ActiveFileState, DocumentAnalysisData?) TryGetCachedDocumentAnalysisData( - TextDocument document, StateSet stateSet, - AnalysisKind kind, VersionStamp version, - BackgroundAnalysisScope analysisScope, - CompilerDiagnosticsScope compilerDiagnosticsScope, - bool isActiveDocument, bool isVisibleDocument, - bool isOpenDocument, bool isGeneratedRazorDocument, - CancellationToken cancellationToken, - out bool isAnalyzerSuppressed) - { - Debug.Assert(isActiveDocument || isOpenDocument || isGeneratedRazorDocument); - - isAnalyzerSuppressed = false; - - try - { - var state = stateSet.GetOrCreateActiveFileState(document.Id); - var existingData = state.GetAnalysisData(kind); - - if (existingData.Version == version) - { - return (state, existingData); - } - - // Check whether analyzer is suppressed for project or document. - // If so, we set the flag indicating that the client can skip analysis for this document. - // Regardless of whether or not the analyzer is suppressed for project or document, - // we return null to indicate that no diagnostics are cached for this document for the given version. - isAnalyzerSuppressed = !DocumentAnalysisExecutor.IsAnalyzerEnabledForProject(stateSet.Analyzer, document.Project, GlobalOptions) || - !IsAnalyzerEnabledForDocument(stateSet.Analyzer, existingData, analysisScope, compilerDiagnosticsScope, - isActiveDocument, isVisibleDocument, isOpenDocument, isGeneratedRazorDocument); - return (state, null); - } - catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) - { - throw ExceptionUtilities.Unreachable(); - } - - static bool IsAnalyzerEnabledForDocument( - DiagnosticAnalyzer analyzer, - DocumentAnalysisData previousData, - BackgroundAnalysisScope analysisScope, - CompilerDiagnosticsScope compilerDiagnosticsScope, - bool isActiveDocument, - bool isVisibleDocument, - bool isOpenDocument, - bool isGeneratedRazorDocument) - { - Debug.Assert(!isActiveDocument || isOpenDocument || isGeneratedRazorDocument); - - if (isGeneratedRazorDocument) - { - // This is a generated Razor document, and they always want all analyzer diagnostics. - return true; - } - - if (analyzer.IsCompilerAnalyzer()) - { - return compilerDiagnosticsScope switch - { - // Compiler diagnostics are disabled for all documents. - CompilerDiagnosticsScope.None => false, - - // Compiler diagnostics are enabled for visible documents and open documents which had errors/warnings in prior snapshot. - CompilerDiagnosticsScope.VisibleFilesAndOpenFilesWithPreviouslyReportedDiagnostics => IsVisibleDocumentOrOpenDocumentWithPriorReportedVisibleDiagnostics(isVisibleDocument, isOpenDocument, previousData), - - // Compiler diagnostics are enabled for all open documents. - CompilerDiagnosticsScope.OpenFiles => isOpenDocument, - - // Compiler diagnostics are enabled for all documents. - CompilerDiagnosticsScope.FullSolution => true, - - _ => throw ExceptionUtilities.UnexpectedValue(analysisScope) - }; - } - else - { - return analysisScope switch - { - // Analyzers are disabled for all documents. - BackgroundAnalysisScope.None => false, - - // Analyzers are enabled for visible documents and open documents which had errors/warnings in prior snapshot. - BackgroundAnalysisScope.VisibleFilesAndOpenFilesWithPreviouslyReportedDiagnostics => IsVisibleDocumentOrOpenDocumentWithPriorReportedVisibleDiagnostics(isVisibleDocument, isOpenDocument, previousData), - - // Analyzers are enabled for all open documents. - BackgroundAnalysisScope.OpenFiles => isOpenDocument, - - // Analyzers are enabled for all documents. - BackgroundAnalysisScope.FullSolution => true, - - _ => throw ExceptionUtilities.UnexpectedValue(analysisScope) - }; - } - } - - static bool IsVisibleDocumentOrOpenDocumentWithPriorReportedVisibleDiagnostics( - bool isVisibleDocument, - bool isOpenDocument, - DocumentAnalysisData previousData) - { - if (isVisibleDocument) - return true; - - return isOpenDocument - && previousData.Items.Any(static d => d.Severity is DiagnosticSeverity.Error or DiagnosticSeverity.Warning or DiagnosticSeverity.Info); - } - } - - /// - /// Computes all local diagnostics (syntax, semantic) that belong to given document for the given StateSet (analyzer). - /// - private static async Task ComputeDocumentAnalysisDataAsync( - DocumentAnalysisExecutor executor, DiagnosticAnalyzer analyzer, ActiveFileState state, bool logTelemetry, CancellationToken cancellationToken) - { - var kind = executor.AnalysisScope.Kind; - var document = executor.AnalysisScope.TextDocument; - - // get log title and functionId - GetLogFunctionIdAndTitle(kind, out var functionId, out var title); - - var logLevel = logTelemetry ? LogLevel.Information : LogLevel.Trace; - using (Logger.LogBlock(functionId, GetDocumentLogMessage, title, document, analyzer, cancellationToken, logLevel: logLevel)) - { - try - { - var diagnostics = await executor.ComputeDiagnosticsAsync(analyzer, cancellationToken).ConfigureAwait(false); - - // this is no-op in product. only run in test environment - Logger.Log(functionId, (t, d, a, ds) => $"{GetDocumentLogMessage(t, d, a)}, {string.Join(Environment.NewLine, ds)}", - title, document, analyzer, diagnostics); - - var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); - var existingData = state.GetAnalysisData(kind); - var text = await document.GetValueTextAsync(cancellationToken).ConfigureAwait(false); - - // we only care about local diagnostics - return new DocumentAnalysisData(version, text.Lines.Count, existingData.Items, diagnostics.ToImmutableArrayOrEmpty()); - } - catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) - { - throw ExceptionUtilities.Unreachable(); - } - } - } - /// /// Return all diagnostics that belong to given project for the given StateSets (analyzers) either from cache or by calculating them /// diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs index 8400a75dbbf32..3adf3d82478a6 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_BuildSynchronization.cs @@ -25,7 +25,6 @@ internal partial class DiagnosticIncrementalAnalyzer public async ValueTask SynchronizeWithBuildAsync( ImmutableDictionary> buildDiagnostics, - TaskQueue postBuildAndErrorListRefreshTaskQueue, bool onBuildCompleted, CancellationToken cancellationToken) { diff --git a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs index 4510c3f95c160..ebd12b30a0bf0 100644 --- a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs +++ b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs @@ -51,16 +51,6 @@ internal sealed class ExternalErrorDiagnosticUpdateSource : IDiagnosticUpdateSou /// private readonly TaskQueue _taskQueue; - /// - /// Task queue to serialize all the post-build and post error list refresh tasks. - /// Error list refresh requires build/live diagnostics de-duping to complete, which happens during - /// . - /// Computationally expensive tasks such as writing build errors into persistent storage, - /// invoking background analysis on open files/solution after build completes, etc. - /// are added to this task queue to help ensure faster error list refresh. - /// - private readonly TaskQueue _postBuildAndErrorListRefreshTaskQueue; - // Gate for concurrent access and fields guarded with this gate. private readonly object _gate = new(); private InProgressState? _stateDoNotAccessDirectly; @@ -97,7 +87,6 @@ internal ExternalErrorDiagnosticUpdateSource( { // use queue to serialize work. no lock needed _taskQueue = new TaskQueue(listener, TaskScheduler.Default); - _postBuildAndErrorListRefreshTaskQueue = new TaskQueue(listener, TaskScheduler.Default); _disposalToken = disposalToken; _workspace = workspace; @@ -357,30 +346,23 @@ internal void OnSolutionBuildCompleted() // Enqueue build/live sync in the queue. _taskQueue.ScheduleTask("OnSolutionBuild", async () => { - try + // nothing to do + if (inProgressState == null) { - // nothing to do - if (inProgressState == null) - { - return; - } + return; + } - // Mark the status as updated to refresh error list before we invoke 'SyncBuildErrorsAndReportAsync', which can take some time to complete. - OnBuildProgressChanged(inProgressState, BuildProgress.Updated); + // Mark the status as updated to refresh error list before we invoke 'SyncBuildErrorsAndReportAsync', which can take some time to complete. + OnBuildProgressChanged(inProgressState, BuildProgress.Updated); - // We are about to update live analyzer data using one from build. - // pause live analyzer - using var operation = _notificationService.Start("BuildDone"); - if (_diagnosticService is DiagnosticAnalyzerService diagnosticService) - await SyncBuildErrorsAndReportOnBuildCompletedAsync(diagnosticService, inProgressState).ConfigureAwait(false); + // We are about to update live analyzer data using one from build. + // pause live analyzer + using var operation = _notificationService.Start("BuildDone"); + if (_diagnosticService is DiagnosticAnalyzerService diagnosticService) + await SyncBuildErrorsAndReportOnBuildCompletedAsync(diagnosticService, inProgressState).ConfigureAwait(false); - // Mark build as complete. - OnBuildProgressChanged(inProgressState, BuildProgress.Done); - } - finally - { - await _postBuildAndErrorListRefreshTaskQueue.LastScheduledTask.ConfigureAwait(false); - } + // Mark build as complete. + OnBuildProgressChanged(inProgressState, BuildProgress.Done); }, GetApplicableCancellationToken(inProgressState)); } @@ -419,7 +401,7 @@ private ValueTask SyncBuildErrorsAndReportOnBuildCompletedAsync(DiagnosticAnalyz ProcessAndRaiseDiagnosticsUpdated(argsBuilder.ToImmutableAndClear()); // Report pending live errors - return diagnosticService.SynchronizeWithBuildAsync(_workspace, pendingLiveErrorsToSync, _postBuildAndErrorListRefreshTaskQueue, onBuildCompleted: true, cancellationToken); + return diagnosticService.SynchronizeWithBuildAsync(_workspace, pendingLiveErrorsToSync, onBuildCompleted: true, cancellationToken); } private DiagnosticsUpdatedArgs CreateArgsToReportBuildErrors(T item, Solution solution, ImmutableArray buildErrors) @@ -535,7 +517,7 @@ private ValueTask SetLiveErrorsForProjectAsync(ProjectId projectId, ImmutableArr { // make those errors live errors var map = ProjectErrorMap.Empty.Add(projectId, diagnostics); - return diagnosticAnalyzerService.SynchronizeWithBuildAsync(_workspace, map, _postBuildAndErrorListRefreshTaskQueue, onBuildCompleted: false, cancellationToken); + return diagnosticAnalyzerService.SynchronizeWithBuildAsync(_workspace, map, onBuildCompleted: false, cancellationToken); } return default; From 07457ae2822f13ac4b2533cd0568a1b0214aa8b9 Mon Sep 17 00:00:00 2001 From: DoctorKrolic <70431552+DoctorKrolic@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:30:13 +0300 Subject: [PATCH 63/94] Do not return nonexistent kinds in `SyntaxFacts`' methods (#72264) --- .../CSharp/Portable/Syntax/SyntaxKind.cs | 6 ++ .../CSharp/Portable/Syntax/SyntaxKindFacts.cs | 31 ++++++++- .../CSharp/Test/Syntax/Syntax/SyntaxTests.cs | 66 +++++++++++++++++++ .../Test/Syntax/Syntax/SyntaxFactsTest.vb | 12 ++++ 4 files changed, 112 insertions(+), 3 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs b/src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs index ba9c1c76ae68f..69c3de99c3b5a 100644 --- a/src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs +++ b/src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs @@ -77,6 +77,9 @@ public enum SyntaxKind : ushort /// Represents .. token. DotDotToken = 8222, + // Values ranging from 8193 (TildeToken) to 8287 (GreaterThanGreaterThanGreaterThanEqualsToken) are reserved for punctuation kinds. + // This gap is included within that range. So if you add a value here make sure `SyntaxFacts.GetPunctuationKinds` includes it in the returned enumeration + // additional xml tokens /// Represents /> token. SlashGreaterThanToken = 8232, // xml empty element end @@ -95,6 +98,9 @@ public enum SyntaxKind : ushort /// Represents ?> token. XmlProcessingInstructionEndToken = 8239, // ?> + // Values ranging from 8193 (TildeToken) to 8287 (GreaterThanGreaterThanGreaterThanEqualsToken) are reserved for punctuation kinds. + // This gap is included within that range. So if you add a value here make sure `SyntaxFacts.GetPunctuationKinds` includes it in the returned enumeration + // compound punctuation /// Represents || token. BarBarToken = 8260, diff --git a/src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs b/src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs index 652092a89b94f..6a19e29e2e469 100644 --- a/src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs +++ b/src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs @@ -2,7 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; +using System.Diagnostics; namespace Microsoft.CodeAnalysis.CSharp { @@ -17,6 +19,7 @@ public static IEnumerable GetReservedKeywordKinds() { for (int i = (int)SyntaxKind.BoolKeyword; i <= (int)SyntaxKind.ImplicitKeyword; i++) { + Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); yield return (SyntaxKind)i; } } @@ -142,9 +145,10 @@ public static IEnumerable GetPreprocessorKeywordKinds() yield return SyntaxKind.TrueKeyword; yield return SyntaxKind.FalseKeyword; yield return SyntaxKind.DefaultKeyword; - yield return SyntaxKind.HiddenKeyword; + for (int i = (int)SyntaxKind.ElifKeyword; i <= (int)SyntaxKind.RestoreKeyword; i++) { + Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); yield return (SyntaxKind)i; } } @@ -172,10 +176,26 @@ private static bool IsDebuggerSpecialPunctuation(SyntaxKind kind) public static IEnumerable GetPunctuationKinds() { - for (int i = (int)SyntaxKind.TildeToken; i <= (int)SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken; i++) + for (int i = (int)SyntaxKind.TildeToken; i <= (int)SyntaxKind.DotDotToken; i++) + { + Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); + yield return (SyntaxKind)i; + } + + for (int i = (int)SyntaxKind.SlashGreaterThanToken; i <= (int)SyntaxKind.XmlProcessingInstructionEndToken; i++) { + Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); yield return (SyntaxKind)i; } + + for (int i = (int)SyntaxKind.BarBarToken; i <= (int)SyntaxKind.QuestionQuestionEqualsToken; i++) + { + Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); + yield return (SyntaxKind)i; + } + + yield return SyntaxKind.GreaterThanGreaterThanGreaterThanToken; + yield return SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken; } public static bool IsPunctuationOrKeyword(SyntaxKind kind) @@ -1148,7 +1168,12 @@ public static IEnumerable GetContextualKeywordKinds() { for (int i = (int)SyntaxKind.YieldKeyword; i <= (int)SyntaxKind.FileKeyword; i++) { - yield return (SyntaxKind)i; + // 8441 corresponds to a deleted kind (DataKeyword) that was previously shipped. + if (i != 8441) + { + Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); + yield return (SyntaxKind)i; + } } } diff --git a/src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxTests.cs b/src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxTests.cs index f8f0d20bfe449..b9d54c3d01f96 100644 --- a/src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxTests.cs +++ b/src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxTests.cs @@ -5,6 +5,9 @@ #nullable disable using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Text; using Roslyn.Test.Utilities; @@ -276,5 +279,68 @@ public void IsAttributeTargetSpecifier() } } } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/72300")] + public void TestAllKindsReturnedFromGetKindsMethodsExist() + { + foreach (var method in typeof(SyntaxFacts).GetMethods(BindingFlags.Public | BindingFlags.Static)) + { + if (method.ReturnType == typeof(IEnumerable) && method.GetParameters() is []) + { + foreach (var kind in (IEnumerable)method.Invoke(null, null)) + { + Assert.True(Enum.IsDefined(typeof(SyntaxKind), kind), $"Nonexistent kind '{kind}' returned from method '{method.Name}'"); + } + } + } + } + + [Theory, WorkItem("https://github.com/dotnet/roslyn/issues/72300")] + [InlineData(nameof(SyntaxFacts.GetContextualKeywordKinds), SyntaxKind.YieldKeyword, SyntaxKind.ElifKeyword)] + [InlineData(nameof(SyntaxFacts.GetPunctuationKinds), SyntaxKind.TildeToken, SyntaxKind.BoolKeyword)] + [InlineData(nameof(SyntaxFacts.GetReservedKeywordKinds), SyntaxKind.BoolKeyword, SyntaxKind.YieldKeyword)] + public void TestRangeBasedGetKindsMethodsReturnExpectedResults(string methodName, SyntaxKind lowerBoundInclusive, SyntaxKind upperBoundExclusive) + { + var method = typeof(SyntaxFacts).GetMethod(methodName, BindingFlags.Public | BindingFlags.Static); + + Assert.NotNull(method); + Assert.Equal(0, method.GetParameters().Length); + Assert.Equal(typeof(IEnumerable), method.ReturnType); + + var returnedKindsInts = ((IEnumerable)method.Invoke(null, null)).Select(static k => (int)k).ToHashSet(); + + for (int i = (int)lowerBoundInclusive; i < (int)upperBoundExclusive; i++) + { + if (Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)) + { + Assert.True(returnedKindsInts.Remove(i)); + } + else + { + Assert.DoesNotContain(i, returnedKindsInts); + } + } + + // We've already removed all expected kinds from the set. It should be empty now + Assert.Empty(returnedKindsInts); + } + + [Fact] + public void TestGetPreprocessorKeywordKindsReturnsExpectedResults() + { + var returnedKindsInts = SyntaxFacts.GetPreprocessorKeywordKinds().Select(static k => (int)k).ToHashSet(); + + Assert.True(returnedKindsInts.Remove((int)SyntaxKind.TrueKeyword)); + Assert.True(returnedKindsInts.Remove((int)SyntaxKind.FalseKeyword)); + Assert.True(returnedKindsInts.Remove((int)SyntaxKind.DefaultKeyword)); + + for (int i = (int)SyntaxKind.ElifKeyword; i < (int)SyntaxKind.ReferenceKeyword; i++) + { + Assert.True(returnedKindsInts.Remove(i)); + } + + // We've already removed all expected kinds from the set. It should be empty now + Assert.Empty(returnedKindsInts); + } } } diff --git a/src/Compilers/VisualBasic/Test/Syntax/Syntax/SyntaxFactsTest.vb b/src/Compilers/VisualBasic/Test/Syntax/Syntax/SyntaxFactsTest.vb index 3b82a4a5be9fd..0c1d011590a7e 100644 --- a/src/Compilers/VisualBasic/Test/Syntax/Syntax/SyntaxFactsTest.vb +++ b/src/Compilers/VisualBasic/Test/Syntax/Syntax/SyntaxFactsTest.vb @@ -3,6 +3,7 @@ ' See the LICENSE file in the project root for more information. Imports System.IO +Imports System.Reflection Imports System.Text Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.VisualBasic @@ -1262,4 +1263,15 @@ End Module Assert.Equal(isReserved, SyntaxFacts.IsReservedTupleElementName(elementName)) End Sub + + Public Sub TestAllKindsReturnedFromGetKindsMethodsExist() + For Each method In GetType(SyntaxFacts).GetMethods(BindingFlags.Public Or BindingFlags.Static) + If method.ReturnType = GetType(IEnumerable(Of SyntaxKind)) AndAlso method.GetParameters().Length = 0 Then + For Each kind As SyntaxKind In DirectCast(method.Invoke(Nothing, Nothing), IEnumerable(Of SyntaxKind)) + Assert.True([Enum].IsDefined(GetType(SyntaxKind), kind), $"Nonexistent kind '{kind}' returned from method '{method.Name}'") + Next + End If + Next + End Sub + End Class From 8f55f83e90e7152003696bb89ed8ee5292e279e8 Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Fri, 22 Mar 2024 14:01:59 -0700 Subject: [PATCH 64/94] Skip failing test (#72679) Opened https://github.com/dotnet/roslyn/issues/72678 for investigation. --- src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs b/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs index ccc34c3e368d9..64cc4a4f131e7 100644 --- a/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs +++ b/src/Compilers/CSharp/Test/EndToEnd/EndToEndTests.cs @@ -172,7 +172,7 @@ void M2() { // This test is a canary attempting to make sure that we don't regress the # of fluent calls that // the compiler can handle. - [Fact, WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1874763")] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/72678"), WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1874763")] public void OverflowOnFluentCall_ExtensionMethods() { int numberFluentCalls = (IntPtr.Size, ExecutionConditionUtil.Configuration, RuntimeUtilities.IsDesktopRuntime, RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) switch From 3ee99c784ae3daa9bc78cf48637b85133be9e27b Mon Sep 17 00:00:00 2001 From: Rich Lander Date: Fri, 22 Mar 2024 14:35:29 -0700 Subject: [PATCH 65/94] Fix indent --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 57258ee73c93d..f12ed1cca1a1e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -148,7 +148,7 @@ stages: # Like template `eng/common/templates/jobs/source-build.yml` - job: Source_Build_Managed displayName: Source-Build (Managed) - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' + container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9 pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $[replace(replace(eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), True, 'NetCore-Svc-Public' ), False, 'NetCore-Public')] From 41a8baf630ea83c44c5d75c0166181614618da13 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Fri, 22 Mar 2024 14:39:50 -0700 Subject: [PATCH 66/94] Add a test and address review comment --- .../Test2/CodeFixes/CodeFixServiceTests.vb | 84 +++++++++++++++++++ .../Diagnostics/DiagnosticProviderTests.vb | 2 +- .../Features/CodeFixes/CodeFixService.cs | 5 +- 3 files changed, 89 insertions(+), 2 deletions(-) diff --git a/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb b/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb index 10c96b8aa8e94..fcea88bb58538 100644 --- a/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb +++ b/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb @@ -9,6 +9,7 @@ Imports System.Reflection Imports System.Threading Imports Microsoft.CodeAnalysis.CodeActions Imports Microsoft.CodeAnalysis.CodeFixes +Imports Microsoft.CodeAnalysis.Copilot Imports Microsoft.CodeAnalysis.Diagnostics Imports Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests Imports Microsoft.CodeAnalysis.Editor.UnitTests @@ -17,6 +18,8 @@ Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces Imports Microsoft.CodeAnalysis.ErrorLogger Imports Microsoft.CodeAnalysis.Host Imports Microsoft.CodeAnalysis.Host.Mef +Imports Microsoft.CodeAnalysis.Text +Imports Microsoft.CodeAnalysis.UnitTests Imports Roslyn.Utilities Namespace Microsoft.CodeAnalysis.Editor.Implementation.CodeFixes.UnitTests @@ -263,5 +266,86 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.CodeFixes.UnitTests #Enable Warning RS0005 End Function End Class + + + Public Async Function TestCopilotCodeAnalysisServiceWithoutSyntaxTree() As Task + Dim workspaceDefinition = + + + + var x = {}; // e.g., TypeScript code or anything else that doesn't support compilations + + + + + Dim composition = EditorTestCompositions.EditorFeatures.AddParts( + GetType(NoCompilationContentTypeDefinitions), + GetType(NoCompilationContentTypeLanguageService), + GetType(NoCompilationCopilotCodeAnalysisService)) + + Using workspace = EditorTestWorkspace.Create(workspaceDefinition, composition:=composition) + + Dim document = workspace.CurrentSolution.Projects.Single().Documents.Single() + Dim diagnosticsXml = + + + MappedFile=<%= document.Name %> MappedLine="0" MappedColumn="0" + OriginalFile=<%= document.Name %> OriginalLine="0" OriginalColumn="0" + Message=<%= "Test Message" %>/> + + Dim diagnostics = DiagnosticProviderTests.GetExpectedDiagnostics(workspace, diagnosticsXml) + + Dim copilotCodeAnalysisService = document.Project.Services.GetService(Of ICopilotCodeAnalysisService)() + Dim noCompilationCopilotCodeAnalysisService = DirectCast(copilotCodeAnalysisService, NoCompilationCopilotCodeAnalysisService) + + NoCompilationCopilotCodeAnalysisService.Diagnostics = diagnostics.SelectAsArray(Of Diagnostic)( + Function(d) d.ToDiagnosticAsync(document.Project, CancellationToken.None).Result) + Dim codefixService = workspace.ExportProvider.GetExportedValue(Of ICodeFixService) + + ' Make sure we don't crash + Dim unused = Await codefixService.GetMostSevereFixAsync( + document, Text.TextSpan.FromBounds(0, 0), New DefaultCodeActionRequestPriorityProvider(), CodeActionOptions.DefaultProvider, CancellationToken.None) + End Using + End Function + + + Private Class NoCompilationCopilotCodeAnalysisService + Implements ICopilotCodeAnalysisService + + + + Public Sub New() + End Sub + + Public Shared Property Diagnostics As ImmutableArray(Of Diagnostic) = ImmutableArray(Of Diagnostic).Empty + + Public Function IsRefineOptionEnabledAsync() As Task(Of Boolean) Implements ICopilotCodeAnalysisService.IsRefineOptionEnabledAsync + Return Task.FromResult(True) + End Function + + Public Function IsCodeAnalysisOptionEnabledAsync() As Task(Of Boolean) Implements ICopilotCodeAnalysisService.IsCodeAnalysisOptionEnabledAsync + Return Task.FromResult(True) + End Function + + Public Function IsAvailableAsync(cancellationToken As CancellationToken) As Task(Of Boolean) Implements ICopilotCodeAnalysisService.IsAvailableAsync + Return Task.FromResult(True) + End Function + + Public Function GetAvailablePromptTitlesAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of String)) Implements ICopilotCodeAnalysisService.GetAvailablePromptTitlesAsync + Return Task.FromResult(ImmutableArray.Create("Title")) + End Function + + Public Function AnalyzeDocumentAsync(document As Document, span As TextSpan?, promptTitle As String, cancellationToken As CancellationToken) As Task Implements ICopilotCodeAnalysisService.AnalyzeDocumentAsync + Return Task.CompletedTask + End Function + + Public Function GetCachedDocumentDiagnosticsAsync(document As Document, promptTitles As ImmutableArray(Of String), cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of Diagnostic)) Implements ICopilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync + Return Task.FromResult(Diagnostics) + End Function + + Public Function StartRefinementSessionAsync(oldDocument As Document, newDocument As Document, primaryDiagnostic As Diagnostic, cancellationToken As CancellationToken) As Task Implements ICopilotCodeAnalysisService.StartRefinementSessionAsync + Return Task.CompletedTask + End Function + End Class End Class End Namespace diff --git a/src/EditorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb b/src/EditorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb index 4768b8eab7245..858ed47dc6313 100644 --- a/src/EditorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb +++ b/src/EditorFeatures/Test2/Diagnostics/DiagnosticProviderTests.vb @@ -302,7 +302,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests Return analyzerService End Function - Private Shared Function GetExpectedDiagnostics(workspace As EditorTestWorkspace, diagnostics As XElement) As List(Of DiagnosticData) + Friend Shared Function GetExpectedDiagnostics(workspace As EditorTestWorkspace, diagnostics As XElement) As List(Of DiagnosticData) Dim result As New List(Of DiagnosticData) Dim mappedLine As Integer, mappedColumn As Integer, originalLine As Integer, originalColumn As Integer Dim Id As String, message As String, originalFile As String, mappedFile As String diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs index dee4670065e4c..600b4369eef98 100644 --- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs +++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs @@ -255,7 +255,10 @@ private static async Task> GetCopilotDiagnosticsA CodeActionRequestPriority? priority, CancellationToken cancellationToken) { - if (!(priority is null or CodeActionRequestPriority.Low) || document is not Document sourceDocument) + if (!(priority is null or CodeActionRequestPriority.Low)) + return []; + + if (document is not Document sourceDocument) return []; var diagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); From 161cfdf4398959ad50440b9f812eafb0b7fcb0e5 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 15:23:58 -0700 Subject: [PATCH 67/94] Simplify updating the primary workspace without passing in a version --- .../Core/Remote/SolutionChecksumUpdater.cs | 9 +- .../Services/ServiceHubServicesTests.cs | 12 +-- .../Services/SolutionServiceTests.cs | 97 +++++++++---------- .../IRemoteAssetSynchronizationService.cs | 19 ++-- .../Remote/ServiceHub/Host/RemoteWorkspace.cs | 48 ++------- .../Host/RemoteWorkspace_SolutionCaching.cs | 5 +- .../RemoteAssetSynchronizationService.cs | 4 +- 7 files changed, 75 insertions(+), 119 deletions(-) diff --git a/src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs b/src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs index 12dd252c7bec2..9febf4218e7e5 100644 --- a/src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs +++ b/src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs @@ -60,9 +60,6 @@ public SolutionChecksumUpdater( listener, shutdownToken); - // Use an equality comparer here as we will commonly get lots of change notifications that will all be - // associated with the same cancellation token controlling that batch of work. No need to enqueue the same - // token a huge number of times when we only need the single value of it when doing the work. _synchronizeWorkspaceQueue = new AsyncBatchingWorkQueue( DelayTimeSpan.NearImmediate, SynchronizePrimaryWorkspaceAsync, @@ -142,17 +139,15 @@ private void OnWorkspaceChanged(object? sender, WorkspaceChangeEventArgs e) private async ValueTask SynchronizePrimaryWorkspaceAsync(CancellationToken cancellationToken) { - var solution = _workspace.CurrentSolution; var client = await RemoteHostClient.TryGetClientAsync(_workspace, cancellationToken).ConfigureAwait(false); if (client == null) return; using (Logger.LogBlock(FunctionId.SolutionChecksumUpdater_SynchronizePrimaryWorkspace, cancellationToken)) { - var workspaceVersion = solution.WorkspaceVersion; await client.TryInvokeAsync( - solution, - (service, solution, cancellationToken) => service.SynchronizePrimaryWorkspaceAsync(solution, workspaceVersion, cancellationToken), + _workspace.CurrentSolution, + (service, solution, cancellationToken) => service.SynchronizePrimaryWorkspaceAsync(solution, cancellationToken), cancellationToken).ConfigureAwait(false); } } diff --git a/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs b/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs index 30022d8d436a0..9ba50f5f37516 100644 --- a/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs +++ b/src/VisualStudio/Core/Test.Next/Services/ServiceHubServicesTests.cs @@ -137,7 +137,7 @@ public async Task TestDesignerAttributes() // Ensure remote workspace is in sync with normal workspace. var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, solution.WorkspaceVersion, CancellationToken.None); + await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None); var callback = new DesignerAttributeComputerCallback(); @@ -188,7 +188,7 @@ public async Task TestDesignerAttributesUnsupportedLanguage() // Ensure remote workspace is in sync with normal workspace. var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, solution.WorkspaceVersion, CancellationToken.None); + await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None); var callback = new DesignerAttributeComputerCallback(); @@ -359,9 +359,8 @@ public async Task TestRemoteWorkspaceCircularReferences() using var remoteWorkspace = new RemoteWorkspace(FeaturesTestCompositions.RemoteHost.GetHostServices()); // this shouldn't throw exception - var (solution, updated) = await remoteWorkspace.GetTestAccessor().TryUpdateWorkspaceCurrentSolutionAsync( - remoteWorkspace.GetTestAccessor().CreateSolutionFromInfo(solutionInfo), workspaceVersion: 1); - Assert.True(updated); + var solution = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync( + remoteWorkspace.GetTestAccessor().CreateSolutionFromInfo(solutionInfo)); Assert.NotNull(solution); } @@ -828,10 +827,9 @@ private static (Project project, ImmutableArray documents) GetProjectA private static async Task UpdatePrimaryWorkspace(RemoteHostClient client, Solution solution) { - var workspaceVersion = solution.WorkspaceVersion; await client.TryInvokeAsync( solution, - async (service, solutionInfo, cancellationToken) => await service.SynchronizePrimaryWorkspaceAsync(solutionInfo, workspaceVersion, cancellationToken), + async (service, solutionInfo, cancellationToken) => await service.SynchronizePrimaryWorkspaceAsync(solutionInfo, cancellationToken), CancellationToken.None); } diff --git a/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs b/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs index 3f6703acfb73d..d4957a9b777d2 100644 --- a/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs +++ b/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs @@ -48,7 +48,7 @@ public async Task TestCreation() var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); } @@ -66,7 +66,7 @@ public async Task TestGetSolutionWithPrimaryFlag(bool updatePrimaryBranch) var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); - var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, solution.WorkspaceVersion, cancellationToken: CancellationToken.None); + var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, cancellationToken: CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); Assert.Equal(WorkspaceKind.RemoteWorkspace, synched.WorkspaceKind); @@ -88,7 +88,7 @@ public async Task TestStrongNameProvider() var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.CurrentSolution); var solutionChecksum = await workspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None); - var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); var compilationOptions = solution.Projects.First().CompilationOptions; @@ -117,7 +117,7 @@ public async Task TestStrongNameProviderEmpty() var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, workspace.CurrentSolution); var solutionChecksum = await workspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None); - var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); var compilationOptions = solution.Projects.First().CompilationOptions; @@ -141,8 +141,8 @@ public async Task TestCache() var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var first = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); - var second = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var first = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); + var second = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); // same instance from cache Assert.True(object.ReferenceEquals(first, second)); @@ -345,44 +345,39 @@ public async Task TestRemoteWorkspace() var remoteSolution1 = await GetInitialOOPSolutionAsync(remoteWorkspace, assetProvider, solution1); await Verify(remoteWorkspace, solution1, remoteSolution1, expectRemoteSolutionToCurrent: true); - var version = solution1.WorkspaceVersion; // update remote workspace var currentSolution = remoteSolution1.WithDocumentText(remoteSolution1.Projects.First().Documents.First().Id, SourceText.From(code + " class Test2 { }")); - var (oopSolution2, _) = await remoteWorkspace.GetTestAccessor().TryUpdateWorkspaceCurrentSolutionAsync(currentSolution, ++version); + var oopSolution2 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(currentSolution); await Verify(remoteWorkspace, currentSolution, oopSolution2, expectRemoteSolutionToCurrent: true); // move backward - await Verify(remoteWorkspace, remoteSolution1, (await remoteWorkspace.GetTestAccessor().TryUpdateWorkspaceCurrentSolutionAsync(remoteSolution1, solution1.WorkspaceVersion)).solution, expectRemoteSolutionToCurrent: false); + await Verify(remoteWorkspace, remoteSolution1, await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(remoteSolution1), expectRemoteSolutionToCurrent: false); // move forward currentSolution = oopSolution2.WithDocumentText(oopSolution2.Projects.First().Documents.First().Id, SourceText.From(code + " class Test3 { }")); - var remoteSolution3 = (await remoteWorkspace.GetTestAccessor().TryUpdateWorkspaceCurrentSolutionAsync(currentSolution, ++version)).solution; + var remoteSolution3 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(currentSolution); await Verify(remoteWorkspace, currentSolution, remoteSolution3, expectRemoteSolutionToCurrent: true); // move to new solution backward var solutionInfo2 = await assetProvider.CreateSolutionInfoAsync(await solution1.CompilationState.GetChecksumAsync(CancellationToken.None), CancellationToken.None); var solution2 = remoteWorkspace.GetTestAccessor().CreateSolutionFromInfo(solutionInfo2); - Assert.False((await remoteWorkspace.GetTestAccessor().TryUpdateWorkspaceCurrentSolutionAsync( - solution2, solution1.WorkspaceVersion)).updated); // move to new solution forward - var (solution3, updated3) = await remoteWorkspace.GetTestAccessor().TryUpdateWorkspaceCurrentSolutionAsync( - solution2, ++version); + var solution3 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(solution2); Assert.NotNull(solution3); - Assert.True(updated3); await Verify(remoteWorkspace, solution1, solution3, expectRemoteSolutionToCurrent: true); static async Task GetInitialOOPSolutionAsync(RemoteWorkspace remoteWorkspace, AssetProvider assetProvider, Solution solution) { // set up initial solution var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, solution.WorkspaceVersion, CancellationToken.None); + await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None); // get solution in remote host - return await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + return await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); } static async Task Verify(RemoteWorkspace remoteWorkspace, Solution givenSolution, Solution remoteSolution, bool expectRemoteSolutionToCurrent) @@ -407,7 +402,7 @@ public async Task TestAddingProjectsWithExplicitOptions(bool useDefaultOptionVal solution = solution.RemoveProject(solution.ProjectIds.Single()); var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: 0, CancellationToken.None); + var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); // Add a C# project and a VB project, set some options, and check again @@ -429,7 +424,7 @@ public async Task TestAddingProjectsWithExplicitOptions(bool useDefaultOptionVal assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: 2, CancellationToken.None); + synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); } @@ -447,7 +442,7 @@ public async Task TestFrozenSourceGeneratedDocument() // First sync the solution over that has a generator var assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, solution); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: 0, CancellationToken.None); + var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); // Now freeze with some content @@ -457,7 +452,7 @@ public async Task TestFrozenSourceGeneratedDocument() assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, frozenSolution1); solutionChecksum = await frozenSolution1.CompilationState.GetChecksumAsync(CancellationToken.None); - synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: 1, CancellationToken.None); + synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); // Try freezing with some different content from the original solution @@ -466,7 +461,7 @@ public async Task TestFrozenSourceGeneratedDocument() assetProvider = await GetAssetProviderAsync(workspace, remoteWorkspace, frozenSolution2); solutionChecksum = await frozenSolution2.CompilationState.GetChecksumAsync(CancellationToken.None); - synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: 2, CancellationToken.None); + synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None)); } @@ -493,7 +488,7 @@ public async Task TestPartialProjectSync_GetSolutionFirst() await solution.AppendAssetMapAsync(map, CancellationToken.None); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: solution.WorkspaceVersion, CancellationToken.None); + var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await syncedFullSolution.CompilationState.GetChecksumAsync(CancellationToken.None)); Assert.Equal(2, syncedFullSolution.Projects.Count()); @@ -501,13 +496,13 @@ public async Task TestPartialProjectSync_GetSolutionFirst() // Syncing project1 should do nothing as syncing the solution already synced it over. var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project1SyncedSolution.Projects.Count()); // Syncing project2 should do nothing as syncing the solution already synced it over. var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project2SyncedSolution.Projects.Count()); } @@ -533,20 +528,20 @@ public async Task TestPartialProjectSync_GetSolutionLast() // Syncing project 1 should just since it over. await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project1SyncedSolution.Projects.Count()); Assert.Equal(project1.Name, project1SyncedSolution.Projects.Single().Name); // Syncing project 2 should end up with only p2 synced over. await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project2SyncedSolution.Projects.Count()); // then syncing the whole project should now copy both over. await solution.AppendAssetMapAsync(map, CancellationToken.None); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: solution.WorkspaceVersion, CancellationToken.None); + var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(solutionChecksum, await syncedFullSolution.CompilationState.GetChecksumAsync(CancellationToken.None)); Assert.Equal(2, syncedFullSolution.Projects.Count()); @@ -574,14 +569,14 @@ public async Task TestPartialProjectSync_GetDependentProjects1() await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project2SyncedSolution.Projects.Count()); Assert.Equal(project2.Name, project2SyncedSolution.Projects.Single().Name); // syncing project 3 should sync project 2 as well because of the p2p ref await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); - var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project3SyncedSolution.Projects.Count()); } @@ -608,20 +603,20 @@ public async Task TestPartialProjectSync_GetDependentProjects2() // syncing P3 should since project P2 as well because of the p2p ref await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); - var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project3SyncedSolution.Projects.Count()); // if we then sync just P2, we should still have only P2 in the synced cone await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project2SyncedSolution.Projects.Count()); AssertEx.Equal(project2.Name, project2SyncedSolution.Projects.Single().Name); // if we then sync just P1, we should only have it in its own cone. await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project1SyncedSolution.Projects.Count()); AssertEx.Equal(project1.Name, project1SyncedSolution.Projects.Single().Name); } @@ -650,19 +645,19 @@ public async Task TestPartialProjectSync_GetDependentProjects3() // syncing project3 should since project2 and project1 as well because of the p2p ref await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); - var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(3, project3SyncedSolution.Projects.Count()); // syncing project2 should only have it and project 1. await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project2SyncedSolution.Projects.Count()); // syncing project1 should only be itself await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project1SyncedSolution.Projects.Count()); } @@ -690,19 +685,19 @@ public async Task TestPartialProjectSync_GetDependentProjects4() // syncing project3 should since project2 and project1 as well because of the p2p ref await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None); var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None); - var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(3, project3SyncedSolution.Projects.Count()); // Syncing project2 should only have a cone with itself. await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project2SyncedSolution.Projects.Count()); // Syncing project1 should only have a cone with itself. await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project1SyncedSolution.Projects.Count()); } @@ -728,14 +723,14 @@ public async Task TestPartialProjectSync_Options1() // Syncing over project1 should give us 1 set of options on the OOP side. await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project1SyncedSolution.Projects.Count()); Assert.Equal(project1.Name, project1SyncedSolution.Projects.Single().Name); // Syncing over project2 should also only be one set of options. await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(1, project2SyncedSolution.Projects.Count()); } @@ -761,7 +756,7 @@ public async Task TestPartialProjectSync_DoesNotSeeChangesOutsideOfCone() // Do the initial full sync await solution.AppendAssetMapAsync(map, CancellationToken.None); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: solution.WorkspaceVersion, CancellationToken.None); + var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(2, fullSyncedSolution.Projects.Count()); // Mutate both projects to each have a document in it. @@ -773,7 +768,7 @@ public async Task TestPartialProjectSync_DoesNotSeeChangesOutsideOfCone() { await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project1SyncedSolution.Projects.Count()); var csharpProject = project1SyncedSolution.Projects.Single(p => p.Language == LanguageNames.CSharp); var vbProject = project1SyncedSolution.Projects.Single(p => p.Language == LanguageNames.VisualBasic); @@ -785,7 +780,7 @@ public async Task TestPartialProjectSync_DoesNotSeeChangesOutsideOfCone() { await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None); var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None); - var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project2SyncedSolution.Projects.Count()); var csharpProject = project2SyncedSolution.Projects.Single(p => p.Language == LanguageNames.CSharp); var vbProject = project2SyncedSolution.Projects.Single(p => p.Language == LanguageNames.VisualBasic); @@ -816,7 +811,7 @@ public async Task TestPartialProjectSync_AddP2PRef() // Do the initial full sync await solution.AppendAssetMapAsync(map, CancellationToken.None); var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); - var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, workspaceVersion: solution.WorkspaceVersion, CancellationToken.None); + var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); Assert.Equal(2, fullSyncedSolution.Projects.Count()); // Mutate both projects to have a document in it, and add a p2p ref from project1 to project2 @@ -829,7 +824,7 @@ public async Task TestPartialProjectSync_AddP2PRef() { await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None); var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None); - var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(2, project1SyncedSolution.Projects.Count()); var project1Synced = project1SyncedSolution.GetRequiredProject(project1.Id); var project2Synced = project1SyncedSolution.GetRequiredProject(project2.Id); @@ -885,8 +880,8 @@ private static async Task VerifySolutionUpdate( var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None); // update primary workspace - await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, solution.WorkspaceVersion, CancellationToken.None); - var recoveredSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None); + var recoveredSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); oldSolutionValidator?.Invoke(recoveredSolution); Assert.Equal(WorkspaceKind.RemoteWorkspace, recoveredSolution.WorkspaceKind); @@ -898,13 +893,13 @@ private static async Task VerifySolutionUpdate( await newSolution.AppendAssetMapAsync(map, CancellationToken.None); // get solution without updating primary workspace - var recoveredNewSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + var recoveredNewSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(newSolutionChecksum, await recoveredNewSolution.CompilationState.GetChecksumAsync(CancellationToken.None)); // do same once updating primary workspace - await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, newSolutionChecksum, solution.WorkspaceVersion + 1, CancellationToken.None); - var third = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, workspaceVersion: -1, CancellationToken.None); + await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, newSolutionChecksum, CancellationToken.None); + var third = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, CancellationToken.None); Assert.Equal(newSolutionChecksum, await third.CompilationState.GetChecksumAsync(CancellationToken.None)); diff --git a/src/Workspaces/Remote/Core/IRemoteAssetSynchronizationService.cs b/src/Workspaces/Remote/Core/IRemoteAssetSynchronizationService.cs index 0b3c0f3a0bc77..455c83c4177ed 100644 --- a/src/Workspaces/Remote/Core/IRemoteAssetSynchronizationService.cs +++ b/src/Workspaces/Remote/Core/IRemoteAssetSynchronizationService.cs @@ -7,15 +7,14 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.CodeAnalysis.Remote +namespace Microsoft.CodeAnalysis.Remote; + +internal interface IRemoteAssetSynchronizationService { - internal interface IRemoteAssetSynchronizationService - { - /// - /// Synchronize data to OOP proactively so that the corresponding solution is often already available when - /// features call into it. - /// - ValueTask SynchronizePrimaryWorkspaceAsync(Checksum solutionChecksum, int workspaceVersion, CancellationToken cancellationToken); - ValueTask SynchronizeTextAsync(DocumentId documentId, Checksum baseTextChecksum, IEnumerable textChanges, CancellationToken cancellationToken); - } + /// + /// Synchronize data to OOP proactively so that the corresponding solution is often already available when features + /// call into it. + /// + ValueTask SynchronizePrimaryWorkspaceAsync(Checksum solutionChecksum, CancellationToken cancellationToken); + ValueTask SynchronizeTextAsync(DocumentId documentId, Checksum baseTextChecksum, IEnumerable textChanges, CancellationToken cancellationToken); } diff --git a/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs b/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs index 0471dfcde019e..3ac0f34a4bf9e 100644 --- a/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs +++ b/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs @@ -25,12 +25,6 @@ internal sealed partial class RemoteWorkspace : Workspace /// private readonly SemaphoreSlim _gate = new(initialCount: 1); - /// - /// Used to make sure we never move remote workspace backward. this version is the WorkspaceVersion of primary - /// solution in client (VS) we are currently caching. - /// - private int _currentRemoteWorkspaceVersion = -1; - // internal for testing purposes. internal RemoteWorkspace(HostServices hostServices) : base(hostServices, WorkspaceKind.RemoteWorkspace) @@ -52,7 +46,7 @@ public AssetProvider CreateAssetProvider(Checksum solutionChecksum, SolutionAsse /// them to be pre-populated for feature requests that come in soon after this call completes. /// public async Task UpdatePrimaryBranchSolutionAsync( - AssetProvider assetProvider, Checksum solutionChecksum, int workspaceVersion, CancellationToken cancellationToken) + AssetProvider assetProvider, Checksum solutionChecksum, CancellationToken cancellationToken) { // See if the current snapshot we're pointing at is the same one the host wants us to sync to. If so, we // don't need to do anything. @@ -65,7 +59,6 @@ public async Task UpdatePrimaryBranchSolutionAsync( await RunWithSolutionAsync( assetProvider, solutionChecksum, - workspaceVersion, updatePrimaryBranch: true, implementation: static _ => ValueTaskFactory.FromResult(false), cancellationToken).ConfigureAwait(false); @@ -90,13 +83,12 @@ await RunWithSolutionAsync( Func> implementation, CancellationToken cancellationToken) { - return RunWithSolutionAsync(assetProvider, solutionChecksum, workspaceVersion: -1, updatePrimaryBranch: false, implementation, cancellationToken); + return RunWithSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, implementation, cancellationToken); } private async ValueTask<(Solution solution, T result)> RunWithSolutionAsync( AssetProvider assetProvider, Checksum solutionChecksum, - int workspaceVersion, bool updatePrimaryBranch, Func> implementation, CancellationToken cancellationToken) @@ -131,7 +123,7 @@ await RunWithSolutionAsync( try { inFlightSolution = GetOrCreateSolutionAndAddInFlightCount_NoLock( - assetProvider, solutionChecksum, workspaceVersion, updatePrimaryBranch); + assetProvider, solutionChecksum, updatePrimaryBranch); solutionTask = inFlightSolution.PreferredSolutionTask_NoLock; // We must have at least 1 for the in-flight-count (representing this current in-flight call). @@ -268,34 +260,15 @@ private Solution CreateSolutionFromInfo(SolutionInfo solutionInfo) } /// - /// Attempts to update this workspace with the given . If this succeeds, will be returned in the tuple result as well as the actual solution that the workspace is - /// updated to point at. If we cannot update this workspace, then will be returned, - /// along with the solution passed in. The only time the solution can not be updated is if it would move backwards. + /// Updates this workspace with the given . The solution returned is the actual + /// one the workspace now points to. /// - private async Task TryUpdateWorkspaceCurrentSolutionAsync( - int workspaceVersion, - Solution newSolution, - CancellationToken cancellationToken) - { - var (solution, _) = await TryUpdateWorkspaceCurrentSolutionWorkerAsync(workspaceVersion, newSolution, cancellationToken).ConfigureAwait(false); - return solution; - } - - private async ValueTask<(Solution solution, bool updated)> TryUpdateWorkspaceCurrentSolutionWorkerAsync( - int workspaceVersion, + private async Task UpdateWorkspaceCurrentSolutionAsync( Solution newSolution, CancellationToken cancellationToken) { using (await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false)) { - // Never move workspace backward - if (workspaceVersion <= _currentRemoteWorkspaceVersion) - return (newSolution, updated: false); - - _currentRemoteWorkspaceVersion = workspaceVersion; - // if either solution id or file path changed, then we consider it as new solution. Otherwise, // update the current solution in place. @@ -316,7 +289,7 @@ private async Task TryUpdateWorkspaceCurrentSolutionAsync( } }); - return (newSolution, updated: true); + return newSolution; } static bool IsAddingSolution(Solution oldSolution, Solution newSolution) @@ -338,18 +311,17 @@ public TestAccessor(RemoteWorkspace remoteWorkspace) public Solution CreateSolutionFromInfo(SolutionInfo solutionInfo) => _remoteWorkspace.CreateSolutionFromInfo(solutionInfo); - public ValueTask<(Solution solution, bool updated)> TryUpdateWorkspaceCurrentSolutionAsync(Solution newSolution, int workspaceVersion) - => _remoteWorkspace.TryUpdateWorkspaceCurrentSolutionWorkerAsync(workspaceVersion, newSolution, CancellationToken.None); + public Task UpdateWorkspaceCurrentSolutionAsync(Solution newSolution) + => _remoteWorkspace.UpdateWorkspaceCurrentSolutionAsync(newSolution, CancellationToken.None); public async ValueTask GetSolutionAsync( AssetProvider assetProvider, Checksum solutionChecksum, bool updatePrimaryBranch, - int workspaceVersion, CancellationToken cancellationToken) { var (solution, _) = await _remoteWorkspace.RunWithSolutionAsync( - assetProvider, solutionChecksum, workspaceVersion, updatePrimaryBranch, _ => ValueTaskFactory.FromResult(false), cancellationToken).ConfigureAwait(false); + assetProvider, solutionChecksum, updatePrimaryBranch, _ => ValueTaskFactory.FromResult(false), cancellationToken).ConfigureAwait(false); return solution; } } diff --git a/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs b/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs index d6c82aee29f98..abe37845c2122 100644 --- a/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs +++ b/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; -using Microsoft.CodeAnalysis.Internal.Log; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Remote @@ -40,7 +39,6 @@ internal sealed partial class RemoteWorkspace private InFlightSolution GetOrCreateSolutionAndAddInFlightCount_NoLock( AssetProvider assetProvider, Checksum solutionChecksum, - int workspaceVersion, bool updatePrimaryBranch) { Contract.ThrowIfFalse(_gate.CurrentCount == 0); @@ -56,8 +54,7 @@ private InFlightSolution GetOrCreateSolutionAndAddInFlightCount_NoLock( // to compute the primary branch as well, let it know so it can start that now. if (updatePrimaryBranch) { - solution.TryKickOffPrimaryBranchWork_NoLock((disconnectedSolution, cancellationToken) => - this.TryUpdateWorkspaceCurrentSolutionAsync(workspaceVersion, disconnectedSolution, cancellationToken)); + solution.TryKickOffPrimaryBranchWork_NoLock(this.UpdateWorkspaceCurrentSolutionAsync); } CheckCacheInvariants_NoLock(); diff --git a/src/Workspaces/Remote/ServiceHub/Services/AssetSynchronization/RemoteAssetSynchronizationService.cs b/src/Workspaces/Remote/ServiceHub/Services/AssetSynchronization/RemoteAssetSynchronizationService.cs index ea25f6948ee99..3f5c2974b6b0b 100644 --- a/src/Workspaces/Remote/ServiceHub/Services/AssetSynchronization/RemoteAssetSynchronizationService.cs +++ b/src/Workspaces/Remote/ServiceHub/Services/AssetSynchronization/RemoteAssetSynchronizationService.cs @@ -30,7 +30,7 @@ public RemoteAssetSynchronizationService(in ServiceConstructionArguments argumen { } - public ValueTask SynchronizePrimaryWorkspaceAsync(Checksum solutionChecksum, int workspaceVersion, CancellationToken cancellationToken) + public ValueTask SynchronizePrimaryWorkspaceAsync(Checksum solutionChecksum, CancellationToken cancellationToken) { return RunServiceAsync(async cancellationToken => { @@ -38,7 +38,7 @@ public ValueTask SynchronizePrimaryWorkspaceAsync(Checksum solutionChecksum, int { var workspace = GetWorkspace(); var assetProvider = workspace.CreateAssetProvider(solutionChecksum, WorkspaceManager.SolutionAssetCache, SolutionAssetSource); - await workspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, workspaceVersion, cancellationToken).ConfigureAwait(false); + await workspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, cancellationToken).ConfigureAwait(false); } }, cancellationToken); } From 93f27ca5f09cd80e6a7c97bd5a675e0003e801a0 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 15:31:50 -0700 Subject: [PATCH 68/94] Whitespace --- .../Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs b/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs index abe37845c2122..edfb339611d09 100644 --- a/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs +++ b/src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace_SolutionCaching.cs @@ -8,7 +8,6 @@ namespace Microsoft.CodeAnalysis.Remote { - internal sealed partial class RemoteWorkspace { /// From dbf37501a00e64a08db1965c486f59a4502680aa Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 17:01:54 -0700 Subject: [PATCH 69/94] remove feature flag option --- .../Def/Options/VisualStudioOptionStorage.cs | 1 - ...sualStudioWorkspaceStatusServiceFactory.cs | 51 +++++-------------- ...ce.cs => DefaultWorkspaceStatusService.cs} | 12 ++--- 3 files changed, 15 insertions(+), 49 deletions(-) rename src/Workspaces/Core/Portable/Workspace/Host/Status/{WorkspaceStatusService.cs => DefaultWorkspaceStatusService.cs} (80%) diff --git a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs index 8b5162180b5d2..1eb5ba95ad514 100644 --- a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs +++ b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs @@ -426,7 +426,6 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti {"visual_basic_style_unused_value_assignment_preference", new RoamingProfileStorage("TextEditor.VisualBasic.Specific.UnusedValueAssignmentPreference")}, {"visual_basic_style_unused_value_expression_statement_preference", new RoamingProfileStorage("TextEditor.VisualBasic.Specific.UnusedValueExpressionStatementPreference")}, {"visual_studio_navigate_to_object_browser", new RoamingProfileStorage("TextEditor.%LANGUAGE%.Specific.NavigateToObjectBrowser")}, - {"visual_studio_workspace_partial_load_mode", new FeatureFlagStorage(@"Roslyn.PartialLoadMode")}, {"dotnet_disable_recoverable_text", new FeatureFlagStorage(@"Roslyn.DisableRecoverableText")}, {"dotnet_validate_compilation_tracker_states", new FeatureFlagStorage(@"Roslyn.ValidateCompilationTrackerStates")}, {"dotnet_enable_diagnostics_in_source_generated_files", new RoamingProfileStorage("TextEditor.Roslyn.Specific.EnableDiagnosticsInSourceGeneratedFilesExperiment")}, diff --git a/src/VisualStudio/Core/Def/Workspace/VisualStudioWorkspaceStatusServiceFactory.cs b/src/VisualStudio/Core/Def/Workspace/VisualStudioWorkspaceStatusServiceFactory.cs index 4909619e4e1e3..5d4eed5781bde 100644 --- a/src/VisualStudio/Core/Def/Workspace/VisualStudioWorkspaceStatusServiceFactory.cs +++ b/src/VisualStudio/Core/Def/Workspace/VisualStudioWorkspaceStatusServiceFactory.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Internal.Log; -using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.ServiceHub.Framework; using Microsoft.VisualStudio.OperationProgress; @@ -23,55 +22,29 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation; [ExportWorkspaceServiceFactory(typeof(IWorkspaceStatusService), ServiceLayer.Host), Shared] -internal sealed class VisualStudioWorkspaceStatusServiceFactory : IWorkspaceServiceFactory +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal sealed class VisualStudioWorkspaceStatusServiceFactory( + SVsServiceProvider serviceProvider, + IThreadingContext threadingContext, + IAsynchronousOperationListenerProvider listenerProvider) : IWorkspaceServiceFactory { - private static readonly Option2 s_partialLoadModeFeatureFlag = new("visual_studio_workspace_partial_load_mode", defaultValue: false); - - private readonly IAsyncServiceProvider2 _serviceProvider; - private readonly IThreadingContext _threadingContext; - private readonly IGlobalOptionService _globalOptions; - private readonly IAsynchronousOperationListener _listener; - - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public VisualStudioWorkspaceStatusServiceFactory( - SVsServiceProvider serviceProvider, - IThreadingContext threadingContext, - IGlobalOptionService globalOptions, - IAsynchronousOperationListenerProvider listenerProvider) - { - _serviceProvider = (IAsyncServiceProvider2)serviceProvider; - _threadingContext = threadingContext; - _globalOptions = globalOptions; - - // for now, we use workspace so existing tests can automatically wait for full solution load event - // subscription done in test - _listener = listenerProvider.GetListener(FeatureAttribute.Workspace); - } + private readonly IAsyncServiceProvider2 _serviceProvider = (IAsyncServiceProvider2)serviceProvider; + private readonly IAsynchronousOperationListener _listener = listenerProvider.GetListener(FeatureAttribute.Workspace); [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices) { - if (workspaceServices.Workspace is VisualStudioWorkspace) - { - if (!_globalOptions.GetOption(s_partialLoadModeFeatureFlag)) - { - // don't enable partial load mode for ones that are not in experiment yet - return new WorkspaceStatusService(); - } - - // only VSWorkspace supports partial load mode - return new Service(_serviceProvider, _threadingContext, _listener); - } - - return new WorkspaceStatusService(); + return workspaceServices.Workspace is VisualStudioWorkspace + ? new Service(_serviceProvider, threadingContext, _listener) + : new DefaultWorkspaceStatusService(); } /// /// for prototype, we won't care about what solution is actually fully loaded. /// we will just see whatever solution VS has at this point of time has actually fully loaded /// - private class Service : IWorkspaceStatusService + private sealed class Service : IWorkspaceStatusService { private readonly IAsyncServiceProvider2 _serviceProvider; private readonly IThreadingContext _threadingContext; diff --git a/src/Workspaces/Core/Portable/Workspace/Host/Status/WorkspaceStatusService.cs b/src/Workspaces/Core/Portable/Workspace/Host/Status/DefaultWorkspaceStatusService.cs similarity index 80% rename from src/Workspaces/Core/Portable/Workspace/Host/Status/WorkspaceStatusService.cs rename to src/Workspaces/Core/Portable/Workspace/Host/Status/DefaultWorkspaceStatusService.cs index bb3d225a923ba..02c72cb3e4183 100644 --- a/src/Workspaces/Core/Portable/Workspace/Host/Status/WorkspaceStatusService.cs +++ b/src/Workspaces/Core/Portable/Workspace/Host/Status/DefaultWorkspaceStatusService.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System; using System.Composition; using System.Threading; @@ -14,14 +12,10 @@ namespace Microsoft.CodeAnalysis.Host; [ExportWorkspaceService(typeof(IWorkspaceStatusService), ServiceLayer.Default), Shared] -internal sealed class WorkspaceStatusService : IWorkspaceStatusService +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal sealed class DefaultWorkspaceStatusService() : IWorkspaceStatusService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public WorkspaceStatusService() - { - } - event EventHandler IWorkspaceStatusService.StatusChanged { add { } From 1f523831552dfe7ae0428280e30d79de38839c47 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 17:05:25 -0700 Subject: [PATCH 70/94] Remove more --- .../DiagnosticIncrementalAnalyzer.Executor.cs | 17 ----------------- .../EngineV2/DiagnosticIncrementalAnalyzer.cs | 3 --- 2 files changed, 20 deletions(-) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs index e8c44e86da6bb..ce0175559bcdf 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs @@ -413,22 +413,5 @@ private void UpdateAnalyzerTelemetryData(ImmutableDictionary GetAnalyzersTestOnly(Project project) => _stateManager.GetOrCreateStateSets(project).Select(s => s.Analyzer); - private static string GetDocumentLogMessage(string title, TextDocument document, DiagnosticAnalyzer analyzer) - => $"{title}: ({document.Id}, {document.Project.Id}), ({analyzer})"; - private static string GetProjectLogMessage(Project project, ImmutableArray stateSets) => $"project: ({project.Id}), ({string.Join(Environment.NewLine, stateSets.Select(s => s.Analyzer.ToString()))})"; From ed85d6600db92bf590311bb24ee42019af87d136 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Fri, 22 Mar 2024 17:04:38 -0700 Subject: [PATCH 71/94] Move langauge specific code out of CodeFixService --- ....SingleDiagnosticKindPullTaggerProvider.cs | 2 +- .../Core/Copilot/CopilotTaggerProvider.cs | 3 +- .../Copilot/CSharpCopilotCodeFixProvider.cs | 30 ++++++++---------- .../Core/Portable/Copilot/Extensions.cs | 8 ++--- .../Copilot/ICopilotCodeAnalysisService.cs | 2 +- .../Features/CodeFixes/CodeFixService.cs | 25 ++------------- .../DocumentDiagnosticSource.cs | 2 +- .../AbstractCopilotCodeAnalysisService.cs | 31 +++++++++++++++++-- 8 files changed, 53 insertions(+), 50 deletions(-) diff --git a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs index a0d1d1a348a82..7f6faedcac22c 100644 --- a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs +++ b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs @@ -143,7 +143,7 @@ private async Task ProduceTagsAsync( // and hence only report them for 'DiagnosticKind.AnalyzerSemantic'. if (_diagnosticKind == DiagnosticKind.AnalyzerSemantic) { - var copilotDiagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); + var copilotDiagnostics = await document.GetCachedCopilotDiagnosticsAsync(requestedSpan.Span.ToTextSpan(), cancellationToken).ConfigureAwait(false); diagnostics = diagnostics.AddRange(copilotDiagnostics); } diff --git a/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs b/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs index 1ec2d03fbfd0b..7468e5dd43fa3 100644 --- a/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs +++ b/src/EditorFeatures/Core/Copilot/CopilotTaggerProvider.cs @@ -84,8 +84,7 @@ protected override async Task ProduceTagsAsync(TaggerContext con var prompts = await service.GetAvailablePromptTitlesAsync(document, cancellationToken).ConfigureAwait(false); if (prompts.Length > 0) { - // Invoke analysis call into the Copilot service for the containing method's span. - await service.AnalyzeDocumentAsync(document, new(spanToTag.SnapshotSpan.Start, 0), prompts[0], cancellationToken).ConfigureAwait(false); + await service.AnalyzeDocumentAsync(document, spanToTag.SnapshotSpan.Span.ToTextSpan(), prompts[0], cancellationToken).ConfigureAwait(false); } } } diff --git a/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs index 1718fea285747..0dd257b5b9d27 100644 --- a/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/Copilot/CSharpCopilotCodeFixProvider.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Immutable; using System.Composition; -using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -71,20 +70,17 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) var hasMultiplePrompts = promptTitles.Length > 1; - // Find the containing method, if any, and also update the fix span to the entire method. - // TODO: count location in doc-comment as part of the method. + // Find the containing method for each diagnostic, and register a fix if any part of the method interect with context span. var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var containingMethod = CSharpSyntaxFacts.Instance.GetContainingMethodDeclaration(root, context.Span.Start, useFullSpan: false); - if (containingMethod is not BaseMethodDeclarationSyntax) - return; - foreach (var diagnostic in context.Diagnostics) { - Debug.Assert(containingMethod.FullSpan.IntersectsWith(diagnostic.Location.SourceSpan)); - - var fix = TryGetFix(document, containingMethod, diagnostic, hasMultiplePrompts); - if (fix != null) - context.RegisterCodeFix(fix, diagnostic); + var containingMethod = CSharpSyntaxFacts.Instance.GetContainingMethodDeclaration(root, diagnostic.Location.SourceSpan.Start, useFullSpan: false); + if (containingMethod?.Span.IntersectsWith(context.Span) is true) + { + var fix = TryGetFix(document, containingMethod, diagnostic, hasMultiplePrompts); + if (fix != null) + context.RegisterCodeFix(fix, diagnostic); + } } } @@ -105,8 +101,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) // Parse the proposed Copilot fix into a method declaration. // Guard against failure cases where the proposed fixed code does not parse into a method declaration. // TODO: consider do this early when we create the diagnostic and add a flag in the property bag to speedup lightbulb computation - var fixMethodDeclaration = SyntaxFactory.ParseMemberDeclaration(fix, options: method.SyntaxTree.Options); - if (fixMethodDeclaration is null || !fixMethodDeclaration.IsKind(SyntaxKind.MethodDeclaration) || fixMethodDeclaration.GetDiagnostics().Count() > 3) + var memberDeclaration = SyntaxFactory.ParseMemberDeclaration(fix, options: method.SyntaxTree.Options); + if (memberDeclaration is null || memberDeclaration is not BaseMethodDeclarationSyntax baseMethodDeclaration || baseMethodDeclaration.GetDiagnostics().Count() > 3) return null; var title = hasMultiplePrompts @@ -125,9 +121,9 @@ async Task GetFixedDocumentAsync(SyntaxNode method, string fix, Cancel var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false); // TODO: Replace all the whitespace trivia with elastic trivia, and any other trivia related improvements - var newMethod = fixMethodDeclaration - .WithLeadingTrivia(fixMethodDeclaration.HasLeadingTrivia ? fixMethodDeclaration.GetLeadingTrivia() : method.GetLeadingTrivia()) - .WithTrailingTrivia(fixMethodDeclaration.HasTrailingTrivia ? fixMethodDeclaration.GetTrailingTrivia() : method.GetTrailingTrivia()) + var newMethod = memberDeclaration + .WithLeadingTrivia(memberDeclaration.HasLeadingTrivia ? memberDeclaration.GetLeadingTrivia() : method.GetLeadingTrivia()) + .WithTrailingTrivia(memberDeclaration.HasTrailingTrivia ? memberDeclaration.GetTrailingTrivia() : method.GetTrailingTrivia()) .WithAdditionalAnnotations(Formatter.Annotation, WarningAnnotation); editor.ReplaceNode(method, newMethod); diff --git a/src/Features/Core/Portable/Copilot/Extensions.cs b/src/Features/Core/Portable/Copilot/Extensions.cs index 2a2ce622bd9de..344aed3654abf 100644 --- a/src/Features/Core/Portable/Copilot/Extensions.cs +++ b/src/Features/Core/Portable/Copilot/Extensions.cs @@ -13,17 +13,17 @@ namespace Microsoft.CodeAnalysis.Copilot; internal static class Extensions { - public static async Task> GetCachedCopilotDiagnosticsAsync(this TextDocument document, CancellationToken cancellationToken) + public static async Task> GetCachedCopilotDiagnosticsAsync(this TextDocument document, TextSpan? span, CancellationToken cancellationToken) { if (document is not Document sourceDocument) - return ImmutableArray.Empty; + return []; var copilotCodeAnalysisService = sourceDocument.GetLanguageService(); if (copilotCodeAnalysisService is null) - return ImmutableArray.Empty; + return []; var promptTitles = await copilotCodeAnalysisService.GetAvailablePromptTitlesAsync(sourceDocument, cancellationToken).ConfigureAwait(false); - var copilotDiagnostics = await copilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync(sourceDocument, promptTitles, cancellationToken).ConfigureAwait(false); + var copilotDiagnostics = await copilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync(sourceDocument, span, promptTitles, cancellationToken).ConfigureAwait(false); return copilotDiagnostics.SelectAsArray(d => DiagnosticData.Create(d, sourceDocument)); } } diff --git a/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs b/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs index 5d3931a773cf2..4aaa20b3c6c17 100644 --- a/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs +++ b/src/Features/Core/Portable/Copilot/ICopilotCodeAnalysisService.cs @@ -61,7 +61,7 @@ internal interface ICopilotCodeAnalysisService : ILanguageService /// /// A prompt's title serves as the ID of the prompt, which can be used to selectively trigger analysis and retrive cached results. /// - Task> GetCachedDocumentDiagnosticsAsync(Document document, ImmutableArray promptTitles, CancellationToken cancellationToken); + Task> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray promptTitles, CancellationToken cancellationToken); /// /// Method to start a Copilot refinement session on top of the changes between the given diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs index 600b4369eef98..f06bae504b101 100644 --- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs +++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs @@ -23,7 +23,6 @@ using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Internal.Log; -using Microsoft.CodeAnalysis.LanguageService; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; @@ -255,28 +254,10 @@ private static async Task> GetCopilotDiagnosticsA CodeActionRequestPriority? priority, CancellationToken cancellationToken) { - if (!(priority is null or CodeActionRequestPriority.Low)) - return []; - - if (document is not Document sourceDocument) - return []; - - var diagnostics = await document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); - if (diagnostics.IsEmpty) - return []; - - if (sourceDocument.SupportsSyntaxTree) - { - // Expand the fixable range for Copilot diagnostics to containing method. - // TODO: Share the below code with other places we compute containing method for Copilot analysis. - var root = await sourceDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var syntaxFacts = sourceDocument.GetRequiredLanguageService(); - var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, range.Start, useFullSpan: false); - range = containingMethod?.Span ?? range; - } + if (priority is null or CodeActionRequestPriority.Low) + return await document.GetCachedCopilotDiagnosticsAsync(range, cancellationToken).ConfigureAwait(false); - var text = await sourceDocument.GetTextAsync(cancellationToken).ConfigureAwait(false); - return diagnostics.WhereAsArray(diagnostic => range.IntersectsWith(diagnostic.DataLocation.UnmappedFileSpan.GetClampedTextSpan(text))); + return []; } private static SortedDictionary> ConvertToMap( diff --git a/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs b/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs index 637fa491c621f..5e632744ee440 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Diagnostics/DiagnosticSources/DocumentDiagnosticSource.cs @@ -34,7 +34,7 @@ public override async Task> GetDiagnosticsAsync( // Add cached Copilot diagnostics when computing analyzer semantic diagnostics. if (DiagnosticKind == DiagnosticKind.AnalyzerSemantic) { - var copilotDiagnostics = await Document.GetCachedCopilotDiagnosticsAsync(cancellationToken).ConfigureAwait(false); + var copilotDiagnostics = await Document.GetCachedCopilotDiagnosticsAsync(span: null, cancellationToken).ConfigureAwait(false); allSpanDiagnostics = allSpanDiagnostics.AddRange(copilotDiagnostics); } diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs index 140b63cf0eaf2..695f81a6cd222 100644 --- a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.LanguageService; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; @@ -116,7 +117,7 @@ private void CacheAndRefreshDiagnosticsIfNeeded(Document document, string prompt diagnosticsRefresher.RequestWorkspaceRefresh(); } - public async Task> GetCachedDocumentDiagnosticsAsync(Document document, ImmutableArray promptTitles, CancellationToken cancellationToken) + public async Task> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray promptTitles, CancellationToken cancellationToken) { if (await ShouldSkipAnalysisAsync(document, cancellationToken).ConfigureAwait(false)) return []; @@ -144,7 +145,33 @@ public async Task> GetCachedDocumentDiagnosticsAsync( } } - return diagnostics.ToImmutable(); + if (!span.HasValue) + return diagnostics.ToImmutable(); + + using var _2 = ArrayBuilder.GetInstance(out var filteredDiagnostics); + if (document.SupportsSyntaxTree) + { + // The location of Copilot diagnostics is on the method identifier, we'd like to expand the range to include them + // if any part of the method intersects with the given span. + var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var syntaxFacts = document.GetRequiredLanguageService(); + foreach (var diagnostic in diagnostics) + { + var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, diagnostic.Location.SourceSpan.Start, useFullSpan: false); + if (containingMethod?.Span.IntersectsWith(span.Value) is true) + filteredDiagnostics.Add(diagnostic); + } + } + else + { + foreach (var diagnostic in diagnostics) + { + if (diagnostic.Location.SourceSpan.IntersectsWith(span.Value)) + filteredDiagnostics.Add(diagnostic); + } + } + + return filteredDiagnostics.ToImmutable(); } public async Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) From e25ef663913d91f7c2c77fa7b618ba94de83495b Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 17:11:29 -0700 Subject: [PATCH 72/94] remove usings --- .../EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs index ce0175559bcdf..05b432309c757 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using System.Linq; @@ -12,7 +11,6 @@ using Microsoft.CodeAnalysis.Diagnostics.Telemetry; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.Internal.Log; -using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Simplification; using Microsoft.CodeAnalysis.SolutionCrawler; using Microsoft.CodeAnalysis.Workspaces.Diagnostics; From 048ebd5f3402c8d78f20c8c6c096baa5eab65e38 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 17:25:05 -0700 Subject: [PATCH 73/94] Fix test --- .../Test.Next/Services/SolutionServiceTests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs b/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs index d4957a9b777d2..3e43f88c1d6c3 100644 --- a/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs +++ b/src/VisualStudio/Core/Test.Next/Services/SolutionServiceTests.cs @@ -344,22 +344,22 @@ public async Task TestRemoteWorkspace() var remoteSolution1 = await GetInitialOOPSolutionAsync(remoteWorkspace, assetProvider, solution1); - await Verify(remoteWorkspace, solution1, remoteSolution1, expectRemoteSolutionToCurrent: true); + await Verify(remoteWorkspace, solution1, remoteSolution1); // update remote workspace var currentSolution = remoteSolution1.WithDocumentText(remoteSolution1.Projects.First().Documents.First().Id, SourceText.From(code + " class Test2 { }")); var oopSolution2 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(currentSolution); - await Verify(remoteWorkspace, currentSolution, oopSolution2, expectRemoteSolutionToCurrent: true); + await Verify(remoteWorkspace, currentSolution, oopSolution2); // move backward - await Verify(remoteWorkspace, remoteSolution1, await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(remoteSolution1), expectRemoteSolutionToCurrent: false); + await Verify(remoteWorkspace, remoteSolution1, await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(remoteSolution1)); // move forward currentSolution = oopSolution2.WithDocumentText(oopSolution2.Projects.First().Documents.First().Id, SourceText.From(code + " class Test3 { }")); var remoteSolution3 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(currentSolution); - await Verify(remoteWorkspace, currentSolution, remoteSolution3, expectRemoteSolutionToCurrent: true); + await Verify(remoteWorkspace, currentSolution, remoteSolution3); // move to new solution backward var solutionInfo2 = await assetProvider.CreateSolutionInfoAsync(await solution1.CompilationState.GetChecksumAsync(CancellationToken.None), CancellationToken.None); @@ -368,7 +368,7 @@ public async Task TestRemoteWorkspace() // move to new solution forward var solution3 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(solution2); Assert.NotNull(solution3); - await Verify(remoteWorkspace, solution1, solution3, expectRemoteSolutionToCurrent: true); + await Verify(remoteWorkspace, solution1, solution3); static async Task GetInitialOOPSolutionAsync(RemoteWorkspace remoteWorkspace, AssetProvider assetProvider, Solution solution) { @@ -380,13 +380,13 @@ static async Task GetInitialOOPSolutionAsync(RemoteWorkspace remoteWor return await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); } - static async Task Verify(RemoteWorkspace remoteWorkspace, Solution givenSolution, Solution remoteSolution, bool expectRemoteSolutionToCurrent) + static async Task Verify(RemoteWorkspace remoteWorkspace, Solution givenSolution, Solution remoteSolution) { // verify we got solution expected Assert.Equal(await givenSolution.CompilationState.GetChecksumAsync(CancellationToken.None), await remoteSolution.CompilationState.GetChecksumAsync(CancellationToken.None)); // verify remote workspace got updated - Assert.True(expectRemoteSolutionToCurrent == (remoteSolution == remoteWorkspace.CurrentSolution)); + Assert.Equal(remoteSolution, remoteWorkspace.CurrentSolution); } } From def259bc9adec3c9dc9dd49a55cd50b969eeab7f Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Fri, 22 Mar 2024 17:33:19 -0700 Subject: [PATCH 74/94] Fix test --- src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb b/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb index fcea88bb58538..75bd40b963bf4 100644 --- a/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb +++ b/src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb @@ -339,7 +339,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.CodeFixes.UnitTests Return Task.CompletedTask End Function - Public Function GetCachedDocumentDiagnosticsAsync(document As Document, promptTitles As ImmutableArray(Of String), cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of Diagnostic)) Implements ICopilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync + Public Function GetCachedDocumentDiagnosticsAsync(document As Document, span As TextSpan?, promptTitles As ImmutableArray(Of String), cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of Diagnostic)) Implements ICopilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync Return Task.FromResult(Diagnostics) End Function From 1f8a80cea31bea27e59ab4817445c2f0fdc1e3c4 Mon Sep 17 00:00:00 2001 From: "gel@microsoft.com" Date: Fri, 22 Mar 2024 17:56:53 -0700 Subject: [PATCH 75/94] Push langauge specific code to language service --- .../AbstractCopilotCodeAnalysisService.cs | 34 +++++-------------- .../CSharpCopilotCodeAnalysisService.cs | 26 ++++++++++++++ 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs index 695f81a6cd222..28cbb7c37c7f3 100644 --- a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/AbstractCopilotCodeAnalysisService.cs @@ -4,13 +4,13 @@ using System; using System.Collections.Concurrent; +using System.Collections.Generic; using System.Collections.Immutable; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.LanguageService; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; @@ -145,33 +145,15 @@ public async Task> GetCachedDocumentDiagnosticsAsync( } } - if (!span.HasValue) - return diagnostics.ToImmutable(); + if (span.HasValue) + return await GetDiagnosticsIntersectWithSpanAsync(document, diagnostics, span.Value, cancellationToken).ConfigureAwait(false); - using var _2 = ArrayBuilder.GetInstance(out var filteredDiagnostics); - if (document.SupportsSyntaxTree) - { - // The location of Copilot diagnostics is on the method identifier, we'd like to expand the range to include them - // if any part of the method intersects with the given span. - var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var syntaxFacts = document.GetRequiredLanguageService(); - foreach (var diagnostic in diagnostics) - { - var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, diagnostic.Location.SourceSpan.Start, useFullSpan: false); - if (containingMethod?.Span.IntersectsWith(span.Value) is true) - filteredDiagnostics.Add(diagnostic); - } - } - else - { - foreach (var diagnostic in diagnostics) - { - if (diagnostic.Location.SourceSpan.IntersectsWith(span.Value)) - filteredDiagnostics.Add(diagnostic); - } - } + return diagnostics.ToImmutable(); + } - return filteredDiagnostics.ToImmutable(); + protected virtual Task> GetDiagnosticsIntersectWithSpanAsync(Document document, IReadOnlyList diagnostics, TextSpan span, CancellationToken cancellationToken) + { + return Task.FromResult(diagnostics.WhereAsArray((diagnostic, _) => diagnostic.Location.SourceSpan.IntersectsWith(span), state: (object)null)); } public async Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) diff --git a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs index 3d930e1f562bf..0e35252fdff52 100644 --- a/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs +++ b/src/Tools/ExternalAccess/Copilot/Internal/Analyzer/CSharp/CSharpCopilotCodeAnalysisService.cs @@ -3,10 +3,16 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Generic; +using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.LanguageService; +using Microsoft.CodeAnalysis.PooledObjects; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.ServiceBroker; @@ -40,4 +46,24 @@ public override Task IsRefineOptionEnabledAsync() public override Task IsCodeAnalysisOptionEnabledAsync() => copilotOptionService.IsCopilotOptionEnabledAsync(CopilotCodeAnalysisOptionName); + + protected override async Task> GetDiagnosticsIntersectWithSpanAsync( + Document document, IReadOnlyList diagnostics, TextSpan span, CancellationToken cancellationToken) + { + using var _ = ArrayBuilder.GetInstance(out var filteredDiagnostics); + + // The location of Copilot diagnostics is on the method identifier, we'd like to expand the range to include them + // if any part of the method intersects with the given span. + var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var syntaxFacts = document.GetRequiredLanguageService(); + + foreach (var diagnostic in diagnostics) + { + var containingMethod = syntaxFacts.GetContainingMethodDeclaration(root, diagnostic.Location.SourceSpan.Start, useFullSpan: false); + if (containingMethod?.Span.IntersectsWith(span) is true) + filteredDiagnostics.Add(diagnostic); + } + + return filteredDiagnostics.ToImmutable(); + } } From 4e91bc91e5b9d815e8d2c691841ad124bb9c4edb Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 22 Mar 2024 19:09:13 -0700 Subject: [PATCH 76/94] Use raw strings in test code --- .../HelloWorldGenerator.cs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Workspaces/TestAnalyzerReference/HelloWorldGenerator.cs b/src/Workspaces/TestAnalyzerReference/HelloWorldGenerator.cs index cf5e8866d86ad..93982f590ab99 100644 --- a/src/Workspaces/TestAnalyzerReference/HelloWorldGenerator.cs +++ b/src/Workspaces/TestAnalyzerReference/HelloWorldGenerator.cs @@ -22,26 +22,26 @@ public void Initialize(GeneratorInitializationContext context) public void Execute(GeneratorExecutionContext context) { - context.AddSource(GeneratedEnglishClassName, SourceText.From(@" -/// is a simple class to fetch the classic message. -internal class " + GeneratedEnglishClassName + @" -{ - public static string GetMessage() - { - return ""Hello, World!""; - } -} -", encoding: Encoding.UTF8)); + context.AddSource(GeneratedEnglishClassName, SourceText.From($$""" + /// is a simple class to fetch the classic message. + internal class {{GeneratedEnglishClassName}} + { + public static string GetMessage() + { + return "Hello, World!"; + } + } + """, encoding: Encoding.UTF8)); - context.AddSource(GeneratedSpanishClassName, SourceText.From(@" -internal class " + GeneratedSpanishClassName + @" -{ - public static string GetMessage() - { - return ""Hola, Mundo!""; - } -} -", encoding: Encoding.UTF8)); + context.AddSource(GeneratedSpanishClassName, SourceText.From($$""" + internal class {{GeneratedSpanishClassName}} + { + public static string GetMessage() + { + return "Hola, Mundo!"; + } + } + """, encoding: Encoding.UTF8)); context.AddSource($"{GeneratedFolderName}/{GeneratedFolderClassName}", $$""" class {{GeneratedFolderClassName}} { } From 10f28f255fa460586db9c1e17c46e92d2cf3580d Mon Sep 17 00:00:00 2001 From: DoctorKrolic Date: Sat, 23 Mar 2024 18:33:36 +0300 Subject: [PATCH 77/94] Provide all possible keywords in xml doc comment `langword` tag --- ...mentationCommentCompletionProviderTests.cs | 20 ++++++++-- .../XmlDocCommentCompletionProviderTests.vb | 4 +- .../XmlDocCommentCompletionProvider.cs | 38 ++++++++++++------- .../AbstractDocCommentCompletionProvider.cs | 2 +- .../XmlDocCommentCompletionProvider.vb | 25 ++++++------ 5 files changed, 59 insertions(+), 30 deletions(-) diff --git a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/XmlDocumentationCommentCompletionProviderTests.cs b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/XmlDocumentationCommentCompletionProviderTests.cs index 94ca88f585996..b9c2606c202f9 100644 --- a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/XmlDocumentationCommentCompletionProviderTests.cs +++ b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/XmlDocumentationCommentCompletionProviderTests.cs @@ -8,8 +8,8 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Completion; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Completion.Providers; -using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; using Roslyn.Test.Utilities; @@ -872,7 +872,7 @@ static void Goo() [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/11490")] public async Task SeeLangwordAttributeValue() { - await VerifyItemsExistAsync(""" + var source = """ class C { /// @@ -882,7 +882,21 @@ static void Goo() { } } - """, "null", "true", "false", "await"); + """; + + foreach (var keywordKind in SyntaxFacts.GetKeywordKinds()) + { + var keywordText = SyntaxFacts.GetText(keywordKind); + + if (keywordText[0] == '_') + { + await VerifyItemIsAbsentAsync(source, keywordText); + } + else + { + await VerifyItemExistsAsync(source, keywordText, glyph: (int)Glyph.Keyword); + } + } } [Fact] diff --git a/src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/XmlDocCommentCompletionProviderTests.vb b/src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/XmlDocCommentCompletionProviderTests.vb index 7adcdeb7c3f4a..a4dc59fd809d3 100644 --- a/src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/XmlDocCommentCompletionProviderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/XmlDocCommentCompletionProviderTests.vb @@ -847,7 +847,9 @@ Class C End Sub End Class " - Await VerifyItemsExistAsync(text, "Nothing", "True", "False", "Await") + For Each keywordKind In SyntaxFacts.GetKeywordKinds() + Await VerifyItemExistsAsync(text, SyntaxFacts.GetText(keywordKind), glyph:=Glyph.Keyword) + Next End Function diff --git a/src/Features/CSharp/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.cs b/src/Features/CSharp/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.cs index b950e664dfc13..f19c7ca86ed08 100644 --- a/src/Features/CSharp/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.cs +++ b/src/Features/CSharp/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Composition; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; @@ -17,7 +16,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Options; +using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; @@ -37,6 +36,27 @@ public XmlDocCommentCompletionProvider() : base(s_defaultRules) { } + private static readonly ImmutableArray s_keywordNames; + + static XmlDocCommentCompletionProvider() + { + using var _ = ArrayBuilder.GetInstance(out var keywordsBuilder); + + foreach (var keywordKind in SyntaxFacts.GetKeywordKinds()) + { + var keywordText = SyntaxFacts.GetText(keywordKind); + + // There are several very special keywords like `__makeref`, which are not intended for pubic use. + // They all start with `_`, so we are filtering them here + if (keywordText[0] != '_') + { + keywordsBuilder.Add(keywordText); + } + } + + s_keywordNames = keywordsBuilder.ToImmutable(); + } + internal override string Language => LanguageNames.CSharp; public override bool IsInsertionTrigger(SourceText text, int characterPosition, CompletionOptions options) @@ -313,18 +333,8 @@ private static bool IsAttributeValueContext(SyntaxToken token, [NotNullWhen(true return false; } - protected override IEnumerable GetKeywordNames() - { - yield return SyntaxFacts.GetText(SyntaxKind.NullKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.StaticKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.VirtualKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.TrueKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.FalseKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.AbstractKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.SealedKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.AsyncKeyword); - yield return SyntaxFacts.GetText(SyntaxKind.AwaitKeyword); - } + protected override ImmutableArray GetKeywordNames() + => s_keywordNames; protected override IEnumerable GetExistingTopLevelElementNames(DocumentationCommentTriviaSyntax syntax) => syntax.Content.Select(GetElementName).WhereNotNull(); diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractDocCommentCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractDocCommentCompletionProvider.cs index 0351f0944b2cb..e8ed717a8bf9d 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractDocCommentCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractDocCommentCompletionProvider.cs @@ -94,7 +94,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext context) protected abstract IEnumerable GetExistingTopLevelAttributeValues(TSyntax syntax, string tagName, string attributeName); - protected abstract IEnumerable GetKeywordNames(); + protected abstract ImmutableArray GetKeywordNames(); /// /// A temporarily hack that should be removed once/if https://github.com/dotnet/roslyn/issues/53092 is fixed. diff --git a/src/Features/VisualBasic/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.vb b/src/Features/VisualBasic/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.vb index 220fea7817f55..206082535f804 100644 --- a/src/Features/VisualBasic/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.vb +++ b/src/Features/VisualBasic/Portable/Completion/CompletionProviders/XmlDocCommentCompletionProvider.vb @@ -9,7 +9,6 @@ Imports Microsoft.CodeAnalysis.Completion Imports Microsoft.CodeAnalysis.Completion.Providers Imports Microsoft.CodeAnalysis.ErrorReporting Imports Microsoft.CodeAnalysis.Host.Mef -Imports Microsoft.CodeAnalysis.Options Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Roslyn.Utilities.DocumentationCommentXmlNames @@ -27,6 +26,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers MyBase.New(s_defaultRules) End Sub + Private Shared ReadOnly s_keywordNames As ImmutableArray(Of String) + + Shared Sub New() + Dim keywordsBuilder As New List(Of String) + + For Each keywordKind In SyntaxFacts.GetKeywordKinds() + keywordsBuilder.Add(SyntaxFacts.GetText(keywordKind)) + Next + + s_keywordNames = keywordsBuilder.ToImmutableArray() + End Sub + Friend Overrides ReadOnly Property Language As String Get Return LanguageNames.VisualBasic @@ -270,16 +281,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers End If End Sub - Protected Overrides Iterator Function GetKeywordNames() As IEnumerable(Of String) - Yield SyntaxFacts.GetText(SyntaxKind.NothingKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.SharedKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.OverridableKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.TrueKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.FalseKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.MustInheritKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.NotOverridableKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.AsyncKeyword) - Yield SyntaxFacts.GetText(SyntaxKind.AwaitKeyword) + Protected Overrides Function GetKeywordNames() As ImmutableArray(Of String) + Return s_keywordNames End Function Protected Overrides Function GetExistingTopLevelElementNames(parentTrivia As DocumentationCommentTriviaSyntax) As IEnumerable(Of String) From 277225da2f888b1c3b826cf7a877afae43fb9510 Mon Sep 17 00:00:00 2001 From: "Juan C. Diaz" Date: Sat, 23 Mar 2024 12:22:36 -0400 Subject: [PATCH 78/94] Fix #72632 --- .../MoveType/MoveTypeTests.MoveToNewFile.cs | 28 +++++++++++++++++++ .../AbstractMoveTypeService.MoveTypeEditor.cs | 12 ++++++-- .../CodeGeneration/CSharpSyntaxGenerator.cs | 11 ++++++++ .../Editing/SyntaxEditorExtensions.cs | 3 ++ .../Core/Portable/Editing/SyntaxGenerator.cs | 5 ++++ .../VisualBasicSyntaxGenerator.vb | 4 +++ 6 files changed, 60 insertions(+), 3 deletions(-) diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs b/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs index a5ed7ad17fe5b..1aaed2ccaa5a0 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs @@ -535,6 +535,34 @@ class Class2 { } await TestMoveTypeToNewFileAsync(code, codeAfterMove, expectedDocumentName, destinationDocumentText, index: 1); } + [WpfFact, WorkItem("https://github.com/dotnet/roslyn/issues/72632")] + public async Task MoveNestedTypeToNewFile_Simple_DottedName_WithPrimaryCtor() + { + var code = +@"internal class Outer() +{ + private class Inner[||] + { + } +}"; + + var codeAfterMove = +@"internal partial class Outer() +{ +}"; + + var expectedDocumentName = "Outer.Inner.cs"; + + var destinationDocumentText = +@"internal partial class Outer +{ + private class Inner + { + } +}"; + await TestMoveTypeToNewFileAsync(code, codeAfterMove, expectedDocumentName, destinationDocumentText, index: 1); + } + [WpfFact] public async Task MoveNestedTypeToNewFile_ParentHasOtherMembers() { diff --git a/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs b/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs index 1cf7f7b7d46e5..ff0f9a84b22af 100644 --- a/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs +++ b/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs @@ -125,7 +125,7 @@ private async Task AddNewDocumentWithSingleTypeDeclarationAsync(Docume // attributes from the containing partial types. We don't want to create // duplicate attributes on things. AddPartialModifiersToTypeChain( - documentEditor, removeAttributesAndComments: true, removeTypeInheritance: true); + documentEditor, removeAttributesAndComments: true, removeTypeInheritance: true, removePrimaryCtor: true); // remove things that are not being moved, from the forked document. var membersToRemove = GetMembersToRemove(root); @@ -193,7 +193,7 @@ private async Task RemoveTypeFromSourceDocumentAsync(Document sourceDo // However, keep all the attributes on these types as theses are the // original attributes and we don't want to mess with them. AddPartialModifiersToTypeChain(documentEditor, - removeAttributesAndComments: false, removeTypeInheritance: false); + removeAttributesAndComments: false, removeTypeInheritance: false, removePrimaryCtor: false); documentEditor.RemoveNode(State.TypeNode, SyntaxRemoveOptions.KeepUnbalancedDirectives); var updatedDocument = documentEditor.GetChangedDocument(); @@ -258,7 +258,8 @@ TMemberDeclarationSyntax or private void AddPartialModifiersToTypeChain( DocumentEditor documentEditor, bool removeAttributesAndComments, - bool removeTypeInheritance) + bool removeTypeInheritance, + bool removePrimaryCtor) { var semanticFacts = State.SemanticDocument.Document.GetRequiredLanguageService(); var typeChain = State.TypeNode.Ancestors().OfType(); @@ -283,6 +284,11 @@ private void AddPartialModifiersToTypeChain( { documentEditor.RemoveAllTypeInheritance(node); } + + if (removePrimaryCtor) + { + documentEditor.RemovePrimaryCtor(node); + } } documentEditor.ReplaceNode(State.TypeNode, diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 4b687b6a306e8..9643ff5f42d82 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -1200,6 +1200,17 @@ private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList< _ => declaration, }; + internal override ImmutableArray GetPrimaryCtor(SyntaxNode declaration) + { + if (declaration is ClassDeclarationSyntax || declaration is StructDeclarationSyntax) + { + var paramList = declaration.GetParameterList(); + if (paramList is not null) + return [paramList]; + } + return []; + } + internal override ImmutableArray GetTypeInheritance(SyntaxNode declaration) => declaration is BaseTypeDeclarationSyntax baseType && baseType.BaseList != null ? [baseType.BaseList] diff --git a/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs b/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs index 51c79506734fd..e7928cda864ac 100644 --- a/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs +++ b/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs @@ -75,4 +75,7 @@ public static void AddInterfaceType(this SyntaxEditor editor, SyntaxNode declara public static void AddBaseType(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode baseType) => editor.ReplaceNode(declaration, (d, g) => g.AddBaseType(d, baseType)); + + internal static void RemovePrimaryCtor(this SyntaxEditor editor, SyntaxNode declaration) + => editor.ReplaceNode(declaration, (d, g) => g.RemovePrimaryCtor(d)); } diff --git a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs index e26b4065bb6cf..53ede1c0038f5 100644 --- a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs +++ b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs @@ -1071,6 +1071,11 @@ public SyntaxNode RemoveAllAttributes(SyntaxNode declaration) /// internal abstract SyntaxNode RemoveAllComments(SyntaxNode node); + internal SyntaxNode RemovePrimaryCtor(SyntaxNode declaration) + => RemoveNodes(declaration, GetPrimaryCtor(declaration)); + + internal abstract ImmutableArray GetPrimaryCtor(SyntaxNode declaration); + internal SyntaxNode RemoveLeadingAndTrailingComments(SyntaxNode node) { return node.WithLeadingTrivia(RemoveCommentLines(node.GetLeadingTrivia())) diff --git a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb index b5eabd5569fa1..5b874da6cc10a 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb @@ -1675,6 +1675,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration Return attr.WithTarget(Nothing) End Function + Friend Overrides Function GetPrimaryCtor(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) + Return ImmutableArray(Of SyntaxNode).Empty + End Function + Friend Overrides Function GetTypeInheritance(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) Dim typeDecl = TryCast(declaration, TypeBlockSyntax) If typeDecl Is Nothing Then From 7e14d70fcc7d25e111dd319aa6a1dba12d642e6a Mon Sep 17 00:00:00 2001 From: DoctorKrolic Date: Sat, 23 Mar 2024 20:05:36 +0300 Subject: [PATCH 79/94] Fix VB --- .../VisualBasicCompletionCommandHandlerTests_XmlDoc.vb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb b/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb index ea5b97d706b47..0d08f4cede6b3 100644 --- a/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb +++ b/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb @@ -637,12 +637,12 @@ End Class Public Function InvokeWithTrueKeywordCommitSeeLangword() As Task - Return InvokeWithKeywordCommitSeeLangword("True") + Return InvokeWithKeywordCommitSeeLangword("True", unique:=False) End Function Public Function InvokeWithFalseKeywordCommitSeeLangword() As Task - Return InvokeWithKeywordCommitSeeLangword("False") + Return InvokeWithKeywordCommitSeeLangword("False", unique:=False) End Function @@ -688,8 +688,6 @@ End Class state.SendTab() End If - Await state.AssertNoCompletionSession() - ' ''' $$ Await state.AssertLineTextAroundCaret(" ''' ", "") End Using From e6f2c66244d9a9103ab181da905766cbe8b84bff Mon Sep 17 00:00:00 2001 From: DoctorKrolic Date: Sat, 23 Mar 2024 20:52:20 +0300 Subject: [PATCH 80/94] Bring back assertion --- .../VisualBasicCompletionCommandHandlerTests_XmlDoc.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb b/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb index 0d08f4cede6b3..df068451d6875 100644 --- a/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb +++ b/src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests_XmlDoc.vb @@ -688,6 +688,8 @@ End Class state.SendTab() End If + Await state.AssertNoCompletionSession() + ' ''' $$ Await state.AssertLineTextAroundCaret(" ''' ", "") End Using From 678dce3819ae9e78c5e8186a7d076140ee080918 Mon Sep 17 00:00:00 2001 From: "Juan C. Diaz" Date: Sat, 23 Mar 2024 16:44:50 -0400 Subject: [PATCH 81/94] Renaming => Ctor to Constructor --- .../MoveType/MoveTypeTests.MoveToNewFile.cs | 2 +- .../MoveType/AbstractMoveTypeService.MoveTypeEditor.cs | 10 +++++----- .../Portable/CodeGeneration/CSharpSyntaxGenerator.cs | 2 +- .../Core/Portable/Editing/SyntaxEditorExtensions.cs | 4 ++-- .../Core/Portable/Editing/SyntaxGenerator.cs | 6 +++--- .../CodeGeneration/VisualBasicSyntaxGenerator.vb | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs b/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs index 1aaed2ccaa5a0..5733000af73f9 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs @@ -536,7 +536,7 @@ class Class2 { } } [WpfFact, WorkItem("https://github.com/dotnet/roslyn/issues/72632")] - public async Task MoveNestedTypeToNewFile_Simple_DottedName_WithPrimaryCtor() + public async Task MoveNestedTypeToNewFile_Simple_DottedName_WithPrimaryConstructor() { var code = @"internal class Outer() diff --git a/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs b/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs index ff0f9a84b22af..fd88a578f05cf 100644 --- a/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs +++ b/src/Features/Core/Portable/CodeRefactorings/MoveType/AbstractMoveTypeService.MoveTypeEditor.cs @@ -125,7 +125,7 @@ private async Task AddNewDocumentWithSingleTypeDeclarationAsync(Docume // attributes from the containing partial types. We don't want to create // duplicate attributes on things. AddPartialModifiersToTypeChain( - documentEditor, removeAttributesAndComments: true, removeTypeInheritance: true, removePrimaryCtor: true); + documentEditor, removeAttributesAndComments: true, removeTypeInheritance: true, removePrimaryConstructor: true); // remove things that are not being moved, from the forked document. var membersToRemove = GetMembersToRemove(root); @@ -193,7 +193,7 @@ private async Task RemoveTypeFromSourceDocumentAsync(Document sourceDo // However, keep all the attributes on these types as theses are the // original attributes and we don't want to mess with them. AddPartialModifiersToTypeChain(documentEditor, - removeAttributesAndComments: false, removeTypeInheritance: false, removePrimaryCtor: false); + removeAttributesAndComments: false, removeTypeInheritance: false, removePrimaryConstructor: false); documentEditor.RemoveNode(State.TypeNode, SyntaxRemoveOptions.KeepUnbalancedDirectives); var updatedDocument = documentEditor.GetChangedDocument(); @@ -259,7 +259,7 @@ private void AddPartialModifiersToTypeChain( DocumentEditor documentEditor, bool removeAttributesAndComments, bool removeTypeInheritance, - bool removePrimaryCtor) + bool removePrimaryConstructor) { var semanticFacts = State.SemanticDocument.Document.GetRequiredLanguageService(); var typeChain = State.TypeNode.Ancestors().OfType(); @@ -285,9 +285,9 @@ private void AddPartialModifiersToTypeChain( documentEditor.RemoveAllTypeInheritance(node); } - if (removePrimaryCtor) + if (removePrimaryConstructor) { - documentEditor.RemovePrimaryCtor(node); + documentEditor.RemovePrimaryConstructor(node); } } diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 9643ff5f42d82..9308849fa2ffa 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -1200,7 +1200,7 @@ private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList< _ => declaration, }; - internal override ImmutableArray GetPrimaryCtor(SyntaxNode declaration) + internal override ImmutableArray GetPrimaryConstructor(SyntaxNode declaration) { if (declaration is ClassDeclarationSyntax || declaration is StructDeclarationSyntax) { diff --git a/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs b/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs index e7928cda864ac..c7111748afc1f 100644 --- a/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs +++ b/src/Workspaces/Core/Portable/Editing/SyntaxEditorExtensions.cs @@ -76,6 +76,6 @@ public static void AddInterfaceType(this SyntaxEditor editor, SyntaxNode declara public static void AddBaseType(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode baseType) => editor.ReplaceNode(declaration, (d, g) => g.AddBaseType(d, baseType)); - internal static void RemovePrimaryCtor(this SyntaxEditor editor, SyntaxNode declaration) - => editor.ReplaceNode(declaration, (d, g) => g.RemovePrimaryCtor(d)); + internal static void RemovePrimaryConstructor(this SyntaxEditor editor, SyntaxNode declaration) + => editor.ReplaceNode(declaration, (d, g) => g.RemovePrimaryConstructor(d)); } diff --git a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs index 53ede1c0038f5..2501962af63f8 100644 --- a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs +++ b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs @@ -1071,10 +1071,10 @@ public SyntaxNode RemoveAllAttributes(SyntaxNode declaration) /// internal abstract SyntaxNode RemoveAllComments(SyntaxNode node); - internal SyntaxNode RemovePrimaryCtor(SyntaxNode declaration) - => RemoveNodes(declaration, GetPrimaryCtor(declaration)); + internal SyntaxNode RemovePrimaryConstructor(SyntaxNode declaration) + => RemoveNodes(declaration, GetPrimaryConstructor(declaration)); - internal abstract ImmutableArray GetPrimaryCtor(SyntaxNode declaration); + internal abstract ImmutableArray GetPrimaryConstructor(SyntaxNode declaration); internal SyntaxNode RemoveLeadingAndTrailingComments(SyntaxNode node) { diff --git a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb index 5b874da6cc10a..861df9663198d 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb @@ -1675,7 +1675,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration Return attr.WithTarget(Nothing) End Function - Friend Overrides Function GetPrimaryCtor(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) + Friend Overrides Function GetPrimaryConstructor(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) Return ImmutableArray(Of SyntaxNode).Empty End Function From d6d80b212a86b0660c20497df2e1e9eb9c7cf33a Mon Sep 17 00:00:00 2001 From: "Juan C. Diaz" Date: Sat, 23 Mar 2024 16:52:07 -0400 Subject: [PATCH 82/94] Checking for TypeDeclarationSyntax when getting the primary constructor node --- .../CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 9308849fa2ffa..789827d4a1088 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -1202,7 +1202,7 @@ private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList< internal override ImmutableArray GetPrimaryConstructor(SyntaxNode declaration) { - if (declaration is ClassDeclarationSyntax || declaration is StructDeclarationSyntax) + if (declaration is TypeDeclarationSyntax) { var paramList = declaration.GetParameterList(); if (paramList is not null) From df19c44ec0f5b2efb111ed83b6acf7057e975967 Mon Sep 17 00:00:00 2001 From: "Juan C. Diaz" Date: Sat, 23 Mar 2024 16:57:57 -0400 Subject: [PATCH 83/94] Renaming to GetPrimaryConstructorParameterList --- .../CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs | 2 +- src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs | 4 ++-- .../Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 789827d4a1088..5ebfbd0ad83dc 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -1200,7 +1200,7 @@ private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList< _ => declaration, }; - internal override ImmutableArray GetPrimaryConstructor(SyntaxNode declaration) + internal override ImmutableArray GetPrimaryConstructorParameterList(SyntaxNode declaration) { if (declaration is TypeDeclarationSyntax) { diff --git a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs index 2501962af63f8..23542b315c784 100644 --- a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs +++ b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs @@ -1072,9 +1072,9 @@ public SyntaxNode RemoveAllAttributes(SyntaxNode declaration) internal abstract SyntaxNode RemoveAllComments(SyntaxNode node); internal SyntaxNode RemovePrimaryConstructor(SyntaxNode declaration) - => RemoveNodes(declaration, GetPrimaryConstructor(declaration)); + => RemoveNodes(declaration, GetPrimaryConstructorParameterList(declaration)); - internal abstract ImmutableArray GetPrimaryConstructor(SyntaxNode declaration); + internal abstract ImmutableArray GetPrimaryConstructorParameterList(SyntaxNode declaration); internal SyntaxNode RemoveLeadingAndTrailingComments(SyntaxNode node) { diff --git a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb index 861df9663198d..b7a0856863bd5 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb @@ -1675,7 +1675,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration Return attr.WithTarget(Nothing) End Function - Friend Overrides Function GetPrimaryConstructor(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) + Friend Overrides Function GetPrimaryConstructorParameterList(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) Return ImmutableArray(Of SyntaxNode).Empty End Function From de9100b6e03f5e5414abb7eacf1cdc6fe54fbe50 Mon Sep 17 00:00:00 2001 From: "Juan C. Diaz" Date: Sat, 23 Mar 2024 18:42:06 -0400 Subject: [PATCH 84/94] Replace return from array for Nullable --- .../Portable/CodeGeneration/CSharpSyntaxGenerator.cs | 6 +++--- src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs | 7 +++++-- .../Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 5ebfbd0ad83dc..0f269577a2e3b 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -1200,15 +1200,15 @@ private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList< _ => declaration, }; - internal override ImmutableArray GetPrimaryConstructorParameterList(SyntaxNode declaration) + internal override SyntaxNode? GetPrimaryConstructorParameterList(SyntaxNode declaration) { if (declaration is TypeDeclarationSyntax) { var paramList = declaration.GetParameterList(); if (paramList is not null) - return [paramList]; + return paramList; } - return []; + return null; } internal override ImmutableArray GetTypeInheritance(SyntaxNode declaration) diff --git a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs index 23542b315c784..427d9f3535086 100644 --- a/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs +++ b/src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs @@ -1072,9 +1072,12 @@ public SyntaxNode RemoveAllAttributes(SyntaxNode declaration) internal abstract SyntaxNode RemoveAllComments(SyntaxNode node); internal SyntaxNode RemovePrimaryConstructor(SyntaxNode declaration) - => RemoveNodes(declaration, GetPrimaryConstructorParameterList(declaration)); + { + var node = GetPrimaryConstructorParameterList(declaration); + return RemoveNodes(declaration, node is not null ? [node] : []); + } - internal abstract ImmutableArray GetPrimaryConstructorParameterList(SyntaxNode declaration); + internal abstract SyntaxNode? GetPrimaryConstructorParameterList(SyntaxNode declaration); internal SyntaxNode RemoveLeadingAndTrailingComments(SyntaxNode node) { diff --git a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb index b7a0856863bd5..bcfa7cbc632d4 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb @@ -1675,8 +1675,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration Return attr.WithTarget(Nothing) End Function - Friend Overrides Function GetPrimaryConstructorParameterList(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) - Return ImmutableArray(Of SyntaxNode).Empty + Friend Overrides Function GetPrimaryConstructorParameterList(declaration As SyntaxNode) As SyntaxNode + Return Nothing End Function Friend Overrides Function GetTypeInheritance(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) From 87c3653ab5ff97f0a741ec4d627233761a859ae1 Mon Sep 17 00:00:00 2001 From: juan-carlos-diaz <43589627+juan-carlos-diaz@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:59:07 -0400 Subject: [PATCH 85/94] Update src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs Co-authored-by: Cyrus Najmabadi --- .../Portable/CodeGeneration/CSharpSyntaxGenerator.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 0f269577a2e3b..5a0714b9452d1 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -1201,15 +1201,7 @@ private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList< }; internal override SyntaxNode? GetPrimaryConstructorParameterList(SyntaxNode declaration) - { - if (declaration is TypeDeclarationSyntax) - { - var paramList = declaration.GetParameterList(); - if (paramList is not null) - return paramList; - } - return null; - } + => declaration is TypeDeclarationSyntax { ParameterList: { } parameterList } ? parameterList : null; internal override ImmutableArray GetTypeInheritance(SyntaxNode declaration) => declaration is BaseTypeDeclarationSyntax baseType && baseType.BaseList != null From 8aeb4d1f980491dd027e80fed465630fa0672cbb Mon Sep 17 00:00:00 2001 From: DoctorKrolic Date: Sun, 24 Mar 2024 09:29:32 +0300 Subject: [PATCH 86/94] Fix CS --- .../CSharpCompletionCommandHandlerTests_XmlDoc.vb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests_XmlDoc.vb b/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests_XmlDoc.vb index ed69904f96831..d04b8b108da6d 100644 --- a/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests_XmlDoc.vb +++ b/src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests_XmlDoc.vb @@ -712,7 +712,7 @@ class c Public Function InvokeWithTrueKeywordCommitSeeLangword(showCompletionInArgumentLists As Boolean) As Task - Return InvokeWithKeywordCommitSeeLangword("true", showCompletionInArgumentLists) + Return InvokeWithKeywordCommitSeeLangword("true", showCompletionInArgumentLists, unique:=False) End Function @@ -740,7 +740,7 @@ class c Return InvokeWithKeywordCommitSeeLangword("await", showCompletionInArgumentLists) End Function - Private Shared Async Function InvokeWithKeywordCommitSeeLangword(keyword As String, showCompletionInArgumentLists As Boolean) As Task + Private Shared Async Function InvokeWithKeywordCommitSeeLangword(keyword As String, showCompletionInArgumentLists As Boolean, Optional unique As Boolean = True) As Task Using state = TestStateFactory.CreateCSharpTestState( $$ From ac643928571c6370d751b25b2da15e42710d0ca7 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sat, 23 Mar 2024 23:44:53 -0700 Subject: [PATCH 87/94] Remove event --- .../Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs index 4876906f6091a..98719e619c20e 100644 --- a/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs +++ b/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs @@ -14,8 +14,4 @@ namespace Microsoft.CodeAnalysis.Diagnostics; /// internal interface IDiagnosticUpdateSource { - /// - /// Raise this when new diagnostics are found - /// - event EventHandler> DiagnosticsUpdated; } From 16535cd7dc931422362112f8190083c60582f51d Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sat, 23 Mar 2024 23:49:02 -0700 Subject: [PATCH 88/94] Remove event --- .../Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb index 698f879f3722a..391609018236f 100644 --- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb +++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb @@ -647,8 +647,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics End Get End Property - Public Event DiagnosticsUpdated As EventHandler(Of ImmutableArray(Of DiagnosticsUpdatedArgs)) Implements IDiagnosticUpdateSource.DiagnosticsUpdated - Public Sub RequestDiagnosticRefresh() Implements IDiagnosticAnalyzerService.RequestDiagnosticRefresh End Sub From b79e70fa0bfb2106be7ab935393f0c5ce3b034ae Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sat, 23 Mar 2024 23:52:56 -0700 Subject: [PATCH 89/94] remove interface --- .../Squiggles/TestDiagnosticTagProducer.cs | 2 +- .../AbstractHostDiagnosticUpdateSource.cs | 2 +- .../Diagnostics/IDiagnosticUpdateSource.cs | 17 ----------------- .../EditAndContinueDiagnosticUpdateSource.cs | 2 +- .../DiagnosticAnalyzerService_UpdateSource.cs | 2 +- .../ExternalErrorDiagnosticUpdateSource.cs | 2 +- .../ExternalDiagnosticUpdateSourceTests.vb | 2 +- 7 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs diff --git a/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs b/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs index 140881143a878..04d7c7e2a9eb4 100644 --- a/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs +++ b/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs @@ -46,7 +46,7 @@ internal static DiagnosticData CreateDiagnosticData(EditorTestHostDocument docum language: document.Project.Language); } - private class TestDiagnosticUpdateSource : IDiagnosticUpdateSource + private class TestDiagnosticUpdateSource { public void RaiseDiagnosticsUpdated(ImmutableArray args) { diff --git a/src/Features/Core/Portable/Diagnostics/AbstractHostDiagnosticUpdateSource.cs b/src/Features/Core/Portable/Diagnostics/AbstractHostDiagnosticUpdateSource.cs index 73c2fc299826b..8b36e8607acc4 100644 --- a/src/Features/Core/Portable/Diagnostics/AbstractHostDiagnosticUpdateSource.cs +++ b/src/Features/Core/Portable/Diagnostics/AbstractHostDiagnosticUpdateSource.cs @@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.Diagnostics; /// which may not be related to any given project/document in the solution. /// For example, these include diagnostics generated for exceptions from third party analyzers. /// -internal abstract class AbstractHostDiagnosticUpdateSource : IDiagnosticUpdateSource +internal abstract class AbstractHostDiagnosticUpdateSource { private ImmutableDictionary> _analyzerHostDiagnosticsMap = ImmutableDictionary>.Empty; diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs deleted file mode 100644 index 98719e619c20e..0000000000000 --- a/src/Features/Core/Portable/Diagnostics/IDiagnosticUpdateSource.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Immutable; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.CodeAnalysis.Diagnostics; - -/// -/// Implement this to participate in diagnostic service framework as one of diagnostic update source -/// -internal interface IDiagnosticUpdateSource -{ -} diff --git a/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs b/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs index 23e7d7626eb91..8b472c95f76a7 100644 --- a/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs +++ b/src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticUpdateSource.cs @@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.EditAndContinue; [Export(typeof(EditAndContinueDiagnosticUpdateSource)), Shared] -internal sealed class EditAndContinueDiagnosticUpdateSource : IDiagnosticUpdateSource +internal sealed class EditAndContinueDiagnosticUpdateSource { private int _diagnosticsVersion; private bool _previouslyHadDiagnostics; diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_UpdateSource.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_UpdateSource.cs index 3a4165e026e94..a265c65c69249 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_UpdateSource.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService_UpdateSource.cs @@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Diagnostics { - internal partial class DiagnosticAnalyzerService : IDiagnosticUpdateSource + internal partial class DiagnosticAnalyzerService { public event EventHandler> DiagnosticsUpdated { diff --git a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs index 8e59d51d2a478..0d9f709c5e94d 100644 --- a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs +++ b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs @@ -36,7 +36,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.TaskList; /// It raises events about diagnostic updates, which eventually trigger the "Build + Intellisense" and "Build only" error list diagnostic /// sources to update the reported diagnostics. /// -internal sealed class ExternalErrorDiagnosticUpdateSource : IDiagnosticUpdateSource, IDisposable +internal sealed class ExternalErrorDiagnosticUpdateSource : IDisposable { private readonly Workspace _workspace; private readonly IDiagnosticAnalyzerService _diagnosticService; diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb index 391609018236f..08517a6f552e3 100644 --- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb +++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb @@ -630,7 +630,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics End Function Private Class TestDiagnosticAnalyzerService - Implements IDiagnosticAnalyzerService, IDiagnosticUpdateSource + Implements IDiagnosticAnalyzerService Private ReadOnly _analyzerInfoCache As DiagnosticAnalyzerInfoCache From fe24b2cdd51761592319aca2aab8cda5f9cd6ba2 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sat, 23 Mar 2024 23:54:02 -0700 Subject: [PATCH 90/94] remove type --- .../Squiggles/TestDiagnosticTagProducer.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs b/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs index 04d7c7e2a9eb4..79108121d640b 100644 --- a/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs +++ b/src/EditorFeatures/TestUtilities/Squiggles/TestDiagnosticTagProducer.cs @@ -45,14 +45,4 @@ internal static DiagnosticData CreateDiagnosticData(EditorTestHostDocument docum location: new DiagnosticDataLocation(new FileLinePositionSpan(document.FilePath, linePosSpan), document.Id), language: document.Project.Language); } - - private class TestDiagnosticUpdateSource - { - public void RaiseDiagnosticsUpdated(ImmutableArray args) - { - DiagnosticsUpdated?.Invoke(this, args); - } - - public event EventHandler>? DiagnosticsUpdated; - } } From 92ec0e2c3f03037eead2ce1a4683675a85b96eaf Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Mon, 25 Mar 2024 09:48:14 +0100 Subject: [PATCH 91/94] Remove invisible character in yaml (#72665) --- azure-pipelines-official.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 3b713dea8d779..1a86360a0fcb0 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -45,7 +45,7 @@ variables: value: .NETCoreValidation - group: DotNet-Roslyn-SDLValidation-Params - name: Codeql.Enabled - value: true​ + value: true # To retrieve OptProf data we need to authenticate to the VS drop storage. # Get access token with $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw from DotNet-VSTS-Infra-Access From 919d4dbfb0dffb35a702417e28ceea652d248bc6 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Mon, 25 Mar 2024 10:36:33 +0100 Subject: [PATCH 92/94] Handle ref safety of user-defined operators (#71911) * Handle ref safety of user-defined conversions * Fixup existing tests * Add more tests * Assert conversions do not return by reference * Add test attempting to return ref from user-defined conversion * Handle IL scenario * Add more tests * Narrow check for unsupported IL method * Handle other user defined operators * Add more tests * Add binary operator scoped tests * Test bit operator * Handle compound assignment * Simplify code * Visit the operator in compound assignment * Test scoped target of compound assignment --- .../Portable/Binder/Binder.ValueChecks.cs | 230 ++- .../Portable/Binder/RefSafetyAnalysis.cs | 7 + .../Semantics/PrimaryConstructorTests.cs | 5 +- .../Semantic/Semantics/RefEscapingTests.cs | 1335 +++++++++++++++++ .../Semantics/StructConstructorTests.cs | 23 +- 5 files changed, 1590 insertions(+), 10 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs b/src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs index 1275fa01322ef..919527d75cd9e 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs @@ -3249,6 +3249,40 @@ internal uint GetRefEscape(BoundExpression expr, uint scopeOfTheContainingExpres } return GetRefEscape(assignment.Left, scopeOfTheContainingExpression); + + case BoundKind.Conversion: + Debug.Assert(expr is BoundConversion conversion && + (!conversion.Conversion.IsUserDefined || + conversion.Conversion.Method.HasUnsupportedMetadata || + conversion.Conversion.Method.RefKind == RefKind.None)); + break; + + case BoundKind.UnaryOperator: + Debug.Assert(expr is BoundUnaryOperator unaryOperator && + (unaryOperator.MethodOpt is not { } unaryMethod || + unaryMethod.HasUnsupportedMetadata || + unaryMethod.RefKind == RefKind.None)); + break; + + case BoundKind.BinaryOperator: + Debug.Assert(expr is BoundBinaryOperator binaryOperator && + (binaryOperator.Method is not { } binaryMethod || + binaryMethod.HasUnsupportedMetadata || + binaryMethod.RefKind == RefKind.None)); + break; + + case BoundKind.UserDefinedConditionalLogicalOperator: + Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator && + (logicalOperator.LogicalOperator.HasUnsupportedMetadata || + logicalOperator.LogicalOperator.RefKind == RefKind.None)); + break; + + case BoundKind.CompoundAssignmentOperator: + Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator && + (compoundAssignmentOperator.Operator.Method is not { } compoundMethod || + compoundMethod.HasUnsupportedMetadata || + compoundMethod.RefKind == RefKind.None)); + break; } // At this point we should have covered all the possible cases for anything that is not a strict RValue. @@ -3587,6 +3621,37 @@ internal bool CheckRefEscape(SyntaxNode node, BoundExpression expr, uint escapeF { return CheckRefEscape(node, conversion.Operand, escapeFrom, escapeTo, checkingReceiver, diagnostics); } + + Debug.Assert(!conversion.Conversion.IsUserDefined || + conversion.Conversion.Method.HasUnsupportedMetadata || + conversion.Conversion.Method.RefKind == RefKind.None); + break; + + case BoundKind.UnaryOperator: + Debug.Assert(expr is BoundUnaryOperator unaryOperator && + (unaryOperator.MethodOpt is not { } unaryMethod || + unaryMethod.HasUnsupportedMetadata || + unaryMethod.RefKind == RefKind.None)); + break; + + case BoundKind.BinaryOperator: + Debug.Assert(expr is BoundBinaryOperator binaryOperator && + (binaryOperator.Method is not { } binaryMethod || + binaryMethod.HasUnsupportedMetadata || + binaryMethod.RefKind == RefKind.None)); + break; + + case BoundKind.UserDefinedConditionalLogicalOperator: + Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator && + (logicalOperator.LogicalOperator.HasUnsupportedMetadata || + logicalOperator.LogicalOperator.RefKind == RefKind.None)); + break; + + case BoundKind.CompoundAssignmentOperator: + Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator && + (compoundAssignmentOperator.Operator.Method is not { } compoundMethod || + compoundMethod.HasUnsupportedMetadata || + compoundMethod.RefKind == RefKind.None)); break; case BoundKind.ThrowExpression: @@ -3891,7 +3956,22 @@ internal uint GetValEscape(BoundExpression expr, uint scopeOfTheContainingExpres GetValEscape(withExpression.InitializerExpression, scopeOfTheContainingExpression)); case BoundKind.UnaryOperator: - return GetValEscape(((BoundUnaryOperator)expr).Operand, scopeOfTheContainingExpression); + var unaryOperator = (BoundUnaryOperator)expr; + if (unaryOperator.MethodOpt is { } unaryMethod) + { + return GetInvocationEscapeScope( + unaryMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + unaryMethod.Parameters, + argsOpt: [unaryOperator.Operand], + argRefKindsOpt: default, + argsToParamsOpt: default, + scopeOfTheContainingExpression: scopeOfTheContainingExpression, + isRefEscape: false); + } + + return GetValEscape(unaryOperator.Operand, scopeOfTheContainingExpression); case BoundKind.Conversion: var conversion = (BoundConversion)expr; @@ -3927,6 +4007,23 @@ internal uint GetValEscape(BoundExpression expr, uint scopeOfTheContainingExpres isRefEscape: false); } + if (conversion.Conversion.IsUserDefined) + { + var operatorMethod = conversion.Conversion.Method; + Debug.Assert(operatorMethod is not null); + + return GetInvocationEscapeScope( + operatorMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + operatorMethod.Parameters, + argsOpt: [conversion.Operand], + argRefKindsOpt: default, + argsToParamsOpt: default, + scopeOfTheContainingExpression: scopeOfTheContainingExpression, + isRefEscape: false); + } + return GetValEscape(conversion.Operand, scopeOfTheContainingExpression); case BoundKind.AssignmentOperator: @@ -3938,12 +4035,40 @@ internal uint GetValEscape(BoundExpression expr, uint scopeOfTheContainingExpres case BoundKind.CompoundAssignmentOperator: var compound = (BoundCompoundAssignmentOperator)expr; + if (compound.Operator.Method is { } compoundMethod) + { + return GetInvocationEscapeScope( + compoundMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + compoundMethod.Parameters, + argsOpt: [compound.Left, compound.Right], + argRefKindsOpt: default, + argsToParamsOpt: default, + scopeOfTheContainingExpression: scopeOfTheContainingExpression, + isRefEscape: false); + } + return Math.Max(GetValEscape(compound.Left, scopeOfTheContainingExpression), GetValEscape(compound.Right, scopeOfTheContainingExpression)); case BoundKind.BinaryOperator: var binary = (BoundBinaryOperator)expr; + if (binary.Method is { } binaryMethod) + { + return GetInvocationEscapeScope( + binaryMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + binaryMethod.Parameters, + argsOpt: [binary.Left, binary.Right], + argRefKindsOpt: default, + argsToParamsOpt: default, + scopeOfTheContainingExpression: scopeOfTheContainingExpression, + isRefEscape: false); + } + return Math.Max(GetValEscape(binary.Left, scopeOfTheContainingExpression), GetValEscape(binary.Right, scopeOfTheContainingExpression)); @@ -3956,8 +4081,16 @@ internal uint GetValEscape(BoundExpression expr, uint scopeOfTheContainingExpres case BoundKind.UserDefinedConditionalLogicalOperator: var uo = (BoundUserDefinedConditionalLogicalOperator)expr; - return Math.Max(GetValEscape(uo.Left, scopeOfTheContainingExpression), - GetValEscape(uo.Right, scopeOfTheContainingExpression)); + return GetInvocationEscapeScope( + uo.LogicalOperator, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + uo.LogicalOperator.Parameters, + argsOpt: [uo.Left, uo.Right], + argRefKindsOpt: default, + argsToParamsOpt: default, + scopeOfTheContainingExpression: scopeOfTheContainingExpression, + isRefEscape: false); case BoundKind.QueryClause: return GetValEscape(((BoundQueryClause)expr).Value, scopeOfTheContainingExpression); @@ -4473,6 +4606,24 @@ internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, uint escapeF case BoundKind.UnaryOperator: var unary = (BoundUnaryOperator)expr; + if (unary.MethodOpt is { } unaryMethod) + { + return CheckInvocationEscape( + unary.Syntax, + unaryMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + unaryMethod.Parameters, + argsOpt: [unary.Operand], + argRefKindsOpt: default, + argsToParamsOpt: default, + checkingReceiver: checkingReceiver, + escapeFrom: escapeFrom, + escapeTo: escapeTo, + diagnostics, + isRefEscape: false); + } + return CheckValEscape(node, unary.Operand, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics); case BoundKind.FromEndIndexExpression: @@ -4520,6 +4671,27 @@ internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, uint escapeF isRefEscape: false); } + if (conversion.Conversion.IsUserDefined) + { + var operatorMethod = conversion.Conversion.Method; + Debug.Assert(operatorMethod is not null); + + return CheckInvocationEscape( + conversion.Syntax, + operatorMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + operatorMethod.Parameters, + argsOpt: [conversion.Operand], + argRefKindsOpt: default, + argsToParamsOpt: default, + checkingReceiver: checkingReceiver, + escapeFrom: escapeFrom, + escapeTo: escapeTo, + diagnostics, + isRefEscape: false); + } + return CheckValEscape(node, conversion.Operand, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics); case BoundKind.AssignmentOperator: @@ -4533,6 +4705,24 @@ internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, uint escapeF case BoundKind.CompoundAssignmentOperator: var compound = (BoundCompoundAssignmentOperator)expr; + if (compound.Operator.Method is { } compoundMethod) + { + return CheckInvocationEscape( + compound.Syntax, + compoundMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + compoundMethod.Parameters, + argsOpt: [compound.Left, compound.Right], + argRefKindsOpt: default, + argsToParamsOpt: default, + checkingReceiver: checkingReceiver, + escapeFrom: escapeFrom, + escapeTo: escapeTo, + diagnostics, + isRefEscape: false); + } + return CheckValEscape(compound.Left.Syntax, compound.Left, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics) && CheckValEscape(compound.Right.Syntax, compound.Right, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics); @@ -4544,6 +4734,24 @@ internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, uint escapeF return true; } + if (binary.Method is { } binaryMethod) + { + return CheckInvocationEscape( + binary.Syntax, + binaryMethod, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + binaryMethod.Parameters, + argsOpt: [binary.Left, binary.Right], + argRefKindsOpt: default, + argsToParamsOpt: default, + checkingReceiver: checkingReceiver, + escapeFrom: escapeFrom, + escapeTo: escapeTo, + diagnostics, + isRefEscape: false); + } + return CheckValEscape(binary.Left.Syntax, binary.Left, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics) && CheckValEscape(binary.Right.Syntax, binary.Right, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics); @@ -4560,8 +4768,20 @@ internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, uint escapeF case BoundKind.UserDefinedConditionalLogicalOperator: var uo = (BoundUserDefinedConditionalLogicalOperator)expr; - return CheckValEscape(uo.Left.Syntax, uo.Left, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics) && - CheckValEscape(uo.Right.Syntax, uo.Right, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics); + return CheckInvocationEscape( + uo.Syntax, + uo.LogicalOperator, + receiver: null, + receiverIsSubjectToCloning: ThreeState.Unknown, + uo.LogicalOperator.Parameters, + argsOpt: [uo.Left, uo.Right], + argRefKindsOpt: default, + argsToParamsOpt: default, + checkingReceiver: checkingReceiver, + escapeFrom: escapeFrom, + escapeTo: escapeTo, + diagnostics, + isRefEscape: false); case BoundKind.QueryClause: var clauseValue = ((BoundQueryClause)expr).Value; diff --git a/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs b/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs index 6d6e983a1ef12..2029d8d5aa669 100644 --- a/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs +++ b/src/Compilers/CSharp/Portable/Binder/RefSafetyAnalysis.cs @@ -539,6 +539,13 @@ private void RemoveLocalScopes(LocalSymbol local) return null; } + public override BoundNode? VisitCompoundAssignmentOperator(BoundCompoundAssignmentOperator node) + { + base.VisitCompoundAssignmentOperator(node); + ValidateAssignment(node.Syntax, node.Left, node, isRef: false, _diagnostics); + return null; + } + public override BoundNode? VisitIsPatternExpression(BoundIsPatternExpression node) { this.Visit(node.Expression); diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs index bd9fcd94491c7..f9f267fa6b620 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/PrimaryConstructorTests.cs @@ -7117,7 +7117,10 @@ struct Example() Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "ReadOnlySpan").WithArguments("System.ReadOnlySpan").WithLocation(5, 12), // (5,50): error CS8353: A result of a stackalloc expression of type 'Span' cannot be used in this context because it may be exposed outside of the containing method // public ReadOnlySpan Property { get; } = stackalloc int[512]; - Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50)); + Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50), + // (5,50): error CS8347: Cannot use a result of 'Span.implicit operator ReadOnlySpan(Span)' in this context because it may expose variables referenced by parameter 'span' outside of their declaration scope + // public ReadOnlySpan Property { get; } = stackalloc int[512]; + Diagnostic(ErrorCode.ERR_EscapeCall, "stackalloc int[512]").WithArguments("System.Span.implicit operator System.ReadOnlySpan(System.Span)", "span").WithLocation(5, 50)); } public static IEnumerable ParameterScope_MemberData() diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/RefEscapingTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/RefEscapingTests.cs index 9167634ab8a04..6da08b9784005 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/RefEscapingTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/RefEscapingTests.cs @@ -760,6 +760,12 @@ ref struct S1 // (22,18): error CS8352: Cannot use variable 'local' in this context because it may expose referenced variables outside of their declaration scope // global = local && global; Diagnostic(ErrorCode.ERR_EscapeVariable, "local").WithArguments("local").WithLocation(22, 18), + // (22,18): error CS8347: Cannot use a result of 'S1.operator &(S1, S1)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // global = local && global; + Diagnostic(ErrorCode.ERR_EscapeCall, "local && global").WithArguments("S1.operator &(S1, S1)", "x").WithLocation(22, 18), + // (25,16): error CS8347: Cannot use a result of 'S1.operator |(S1, S1)' in this context because it may expose variables referenced by parameter 'y' outside of their declaration scope + // return global || local; + Diagnostic(ErrorCode.ERR_EscapeCall, "global || local").WithArguments("S1.operator |(S1, S1)", "y").WithLocation(25, 16), // (25,26): error CS8352: Cannot use variable 'local' in this context because it may expose referenced variables outside of their declaration scope // return global || local; Diagnostic(ErrorCode.ERR_EscapeVariable, "local").WithArguments("local").WithLocation(25, 26) @@ -7196,5 +7202,1334 @@ static void M(ReadOnlySpan s) var comp = CreateCompilation(source, targetFramework: TargetFramework.Net70); comp.VerifyDiagnostics(); } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefStruct_Explicit() + { + var source = """ + class C + { + S M1() + { + S s; + s = (S)100; // 1 + return s; + } + + S M2() + { + return (S)200; // 2 + } + + S M3(in int x) + { + S s; + s = (S)x; // 3 + return s; + } + + S M4(in int x) + { + return (S)x; + } + + S M4s(scoped in int x) + { + return (S)x; // 4 + } + + S M5(in int x) + { + S s = (S)x; + return s; + } + + S M5s(scoped in int x) + { + S s = (S)x; + return s; // 5 + } + + S M6() + { + S s = (S)300; + return s; // 6 + } + + void M7(in int x) + { + scoped S s; + s = (S)x; + s = (S)100; + } + } + + ref struct S + { + public static explicit operator S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (6,13): error CS8347: Cannot use a result of 'S.explicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = (S)100; // 1 + Diagnostic(ErrorCode.ERR_EscapeCall, "(S)100").WithArguments("S.explicit operator S(in int)", "x").WithLocation(6, 13), + // (6,16): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // s = (S)100; // 1 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 16), + // (12,16): error CS8347: Cannot use a result of 'S.explicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return (S)200; // 2 + Diagnostic(ErrorCode.ERR_EscapeCall, "(S)200").WithArguments("S.explicit operator S(in int)", "x").WithLocation(12, 16), + // (12,19): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return (S)200; // 2 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 19), + // (18,13): error CS8347: Cannot use a result of 'S.explicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = (S)x; // 3 + Diagnostic(ErrorCode.ERR_EscapeCall, "(S)x").WithArguments("S.explicit operator S(in int)", "x").WithLocation(18, 13), + // (18,16): error CS9077: Cannot return a parameter by reference 'x' through a ref parameter; it can only be returned in a return statement + // s = (S)x; // 3 + Diagnostic(ErrorCode.ERR_RefReturnOnlyParameter, "x").WithArguments("x").WithLocation(18, 16), + // (29,16): error CS8347: Cannot use a result of 'S.explicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return (S)x; // 4 + Diagnostic(ErrorCode.ERR_EscapeCall, "(S)x").WithArguments("S.explicit operator S(in int)", "x").WithLocation(29, 16), + // (29,19): error CS9075: Cannot return a parameter by reference 'x' because it is scoped to the current method + // return (S)x; // 4 + Diagnostic(ErrorCode.ERR_RefReturnScopedParameter, "x").WithArguments("x").WithLocation(29, 19), + // (41,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 5 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(41, 16), + // (47,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 6 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(47, 16)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefStruct_Implicit() + { + var source = """ + class C + { + S M1() + { + S s; + s = 100; // 1 + return s; + } + + S M2() + { + return 200; // 2 + } + + S M3(in int x) + { + S s; + s = x; // 3 + return s; + } + + S M4(in int x) + { + return x; + } + + S M4s(scoped in int x) + { + return x; // 4 + } + + S M5(in int x) + { + S s = x; + return s; + } + + S M5s(scoped in int x) + { + S s = x; + return s; // 5 + } + + S M6() + { + S s = 300; + return s; // 6 + } + + void M7(in int x) + { + scoped S s; + s = x; + s = 100; + } + } + + ref struct S + { + public static implicit operator S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (6,13): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // s = 100; // 1 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), + // (6,13): error CS8347: Cannot use a result of 'S.implicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = 100; // 1 + Diagnostic(ErrorCode.ERR_EscapeCall, "100").WithArguments("S.implicit operator S(in int)", "x").WithLocation(6, 13), + // (12,16): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return 200; // 2 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), + // (12,16): error CS8347: Cannot use a result of 'S.implicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return 200; // 2 + Diagnostic(ErrorCode.ERR_EscapeCall, "200").WithArguments("S.implicit operator S(in int)", "x").WithLocation(12, 16), + // (18,13): error CS9077: Cannot return a parameter by reference 'x' through a ref parameter; it can only be returned in a return statement + // s = x; // 3 + Diagnostic(ErrorCode.ERR_RefReturnOnlyParameter, "x").WithArguments("x").WithLocation(18, 13), + // (18,13): error CS8347: Cannot use a result of 'S.implicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = x; // 3 + Diagnostic(ErrorCode.ERR_EscapeCall, "x").WithArguments("S.implicit operator S(in int)", "x").WithLocation(18, 13), + // (29,16): error CS9075: Cannot return a parameter by reference 'x' because it is scoped to the current method + // return x; // 4 + Diagnostic(ErrorCode.ERR_RefReturnScopedParameter, "x").WithArguments("x").WithLocation(29, 16), + // (29,16): error CS8347: Cannot use a result of 'S.implicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return x; // 4 + Diagnostic(ErrorCode.ERR_EscapeCall, "x").WithArguments("S.implicit operator S(in int)", "x").WithLocation(29, 16), + // (41,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 5 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(41, 16), + // (47,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 6 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(47, 16)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefStructArgument() + { + var source = """ + class C + { + S2 M1() + { + int x = 1; + S1 s1 = (S1)x; + return (S2)s1; // 1 + } + } + + ref struct S1 + { + public static implicit operator S1(in int x) => throw null; + } + + ref struct S2 + { + public static implicit operator S2(S1 s1) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (7,16): error CS8347: Cannot use a result of 'S2.implicit operator S2(S1)' in this context because it may expose variables referenced by parameter 's1' outside of their declaration scope + // return (S2)s1; // 1 + Diagnostic(ErrorCode.ERR_EscapeCall, "(S2)s1").WithArguments("S2.implicit operator S2(S1)", "s1").WithLocation(7, 16), + // (7,20): error CS8352: Cannot use variable 's1' in this context because it may expose referenced variables outside of their declaration scope + // return (S2)s1; // 1 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s1").WithArguments("s1").WithLocation(7, 20)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefStructArgument_ScopedIn() + { + var source = """ + class C + { + S2 M1() + { + int x = 1; + S1 s1 = (S1)x; + return (S2)s1; + } + } + + ref struct S1 + { + public static implicit operator S1(scoped in int x) => throw null; + } + + ref struct S2 + { + public static implicit operator S2(S1 s1) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RegularStruct() + { + var source = """ + S s; + s = (S)100; + + struct S + { + public static explicit operator S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_StandardImplicitConversion_Input() + { + var source = """ + class C + { + S M1() + { + S s; + s = 100; // 1 + return s; + } + + S M2() + { + return 200; // 2 + } + + S M3(in int x) + { + S s; + s = x; // 3 + return s; + } + + S M4(in int x) + { + return x; // 4 + } + + S M4s(scoped in int x) + { + return x; // 5 + } + + S M5(in int x) + { + S s = x; + return s; // 6 + } + + S M5s(scoped in int x) + { + S s = x; + return s; // 7 + } + + S M6() + { + S s = 300; + return s; // 8 + } + } + + ref struct S + { + public static implicit operator S(in int? x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (6,13): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // s = 100; // 1 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), + // (6,13): error CS8347: Cannot use a result of 'S.implicit operator S(in int?)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = 100; // 1 + Diagnostic(ErrorCode.ERR_EscapeCall, "100").WithArguments("S.implicit operator S(in int?)", "x").WithLocation(6, 13), + // (12,16): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return 200; // 2 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), + // (12,16): error CS8347: Cannot use a result of 'S.implicit operator S(in int?)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return 200; // 2 + Diagnostic(ErrorCode.ERR_EscapeCall, "200").WithArguments("S.implicit operator S(in int?)", "x").WithLocation(12, 16), + // (18,13): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // s = x; // 3 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(18, 13), + // (18,13): error CS8347: Cannot use a result of 'S.implicit operator S(in int?)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = x; // 3 + Diagnostic(ErrorCode.ERR_EscapeCall, "x").WithArguments("S.implicit operator S(in int?)", "x").WithLocation(18, 13), + // (24,16): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return x; // 4 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(24, 16), + // (24,16): error CS8347: Cannot use a result of 'S.implicit operator S(in int?)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return x; // 4 + Diagnostic(ErrorCode.ERR_EscapeCall, "x").WithArguments("S.implicit operator S(in int?)", "x").WithLocation(24, 16), + // (29,16): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return x; // 5 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(29, 16), + // (29,16): error CS8347: Cannot use a result of 'S.implicit operator S(in int?)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return x; // 5 + Diagnostic(ErrorCode.ERR_EscapeCall, "x").WithArguments("S.implicit operator S(in int?)", "x").WithLocation(29, 16), + // (35,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 6 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(35, 16), + // (41,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 7 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(41, 16), + // (47,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 8 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(47, 16)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_StandardImplicitConversion_Output() + { + var source = """ + object o; + o = (S)100; + + struct S + { + public static explicit operator S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_StandardImplicitConversion_Both() + { + var source = """ + object o; + int x = 100; + o = (S)x; + + struct S + { + public static explicit operator S(in int? x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_Call() + { + var source = """ + class C + { + S M1(int x) + { + return M2(x); + } + + S M2(S s) => s; + } + + ref struct S + { + public static implicit operator S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (5,16): error CS8347: Cannot use a result of 'C.M2(S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // return M2(x); + Diagnostic(ErrorCode.ERR_EscapeCall, "M2(x)").WithArguments("C.M2(S)", "s").WithLocation(5, 16), + // (5,19): error CS8166: Cannot return a parameter by reference 'x' because it is not a ref parameter + // return M2(x); + Diagnostic(ErrorCode.ERR_RefReturnParameter, "x").WithArguments("x").WithLocation(5, 19), + // (5,19): error CS8347: Cannot use a result of 'S.implicit operator S(in int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return M2(x); + Diagnostic(ErrorCode.ERR_EscapeCall, "x").WithArguments("S.implicit operator S(in int)", "x").WithLocation(5, 19)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefReturn_01() + { + var source = """ + class C + { + static ref readonly int M1(int x) + { + return ref M2(x); + } + + static ref readonly int M2(in S s) => throw null; + } + + struct S + { + public static implicit operator S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (5,20): error CS8347: Cannot use a result of 'C.M2(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // return ref M2(x); + Diagnostic(ErrorCode.ERR_EscapeCall, "M2(x)").WithArguments("C.M2(in S)", "s").WithLocation(5, 20), + // (5,23): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return ref M2(x); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(5, 23)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefReturn_02() + { + var source = """ + class C + { + static ref readonly int M1(int x) + { + return ref M2(x); + } + + static ref readonly int M2(in S s) => throw null; + } + + struct S + { + public static implicit operator ref S(in int x) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (5,20): error CS8347: Cannot use a result of 'C.M2(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // return ref M2(x); + Diagnostic(ErrorCode.ERR_EscapeCall, "M2(x)").WithArguments("C.M2(in S)", "s").WithLocation(5, 20), + // (5,23): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return ref M2(x); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(5, 23), + // (13,37): error CS1073: Unexpected token 'ref' + // public static implicit operator ref S(in int x) => throw null; + Diagnostic(ErrorCode.ERR_UnexpectedToken, "ref").WithArguments("ref").WithLocation(13, 37)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedCast_RefReturn_IL() + { + // public struct S + // { + // public static implicit operator ref readonly S(in int x) => throw null; + // } + var ilSource = """ + .class public sequential ansi sealed beforefieldinit S extends System.ValueType + { + .pack 0 + .size 1 + + .method public hidebysig specialname static valuetype S& modreq(System.Runtime.InteropServices.InAttribute) op_Implicit ( + [in] int32& x + ) cil managed + { + .param [1] + .custom instance void System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( + 01 00 00 00 + ) + + .maxstack 1 + .locals init ( + [0] valuetype S + ) + + ldnull + throw + } + } + + .class public auto ansi sealed beforefieldinit System.Runtime.InteropServices.InAttribute extends System.Object + { + .method public hidebysig specialname rtspecialname instance void .ctor() cil managed + { + .maxstack 8 + ret + } + } + + .class public auto ansi sealed beforefieldinit System.Runtime.CompilerServices.IsReadOnlyAttribute extends System.Object + { + .method public hidebysig specialname rtspecialname instance void .ctor() cil managed + { + .maxstack 8 + ret + } + } + """; + + var source = """ + class C + { + static ref readonly int M1(int x) + { + return ref M2(x); + } + + static ref readonly int M2(in S s) => throw null; + } + """; + CreateCompilationWithIL(source, ilSource).VerifyDiagnostics( + // (5,20): error CS8347: Cannot use a result of 'C.M2(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // return ref M2(x); + Diagnostic(ErrorCode.ERR_EscapeCall, "M2(x)").WithArguments("C.M2(in S)", "s").WithLocation(5, 20), + // (5,23): error CS0570: 'S.implicit operator S(in int)' is not supported by the language + // return ref M2(x); + Diagnostic(ErrorCode.ERR_BindToBogus, "x").WithArguments("S.implicit operator S(in int)").WithLocation(5, 23), + // (5,23): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return ref M2(x); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(5, 23)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct() + { + var source = """ + class C + { + S M1() + { + S s; + s = 100 + default(S); // 1 + return s; + } + + S M2() + { + return 200 + default(S); // 2 + } + + S M3(in int x) + { + S s; + s = x + default(S); // 3 + return s; + } + + S M4(in int x) + { + return x + default(S); + } + + S M4s(scoped in int x) + { + return x + default(S); // 4 + } + + S M5(in int x) + { + S s = x + default(S); + return s; + } + + S M5s(scoped in int x) + { + S s = x + default(S); + return s; // 5 + } + + S M6() + { + S s = 300 + default(S); + return s; // 6 + } + + void M7(in int x) + { + scoped S s; + s = x + default(S); + s = 100 + default(S); + } + } + + ref struct S + { + public static S operator+(in int x, S y) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (6,13): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // s = 100 + default(S); // 1 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), + // (6,13): error CS8347: Cannot use a result of 'S.operator +(in int, S)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = 100 + default(S); // 1 + Diagnostic(ErrorCode.ERR_EscapeCall, "100 + default(S)").WithArguments("S.operator +(in int, S)", "x").WithLocation(6, 13), + // (12,16): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return 200 + default(S); // 2 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), + // (12,16): error CS8347: Cannot use a result of 'S.operator +(in int, S)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return 200 + default(S); // 2 + Diagnostic(ErrorCode.ERR_EscapeCall, "200 + default(S)").WithArguments("S.operator +(in int, S)", "x").WithLocation(12, 16), + // (18,13): error CS9077: Cannot return a parameter by reference 'x' through a ref parameter; it can only be returned in a return statement + // s = x + default(S); // 3 + Diagnostic(ErrorCode.ERR_RefReturnOnlyParameter, "x").WithArguments("x").WithLocation(18, 13), + // (18,13): error CS8347: Cannot use a result of 'S.operator +(in int, S)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // s = x + default(S); // 3 + Diagnostic(ErrorCode.ERR_EscapeCall, "x + default(S)").WithArguments("S.operator +(in int, S)", "x").WithLocation(18, 13), + // (29,16): error CS9075: Cannot return a parameter by reference 'x' because it is scoped to the current method + // return x + default(S); // 4 + Diagnostic(ErrorCode.ERR_RefReturnScopedParameter, "x").WithArguments("x").WithLocation(29, 16), + // (29,16): error CS8347: Cannot use a result of 'S.operator +(in int, S)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return x + default(S); // 4 + Diagnostic(ErrorCode.ERR_EscapeCall, "x + default(S)").WithArguments("S.operator +(in int, S)", "x").WithLocation(29, 16), + // (41,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 5 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(41, 16), + // (47,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 6 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(47, 16)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Scoped_Left() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static R operator +(scoped R x, R y) => default; + } + class Program + { + static R F() + { + return new R(1) + new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (11,16): error CS8347: Cannot use a result of 'R.operator +(scoped R, R)' in this context because it may expose variables referenced by parameter 'y' outside of their declaration scope + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) + new R(2)").WithArguments("R.operator +(scoped R, R)", "y").WithLocation(11, 16), + // (11,27): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(2)").WithArguments("R.R(in int)", "i").WithLocation(11, 27), + // (11,33): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(11, 33)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Scoped_Right() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static R operator +(R x, scoped R y) => default; + } + class Program + { + static R F() + { + return new R(1) + new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (11,16): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1)").WithArguments("R.R(in int)", "i").WithLocation(11, 16), + // (11,16): error CS8347: Cannot use a result of 'R.operator +(R, scoped R)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) + new R(2)").WithArguments("R.operator +(R, scoped R)", "x").WithLocation(11, 16), + // (11,22): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(11, 22)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Scoped_Both() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static R operator +(scoped R x, scoped R y) => default; + } + class Program + { + static R F() + { + return new R(1) + new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Scoped_None() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static R operator +(R x, R y) => default; + } + class Program + { + static R F() + { + return new R(1) + new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (11,16): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1)").WithArguments("R.R(in int)", "i").WithLocation(11, 16), + // (11,16): error CS8347: Cannot use a result of 'R.operator +(R, R)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) + new R(2)").WithArguments("R.operator +(R, R)", "x").WithLocation(11, 16), + // (11,22): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) + new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(11, 22)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound() + { + var source = """ + public ref struct C + { + public static C operator +(C left, C right) => right; + public static C X(C left, C right) => right; + public C M(C c, scoped C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c; + } + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (7,9): error CS8347: Cannot use a result of 'C.operator +(C, C)' in this context because it may expose variables referenced by parameter 'right' outside of their declaration scope + // c += c1; + Diagnostic(ErrorCode.ERR_EscapeCall, "c += c1").WithArguments("C.operator +(C, C)", "right").WithLocation(7, 9), + // (7,14): error CS8352: Cannot use variable 'scoped C c1' in this context because it may expose referenced variables outside of their declaration scope + // c += c1; + Diagnostic(ErrorCode.ERR_EscapeVariable, "c1").WithArguments("scoped C c1").WithLocation(7, 14), + // (8,13): error CS8347: Cannot use a result of 'C.operator +(C, C)' in this context because it may expose variables referenced by parameter 'right' outside of their declaration scope + // c = c + c1; + Diagnostic(ErrorCode.ERR_EscapeCall, "c + c1").WithArguments("C.operator +(C, C)", "right").WithLocation(8, 13), + // (8,17): error CS8352: Cannot use variable 'scoped C c1' in this context because it may expose referenced variables outside of their declaration scope + // c = c + c1; + Diagnostic(ErrorCode.ERR_EscapeVariable, "c1").WithArguments("scoped C c1").WithLocation(8, 17), + // (9,13): error CS8347: Cannot use a result of 'C.X(C, C)' in this context because it may expose variables referenced by parameter 'right' outside of their declaration scope + // c = X(c, c1); + Diagnostic(ErrorCode.ERR_EscapeCall, "X(c, c1)").WithArguments("C.X(C, C)", "right").WithLocation(9, 13), + // (9,18): error CS8352: Cannot use variable 'scoped C c1' in this context because it may expose referenced variables outside of their declaration scope + // c = X(c, c1); + Diagnostic(ErrorCode.ERR_EscapeVariable, "c1").WithArguments("scoped C c1").WithLocation(9, 18)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_Scoped_Left() + { + var source = """ + public ref struct C + { + public static C operator +(scoped C left, C right) => right; + public static C X(scoped C left, C right) => right; + public C M(C c, scoped C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c; + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (7,9): error CS8347: Cannot use a result of 'C.operator +(scoped C, C)' in this context because it may expose variables referenced by parameter 'right' outside of their declaration scope + // c += c1; + Diagnostic(ErrorCode.ERR_EscapeCall, "c += c1").WithArguments("C.operator +(scoped C, C)", "right").WithLocation(7, 9), + // (7,14): error CS8352: Cannot use variable 'scoped C c1' in this context because it may expose referenced variables outside of their declaration scope + // c += c1; + Diagnostic(ErrorCode.ERR_EscapeVariable, "c1").WithArguments("scoped C c1").WithLocation(7, 14), + // (8,13): error CS8347: Cannot use a result of 'C.operator +(scoped C, C)' in this context because it may expose variables referenced by parameter 'right' outside of their declaration scope + // c = c + c1; + Diagnostic(ErrorCode.ERR_EscapeCall, "c + c1").WithArguments("C.operator +(scoped C, C)", "right").WithLocation(8, 13), + // (8,17): error CS8352: Cannot use variable 'scoped C c1' in this context because it may expose referenced variables outside of their declaration scope + // c = c + c1; + Diagnostic(ErrorCode.ERR_EscapeVariable, "c1").WithArguments("scoped C c1").WithLocation(8, 17), + // (9,13): error CS8347: Cannot use a result of 'C.X(scoped C, C)' in this context because it may expose variables referenced by parameter 'right' outside of their declaration scope + // c = X(c, c1); + Diagnostic(ErrorCode.ERR_EscapeCall, "X(c, c1)").WithArguments("C.X(scoped C, C)", "right").WithLocation(9, 13), + // (9,18): error CS8352: Cannot use variable 'scoped C c1' in this context because it may expose referenced variables outside of their declaration scope + // c = X(c, c1); + Diagnostic(ErrorCode.ERR_EscapeVariable, "c1").WithArguments("scoped C c1").WithLocation(9, 18)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_Scoped_Right() + { + var source = """ + public ref struct C + { + public static C operator +(C left, scoped C right) => left; + public static C X(C left, scoped C right) => left; + public C M(C c, scoped C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c; + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_Scoped_Both() + { + var source = """ + public ref struct C + { + public static C operator +(scoped C left, scoped C right) => right; + public static C X(scoped C left, scoped C right) => right; + public C M(C c, scoped C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c; + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (3,66): error CS8352: Cannot use variable 'scoped C right' in this context because it may expose referenced variables outside of their declaration scope + // public static C operator +(scoped C left, scoped C right) => right; + Diagnostic(ErrorCode.ERR_EscapeVariable, "right").WithArguments("scoped C right").WithLocation(3, 66), + // (4,57): error CS8352: Cannot use variable 'scoped C right' in this context because it may expose referenced variables outside of their declaration scope + // public static C X(scoped C left, scoped C right) => right; + Diagnostic(ErrorCode.ERR_EscapeVariable, "right").WithArguments("scoped C right").WithLocation(4, 57)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_ScopedTarget() + { + var source = """ + public ref struct C + { + public static C operator +(C left, C right) => right; + public static C X(C left, C right) => right; + public C M(scoped C c, C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c1; + } + } + """; + CreateCompilation(source).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_Scoped_Left_ScopedTarget() + { + var source = """ + public ref struct C + { + public static C operator +(scoped C left, C right) => right; + public static C X(scoped C left, C right) => right; + public C M(scoped C c, C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c1; + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_Scoped_Right_ScopedTarget() + { + var source = """ + public ref struct C + { + public static C operator +(C left, scoped C right) => left; + public static C X(C left, scoped C right) => left; + public C M(scoped C c, C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c1; + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedBinaryOperator_RefStruct_Compound_Scoped_Both_ScopedTarget() + { + var source = """ + public ref struct C + { + public static C operator +(scoped C left, scoped C right) => throw null; + public static C X(scoped C left, scoped C right) => throw null; + public C M(scoped C c, C c1) + { + c += c1; + c = c + c1; + c = X(c, c1); + return c1; + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedUnaryOperator_RefStruct() + { + var source = """ + class C + { + S M1() + { + S s; + s = +s; // 1 + return s; + } + + S M2() + { + return +new S(); // 2 + } + + S M3(in S x) + { + S s; + s = +x; // 3 + return s; + } + + S M4(in S x) + { + return +x; + } + + S M4s(scoped in S x) + { + return +x; // 4 + } + + S M5(in S x) + { + S s = +x; + return s; + } + + S M5s(scoped in S x) + { + S s = +x; + return s; // 5 + } + + S M6() + { + S s = +new S(); + return s; // 6 + } + + void M7(in S x) + { + scoped S s; + s = +x; + s = +new S(); + } + } + + ref struct S + { + public static S operator+(in S s) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (6,13): error CS8347: Cannot use a result of 'S.operator +(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // s = +s; // 1 + Diagnostic(ErrorCode.ERR_EscapeCall, "+s").WithArguments("S.operator +(in S)", "s").WithLocation(6, 13), + // (6,14): error CS8168: Cannot return local 's' by reference because it is not a ref local + // s = +s; // 1 + Diagnostic(ErrorCode.ERR_RefReturnLocal, "s").WithArguments("s").WithLocation(6, 14), + // (12,16): error CS8347: Cannot use a result of 'S.operator +(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // return +new S(); // 2 + Diagnostic(ErrorCode.ERR_EscapeCall, "+new S()").WithArguments("S.operator +(in S)", "s").WithLocation(12, 16), + // (12,17): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return +new S(); // 2 + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new S()").WithLocation(12, 17), + // (18,13): error CS8347: Cannot use a result of 'S.operator +(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // s = +x; // 3 + Diagnostic(ErrorCode.ERR_EscapeCall, "+x").WithArguments("S.operator +(in S)", "s").WithLocation(18, 13), + // (18,14): error CS9077: Cannot return a parameter by reference 'x' through a ref parameter; it can only be returned in a return statement + // s = +x; // 3 + Diagnostic(ErrorCode.ERR_RefReturnOnlyParameter, "x").WithArguments("x").WithLocation(18, 14), + // (29,16): error CS8347: Cannot use a result of 'S.operator +(in S)' in this context because it may expose variables referenced by parameter 's' outside of their declaration scope + // return +x; // 4 + Diagnostic(ErrorCode.ERR_EscapeCall, "+x").WithArguments("S.operator +(in S)", "s").WithLocation(29, 16), + // (29,17): error CS9075: Cannot return a parameter by reference 'x' because it is scoped to the current method + // return +x; // 4 + Diagnostic(ErrorCode.ERR_RefReturnScopedParameter, "x").WithArguments("x").WithLocation(29, 17), + // (41,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 5 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(41, 16), + // (47,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 6 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(47, 16)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedUnaryOperator_RefStruct_Scoped() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static R operator !(scoped R r) => default; + } + class Program + { + static R F() + { + return !new R(0); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedLogicalOperator_RefStruct() + { + var source = """ + class C + { + S M1(S s1, S s2) + { + S s = s1 && s2; + return s; // 1 + } + + S M2(S s1, S s2) + { + return s1 && s2; // 2 + } + + S M3(in S s1, in S s2) + { + S s = s1 && s2; + return s; + } + + S M4(scoped in S s1, in S s2) + { + S s = s1 && s2; + return s; // 3 + } + + S M5(in S s1, scoped in S s2) + { + S s = s1 && s2; + return s; // 4 + } + } + + ref struct S + { + public static bool operator true(in S s) => throw null; + public static bool operator false(in S s) => throw null; + public static S operator &(in S x, in S y) => throw null; + public static S operator |(in S x, in S y) => throw null; + } + """; + CreateCompilation(source).VerifyDiagnostics( + // (6,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 1 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(6, 16), + // (11,16): error CS8166: Cannot return a parameter by reference 's1' because it is not a ref parameter + // return s1 && s2; // 2 + Diagnostic(ErrorCode.ERR_RefReturnParameter, "s1").WithArguments("s1").WithLocation(11, 16), + // (11,16): error CS8347: Cannot use a result of 'S.operator &(in S, in S)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return s1 && s2; // 2 + Diagnostic(ErrorCode.ERR_EscapeCall, "s1 && s2").WithArguments("S.operator &(in S, in S)", "x").WithLocation(11, 16), + // (23,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 3 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(23, 16), + // (29,16): error CS8352: Cannot use variable 's' in this context because it may expose referenced variables outside of their declaration scope + // return s; // 4 + Diagnostic(ErrorCode.ERR_EscapeVariable, "s").WithArguments("s").WithLocation(29, 16)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedLogicalOperator_RefStruct_Scoped_Left() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static bool operator true(R r) => true; + public static bool operator false(R r) => false; + public static R operator |(scoped R x, R y) => default; + } + class Program + { + static R F() + { + return new R(1) || new R(2); + } + + static R F2() + { + return new R(1) | new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (13,16): error CS8347: Cannot use a result of 'R.operator |(scoped R, R)' in this context because it may expose variables referenced by parameter 'y' outside of their declaration scope + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) || new R(2)").WithArguments("R.operator |(scoped R, R)", "y").WithLocation(13, 16), + // (13,28): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(2)").WithArguments("R.R(in int)", "i").WithLocation(13, 28), + // (13,34): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(13, 34), + // (18,16): error CS8347: Cannot use a result of 'R.operator |(scoped R, R)' in this context because it may expose variables referenced by parameter 'y' outside of their declaration scope + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) | new R(2)").WithArguments("R.operator |(scoped R, R)", "y").WithLocation(18, 16), + // (18,27): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(2)").WithArguments("R.R(in int)", "i").WithLocation(18, 27), + // (18,33): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(18, 33)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedLogicalOperator_RefStruct_Scoped_Right() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static bool operator true(R r) => true; + public static bool operator false(R r) => false; + public static R operator |(R x, scoped R y) => default; + } + class Program + { + static R F() + { + return new R(1) || new R(2); + } + + static R F2() + { + return new R(1) | new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (13,16): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1)").WithArguments("R.R(in int)", "i").WithLocation(13, 16), + // (13,16): error CS8347: Cannot use a result of 'R.operator |(R, scoped R)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) || new R(2)").WithArguments("R.operator |(R, scoped R)", "x").WithLocation(13, 16), + // (13,22): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(13, 22), + // (18,16): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1)").WithArguments("R.R(in int)", "i").WithLocation(18, 16), + // (18,16): error CS8347: Cannot use a result of 'R.operator |(R, scoped R)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) | new R(2)").WithArguments("R.operator |(R, scoped R)", "x").WithLocation(18, 16), + // (18,22): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(18, 22)); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedLogicalOperator_RefStruct_Scoped_Both() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static bool operator true(R r) => true; + public static bool operator false(R r) => false; + public static R operator |(scoped R x, scoped R y) => default; + } + class Program + { + static R F() + { + return new R(1) || new R(2); + } + + static R F2() + { + return new R(1) | new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics(); + } + + [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71773")] + public void UserDefinedLogicalOperator_RefStruct_Scoped_None() + { + var source = """ + ref struct R + { + private ref readonly int _i; + public R(in int i) { _i = ref i; } + public static bool operator true(R r) => true; + public static bool operator false(R r) => false; + public static R operator |(R x, R y) => default; + } + class Program + { + static R F() + { + return new R(1) || new R(2); + } + + static R F2() + { + return new R(1) | new R(2); + } + } + """; + CreateCompilation(source, targetFramework: TargetFramework.Net70).VerifyDiagnostics( + // (13,16): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1)").WithArguments("R.R(in int)", "i").WithLocation(13, 16), + // (13,16): error CS8347: Cannot use a result of 'R.operator |(R, R)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) || new R(2)").WithArguments("R.operator |(R, R)", "x").WithLocation(13, 16), + // (13,22): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) || new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(13, 22), + // (18,16): error CS8347: Cannot use a result of 'R.R(in int)' in this context because it may expose variables referenced by parameter 'i' outside of their declaration scope + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1)").WithArguments("R.R(in int)", "i").WithLocation(18, 16), + // (18,16): error CS8347: Cannot use a result of 'R.operator |(R, R)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_EscapeCall, "new R(1) | new R(2)").WithArguments("R.operator |(R, R)", "x").WithLocation(18, 16), + // (18,22): error CS8156: An expression cannot be used in this context because it may not be passed or returned by reference + // return new R(1) | new R(2); + Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(18, 22)); + } } } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/StructConstructorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/StructConstructorTests.cs index 6987f658c4acb..aef38ff610f8a 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/StructConstructorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/StructConstructorTests.cs @@ -3721,9 +3721,15 @@ public Example() {} // (5,38): error CS8353: A result of a stackalloc expression of type 'Span' cannot be used in this context because it may be exposed outside of the containing method // public ReadOnlySpan Field = stackalloc int[512]; Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 38), + // (5,38): error CS8347: Cannot use a result of 'Span.implicit operator ReadOnlySpan(Span)' in this context because it may expose variables referenced by parameter 'span' outside of their declaration scope + // public ReadOnlySpan Field = stackalloc int[512]; + Diagnostic(ErrorCode.ERR_EscapeCall, "stackalloc int[512]").WithArguments("System.Span.implicit operator System.ReadOnlySpan(System.Span)", "span").WithLocation(5, 38), // (6,50): error CS8353: A result of a stackalloc expression of type 'Span' cannot be used in this context because it may be exposed outside of the containing method // public ReadOnlySpan Property { get; } = stackalloc int[512]; - Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(6, 50)); + Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(6, 50), + // (6,50): error CS8347: Cannot use a result of 'Span.implicit operator ReadOnlySpan(Span)' in this context because it may expose variables referenced by parameter 'span' outside of their declaration scope + // public ReadOnlySpan Property { get; } = stackalloc int[512]; + Diagnostic(ErrorCode.ERR_EscapeCall, "stackalloc int[512]").WithArguments("System.Span.implicit operator System.ReadOnlySpan(System.Span)", "span").WithLocation(6, 50)); } [WorkItem(60568, "https://github.com/dotnet/roslyn/issues/60568")] @@ -3802,7 +3808,10 @@ public Example() {} Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "ReadOnlySpan").WithArguments("System.ReadOnlySpan").WithLocation(5, 12), // (5,50): error CS8353: A result of a stackalloc expression of type 'Span' cannot be used in this context because it may be exposed outside of the containing method // public ReadOnlySpan Property { get; } = stackalloc int[512]; - Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50)); + Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50), + // (5,50): error CS8347: Cannot use a result of 'Span.implicit operator ReadOnlySpan(Span)' in this context because it may expose variables referenced by parameter 'span' outside of their declaration scope + // public ReadOnlySpan Property { get; } = stackalloc int[512]; + Diagnostic(ErrorCode.ERR_EscapeCall, "stackalloc int[512]").WithArguments("System.Span.implicit operator System.ReadOnlySpan(System.Span)", "span").WithLocation(5, 50)); } [WorkItem(60568, "https://github.com/dotnet/roslyn/issues/60568")] @@ -3829,7 +3838,10 @@ record struct Example() Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "ReadOnlySpan").WithArguments("System.ReadOnlySpan").WithLocation(5, 12), // (5,50): error CS8353: A result of a stackalloc expression of type 'Span' cannot be used in this context because it may be exposed outside of the containing method // public ReadOnlySpan Property { get; } = stackalloc int[512]; - Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50)); + Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50), + // (5,50): error CS8347: Cannot use a result of 'Span.implicit operator ReadOnlySpan(Span)' in this context because it may expose variables referenced by parameter 'span' outside of their declaration scope + // public ReadOnlySpan Property { get; } = stackalloc int[512]; + Diagnostic(ErrorCode.ERR_EscapeCall, "stackalloc int[512]").WithArguments("System.Span.implicit operator System.ReadOnlySpan(System.Span)", "span").WithLocation(5, 50)); } [WorkItem(60568, "https://github.com/dotnet/roslyn/issues/60568")] @@ -3856,7 +3868,10 @@ class Example Diagnostic(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, "ReadOnlySpan").WithArguments("System.ReadOnlySpan").WithLocation(5, 12), // (5,50): error CS8353: A result of a stackalloc expression of type 'Span' cannot be used in this context because it may be exposed outside of the containing method // public ReadOnlySpan Property { get; } = stackalloc int[512]; - Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50)); + Diagnostic(ErrorCode.ERR_EscapeStackAlloc, "stackalloc int[512]").WithArguments("System.Span").WithLocation(5, 50), + // (5,50): error CS8347: Cannot use a result of 'Span.implicit operator ReadOnlySpan(Span)' in this context because it may expose variables referenced by parameter 'span' outside of their declaration scope + // public ReadOnlySpan Property { get; } = stackalloc int[512]; + Diagnostic(ErrorCode.ERR_EscapeCall, "stackalloc int[512]").WithArguments("System.Span.implicit operator System.ReadOnlySpan(System.Span)", "span").WithLocation(5, 50)); } [ConditionalFact(typeof(CoreClrOnly))] // For conversion from Span to ReadOnlySpan. From 58976e13c21c3167ad33bbcd95467b63ff6e23e4 Mon Sep 17 00:00:00 2001 From: AlekseyTs Date: Mon, 25 Mar 2024 09:34:02 -0700 Subject: [PATCH 93/94] Do not call `IsBetterCollectionExpressionConversion` for identical collection types. (#72706) Fixes #72696. --- .../OverloadResolution/OverloadResolution.cs | 16 ++++--- .../Emit2/Semantics/ParamsCollectionTests.cs | 46 +++++++++++++++++++ 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs index d5b9a3efeb4ae..4253977f7544a 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs @@ -2332,13 +2332,16 @@ private BetterResult BetterFunctionMember( TypeSymbol t1 = m1LeastOverriddenParameters[^1].Type; TypeSymbol t2 = m2LeastOverriddenParameters[^1].Type; - if (IsBetterParamsCollectionType(t1, t2, ref useSiteInfo)) + if (!Conversions.HasIdentityConversion(t1, t2)) { - return BetterResult.Left; - } - if (IsBetterParamsCollectionType(t2, t1, ref useSiteInfo)) - { - return BetterResult.Right; + if (IsBetterParamsCollectionType(t1, t2, ref useSiteInfo)) + { + return BetterResult.Left; + } + if (IsBetterParamsCollectionType(t2, t1, ref useSiteInfo)) + { + return BetterResult.Right; + } } } } @@ -2778,6 +2781,7 @@ private bool IsBetterCollectionExpressionConversion( TypeSymbol t2, CollectionExpressionTypeKind kind2, TypeSymbol elementType2, ref CompoundUseSiteInfo useSiteInfo) { + Debug.Assert(!Conversions.HasIdentityConversion(t1, t2)); // - T1 is System.ReadOnlySpan, and T2 is System.Span, and an implicit conversion exists from E1 to E2 if (kind1 is CollectionExpressionTypeKind.ReadOnlySpan && diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs index 36a07cc8f3bd8..d49e01cfcdde5 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs @@ -5723,6 +5723,52 @@ static void Test(int y, params long[] x) ); } + [Fact] + [WorkItem("https://github.com/dotnet/roslyn/issues/72696")] + public void BetterOverload_04_Ambiguity() + { + var src = """ +using System.Collections; +using System.Collections.Generic; + +class MyCollection : IEnumerable +{ + IEnumerator IEnumerable.GetEnumerator() => throw null; + IEnumerator IEnumerable.GetEnumerator() => throw null; +} + +static class ExtensionsA +{ + public static void Add(this MyCollection collection, params string[] args) { } +} + +static class ExtensionsB +{ + public static void Add(this MyCollection collection, params string[] args) { } +} + +class Program +{ + static void Main() + { + var x = new MyCollection(); + x.Add(""); + + var y = new MyCollection { "" }; + } +} +"""; + var comp = CreateCompilation(src, targetFramework: TargetFramework.Net80, options: TestOptions.ReleaseExe); + comp.VerifyDiagnostics( + // (25,11): error CS0121: The call is ambiguous between the following methods or properties: 'ExtensionsA.Add(MyCollection, params string[])' and 'ExtensionsB.Add(MyCollection, params string[])' + // x.Add(""); + Diagnostic(ErrorCode.ERR_AmbigCall, "Add").WithArguments("ExtensionsA.Add(MyCollection, params string[])", "ExtensionsB.Add(MyCollection, params string[])").WithLocation(25, 11), + // (27,44): error CS0121: The call is ambiguous between the following methods or properties: 'ExtensionsA.Add(MyCollection, params string[])' and 'ExtensionsB.Add(MyCollection, params string[])' + // var y = new MyCollection { "" }; + Diagnostic(ErrorCode.ERR_AmbigCall, @"""""").WithArguments("ExtensionsA.Add(MyCollection, params string[])", "ExtensionsB.Add(MyCollection, params string[])").WithLocation(27, 44) + ); + } + [Fact] public void GenericInference() { From 5528cb37979e65eaec1725afecd9351c18e6a6fa Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 25 Mar 2024 09:35:54 -0700 Subject: [PATCH 94/94] generate package for clasp binary to ensure symbols exist (#72686) --- eng/config/PublishData.json | 3 ++- ....CommonLanguageServerProtocol.Framework.Binary.csproj | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index b92b2e1dd3e92..d41ae64c4f360 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -87,7 +87,8 @@ "Microsoft.CodeAnalysis.Remote.Workspaces": "vs-impl", "Microsoft.VisualStudio.LanguageServices.LiveShare": "vs-impl", "Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient": "vs-impl", - "Microsoft.CommonLanguageServerProtocol.Framework": "vs-impl" + "Microsoft.CommonLanguageServerProtocol.Framework": "vs-impl", + "Microsoft.CommonLanguageServerProtocol.Framework.Binary": "vs-impl" } }, "comment-about-servicing-branches": "For a list of VS versions under servicing, see https://docs.microsoft.com/en-us/visualstudio/releases/2019/servicing#support-options-for-enterprise-and-professional-customers", diff --git a/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework.Binary/Microsoft.CommonLanguageServerProtocol.Framework.Binary.csproj b/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework.Binary/Microsoft.CommonLanguageServerProtocol.Framework.Binary.csproj index 482f6dfbdeba7..b82d6a2a340bd 100644 --- a/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework.Binary/Microsoft.CommonLanguageServerProtocol.Framework.Binary.csproj +++ b/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework.Binary/Microsoft.CommonLanguageServerProtocol.Framework.Binary.csproj @@ -12,8 +12,13 @@ netstandard2.0 Microsoft.CommonLanguageServerProtocol.Framework - - false + + true + Microsoft.CommonLanguageServerProtocol.Framework.Binary + + A legacy binary implementation of Microsoft.CommonLanguageServerProtocol.Framework. + + BINARY_COMPAT