Skip to content

✨ Comment out highlighted code #38

Closed

Description

@jenslys

Description

⌘ / should allows users to toggle between commented and uncommented for the line the cursor is currently on when you press ⌘ /.

If a selection is made on a single line, a range comment should be used.

Comment placement styles…

/* Xcode - At leading end of leading whitespace */
func hi() {
    print("Hi")
//    print("Hi")
}

/* Android Studio - Inset at leading end of leading whitespace */
func hi() {
    print("Hi")
//  print("Hi")
}

/* VS Code - At trailing end of leading whitespace */
func hi() {
    print("Hi")
    // print("Hi")
}

/* Inset at trailing end of leading whitespace */
func hi() {
    print("Hi")
 // print("Hi")
}

We should allow for all three styles via a Setting:

Comment Placement:

  • At leading end of leading whitespace
  • Inset at leading end of leading whitespace
  • At trailing end of leading whitespace
  • Inset at trailing end of leading whitespace

Describe the solution you'd like

Ability to comment out code by highlighting some code and pressing: ⌘ /

Additional context

hightlight

Activity

  1. guga1109 commented on May 24, 2022

    @guga1109

    Hi, I would like to work on this issue as my first contribuition :)

  2. austincondiff commented on May 25, 2022

    @austincondiff
    Collaborator

    @lukepistrol does this depend on the new editor being in place or can this be worked on now? Different languages have different ways of commenting code, so will this depend on tree sitter, language grammars, or the LSP?

  3. lukepistrol commented on Jun 1, 2022

    @lukepistrol
    Member

    This should be implemented in CodeEditTextView directly.

  4. crpatil1901 commented on Jan 18, 2024

    @crpatil1901

    Can you assign this issue to me? I would like to start contributing to this project

  5. austincondiff commented on Jan 18, 2024

    @austincondiff
    Collaborator

    Done! Let me know if you have any questions.

  6. Sophiahooley commented on Mar 24, 2024

    @Sophiahooley
    Contributor

    How is this going @crpatil1901 @austincondiff? I would be interesting in working on this also if no solution has been found yet.

  7. austincondiff commented on Mar 24, 2024

    @austincondiff
    Collaborator

    @Sophiahooley I can assign it to you. This related PR is about to be merged just so you are aware.

  8. moved this from 📋 Todo to 🏃‍♂️ In Progress in CodeEdit Projecton Mar 24, 2024
  9. Sophiahooley commented on Apr 10, 2024

    @Sophiahooley
    Contributor

    Do you know if the PR is going to be merged soon? I am trying to see if I should start working now or if the related PR will completely change what I do.

  10. austincondiff commented on May 14, 2024

    @austincondiff
    Collaborator

    Can we close this or do we still need to update CESE version in CodeEdit?

  11. thecoolwinter commented on May 15, 2024

    @thecoolwinter
    Collaborator

    Still need to update, and this is 1/2 done. Still needs multi-line commenting implemented as well as detecting comment type in context.

  12. austincondiff commented on Feb 27, 2025

    @austincondiff
    Collaborator

    We have multiline commenting, though it clears your selection after commenting text out. Closing this issue and we will create a separate bug to track that.

  13. moved this from 🏃‍♂️ In Progress to 🏁 Complete in CodeEdit Projecton Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions