Skip to content

Commit

Permalink
closes #37, closes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Bond committed Mar 19, 2018
1 parent 88e0720 commit e9f40a0
Showing 5 changed files with 23 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,8 +2,11 @@

## [1.2.0] (????-??-??)
### Features
* Adding support for: Clojure, Racket, Lisp ([]()), merges [#40](https://github.com/aaron-bond/better-comments/pull/40)
* Adding support for: Clojure, Racket, Lisp ([88e0720](https://github.com/aaron-bond/better-comments/commit/88e0720)), merges [#40](https://github.com/aaron-bond/better-comments/pull/40)
* Adding support for: Yaml ([]()), merges [#37](https://github.com/aaron-bond/better-comments/pull/37)

## Bug Fixes
* Fixing random crashes when unsupported language is opened in the window ([]()), closes [#35](https://github.com/aaron-bond/better-comments/issues/35)

## [1.1.9] (2018-02-11)
### Features
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -95,4 +95,5 @@ The default 5 can be modifed to change the colors, and more can be added.
* SQL
* Swift
* TypeScript
* Visual Basic
* Visual Basic
* YAML
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"displayName": "Better Comments",
"icon": "icon.png",
"description": "Improve your code commenting by annotating with alert, informational, TODOs, and more!",
"version": "1.1.8",
"version": "1.2.0",
"publisher": "aaron-bond",
"author": {
"name": "Aaron Bond"
@@ -68,7 +68,8 @@
"onLanguage:sql",
"onLanguage:swift",
"onLanguage:typescript",
"onLanguage:vb"
"onLanguage:vb",
"onLanguage:yaml"
],
"galleryBanner": {
"color": "#e3f4ff",
4 changes: 4 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -9,8 +9,12 @@ export function activate(context: vscode.ExtensionContext) {

// Called to handle events below
let updateDecorations = function (useHash = false) {
// * if no active window is open, return
if (!activeEditor) return;

// * if lanugage isn't supported, return
if (parser.unsupportedLanguage) return;

// Finds the single line comments using the language comment delimiter
parser.FindSingleLineComments(activeEditor)

12 changes: 10 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
@@ -19,10 +19,13 @@ interface Contributions {

export class Parser {
private tags: CommentTag[] = [];
private expression: string;
private delimiter: string;
private expression: string = "";
private delimiter: string = "";
private highlightMultilineComments = false;

// * this is used to trigger the events when a supported language code is found
public unsupportedLanguage = false;

// Read from the package.json
private contributions: Contributions = vscode.workspace.getConfiguration('better-comments') as any;

@@ -188,6 +191,7 @@ export class Parser {
case "r":
case "ruby":
case "shellscript":
case "yaml":
this.delimiter = "#";
break;

@@ -213,6 +217,10 @@ export class Parser {
case "lisp":
this.delimiter = ";";
break;

default:
this.unsupportedLanguage = true;
break;
}
}

0 comments on commit e9f40a0

Please sign in to comment.