Skip to content

Switch default comment to # #6470

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

Closed
wants to merge 1 commit into from

Conversation

pickfire
Copy link
Contributor

Having # as comment is far more common in non-support files like random configuration files as compared to //, so it will be using the correct comment at a higher chance.

Having # as comment is far more common in non-support files like random
configuration files as compared to //, so it will be using the correct
comment at a higher chance.
@the-mikedavis
Copy link
Member

There is #3799

@pickfire
Copy link
Contributor Author

Thanks for linking me to that, I think that is good, but this does a different thing, it sets the default comment character to # instead of //, it does not change the key.

@the-mikedavis
Copy link
Member

Ah whoops, I hadn't looked at the changes 😅

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. R-breaking-change This PR is a breaking change for some behavior labels Mar 28, 2023
@firstrow
Copy link

dependes. I'm perfectly fine with // for c .

@pickfire
Copy link
Contributor Author

We have no issues with c and c++ and rust or the likes with // because there are language servers and tree-sitter clients for those, but for those without I am not aware of anything that is using // as comment.

But instead, tons of random configuration that we do not support uses # instead of //, which is why I suggested this change.

@@ -60,7 +60,7 @@ fn find_line_comment(
pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&str>) -> Transaction {
let text = doc.slice(..);

let token = token.unwrap_or("//");
let token = token.unwrap_or("#");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it should be configurable. And then change the default in the configuration.

@frou
Copy link

frou commented Sep 9, 2023

If anything is, then # is the one true line comment character because languages that use it get shebang support for free.

@omentic
Copy link
Contributor

omentic commented Jan 30, 2025

Superceded by #12080

@pickfire pickfire deleted the default-comment branch May 22, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R-breaking-change This PR is a breaking change for some behavior S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants