WhiskerBiscuit
WhiskerBiscuit

Reputation: 5157

Is there a tool to comment out a function quickly?

I'm doing a major refactoring on my project, and frankly my fingers are getting tired. I want to be able to comment out a function/sub quickly so that would change this:

    Public Function FooBar()
        dim x as integer
        dim y as integer
        dim z as integer
    End Function

to this:

    Public Function FooBar()
        throw new exception("refactoring required")
        'dim x as integer
        'dim y as integer
        'dim z as integer
    End Function

Is there some sort of tool that will allow me to click the function name then make the changes?

Upvotes: 0

Views: 60

Answers (1)

Jon Adams
Jon Adams

Reputation: 25137

There isn't one for a function/method specifically, but there is one for the highlighted selection.

  • Select the lines to comment
  • Press Ctrl+K, Ctrl+C to comment those lines
  • Press Ctrl+K, Ctrl+U to uncomment those lines

Upvotes: 2

Related Questions