vscode-todo-plus
Version:
Manage todo lists with ease. Powerful, easy to use and customizable.
39 lines (25 loc) • 780 B
text/typescript
/* IMPORT */
import * as vscode from 'vscode';
import Line from './line';
import CommentItem from '../items/comment';
import Consts from '../../consts';
/* DECORATION TYPES */
const COMMENT = vscode.window.createTextEditorDecorationType ({
color: Consts.colors.comment,
rangeBehavior: vscode.DecorationRangeBehavior.OpenOpen,
dark: {
color: Consts.colors.dark.comment
},
light: {
color: Consts.colors.light.comment
}
});
/* COMMENT */
class Comment extends Line {
TYPES = [COMMENT];
getItemRanges ( comment: CommentItem, negRange?: vscode.Range | vscode.Range[] ) {
return [this.getRangeDifference ( comment.text, comment.range, negRange || [Consts.regexes.tag, Consts.regexes.formattedCode] )];
}
}
/* EXPORT */
export default Comment;