Skip to content

Commit a1cbe52

Browse files
committed
deploy: 606b7d0
1 parent f0759cf commit a1cbe52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+468
-372
lines changed

JSUtils/Preferences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ define(function (require, exports, module) {
7070
/**
7171
* Convert an array of strings with optional wildcards, to an equivalent
7272
* regular expression.
73-
*
73+
* @private
7474
* @param {Array.<string|RegExp>} settings from the file (note: this may be mutated by this function)
7575
* @param {?RegExp} baseRegExp - base regular expression that is always used
7676
* @param {?RegExp} defaultRegExp - additional regular expression that is only used if the user has not configured settings

JSUtils/ScopeManager.js

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ define(function (require, exports, module) {
8686

8787
/**
8888
* Read in the json files that have type information for the builtins, dom,etc
89+
* @private
8990
*/
9091
function initTernEnv() {
9192
const builtinDefinitionFiles = JSON.parse(require("text!thirdparty/tern/defs/defs.json"));
@@ -110,7 +111,7 @@ define(function (require, exports, module) {
110111
/**
111112
* Init preferences from a file in the project root or builtin
112113
* defaults if no file is found;
113-
*
114+
* @private
114115
* @param {string=} projectRootPath - new project root path. Only needed
115116
* for unit tests.
116117
*/
@@ -166,7 +167,7 @@ define(function (require, exports, module) {
166167

167168
/**
168169
* Will initialize preferences only if they do not exist.
169-
*
170+
* @private
170171
*/
171172
function ensurePreferences() {
172173
if (!deferredPreferences) {
@@ -186,7 +187,7 @@ define(function (require, exports, module) {
186187

187188
/**
188189
* Test if the directory should be excluded from analysis.
189-
*
190+
* @private
190191
* @param {!string} path - full directory path.
191192
* @return {boolean} true if excluded, false otherwise.
192193
*/
@@ -205,7 +206,7 @@ define(function (require, exports, module) {
205206

206207
/**
207208
* Test if the file path is in current editor
208-
*
209+
* @private
209210
* @param {string} filePath file path to test for exclusion.
210211
* @return {boolean} true if in editor, false otherwise.
211212
*/
@@ -218,7 +219,7 @@ define(function (require, exports, module) {
218219

219220
/**
220221
* Test if the file path is an internal exclusion.
221-
*
222+
* @private
222223
* @param {string} path file path to test for exclusion.
223224
* @return {boolean} true if excluded, false otherwise.
224225
*/
@@ -235,7 +236,7 @@ define(function (require, exports, module) {
235236

236237
/**
237238
* Test if the file should be excluded from analysis.
238-
*
239+
* @private
239240
* @param {!File} file - file to test for exclusion.
240241
* @return {boolean} true if excluded, false otherwise.
241242
*/
@@ -328,6 +329,7 @@ define(function (require, exports, module) {
328329

329330
/**
330331
* Get a Promise for the definition from TernJS, for the file & offset passed in.
332+
* @private
331333
* @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
332334
* - type of update, name of file, and the text of the update.
333335
* For "full" updates, the whole text of the file is present. For "part" updates,
@@ -363,6 +365,7 @@ define(function (require, exports, module) {
363365
/**
364366
* Get the text of a document, applying any size restrictions
365367
* if necessary
368+
* @private
366369
* @param {Document} document - the document to get the text from
367370
* @return {string} the text, or the empty text if the original was too long
368371
*/
@@ -375,7 +378,7 @@ define(function (require, exports, module) {
375378
/**
376379
* Handle the response from the tern node domain when
377380
* it responds with the references
378-
*
381+
* @private
379382
* @param response - the response from the node domain
380383
*/
381384
function handleRename(response) {
@@ -423,7 +426,7 @@ define(function (require, exports, module) {
423426
/**
424427
* Handle the response from the tern node domain when
425428
* it responds with the definition
426-
*
429+
* @private
427430
* @param response - the response from the node domain
428431
*/
429432
function handleJumptoDef(response) {
@@ -442,7 +445,7 @@ define(function (require, exports, module) {
442445
/**
443446
* Handle the response from the tern node domain when
444447
* it responds with the scope data
445-
*
448+
* @private
446449
* @param response - the response from the node domain
447450
*/
448451
function handleScopeData(response) {
@@ -488,6 +491,7 @@ define(function (require, exports, module) {
488491

489492
/**
490493
* Get a Promise for the function type from TernJS.
494+
* @private
491495
* @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
492496
* - type of update, name of file, and the text of the update.
493497
* For "full" updates, the whole text of the file is present. For "part" updates,
@@ -510,7 +514,7 @@ define(function (require, exports, module) {
510514
/**
511515
* Given a starting and ending position, get a code fragment that is self contained
512516
* enough to be compiled.
513-
*
517+
* @private
514518
* @param {!Session} session - the current session
515519
* @param {{line: number, ch: number}} start - the starting position of the changes
516520
* @return {{type: string, name: string, offsetLines: number, text: string}}
@@ -580,7 +584,7 @@ define(function (require, exports, module) {
580584
* Get an object that describes what tern needs to know about the updated
581585
* file to produce a hint. As a side-effect of this calls the document
582586
* changes are reset.
583-
*
587+
* @private
584588
* @param {!Session} session - the current session
585589
* @param {boolean=} preventPartialUpdates - if true, disallow partial updates.
586590
* Optional, defaults to false.
@@ -619,7 +623,7 @@ define(function (require, exports, module) {
619623

620624
/**
621625
* Get the current offset. The offset is adjusted for "part" updates.
622-
*
626+
* @private
623627
* @param {!Session} session - the current session
624628
* @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
625629
* - type of update, name of file, and the text of the update.
@@ -680,7 +684,7 @@ define(function (require, exports, module) {
680684
/**
681685
* Handle the response from the tern node domain when
682686
* it responds with the list of completions
683-
*
687+
* @private
684688
* @param {{file: string, offset: {line: number, ch: number}, completions:Array.<string>,
685689
* properties:Array.<string>}} response - the response from node domain
686690
*/
@@ -711,7 +715,7 @@ define(function (require, exports, module) {
711715
/**
712716
* Handle the response from the tern node domain when
713717
* it responds to the get guesses message.
714-
*
718+
* @private
715719
* @param {{file: string, type: string, offset: {line: number, ch: number},
716720
* properties: Array.<string>}} response -
717721
* the response from node domain contains the guesses for a
@@ -731,7 +735,7 @@ define(function (require, exports, module) {
731735
/**
732736
* Handle the response from the tern node domain when
733737
* it responds to the update file message.
734-
*
738+
* @private
735739
* @param {{path: string, type: string}} response - the response from node domain
736740
*/
737741
function handleUpdateFile(response) {
@@ -747,7 +751,7 @@ define(function (require, exports, module) {
747751

748752
/**
749753
* Handle timed out inference
750-
*
754+
* @private
751755
* @param {{path: string, type: string}} response - the response from node domain
752756
*/
753757
function handleTimedOut(response) {
@@ -809,7 +813,6 @@ define(function (require, exports, module) {
809813
* Encapsulate all the logic to talk to the tern module. This will create
810814
* a new instance of a TernModule, which the rest of the hinting code can use to talk
811815
* to the tern node domain, without worrying about initialization, priming the pump, etc.
812-
*
813816
*/
814817
function TernModule() {
815818
var ternPromise = null,
@@ -833,7 +836,7 @@ define(function (require, exports, module) {
833836
/**
834837
* Determine whether the current set of files are using modules to pull in
835838
* additional files.
836-
*
839+
* @private
837840
* @return {boolean} - true if more files than the current directory have
838841
* been read in.
839842
*/
@@ -857,6 +860,7 @@ define(function (require, exports, module) {
857860
/**
858861
* Send a message to the tern node domain - this is only for messages that
859862
* need to be sent before and while the addFilesPromise is being resolved.
863+
* @private
860864
*/
861865
function _postMessageByPass(msg) {
862866
ternPromise.done(function () {
@@ -869,7 +873,7 @@ define(function (require, exports, module) {
869873

870874
/**
871875
* Update tern with the new contents of a given file.
872-
*
876+
* @private
873877
* @param {Document} document - the document to update
874878
* @return {jQuery.Promise} - the promise for the request
875879
*/
@@ -887,7 +891,7 @@ define(function (require, exports, module) {
887891

888892
/**
889893
* Handle a request from the tern node domain for text of a file
890-
*
894+
* @private
891895
* @param {{file:string}} request - the request from the tern node domain. Should be an Object containing the name
892896
* of the file tern wants the contents of
893897
*/
@@ -907,7 +911,7 @@ define(function (require, exports, module) {
907911
* Helper function to get the text of a given document and send it to tern.
908912
* If DocumentManager successfully gets the file's text then we'll send it to the tern node domain.
909913
* The Promise for getDocumentText() is returned so that custom fail functions can be used.
910-
*
914+
* @private
911915
* @param {string} filePath - the path of the file to get the text of
912916
* @return {jQuery.Promise} - the Promise returned from DocumentMangaer.getDocumentText()
913917
*/
@@ -937,6 +941,7 @@ define(function (require, exports, module) {
937941
* name we are looking for. This is so we can find requirejs modules
938942
* when the baseUrl is unknown, or when the project root is not the same
939943
* as the script root (e.g. if you open the 'brackets' dir instead of 'brackets/src' dir).
944+
* @private
940945
*/
941946
function findNameInProject() {
942947
// check for any files in project that end with the right path.
@@ -981,7 +986,7 @@ define(function (require, exports, module) {
981986

982987
/**
983988
* Prime the pump for a fast first lookup.
984-
*
989+
* @private
985990
* @param {string} path - full path of file
986991
* @return {jQuery.Promise} - the promise for the request
987992
*/
@@ -998,7 +1003,7 @@ define(function (require, exports, module) {
9981003
/**
9991004
* Handle the response from the tern node domain when
10001005
* it responds to the prime pump message.
1001-
*
1006+
* @private
10021007
* @param {{path: string, type: string}} response - the response from node domain
10031008
*/
10041009
function handlePrimePumpCompletion(response) {
@@ -1016,7 +1021,7 @@ define(function (require, exports, module) {
10161021
* Add new files to tern, keeping any previous files.
10171022
* The tern server must be initialized before making
10181023
* this call.
1019-
*
1024+
* @private
10201025
* @param {Array.<string>} files - array of file to add to tern.
10211026
* @return {boolean} - true if more files may be added, false if maximum has been reached.
10221027
*/
@@ -1053,7 +1058,7 @@ define(function (require, exports, module) {
10531058
/**
10541059
* Add the files in the directory and subdirectories of a given directory
10551060
* to tern.
1056-
*
1061+
* @private
10571062
* @param {string} dir - the root directory to add.
10581063
* @param {function ()} doneCallback - called when all files have been
10591064
* added to tern.
@@ -1087,6 +1092,7 @@ define(function (require, exports, module) {
10871092

10881093
/**
10891094
* Init the Tern module that does all the code hinting work.
1095+
* @private
10901096
*/
10911097
function initTernModule() {
10921098
let moduleDeferred = $.Deferred();
@@ -1147,6 +1153,7 @@ define(function (require, exports, module) {
11471153

11481154
/**
11491155
* Create a new tern server.
1156+
* @private
11501157
*/
11511158
function initTernServer(dir, files) {
11521159
initTernModule();
@@ -1171,7 +1178,7 @@ define(function (require, exports, module) {
11711178
/**
11721179
* We can skip tern initialization if we are opening a file that has
11731180
* already been added to tern.
1174-
*
1181+
* @private
11751182
* @param {string} newFile - full path of new file being opened in the editor.
11761183
* @return {boolean} - true if tern initialization should be skipped,
11771184
* false otherwise.
@@ -1183,7 +1190,7 @@ define(function (require, exports, module) {
11831190

11841191
/**
11851192
* Do the work to initialize a code hinting session.
1186-
*
1193+
* @private
11871194
* @param {Session} session - the active hinting session (TODO: currently unused)
11881195
* @param {!Document} document - the document the editor has changed to
11891196
* @param {?Document} previousDocument - the document the editor has changed from
@@ -1314,6 +1321,7 @@ define(function (require, exports, module) {
13141321
*
13151322
* We can clean up the node tern server we use to calculate hints now, since
13161323
* we know we will need to re-init it in any new project that is opened.
1324+
* @private
13171325
*/
13181326
function resetModule() {
13191327
function resetTernServer() {
@@ -1354,7 +1362,7 @@ define(function (require, exports, module) {
13541362
* ```
13551363
* This function is also used in unit testing with the "force" flag to
13561364
* reset the module for each test to start with a clean environment.
1357-
*
1365+
* @private
13581366
* @param {Session} session
13591367
* @param {Document} document
13601368
* @param {boolean} force true to force a reset regardless of how long since the last one
@@ -1472,6 +1480,7 @@ define(function (require, exports, module) {
14721480
* Track the update area of the current document so we can tell if we can send
14731481
* partial updates to tern or not.
14741482
* @param {{from: {line: number, ch: number}, to: {line: number, ch: number}, text: string[]}} changeList - The document changes from the current change event
1483+
* @private
14751484
*/
14761485
function trackChange(changeList) {
14771486
var changed = documentChanges, i;
@@ -1499,11 +1508,11 @@ define(function (require, exports, module) {
14991508
}
15001509
}
15011510

1502-
/*
1511+
/**
15031512
* Called each time the file associated with the active editor changes.
15041513
* Marks the file as being dirty.
15051514
*
1506-
* @param {from: {line:number, ch: number}, to: {line:number, ch: number}}
1515+
* @param {{line:number, ch: number}} changeList {from: {line:number, ch: number}, to: {line:number, ch:number}}
15071516
*/
15081517
function handleFileChange(changeList) {
15091518
isDocumentDirty = true;
@@ -1547,7 +1556,10 @@ define(function (require, exports, module) {
15471556
initPreferences(projectRootPath);
15481557
}
15491558

1550-
/** Used to avoid timing bugs in unit tests */
1559+
/**
1560+
* Used to avoid timing bugs in unit tests
1561+
* @private
1562+
*/
15511563
function _readyPromise() {
15521564
return deferredPreferences;
15531565
}

0 commit comments

Comments
 (0)