Codemirror comment fix (#30378)

* fixed typedef for toggleComment

there is a mistake in the documenation.
(See https://github.com/codemirror/CodeMirror/issues/5654)
This is why this mistake in the type defs slipped through.

workstream:

* fixed corresponding test.

workstream:
This commit is contained in:
Nikolaj Kappler
2018-11-14 23:20:21 +01:00
committed by Pranav Senthilnathan
parent 9acca8ab3e
commit f7b71c452a
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ declare module "codemirror" {
interface Editor {
/** Tries to uncomment the current selection, and if that fails, line-comments it. */
toggleComment(from: Position, to: Position, options?: CommentOptions): void;
toggleComment(options?: CommentOptions): void;
/** Set the lines in the given range to be line comments. Will fall back to `blockComment` when no line comment style is defined for the mode. */
lineComment(from: Position, to: Position, options?: CommentOptions): void;
/** Wrap the code in the given range in a block comment. Will fall back to `lineComment` when no block comment style is defined for the mode. */

View File

@@ -10,7 +10,7 @@ const opt: CodeMirror.CommentOptions = {
lineComment: "//",
padding: " "
};
editor.toggleComment(position, position, opt);
editor.toggleComment(opt);
editor.blockComment(position, position, opt);
editor.lineComment(position, position, opt);
const b: boolean = editor.uncomment(position, position, opt);