Format document in X# 2.21

This forum is meant for questions and discussions about the X# language and tools
ecos
Posts: 134
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: Format document in X# 2.21

Post by ecos »

Hi,

I'm working with VS 2022 (german version). This option is not present. I can however add the command
"Kommentarzeile ein/aus Strg+#"
to a menu, but it stays disabled in x#-files. In c#-files you can indeed toggle comments with this option.

Is this something Robert must implement ?

Karl
User avatar
robert
Posts: 4886
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Format document in X# 2.21

Post by robert »

Karl,
Is this something Robert must implement ?
Yes, this is something we must implement.
We're looking at this

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ecos
Posts: 134
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: Format document in X# 2.21

Post by ecos »

Robert,

this would be great, no more broken fingers with Ctrl-K-C and Ctrl-K-U

Karl
ic2
Posts: 1956
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Format document in X# 2.21

Post by ic2 »

robert wrote: Mon Feb 10, 2025 1:38 pm Yes, this is something we must implement.
We're looking at this
That explains I never saw it. It isn't in the Advanced menu either in VS2019. I must have checked the options earlier - in an X# project.

The toggle comment is present in VS2019 in a C# project.

Dick
HansjoergP
Posts: 155
Joined: Mon Jul 25, 2016 3:58 pm
Location: Italy

Re: Format document in X# 2.21

Post by HansjoergP »

Toggling works also in VS2022 and X#. If nothing is marked it toggles the current line. If more lines are selected than it toggles this lines. If you select only a part inside of an line, than this part is commented out with /* */
The comment assigned is Edit.CommentSelection.
I think everything is working fine in the current version of VS 2022 and current X# Version
User avatar
robert
Posts: 4886
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Format document in X# 2.21

Post by robert »

HansJoerg
HansjoergP wrote: Wed Feb 12, 2025 6:47 am Toggling works also in VS2022 and X#. If nothing is marked it toggles the current line. If more lines are selected than it toggles this lines. If you select only a part inside of an line, than this part is commented out with /* */
The comment assigned is Edit.CommentSelection.
I think everything is working fine in the current version of VS 2022 and current X# Version
What they are referring to is the Edit.ToggleBlockComment and Edit.ToggleLineComment.
The last of these 2 is the equivalent of Ctrl+B in VO and in XIDE

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ecos
Posts: 134
Joined: Tue Nov 10, 2015 6:49 am
Location: Germany

Re: Format document in X# 2.21

Post by ecos »

Hi Robert,

just installed the new beta 2.23.0.1 and saw that Edit.ToggleLineComment is indeed working. Thanks for that.
However I didn't see it in the What's New. I think this feature has well deserved to be mentioned...

Karl
User avatar
Chris
Posts: 5468
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Format document in X# 2.21

Post by Chris »

Hi Karl,

Ah, right, we missed that when filling the what's new document, because there was no git ticket associated with this fix.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply