Skip to content
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

Feature request: multiline comments #3

Open
DRSDavidSoft opened this issue Feb 28, 2019 · 2 comments
Open

Feature request: multiline comments #3

DRSDavidSoft opened this issue Feb 28, 2019 · 2 comments

Comments

@DRSDavidSoft
Copy link

Description

Could you please add support for multi-line style comments, e.g.:

/* ===================================================================== *
 * This is a multi-line comment section
 * ===================================================================== */
@dinhani
Copy link
Owner

dinhani commented Mar 1, 2019

I believe this cannot be supported for the following reasons:

1 - Not all languages have multi-line comments.

2 - Even in languages that have multi-line comments, a block like this may not look good. Take HTML / XML <!-- --> as example.

3 - To look good, each language will probably need a much more complex logic than what we have today.

switch (languageNormalized) {
// //
case "c":
case "ceylon":
case "cpp":
case "csharp":
case "d":
case "dart":
case "fsharp":
case "go":
case "groovy":
case "haxe":
case "java":
case "javascript":
case "kotlin":
case "objective-c":
case "pascal":
case "php":
case "rust":
case "scala":
case "stylus":
case "swift":
case "typescript":
return new LineCommentRenderer("//");
// //-
case "jade":
case "pug":
return new LineCommentRenderer("//-");
// #
case "coffeescript":
case "crystal":
case "dockerfile":
case "elixir":
case "gemfile":
case "graphql":
case "julia":
case "makefile":
case "perl":
case "perl6":
case "powershell":
case "properties":
case "python":
case "r":
case "ruby":
case "shellscript":
case "yaml":
return new LineCommentRenderer("#");
// --
case "ada":
case "elm":
case "haskell":
case "lua":
case "sql":
return new LineCommentRenderer("--");
// ;
case "ahk":
return new LineCommentRenderer(";");
// ;;
case "clojure":
case "lisp":
case "racket":
return new LineCommentRenderer(";;");
// '
case "vb":
return new LineCommentRenderer("'");
// !
case "fortran":
return new LineCommentRenderer("!");
// %
case "erlang":
case "latex":
case "matlab":
return new LineCommentRenderer("%");
// \
case "forth":
return new LineCommentRenderer("\\");
// *
case "abap":
case "cobol":
case "sas":
case "spss":
case "stata":
return new LineCommentRenderer("*");
case "bat":
return new LineCommentRenderer("REM");
// /* */
case "css":
case "less":
case "scss":
return new BlockCommentRenderer("/*", "*/");
// <!-- -->
case "coldfusion":
case "erb":
case "html":
case "html (eex)":
case "markdown":
case "vue":
case "xml":
case "xsl":
return new BlockCommentRenderer("<!--", "-->");
case "mathematica":
case "wolfram":
return new BlockCommentRenderer("(*", "*)");
default:
return new LineCommentRenderer("//");
}

@DRSDavidSoft
Copy link
Author

I understand, but I appreciate if you could keep this in mind for v3.0.0 for supported languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants