mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
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:
committed by
Pranav Senthilnathan
parent
9acca8ab3e
commit
f7b71c452a
2
types/codemirror/codemirror-comment.d.ts
vendored
2
types/codemirror/codemirror-comment.d.ts
vendored
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user