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

Add an option to the C# code editor to simulate case insensitivity #57845

Open
vsfeedback opened this issue Nov 18, 2021 · 3 comments
Open

Add an option to the C# code editor to simulate case insensitivity #57845

vsfeedback opened this issue Nov 18, 2021 · 3 comments
Assignees
Labels
Area-IDE Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Need Design Review The end user experience design needs to be reviewed and approved.
Milestone

Comments

@vsfeedback
Copy link

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


I program in both C# and VB, and one of the frustrations I experience with editing C# code is related to its case sensitivity.

With VB, one of the code editor's excellent features is that once you've defined a variable, auto-complete will subsequently change the case of what you type to match the variable previously defined.

This means that many typos are automatically corrected. This gives a substantial productivity advantage over C#, as even slight typos where the only issue is capitalisation have to be manually corrected.

What makes this possible, of course, is that VB.net is intrinsically case insensitive.

Now, I've noticed in the C# editor, that a variable that is misspelled only in the sense that its case is wrong, will often have the correct case change available in the list of suggested fixes.

So it occurs to me that an option to automatically implement that suggested fix would give the same productivity advantage as enjoyed in the VB code editor.

If IntelliSense is clever enough (a) to work out when a case change would fix a particular precompile error, and (b) to offer such a case change in the list of suggested fixes, it must also therefore be possible in principle, to implement that fix automatically if such implementation was predicated on the selection of a suitable option.

I think making such an option available would make a big difference to C#'s usability, and speed of development, and therefore I'd like to request that it be added to Visual Studio's feature set.

It would be excellent as well, if the C# editor would do its auto formatting properly whenever the enter key was pressed (or indeed whenever you click to a different code line with the mouse). Although I have the option selected, it only ever seems to auto format the code when the ';' is pressed. Again, the VB code editor is far superior in this regard.


Original Comments

Feedback Bot on 10/29/2021, 00:30 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

John Henderson on 11/6/2021, 08:37 AM:

I fully agree. Having to type everything with the correct case is a waste of time when no sane person actually makes use of case sensitivity.

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

I don't try to write things with the right casing. I just write it as lowercase, and intellisense auto-matches against the right-cased item and corrects it for me :)

@JoeRobich
Copy link
Member

I think it is an interesting idea that semi-colon could be the trigger to auto-fix error diagnostics in the statement being completed. Either for a fixed set of diagnostics or those with a single code fix being available.

@jmarolf
Copy link
Contributor

jmarolf commented Nov 25, 2021

@JoeRobich yeah, I like this idea in conjunction with code-cleanup settings. I'll keep this in mind when I revisit code-cleanup in a month or so.

@jinujoseph jinujoseph added Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 1, 2021
@jinujoseph jinujoseph added this to the Backlog milestone Dec 1, 2021
@jinujoseph jinujoseph added Need Design Review The end user experience design needs to be reviewed and approved. and removed help wanted The issue is "up for grabs" - add a comment if you are interested in working on it labels Dec 1, 2021
@jinujoseph jinujoseph added this to In Queue in IDE: Design review via automation Dec 1, 2021
@jinujoseph jinujoseph moved this from In Queue to Need Proposal in IDE: Design review Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Need Design Review The end user experience design needs to be reviewed and approved.
Projects
Status: Need Proposal
IDE: Design review
  
Need Proposal
Development

No branches or pull requests

5 participants