-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Comment out a new line when return is pressed while the caret is within a // comment #48217
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
Merged
Merged
Changes from 46 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
ef433f7
Comment out a new line when return is pressed while the caret is with…
06needhamt c602333
Remove Unused Variable
06needhamt a8502a6
Add Tests
06needhamt f1bb7ba
Fix Indentation Issue
06needhamt 1957373
Remove Abstract Comment Splitter and Add Abstract CommandHandler Defi…
06needhamt 80e0396
Add More Tests
06needhamt 8a1169e
Fix Broken Test
06needhamt 9a71a5a
[WIP] Visual Basic Comment Splitter Implementation
06needhamt b1f3c6f
[WIP] VB Comment Splitter GetNoteToReplace Incorrect
06needhamt a2c724e
Fix VB Comment Splitter
06needhamt 515c332
Implement VB Split Comment Test Worker
06needhamt 8981612
Add More Test Cases
06needhamt 604709e
Handle Line Continuation When Splitting Comments in VB
06needhamt 41d257f
Update src/EditorFeatures/Core/Implementation/SplitComment/AbstractSp…
06needhamt c6a856a
Update src/EditorFeatures/VisualBasic/SplitComment/SplitCommentComman…
06needhamt 304f5de
Merge branch 'master' into patch-38516
06needhamt 83bb3da
Fix Tests
06needhamt 79192ca
Address most of the review feedback
06needhamt ab9f2b7
All Tests Now Pass
06needhamt 65ab354
Merge Master
06needhamt f4abf65
Add Space after split comment if it was present on the original
06needhamt 8dfcd54
Address ArrowCase's Comments
06needhamt b056134
Update src/EditorFeatures/CSharp/SplitComment/SplitCommentCommandHand…
06needhamt b8277a5
Update src/EditorFeatures/CSharp/SplitComment/SplitCommentCommandHand…
06needhamt e05db8f
Update src/EditorFeatures/CSharp/SplitComment/SplitCommentCommandHand…
06needhamt 0db9999
Merge Master
06needhamt 451045d
Merge branch 'patch-38516' of https://github.com/06needhamt/roslyn in…
06needhamt 29bb7c8
Fix Build
06needhamt 3d7be65
Update Licences
06needhamt b2d427a
Merge branch 'patch-38516' of https://github.com/06needhamt/roslyn in…
06needhamt 1767d0a
Fix Tests
06needhamt 7ec767b
Merge remote-tracking branch 'upstream/master' into patch-38516
CyrusNajmabadi b235e3a
Spacing
CyrusNajmabadi 30d1607
Make readonly
CyrusNajmabadi 5f5d7b4
Merge remote-tracking branch 'upstream/master' into patch-38516
CyrusNajmabadi 99b6d37
Update loc string
CyrusNajmabadi 3843330
Rename types
CyrusNajmabadi 4be6cb6
Simplify implementation greatly
CyrusNajmabadi aa8a65d
Share test code
CyrusNajmabadi 2e7878c
Single command handler
CyrusNajmabadi d42d583
Update tests
CyrusNajmabadi c365008
Disable
CyrusNajmabadi c28fc12
Add UI
CyrusNajmabadi cb25ae8
Add tests
CyrusNajmabadi 9227b28
Cleanup
CyrusNajmabadi 4c5970f
Add comment
CyrusNajmabadi e91a3c7
Use normal async method
CyrusNajmabadi 7d85da3
Remove partial
CyrusNajmabadi fc04d01
Parameterize test
CyrusNajmabadi 47477f3
Revert
CyrusNajmabadi a22430e
Align code with UI
CyrusNajmabadi 48bae5a
Update src/EditorFeatures/VisualBasic/SplitComment/VisualBasicSplitCo…
CyrusNajmabadi 59b2a44
Handle cases like ////
CyrusNajmabadi 8735f6a
Add vb tests
CyrusNajmabadi 0b61756
Remove parameter
CyrusNajmabadi 271937e
use IsKind
CyrusNajmabadi 7a55545
Update buffer on UI thread
CyrusNajmabadi 4f8c243
Support feature when span is selected
CyrusNajmabadi ff77147
Add test
CyrusNajmabadi 2c05b36
Move code
CyrusNajmabadi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/EditorFeatures/CSharp/SplitComment/CSharpSplitCommentService.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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.Editor.Implementation.SplitComment; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.CSharp.SplitComment | ||
{ | ||
[ExportLanguageService(typeof(ISplitCommentService), LanguageNames.CSharp), Shared] | ||
internal partial class CSharpSplitCommentService : ISplitCommentService | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public CSharpSplitCommentService() | ||
{ | ||
} | ||
|
||
public string CommentStart => "//"; | ||
|
||
public bool IsAllowed(SyntaxNode root, SyntaxTrivia trivia) | ||
=> true; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1397,7 +1397,7 @@ public int I | |
}", options: Option(CodeStyleOptions2.QualifyFieldAccess, true, NotificationOption2.Error)); | ||
} | ||
|
||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), Test.Utilities.CompilerTrait(Test.Utilities.CompilerFeature.Tuples)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these were all simplified because i added a reference from teh C# tests to the common tests so i could share a base type. Adding that reference made 'Test' ambiguous here. Fortunately, easy resolution was to not fully qualify any of this. |
||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), CompilerTrait(CompilerFeature.Tuples)] | ||
public async Task TestTuple(TestHost host) | ||
{ | ||
var text = @" | ||
|
@@ -1439,7 +1439,7 @@ void M() | |
await TestAllOptionsOffAsync(host, text, expected, index: 1); | ||
} | ||
|
||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), Test.Utilities.CompilerTrait(Test.Utilities.CompilerFeature.Tuples)] | ||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), CompilerTrait(CompilerFeature.Tuples)] | ||
public async Task TupleWithNames(TestHost host) | ||
{ | ||
var text = @" | ||
|
@@ -1481,7 +1481,7 @@ void M() | |
await TestAllOptionsOffAsync(host, text, expected, index: 1); | ||
} | ||
|
||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), Test.Utilities.CompilerTrait(Test.Utilities.CompilerFeature.FunctionPointers)] | ||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), CompilerTrait(CompilerFeature.FunctionPointers)] | ||
public async Task FunctionPointer(TestHost host) | ||
{ | ||
var text = @" | ||
|
@@ -1523,7 +1523,7 @@ void M() | |
await TestAllOptionsOffAsync(host, text, expected, index: 1); | ||
} | ||
|
||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), Test.Utilities.CompilerTrait(Test.Utilities.CompilerFeature.FunctionPointers)] | ||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), CompilerTrait(CompilerFeature.FunctionPointers)] | ||
public async Task FunctionPointerWithPrivateTypeParameter(TestHost host) | ||
{ | ||
var text = @" | ||
|
@@ -1567,7 +1567,7 @@ void M() | |
await TestAllOptionsOffAsync(host, text, expected, index: 1); | ||
} | ||
|
||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), Test.Utilities.CompilerTrait(Test.Utilities.CompilerFeature.FunctionPointers)] | ||
[Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.EncapsulateField), CompilerTrait(CompilerFeature.FunctionPointers)] | ||
public async Task FunctionPointerWithPrivateTypeReturnValue(TestHost host) | ||
{ | ||
var text = @" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.