Giter Club home page Giter Club logo

aaron-bond / better-comments Goto Github PK

View Code? Open in Web Editor NEW
813.0 12.0 156.0 448 KB

Home Page: https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments

License: MIT License

TypeScript 29.92% Clojure 25.21% CSS 0.12% Dart 0.92% JavaScript 3.70% Common Lisp 9.65% MATLAB 0.28% Pascal 2.93% C# 5.45% Racket 3.12% HCL 0.34% Python 4.90% Vue 1.24% HTML 2.75% Nim 5.29% HiveQL 0.39% PigLatin 0.85% COBOL 2.21% GDScript 0.43% Fortran 0.31%
vscode-extension typescript formatting

better-comments's Introduction

Better Comments

The Better Comments extension will help you create more human-friendly comments in your code.
With this extension, you will be able to categorise your annotations into:

  • Alerts
  • Queries
  • TODOs
  • Highlights
  • Commented out code can also be styled to make it clear the code shouldn't be there
  • Any other comment styles you'd like can be specified in the settings

Annotated code

Configuration

This extension can be configured in User Settings or Workspace settings.

"better-comments.multilineComments": true
This setting will control whether multiline comments are styled using the annotation tags. When false, multiline comments will be presented without decoration.

"better-comments.highlightPlainText": false
This setting will control whether comments in a plain text file are styled using the annotation tags. When true, the tags (defaults: ! * ? //) will be detected if they're the first character on a line.

better-comments.tags
The tags are the characters or sequences used to mark a comment for decoration. The default 5 can be modified to change the colors, and more can be added.

"better-comments.tags": [
  {
    "tag": "!",
    "color": "#FF2D00",
    "strikethrough": false,
    "underline": false,
    "backgroundColor": "transparent",
    "bold": false,
    "italic": false
  },
  {
    "tag": "?",
    "color": "#3498DB",
    "strikethrough": false,
    "underline": false,
    "backgroundColor": "transparent",
    "bold": false,
    "italic": false
  },
  {
    "tag": "//",
    "color": "#474747",
    "strikethrough": true,
    "underline": false,
    "backgroundColor": "transparent",
    "bold": false,
    "italic": false
  },
  {
    "tag": "todo",
    "color": "#FF8C00",
    "strikethrough": false,
    "underline": false,
    "backgroundColor": "transparent",
    "bold": false,
    "italic": false
  },
  {
    "tag": "*",
    "color": "#98C379",
    "strikethrough": false,
    "underline": false,
    "backgroundColor": "transparent",
    "bold": false,
    "italic": false
  }
]

Supported Languages

  • Ada
  • AL
  • Apex
  • AsciiDoc
  • BrightScript
  • C
  • C#
  • C++
  • ColdFusion
  • Clojure
  • COBOL
  • CoffeeScript
  • CSS
  • Dart
  • Dockerfile
  • Elixir
  • Elm
  • Erlang
  • F#
  • Fortran
  • gdscript
  • GenStat
  • Go
  • GraphQL
  • Groovy
  • Haskell
  • Haxe
  • HiveQL
  • HTML
  • Java
  • JavaScript
  • JavaScript React
  • JSON with comments
  • Julia
  • Kotlin
  • LaTex (inlc. Bibtex/Biblatex)
  • Less
  • Lisp
  • Lua
  • Makefile
  • Markdown
  • Nim
  • MATLAB
  • Objective-C
  • Objective-C++
  • Pascal
  • Perl
  • Perl 6
  • PHP
  • Pig
  • PlantUML
  • PL/SQL
  • PowerShell
  • Puppet
  • Python
  • R
  • Racket
  • Ruby
  • Rust
  • SAS
  • Sass
  • Scala
  • SCSS
  • ShaderLab
  • ShellScript
  • SQL
  • STATA
  • Stylus
  • Svelte
  • Swift
  • Tcl
  • Terraform
  • Twig
  • TypeScript
  • TypeScript React
  • Verilog
  • Visual Basic
  • Vue.js
  • XML
  • YAML

better-comments's People

Contributors

aaron-bond avatar alglez avatar bekorn avatar blakewilson avatar chrisokuda avatar christian-predebon avatar javierreyes945 avatar kylestev avatar mjbvz avatar pwelby avatar tanhakabir avatar therustyknife avatar thewhoareyouperson avatar tobiasbales avatar vednoc avatar zhiayang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

better-comments's Issues

Feature request: Add support for Dart

Dart (extension .dart) is a language from Google that includes JS-style comments,
including the block comment (/* */) and the line comment (// . . . ).

I use Visual Studio Code daily for writing Dart code and I really want to try out your
extension, thanks!

Rust's comments: not supported all variants

Comments in Rust can start with various delimiters as described in the reference.

I don't know how yet, but there should be regex or list with next options:

  • // - Simple comment
  • /// - Outer line doc (exactly 3 slashes)
  • //! - Inner line doc
  • /*! - Inner line doc
  • /** - Outer block doc (exactly) 2 asterisks

Firstly, please, disable //! for Rust because it's horrible when standard docs looks like attention like XXX or FIXME.

screen shot 2018-01-10 at 00 12 20

Unit tests

Unit tests for parser.ts and extension.ts need to be started

Feature request: add current date/time command

Sometimes we need to put date/time info into comment section. It'd be very handy to have a command to insert such info automatically using this extension. The date and time format can be configured through settings.

Thank you.

Options warning

Expected object instead of array.

"better-comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false
},
{
"tag": "//",
"color": "#474747",
"strikethrough": true
},
{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false
},
{
"tag": "*",
"color": "#98C379",
"strikethrough": false
}
],

bug: rendering failed after switching to unsupported file type

The extension fails to render comments correctly after switching to unsupported file types such as .gitignore file or a plain text file. Is this a known bug?

Bug evidence:
licecap record at 13 02

Workaroud:
Restart VS Code and never open any files that are not supported by this extension while you need to use this extension.

Info:
– extension v.1.2.0
– vscode v.1.21
– macOS v.10.11

Language support: Object Pascal

Please, add support for object pascal (modern pascal) programming language.

The comment syntaxes in object pascal are:

  • line comment: //
  • block comment:
    • {}
    • (**)

Can you just add an option to make this extension works on any kinds of file? By simply using the given tags. So everyone could use this extension on any languages that haven't yet supported, while waiting for official support.

Thank you.

Support for AL Language

Can you please add support for AL language?

The syntax for comments are as follow:

  • line comment: //
  • block comment: /* */

AL files end with the .al file extension.

Many thanks for your great extension and your great job!

Salut!
Laura Nicolàs

Slight issue with multiline comments

The TODO highlighting works for single line comments with a colon, i.e:

// TODO: Something something...

But doesn't work for multiline comments, i.e:

/*
TODO: Something something...
*/

I don't have time to make a pull request at the moment though, sorry!

Feature request: more font style options for comment tag

Currently, this extension only supports color and strikethrough options. Could you please add more font style options for comment tag?

Here's some other font style options that can be provided:

  • bold
  • italic
  • underline
  • font size
  • font family

Thank you.

Randomly stops working

Sometimes it works, then it stops working for no reason and it stays like this, only way i to get it back is to keep reloading, disabling and enabling shit, until it eventually pops back again when it feels like it.

this is my code from user settings

    "better-comments.multilineComments": true, 
    "better-comments.tags": [
        {
            "tag": "!",
            "color": "#FF2D00",
            "strikethrough": false
        },
        {
            "tag": "?",
            "color": "#3498DB",
            "strikethrough": false
        },
        {
            "tag": "//",
            "color": "#474747",
            "strikethrough": true
        },
        {
            "tag": "todo",
            "color": "#FF8C00",
            "strikethrough": false
        },
        {
            "tag": "*",
            "color": "#98C379",
            "strikethrough": false
        }
    ],

No coloring in SCSS files.

The extension works for me on most languages except .scss files. I can't seem to figure out why. I did check the extension log that shows extensions being loaded and I didn't see it load but IDK if that means anything. PLEASE HELP!!!!

Feature request: comment mark as settings

Could you please add some settings to let us define custom comment marks? My proposal is:

  • add a section to define block comment syntax, for example:
    "block comment": {
      "start mark": "(*"
      "stop mark": "*)"
    }
  • add an option to define (single) line comment syntax, for example:
    "line comment mark": "//"
  • add an option to toggle this custom comment feature, for example:
    "custom comment": true

These custom comment marks settings would only work if the language isn't recognized by the extension. Otherwise the extension would use the official language comment syntax. This way would enable user to use this extension for any kinds of programming languages that haven't yet supported, until they are supported officially.

Thank you.

enhancement: starting point of striked text

Just updated to the latest version of this extension, v.1.2.0. And I got some enhancement ideas.

The new striked text feature is very useful. However, there's a little glitch that makes it look imperfect when it's used within the jsdoc section. It's the starting point of the striked text. Instead of starting from the beginning of line, could you make it to start from the asterisk? Like it's shown at the line number 33 that starts from the //.

Screenshot attached, the glitch is shown at the line number 16 (I changed // to -).

Screenshot:
better-comments-report

Setting to change what comment tag to detect? (instead of //)

Would it be possible to simply add the ability for us to tell Better Comments which comment tag to search for? This would allow us to configure the extension to work with many other languages such as Python or Lua.

I want to change it from registering // as a comment, to -- to work with SQL and Lua Scripts.
So that I can do: -- TODO: This needs completing!

I'm currently using Visual Studio Code and no option like this exists (you can only change colours).

Thanks for the great extension. I've recommended it to every developer I work with and they love it too!

How to use ?

I have forgotten how to use this extension ? :)

Feature Request: Font size

Hello, is possible to change the font size for a particular tag? This would help in better comment for the code sections - I now use ASCII art, but it would be better to tag a specific line of comment (which would also result in a change in font size).

Feature Request: Support for simple tagging in plain text file

Great extension. I use it daily. What I would like to see is support for text file (.txt) with simplified tagging. Reading the first character and utilizing that (+,?,TODO, etc.) without having to do // or comment block to trigger text formatting.

Javascript React not auto detecting

When opening up vscode, comment colors are not showing. If i swap my language detection from Javascript React just to Javascript, it begins to work again.

Feature Request: Add settings for modifying annotation indicators

Rationale: Allow those who follow JSDoc or similar documentation conventions, @ to have highlighting.

Current:

  • Alert: !
  • Queries: ?
  • Todo: TODO
  • Removed: ////
  • Description: (none?)

Proposed: (defaults written in)

better-comments.annotations: {
  alert: ['!'],
  queries: ['?'],
  todo: ['TODO'],
  removed: ['////'],
  description: [' '],
}

I suggest an array so that if people want to have multiple annotations be highlighted identically, such as both ['TODO', '@todo', '@todo'], it'll be feasible.

Feature Request: @ to jump to a given position.

I'd like to propose a new feature. It's a common practice in coding that inside a comment we need to point a specific position in the source code to explain something. For example, this comment

// the code block below is similar to a code block @123,5

would render @123,5 like a link (underlined). If it's clicked, the cursor will jump to line 123 column 5. If the column value is omitted, the default value is 1 (first column). It's like a shortcut for go to line command. Doing an undo (or go back?) would bring the cursor back into the previous location.

It'd be great if it's able to jump into another file. For cross file jump, the syntax should be filename.ext@line[,column]. For example: test.pas@10,5 would jump to test.pas file at line 10 column 5.

Is this kind of feature possible to be implemented? What do you think?

Thank you.

Support Python docstrings as block comments

As discussed in #8 python uses docstrings for block comments like so:

"""
my_method does a thing. There are many like it, but this one is mine.
? Do we really need this?
! Deprecated
@param my_param Do some stuff with this
"""
def my_method(my_param):
    ...stuff goes here...

It would be nice to have Better Comments work for that as well.

Some people put spaces before their text in those docstrings:

"""
    my_method does a thing. There are many like it, but this one is mine.
    ? Do we really need this?
    ! Deprecated
    @param my_param Do some stuff with this
"""
def my_method(my_param):
    ...stuff goes here...

Options for alternate style of block comments

I'm not sure how much this would be to add, but it would be nice to allow block comments without stars in front of them to have the highlighting. Like this style:
image

The options to put the tags right after the /* to make the entire block comment highlighted would be handy as well, to add a strikethrough to an entire block of code or allow multiline todos

Support for VB and VBScript

Hi! It would be great if your extension could support VB and VBScript comment. Both use a single quote (ex: ') to start a line comment and there's no block comment. Thanks!

Not working | Elixir | moduledoc

The issue pertains to @moduledoc in Elixir.

@moduledoc """"
Some description
    !This does not work
"""

A normal comment #! some comment works fine.
I can also get moduledoc to be working if inside the triple quotes I add a # comment symbol with a tag:

@moduledoc """"
Some description
    # !This does work but now I will have to go through 500 files and adjust accordingly.
"""

Is it plausible to add support for tags to be working within moduledoc?

Please dont make //! alert for rust

Rust uses it for module documentation eg:

//! This library multiplies numbers

/*!
This is a multiline module doc comment
*/

fn mul(a: u8, b: u8) -> u8 { a * b }

Tags for comments ?

I was hoping tags for comments could be added; though the command palette you could search the tag for the severity of the comment. For example one comment would have a tag of; maybe. When searching for tags if there is more then one comment with the tag of, maybe you can quickly view them ?

bug: @param isn't working on pascal file

Just updated to the latest version of this extension, v.1.2.0. And I found some bugs.

The @param of jsdoc feature isn't working, at least with pascal source file. Screenshot attached, the bug is shown at the line number 18.

Screenshot:
better-comments-report

Markdown Not Support?

I'm using this extension with markdown file for months ,
it works great!
but suddenly it didn't work!?
any idea?

Feature Request: Add option to ignore comments on the 1st line of a file

Many scripting languages start their file with a shebang to indicate which interpreter should be used (i.e. python3 scripts have #!/usr/bin/env python3). By default this is picked up as an important comment and the color is changed incorrectly.

As the shebang always starts #! and is on the first line, it should be possible to exclude comments from highlighting if they start with a #! and are on the 1st line of a file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.