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

Global reordering code inside classes #54215

Open
vsfeedback opened this issue Jun 18, 2021 · 1 comment
Open

Global reordering code inside classes #54215

vsfeedback opened this issue Jun 18, 2021 · 1 comment
Labels
Area-IDE Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Feature Request IDE-CodeStyle Built-in analyzers, fixes, and refactorings

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


It is a great idea to add reorder and group into regions members inside classes.

First by access level: private, private protected, protected, friend, public.
Second by kind: classes, enums, constants, events, declarations (I mean in abstract classes), variables, properties, functions.
Inside regions by alphabet by name and after by name of parameters types

Will be created regions from "private classes" to "public functions" and members distributed between these regions. If the coder have own regions, the feature will place them alphabetically with sorting inside.

This is a tiny manually sorted example in Visual Basic.

Public Class Counter

#Region "Private Variables"

Private bIsClosed As Boolean = False

Private nQuantity As Integer = 0

#End Region

#Region "Public Enums"

Public Enum CounterState
		Initazed
		Counting
		Closed
	End Enum

#End Region

#Region "Public Prperties"

Public ReadOnly Property Quantity As Integer
		Get
			Return nQuantity
		End Get
	End Property

Public ReadOnly Property State As CounterState
		Get
			If bIsClosed Then Return CounterState.Closed
			Return If(nQuantity = 0, CounterState.Initazed, CounterState.Counting)
		End Get
	End Property

#End Region

#Region "Public Functions"

Public Function Count() As Boolean
		If bIsClosed Then Return False
		nQuantity += 1
		Return True
	End Function

Public Sub Reset()
		bIsClosed = False
		nQuantity = 0
	End Sub

#End Region

End Class

Thanks for your consideration!


Original Comments

Feedback Bot on 6/6/2021, 11:00 PM:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 18, 2021
@jinujoseph
Copy link
Contributor

Related to #54097

@jinujoseph jinujoseph added Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 14, 2021
@jinujoseph jinujoseph added this to Backlog in IDE: InternalPriority via automation Jul 14, 2021
@jinujoseph jinujoseph moved this from Backlog to Priority 4 in IDE: InternalPriority Jul 14, 2021
@jinujoseph jinujoseph added the IDE-CodeStyle Built-in analyzers, fixes, and refactorings label Jul 14, 2021
@jmarolf jmarolf added the User Story A single user-facing feature. Can be grouped under an epic. label Dec 2, 2021
@jmarolf jmarolf removed the User Story A single user-facing feature. Can be grouped under an epic. label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Feature Request IDE-CodeStyle Built-in analyzers, fixes, and refactorings
Projects
Development

No branches or pull requests

3 participants