Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main to main-vs-deps #57605

Merged
merged 85 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
fad93f9
Fix spacing when generating editorconfig options from UI
Youssef1313 Jul 4, 2021
b077566
Minor refactoring in SettingsUpdateHelper
Youssef1313 Jul 26, 2021
fa32397
WIP: First successful fix of CS1591
MaStr11 Oct 7, 2021
1a06526
WIP:Change to new test harness
MaStr11 Oct 7, 2021
fcc996a
WIP: Use new test suite. Make test pass.
MaStr11 Oct 8, 2021
31c20d8
Support CodeActionValidationMode.Full, take newLine from options and …
MaStr11 Oct 8, 2021
4bfc52f
Fix test method name.
MaStr11 Oct 8, 2021
26db397
Only offer on overriden member or implicit or explicit interface impl…
MaStr11 Oct 8, 2021
5fa5fce
Fix explicit interface implementation in C#.
MaStr11 Oct 8, 2021
46ec060
Add tests for properties and existing trivia
MaStr11 Oct 8, 2021
b54ecff
Add trivia test and test with attribute on method.
MaStr11 Oct 8, 2021
5650259
Add FixxAll test.
MaStr11 Oct 8, 2021
a4673e1
Add "Add_Inheritdoc_documentation_comment" to Feature resources.
MaStr11 Oct 8, 2021
ba8f2f0
Apply Add_inheritdoc_documentation_comment to CodeAction.Title.
MaStr11 Oct 8, 2021
7f2d659
Remove _1 from test method
MaStr11 Oct 8, 2021
005cc31
Add space between /// and <inheritdoc/>
MaStr11 Oct 8, 2021
cac1947
Fix code comment to match the newly created code comment.
MaStr11 Oct 8, 2021
e968aec
Rename AddInheritdocCodeFixProvider.cs
MaStr11 Oct 9, 2021
cb71346
Rename AddInheritdocTests.cs
MaStr11 Oct 9, 2021
6991e1b
Rename InheritDoc to Inheritdoc in classes, variables, test names, tr…
MaStr11 Oct 9, 2021
d8d5f2b
Simplify TestMissingAsync
MaStr11 Oct 9, 2021
2dd7e98
Move Trait to test class
MaStr11 Oct 9, 2021
930e3af
Fix spelling
MaStr11 Oct 9, 2021
0983c5e
Replace calls to TestFixAllAsync with isomorphic TestAsync
MaStr11 Oct 9, 2021
85b1b67
Make RegisterCodeFixesAsync to iterate over the diagnostics instead o…
MaStr11 Oct 9, 2021
fb756f5
Change Codefix title
MaStr11 Oct 9, 2021
b9466b4
Rename codefix title
MaStr11 Oct 9, 2021
1ef7373
Refactor: Replace Where() with imperative equivalent in hot path.
MaStr11 Oct 11, 2021
b4ab946
Use RequiredSemanticModel and spelling fix
MaStr11 Oct 13, 2021
2f10260
Small changes from code review
MaStr11 Oct 13, 2021
74989ca
Add support for event fields implementing an interface.
MaStr11 Oct 13, 2021
2d21217
Remove #nullable disable in test file.
MaStr11 Oct 13, 2021
b61c7ac
Use SyntaxFactory.TriviaList
MaStr11 Oct 13, 2021
d2d2572
Use GetLeadingWhitespaceOfLineAtPosition to get indentation,
MaStr11 Oct 13, 2021
726cb7e
Use SyntaxFactory.TriviaList
MaStr11 Oct 13, 2021
d83f851
Add the benchmark to test the glyph
Cosifne Oct 26, 2021
9547a6c
Add benchmark to test InheritanceMarginItem generation
Cosifne Oct 28, 2021
0e11d0a
Clean some unnecessary IVTs
Cosifne Oct 28, 2021
e22c0dc
Switch to a smaller size solution
Cosifne Oct 28, 2021
e046cbb
Handle individual paths
CyrusNajmabadi Nov 3, 2021
e3e9bea
Extract code into helper types
CyrusNajmabadi Nov 3, 2021
5197dc9
Merge remote-tracking branch 'upstream/main' into removeEnum2
CyrusNajmabadi Nov 3, 2021
83121ec
Update src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearch…
CyrusNajmabadi Nov 3, 2021
22b9c0b
Simplify
CyrusNajmabadi Nov 3, 2021
9b11b72
Merge branch 'removeEnum2' of https://github.com/CyrusNajmabadi/rosly…
CyrusNajmabadi Nov 3, 2021
a1847b6
Inline
CyrusNajmabadi Nov 3, 2021
975084a
Complete the progress
CyrusNajmabadi Nov 3, 2021
3c1b68a
Cancel property
CyrusNajmabadi Nov 3, 2021
e4334c1
Update the progress API shape to make it easier to mark a set of work…
CyrusNajmabadi Nov 3, 2021
101849e
Merge branch 'progressApi' into removeEnum2
CyrusNajmabadi Nov 3, 2021
51dc674
Simplify
CyrusNajmabadi Nov 3, 2021
a502c07
Processing order
CyrusNajmabadi Nov 3, 2021
09d214c
Add measure
Cosifne Nov 4, 2021
d58346e
Add comment
Cosifne Nov 4, 2021
77dbfa3
Merge remote-tracking branch 'upstream/main' into progressApi
CyrusNajmabadi Nov 4, 2021
ee5f748
Merge branch 'progressApi' into removeEnum2
CyrusNajmabadi Nov 4, 2021
bbf6f4c
Verify Smart Break Line behavior with tabs
sharwell Nov 3, 2021
b5686a8
Use DocumentOptionSet instead of IEditorOptions for new line settings
sharwell Nov 4, 2021
3e2c459
Fix flaky issue in the SourceGeneratorItemTests
jasonmalinowski Nov 5, 2021
d3d009d
StackFrame Parser/Lexer as EmbeddedLanguage (#56957)
ryzngard Nov 5, 2021
85522f1
Merge pull request #57538 from CyrusNajmabadi/removeEnum2
CyrusNajmabadi Nov 5, 2021
6ab724e
Merge pull request #57579 from sharwell/break-line
sharwell Nov 5, 2021
77b8c0e
Merge remote-tracking branch 'upstream/main' into dev/shech/Inheritan…
Cosifne Nov 5, 2021
d4fd404
Merge pull request #57004 from MaStr11/CodefixCS1591
sharwell Nov 5, 2021
44f0576
Revert to VS2019 for official build
JoeRobich Nov 5, 2021
4dcbb7c
Merge pull request #57593 from jasonmalinowski/fix-flaky-tests
jasonmalinowski Nov 5, 2021
97993be
Clean up VsCodeWindowManager (#57582)
tmat Nov 5, 2021
d1b9b73
Validate the checksum of source on disk (#57541)
davidwengier Nov 5, 2021
9a4ccdd
Revert to VS2019 for PR Validation
JoeRobich Nov 5, 2021
732a2ab
Merge pull request #57445 from Cosifne/dev/shech/InheritanceMarginBen…
Cosifne Nov 5, 2021
efb6343
Install .NET SDK in PR Validation pipeline
JoeRobich Nov 5, 2021
ae9dea8
WIP
CyrusNajmabadi Nov 5, 2021
67594ae
Simplify
CyrusNajmabadi Nov 5, 2021
df61bc6
Add test
CyrusNajmabadi Nov 5, 2021
aac6702
Update src/Features/VisualBasic/Portable/NavigationBar/VisualBasicNav…
CyrusNajmabadi Nov 5, 2021
2cc3af0
Revert
CyrusNajmabadi Nov 5, 2021
bc3d977
Less linq
CyrusNajmabadi Nov 5, 2021
9828d63
Don't crash Use ExpressionBody on local functions in top level statem…
davidwengier Nov 5, 2021
1096066
Merge remote-tracking branch 'upstream/main' into vbEvents
CyrusNajmabadi Nov 5, 2021
929e309
PR feedback
CyrusNajmabadi Nov 6, 2021
fde963d
Simplify
CyrusNajmabadi Nov 6, 2021
441b10f
Merge pull request #57606 from CyrusNajmabadi/vbEvents
CyrusNajmabadi Nov 6, 2021
a7324b0
Merge pull request #55123 from Youssef1313/patch-9
jmarolf Nov 7, 2021
ae8beb0
Merge pull request #54601 from Youssef1313/editorconfig-format
jmarolf Nov 7, 2021
769c623
Merge remote-tracking branch 'origin/main-vs-deps' into merges/main-t…
JoeRobich Nov 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ stages:
timeoutInMinutes: 360
pool:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre
demands: ImageOverride -equals Build.Server.Amd64.VS2019

steps:
- powershell: Write-Host "##vso[task.setvariable variable=SourceBranchName]$('$(Build.SourceBranch)'.Substring('refs/heads/'.Length))"
Expand Down
10 changes: 9 additions & 1 deletion azure-pipelines-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ stages:
timeoutInMinutes: 360
# Conditionally set build pool so we can share this YAML when building with different pipeline
pool:
name: VSEngSS-MicroBuild2022-1ES
name: VSEngSS-MicroBuild2019-1ES
demands:
- msbuild
- visualstudio
Expand Down Expand Up @@ -89,6 +89,14 @@ stages:
inputs:
nuGetServiceConnections: azure-public/vs-impl, azure-public/vssdk

# Needed because the build fails the NuGet Tools restore without it
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'

# Needed to restore the Microsoft.DevDiv.Optimization.Data.PowerShell package
- task: NuGetCommand@2
displayName: Restore internal tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal static class PredefinedCodeFixProviderNames
public const string AddBraces = nameof(AddBraces);
public const string AddDocCommentNodes = nameof(AddDocCommentNodes);
public const string AddExplicitCast = nameof(AddExplicitCast);
public const string AddInheritdoc = nameof(AddInheritdoc);
public const string AddImport = nameof(AddImport);
public const string AddMissingReference = nameof(AddMissingReference);
public const string AddNew = nameof(AddNew);
Expand Down
1 change: 1 addition & 0 deletions src/Compilers/Test/Core/Traits/Traits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static class Features
public const string CodeActionsAddDebuggerDisplay = "CodeActions.AddDebuggerDisplay";
public const string CodeActionsAddDocCommentNodes = "CodeActions.AddDocCommentParamNodes";
public const string CodeActionsAddExplicitCast = "CodeActions.AddExplicitCast";
public const string CodeActionsAddInheritdoc = "CodeActions.AddInheritdoc";
public const string CodeActionsAddFileBanner = "CodeActions.AddFileBanner";
public const string CodeActionsAddImport = "CodeActions.AddImport";
public const string CodeActionsAddMissingReference = "CodeActions.AddMissingReference";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Editor.OptionsExtensionMethods;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;
Expand Down Expand Up @@ -329,6 +328,7 @@ protected override void ModifySelectedNode(
CancellationToken cancellationToken)
{
var root = document.GetRequiredSyntaxRootSynchronously(cancellationToken);
var documentOptions = document.GetOptionsAsync(cancellationToken).WaitAndGetResult(cancellationToken);
// Add braces for the selected node
if (addBrace)
{
Expand All @@ -350,7 +350,7 @@ or IfStatementSyntax
or ElseClauseSyntax)
{
// Add the braces and get the next caretPosition
var (newRoot, nextCaretPosition) = AddBraceToSelectedNode(document, root, selectedNode, args.TextView.Options, cancellationToken);
var (newRoot, nextCaretPosition) = AddBraceToSelectedNode(document, root, selectedNode, documentOptions, cancellationToken);
if (document.Project.Solution.Workspace.TryApplyChanges(document.WithSyntaxRoot(newRoot).Project.Solution))
{
args.TextView.TryMoveCaretToAndEnsureVisible(new SnapshotPoint(args.SubjectBuffer.CurrentSnapshot, nextCaretPosition));
Expand All @@ -375,7 +375,7 @@ or IfStatementSyntax
var insertionPosition = GetBraceInsertionPosition(selectedNode);

// 2. Insert the braces and move caret
InsertBraceAndMoveCaret(args.TextView, document, insertionPosition, cancellationToken);
InsertBraceAndMoveCaret(args.TextView, document, documentOptions, insertionPosition, cancellationToken);
}
}
else
Expand All @@ -385,7 +385,7 @@ or IfStatementSyntax
document,
root,
selectedNode,
args.TextView.Options,
documentOptions,
cancellationToken);

if (document.Project.Solution.Workspace.TryApplyChanges(document.WithSyntaxRoot(newRoot).Project.Solution))
Expand All @@ -399,7 +399,7 @@ private static (SyntaxNode newRoot, int nextCaretPosition) AddBraceToSelectedNod
Document document,
SyntaxNode root,
SyntaxNode selectedNode,
IEditorOptions editorOptions,
DocumentOptionSet documentOptions,
CancellationToken cancellationToken)
{
// For these nodes, directly modify the node and replace it.
Expand All @@ -414,7 +414,7 @@ or EventFieldDeclarationSyntax
document,
root,
selectedNode,
WithBraces(selectedNode, editorOptions),
WithBraces(selectedNode, documentOptions),
cancellationToken);
// Locate the open brace token, and move the caret after it.
var nextCaretPosition = GetOpenBraceSpanEnd(newRoot);
Expand All @@ -428,7 +428,7 @@ or EventFieldDeclarationSyntax
// var c = new Obje$$ct() => var c = new Object();
if (selectedNode is ObjectCreationExpressionSyntax objectCreationExpressionNode)
{
var (newNode, oldNode) = ModifyObjectCreationExpressionNode(objectCreationExpressionNode, addOrRemoveInitializer: true, editorOptions);
var (newNode, oldNode) = ModifyObjectCreationExpressionNode(objectCreationExpressionNode, addOrRemoveInitializer: true, documentOptions);
var newRoot = ReplaceNodeAndFormat(
document,
root,
Expand Down Expand Up @@ -480,7 +480,7 @@ or EventFieldDeclarationSyntax
// In this case 'Print("Bar")' is considered as the innerStatement so when we inserted the empty block, we need also insert that
if (selectedNode.IsEmbeddedStatementOwner())
{
return AddBraceToEmbeddedStatementOwner(document, root, selectedNode, editorOptions, cancellationToken);
return AddBraceToEmbeddedStatementOwner(document, root, selectedNode, documentOptions, cancellationToken);
}

throw ExceptionUtilities.UnexpectedValue(selectedNode);
Expand All @@ -490,7 +490,7 @@ private static (SyntaxNode newRoot, int nextCaretPosition) RemoveBraceFromSelect
Document document,
SyntaxNode root,
SyntaxNode selectedNode,
IEditorOptions editorOptions,
DocumentOptionSet documentOptions,
CancellationToken cancellationToken)
{
// Remove the initializer from ObjectCreationExpression
Expand All @@ -504,7 +504,7 @@ private static (SyntaxNode newRoot, int nextCaretPosition) RemoveBraceFromSelect
// e.g. var c = new Bar() => var c = new Bar();
if (selectedNode is ObjectCreationExpressionSyntax objectCreationExpressionNode)
{
var (newNode, oldNode) = ModifyObjectCreationExpressionNode(objectCreationExpressionNode, addOrRemoveInitializer: false, editorOptions);
var (newNode, oldNode) = ModifyObjectCreationExpressionNode(objectCreationExpressionNode, addOrRemoveInitializer: false, documentOptions);
var newRoot = ReplaceNodeAndFormat(
document,
root,
Expand Down Expand Up @@ -633,18 +633,19 @@ private static bool IsTokenPartOfExpression(SyntaxToken syntaxToken)
return !syntaxToken.GetAncestors<ExpressionSyntax>().IsEmpty();
}

private static string GetBracePairString(IEditorOptions editorOptions)
private static string GetBracePairString(DocumentOptionSet documentOptions)
=> string.Concat(SyntaxFacts.GetText(SyntaxKind.OpenBraceToken),
editorOptions.GetNewLineCharacter(),
documentOptions.GetOption(FormattingOptions2.NewLine),
SyntaxFacts.GetText(SyntaxKind.CloseBraceToken));

private void InsertBraceAndMoveCaret(
ITextView textView,
Document document,
DocumentOptionSet documentOptions,
int insertionPosition,
CancellationToken cancellationToken)
{
var bracePair = GetBracePairString(textView.Options);
var bracePair = GetBracePairString(documentOptions);

// 1. Insert { }.
var newDocument = document.InsertText(insertionPosition, bracePair, cancellationToken);
Expand Down
Loading