Skip to content

Commit 7ef112d

Browse files
devvaannshabose
authored andcommitted
fix: compatibility issues with jsdoc2md and docusaurus
1 parent 8e4bd37 commit 7ef112d

37 files changed

+220
-206
lines changed

src/JSUtils/ScopeManager.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,9 @@ define(function (require, exports, module) {
13491349
*
13501350
* During debugging, you can turn this automatic resetting behavior off
13511351
* by running this in the console:
1352+
* ```js
13521353
* brackets._configureJSCodeHints({ noReset: true })
1353-
*
1354+
* ```
13541355
* This function is also used in unit testing with the "force" flag to
13551356
* reset the module for each test to start with a clean environment.
13561357
*
@@ -1470,9 +1471,7 @@ define(function (require, exports, module) {
14701471
/**
14711472
* Track the update area of the current document so we can tell if we can send
14721473
* partial updates to tern or not.
1473-
*
1474-
* @param {Array.<{from: {line:number, ch: number}, to: {line:number, ch: number},
1475-
* text: Array<string>}>} changeList - the document changes from the current change event
1474+
* @param {{from: {line: number, ch: number}, to: {line: number, ch: number}, text: string[]}} changeList - The document changes from the current change event
14761475
*/
14771476
function trackChange(changeList) {
14781477
var changed = documentChanges, i;

src/JSUtils/Session.js

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define(function (require, exports, module) {
5555
/**
5656
* Get the builtin libraries tern is using.
5757
*
58-
* @return {Array.<string>} - array of library names.
58+
* @return {Array.<String>} - array of library names.
5959
* @private
6060
*/
6161
Session.prototype._getBuiltins = function () {
@@ -70,7 +70,7 @@ define(function (require, exports, module) {
7070
/**
7171
* Get the name of the file associated with the current session
7272
*
73-
* @return {string} - the full pathname of the file associated with the
73+
* @return {String} - the full pathname of the file associated with the
7474
* current session
7575
*/
7676
Session.prototype.getPath = function () {
@@ -90,7 +90,7 @@ define(function (require, exports, module) {
9090
* Get the text of a line.
9191
*
9292
* @param {number} line - the line number
93-
* @return {string} - the text of the line
93+
* @return {String} - the text of the line
9494
*/
9595
Session.prototype.getLine = function (line) {
9696
var doc = this.editor.document;
@@ -210,7 +210,7 @@ define(function (require, exports, module) {
210210
*
211211
* @param {{line: number, ch: number}} cursor - cursor position after
212212
* which a token should be retrieved
213-
* @param {boolean} skipWhitespace - true if this should skip over whitespace tokens
213+
* @param {Boolean} skipWhitespace - true if this should skip over whitespace tokens
214214
* @return {Object} - the CodeMirror token after the one at the given
215215
* cursor position
216216
*/
@@ -238,11 +238,11 @@ define(function (require, exports, module) {
238238
};
239239

240240
/**
241-
* Calculate a query string relative to the current cursor position
242-
* and token. E.g., from a state "identi<cursor>er", the query string is
241+
* Calculate a query String relative to the current cursor position
242+
* and token. E.g., from a state "identi--cursor--er", the query String is
243243
* "identi".
244244
*
245-
* @return {string} - the query string for the current cursor position
245+
* @return {String} - the query String for the current cursor position
246246
*/
247247
Session.prototype.getQuery = function () {
248248
var cursor = this.getCursor(),
@@ -275,7 +275,7 @@ define(function (require, exports, module) {
275275
* at which context information is to be retrieved
276276
* @param {number=} depth - the current depth of the parenthesis stack, or
277277
* undefined if the depth is 0.
278-
* @return {string} - the context for the property that was looked up
278+
* @return {String} - the context for the property that was looked up
279279
*/
280280
Session.prototype.getContext = function (cursor, depth) {
281281
var token = this.getToken(cursor);
@@ -342,7 +342,7 @@ define(function (require, exports, module) {
342342
/**
343343
* Determine if the caret is either within a function call or on the function call itself.
344344
*
345-
* @return {{inFunctionCall: boolean, functionCallPos: {line: number, ch: number}}}
345+
* @return {{inFunctionCall: Boolean, functionCallPos: {line: number, ch: number}}}
346346
* inFunctionCall - true if the caret if either within a function call or on the
347347
* function call itself.
348348
* functionCallPos - the offset of the '(' character of the function call if inFunctionCall
@@ -385,7 +385,7 @@ define(function (require, exports, module) {
385385
* Test is a lexical state is in a function call.
386386
*
387387
* @param {Object} lex - lexical state.
388-
* @return {Object | boolean}
388+
* @return {Object | Boolean}
389389
*
390390
*/
391391
function isInFunctionalCall(lex) {
@@ -453,10 +453,9 @@ define(function (require, exports, module) {
453453
* Get the type of the current session, i.e., whether it is a property
454454
* lookup and, if so, what the context of the lookup is.
455455
*
456-
* @return {{property: boolean,
457-
context: string} - an Object consisting
458-
* of a {boolean} "property" that indicates whether or not the type of
459-
* the session is a property lookup, and a {string} "context" that
456+
* @return {{property: Boolean, context: String}} - an Object consisting
457+
* of a {Boolean} "property" that indicates whether or not the type of
458+
* the session is a property lookup, and a {String} "context" that
460459
* indicates the object context (as described in getContext above) of
461460
* the property lookup, or null if there is none. The context is
462461
* always null for non-property lookups.
@@ -485,8 +484,8 @@ define(function (require, exports, module) {
485484
};
486485
};
487486

488-
// Comparison function used for sorting that does a case-insensitive string
489-
// comparison on the "value" field of both objects. Unlike a normal string
487+
// Comparison function used for sorting that does a case-insensitive String
488+
// comparison on the "value" field of both objects. Unlike a normal String
490489
// comparison, however, this sorts leading "_" to the bottom, given that a
491490
// leading "_" usually denotes a private value.
492491
function penalizeUnderscoreValueCompare(a, b) {
@@ -510,11 +509,11 @@ define(function (require, exports, module) {
510509
* Retrieves a list of hints for the current session based on the current scope
511510
* information.
512511
*
513-
* @param {string} query - The query prefix used to filter hints.
512+
* @param {String} query - The query prefix used to filter hints.
514513
* @param {StringMatcher} matcher - The class used to find query matches and sort the results.
515-
* @return {{hints: Array<string>, needGuesses: boolean}} An object containing:
514+
* @return {{hints: Array<String>, needGuesses: Boolean}} An object containing:
516515
* - `hints`: An array of matching hints.
517-
* - `needGuesses`: A boolean indicating whether the caller needs to request guesses and call getHints again.
516+
* - `needGuesses`: A Boolean indicating whether the caller needs to request guesses and call getHints again.
518517
*/
519518
Session.prototype.getHints = function (query, matcher) {
520519

@@ -531,7 +530,7 @@ define(function (require, exports, module) {
531530
/**
532531
* Is the origin one of the builtin files.
533532
*
534-
* @param {string} origin
533+
* @param {String} origin
535534
*/
536535
function isBuiltin(origin) {
537536
return builtins.indexOf(origin) !== -1;
@@ -628,9 +627,7 @@ define(function (require, exports, module) {
628627

629628
/**
630629
* Set a new function type hint.
631-
*
632-
* @param {Array<{name: string, type: string, isOptional: boolean}>} newFnType -
633-
* Array of function hints.
630+
* @param {{name: String, type: String, isOptional: Boolean[]}} newFnType - Array of function hints
634631
*/
635632
Session.prototype.setFnType = function (newFnType) {
636633
this.fnType = newFnType;
@@ -649,7 +646,7 @@ define(function (require, exports, module) {
649646
* Get the function type hint. This will format the hint, showing the
650647
* parameter at the cursor in bold.
651648
*
652-
* @return {{parameters: Array<{name: string, type: string, isOptional: boolean}>,
649+
* @return {{parameters: Array<{name: String, type: String, isOptional: Boolean}>,
653650
* currentIndex: number}} An Object where the
654651
* "parameters" property is an array of parameter objects;
655652
* the "currentIndex" property index of the hint the cursor is on, may be
@@ -746,15 +743,15 @@ define(function (require, exports, module) {
746743
/**
747744
* Get the javascript text of the file open in the editor for this Session.
748745
* For a javascript file, this is just the text of the file. For an HTML file,
749-
* this will be only the text in the <script> tags. This is so that we can pass
746+
* this will be only the text in the script tags. This is so that we can pass
750747
* just the javascript text to tern, and avoid confusing it with HTML tags, since it
751748
* only knows how to parse javascript.
752-
* @return {string} - the "javascript" text that can be sent to Tern.
749+
* @return {String} - the "javascript" text that can be sent to Tern.
753750
*/
754751
Session.prototype.getJavascriptText = function () {
755752
if (LanguageManager.getLanguageForPath(this.editor.document.file.fullPath).getId() === "html") {
756753
// HTML file - need to send back only the bodies of the
757-
// <script> tags
754+
// script tags
758755
var text = "",
759756
editor = this.editor,
760757
scriptBlocks = HTMLUtils.findBlocks(editor, "javascript");
@@ -792,7 +789,7 @@ define(function (require, exports, module) {
792789
* parameter declarations, but we can tell those from the token itself rather than having
793790
* to look at previous tokens.
794791
*
795-
* @return {boolean} - true if the current cursor position is in the name of a function
792+
* @return {Boolean} - true if the current cursor position is in the name of a function
796793
* declaration.
797794
*/
798795
Session.prototype.isFunctionName = function () {

src/command/Menus.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,7 @@ define(function (require, exports, module) {
549549
*
550550
* @param {!string | Command} command - the command the menu will execute.
551551
* Pass Menus.DIVIDER for a menu divider, or just call addMenuDivider() instead.
552-
* @param {?string | Array.<{key: string, platform: string}>} [keyBindings] - register one
553-
* one or more key bindings to associate with the supplied command.
552+
* @param {?(string | {key: string, platform: string[]})} [keyBindings] - Register one or more key bindings to associate with the supplied command
554553
* @param {?string} [position] - constant defining the position of new MenuItem relative to
555554
* other MenuItems. Values:
556555
* - With no relativeID, use Menus.FIRST or LAST (default is LAST)
@@ -1603,12 +1602,13 @@ define(function (require, exports, module) {
16031602
* - use addMenuItem() to add items to the context menu
16041603
* - call open() to show the context menu.
16051604
* For example:
1605+
* ```js
16061606
* $("#my_ID").contextmenu(function (e) {
16071607
* if (e.which === 3) {
16081608
* my_cmenu.open(e);
16091609
* }
16101610
* });
1611-
*
1611+
* ```
16121612
* To make menu items be contextual to things like selection, listen for the "beforeContextMenuOpen"
16131613
* to make changes to Command objects before the context menu is shown. MenuItems are views of
16141614
* Commands, which control a MenuItem's name, enabled state, and checked state.

src/document/Document.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ define(function (require, exports, module) {
4141
*
4242
* __change__ -- When the text of the editor changes (including due to undo/redo).
4343
*
44-
* Passes ({Document}, {ChangeList}), where ChangeList is an array
44+
* Passes ({Document}, {'ChangeList'}), where ChangeList is an array
4545
* of change record objects. Each change record looks like:
46-
*
46+
*```js
4747
* { from: start of change, expressed as {line: <line number>, ch: <character offset>},
4848
* to: end of change, expressed as {line: <line number>, ch: <chracter offset>},
4949
* text: array of lines of text to replace existing text }
50-
*
50+
*```
5151
* The line and ch offsets are both 0-based.
5252
*
5353
* The ch offset in "from" is inclusive, but the ch offset in "to" is exclusive. For example,
@@ -625,10 +625,10 @@ define(function (require, exports, module) {
625625
* then this function will adjust them as necessary for the effects of other edits, and then return a
626626
* flat list of all the selections, suitable for passing to `setSelections()`.
627627
*
628-
* @param {!Array<{edit: {text: string, start:{line: number, ch: number}, end: {line: number, ch: number} | undefined}
629-
* | Array<{text: string, start:{line: number, ch: number}, end: {line: number, ch: number} | undefined}>,
628+
* @param {!{edit: {text: string, start:{line: number, ch: number}, end: {line: number, ch: number} | undefined}
629+
* | {text: string, start:{line: number, ch: number}, end: {line: number, ch: number} | undefined},
630630
* selection: {start:{line:number, ch:number}, end:{line:number, ch:number},
631-
* primary:boolean, reversed: boolean, isBeforeEdit: boolean} | undefined}>} edits
631+
* primary:boolean, reversed: boolean, isBeforeEdit: boolean} | undefined}} edits
632632
* Specifies the list of edits to perform in a manner similar to CodeMirror's `replaceRange`. This array
633633
* will be mutated.
634634
*
@@ -657,7 +657,7 @@ define(function (require, exports, module) {
657657
* the total bounds of edit groups must not overlap (e.g. edits in one group can't surround an edit from another group).
658658
*
659659
* @param {?string} origin An optional edit origin that's passed through to each replaceRange().
660-
* @return {Array<{start:{line:number, ch:number}, end:{line:number, ch:number}, primary:boolean, reversed: boolean}>}
660+
* @return {{start:{line:number, ch:number}, end:{line:number, ch:number}, primary:boolean, reversed: boolean[]}}
661661
* The list of passed selections adjusted for the performed edits, if any.
662662
*/
663663

src/editor/CodeHintManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ define(function (require, exports, module) {
353353
* This gets called (potentially) on every keypress. So, it should be fast.
354354
*
355355
* @param {!string} languageId
356-
* @return {?Array.<{provider: Object, priority: number}>}
356+
* @return {?{provider: Object, priority: number[]}}
357357
*/
358358
function _getProvidersForLanguageId(languageId) {
359359
var providers = hintProviders[languageId] || hintProviders.all;

0 commit comments

Comments
 (0)