Interstitial (Mid-Line) Comments support #28165
gdvine
started this conversation in
Feature Ideas / Enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
In certain development and debugging scenarios, it's beneficial to insert comments within a line of code, known as interstitial or mid-line comments. This practice allows developers to temporarily disable specific segments of a line or provide context without commenting out the entire line. Currently, Zed supports full-line and block comments but lacks the capability to insert comments within a line.
Proposed Feature:
Toggle interstitial comment
, key binding (commonlycmd-opt-/
), etc.Use Cases:
Testing and Debugging: Quickly disable specific function parameters or arguments without removing them, facilitating efficient testing.
Code Clarity: Provide context or explanations for particular segments within a line, enhancing readability.
Example:
In JavaScript, a developer might want to temporarily disable an argument in a function call:
// Original line
processData(param1, param2, param3);
// With interstitial comment to disable param2
processData(param1, /* param2, */ param3);
Benefits:
Additional Context:
While interstitial comments are less common than full-line comments, they serve specific purposes in development workflows, particularly in testing and debugging phases. Implementing this feature would provide developers with more granular control over their code annotations.
Similar issues
Both of these reference block comments, which are not the same thing:
Beta Was this translation helpful? Give feedback.
All reactions