Skip to content

Commit 858fdaa

Browse files
committed
docs: add required files to API docs
1 parent cde1a6f commit 858fdaa

File tree

10 files changed

+448
-15
lines changed

10 files changed

+448
-15
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Import :
2+
```js
3+
const PriorityBasedRegistration = brackets.getModule("features/PriorityBasedRegistration")
4+
```
5+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
### Import :
2+
```js
3+
const FileSystemError = brackets.getModule("filesystem/FileSystemError")
4+
```
5+
6+
<a name="FileSystemError FileSystemError
7+
8+
9+
FileSystemError describes the errors that can occur when using the FileSystem, File,
10+
and Directory modules.
11+
12+
Error values are strings. Any falsy value_ null, undefined or means no error.
13+
14+
Enumerated File System Errors
15+
```js
16+
UNKNOWN_ Unknown,
17+
INVALID_PARAMS_ InvalidParams,
18+
NOT_FOUND_ NotFound,
19+
NOT_READABLE_ NotReadable,
20+
UNSUPPORTED_ENCODING_ UnsupportedEncoding,
21+
NOT_SUPPORTED_ NotSupported,
22+
NOT_WRITABLE_ NotWritable,
23+
OUT_OF_SPACE_ OutOfSpace,
24+
TOO_MANY_ENTRIES_ TooManyEntries,
25+
ALREADY_EXISTS_ AlreadyExists,
26+
CONTENTS_MODIFIED_ ContentsModified,
27+
ROOT_NOT_WATCHED_ RootNotBeingWatched,
28+
EXCEEDS_MAX_FILE_SIZE_ ExceedsMaxFileSize,
29+
NETWORK_DRIVE_NOT_SUPPORTED_ NetworkDriveNotSupported,
30+
ENCODE_FILE_FAILED_ EncodeFileFailed,
31+
DECODE_FILE_FAILED_ DecodeFileFailed,
32+
UNSUPPORTED_UTF16_ENCODING_ UnsupportedUTF16Encoding
33+
```module_"></a>
34+
35+
## FileSystemError FileSystemError
36+
37+
38+
FileSystemError describes the errors that can occur when using the FileSystem, File,
39+
and Directory modules.
40+
41+
Error values are strings. Any falsy value: null, undefined or means no error.
42+
43+
Enumerated File System Errors
44+
```js
45+
UNKNOWN: Unknown,
46+
INVALID\_PARAMS: InvalidParams,
47+
NOT\_FOUND: NotFound,
48+
NOT\_READABLE: NotReadable,
49+
UNSUPPORTED\_ENCODING: UnsupportedEncoding,
50+
NOT\_SUPPORTED: NotSupported,
51+
NOT\_WRITABLE: NotWritable,
52+
OUT\_OF\_SPACE: OutOfSpace,
53+
TOO\_MANY\_ENTRIES: TooManyEntries,
54+
ALREADY\_EXISTS: AlreadyExists,
55+
CONTENTS\_MODIFIED: ContentsModified,
56+
ROOT\_NOT\_WATCHED: RootNotBeingWatched,
57+
EXCEEDS\_MAX\_FILE\_SIZE: ExceedsMaxFileSize,
58+
NETWORK\_DRIVE\_NOT\_SUPPORTED: NetworkDriveNotSupported,
59+
ENCODE\_FILE\_FAILED: EncodeFileFailed,
60+
DECODE\_FILE\_FAILED: DecodeFileFailed,
61+
UNSUPPORTED\_UTF16\_ENCODING: UnsupportedUTF16Encoding
62+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
### Import :
2+
```js
3+
const FileSystemStats = brackets.getModule("filesystem/FileSystemStats")
4+
```
5+
6+
<a name="FileSystemStats"></a>
7+
8+
## FileSystemStats
9+
**Kind**: global class
10+
<a name="new_FileSystemStats_new"></a>
11+
12+
### new FileSystemStats(options)
13+
The FileSystemStats represents a particular FileSystemEntry's stats.
14+
15+
16+
| Param | Type |
17+
| --- | --- |
18+
| options | <code>Object</code> |
19+
20+
<a name="isFile"></a>
21+
22+
## isFile : <code>boolean</code>
23+
Whether or not this is a stats object for a file
24+
25+
**Kind**: global variable
26+
<a name="isDirectory"></a>
27+
28+
## isDirectory : <code>boolean</code>
29+
Whether or not this is a stats object for a directory
30+
31+
**Kind**: global variable
32+
<a name="mtime"></a>
33+
34+
## mtime : <code>Date</code>
35+
Modification time for a file
36+
37+
**Kind**: global variable
38+
<a name="size"></a>
39+
40+
## size : <code>Number</code>
41+
Size in bytes of a file
42+
43+
**Kind**: global variable
44+
<a name="realPath"></a>
45+
46+
## realPath : <code>string</code>
47+
The canonical path of this file or directory ONLY if it is a symbolic link,
48+
and null otherwise.
49+
50+
**Kind**: global variable
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
### Import :
2+
```js
3+
const RemoteFile = brackets.getModule("filesystem/RemoteFile")
4+
```
5+
6+
<a name="RemoteFile"></a>
7+
8+
## RemoteFile
9+
**Kind**: global class
10+
11+
* [RemoteFile](#RemoteFile)
12+
* [new RemoteFile(fullPath, fileSystem)](#new_RemoteFile_new)
13+
* [.toString()](#RemoteFile+toString)
14+
* [.stat(callback)](#RemoteFile+stat)
15+
* [.read([options], callback)](#RemoteFile+read)
16+
* [.write(data, [options], [callback])](#RemoteFile+write)
17+
* [.exists(callback)](#RemoteFile+exists)
18+
* [.unlink(callback)](#RemoteFile+unlink)
19+
* [.rename(callback)](#RemoteFile+rename)
20+
* [.moveToTrash(callback)](#RemoteFile+moveToTrash)
21+
22+
<a name="new_RemoteFile_new"></a>
23+
24+
### new RemoteFile(fullPath, fileSystem)
25+
Model for a RemoteFile.
26+
27+
This class should *not* be instantiated directly. Use FileSystem.getFileForPath
28+
29+
See the FileSystem class for more details.
30+
31+
32+
| Param | Type | Description |
33+
| --- | --- | --- |
34+
| fullPath | <code>string</code> | The full path for this File. |
35+
| fileSystem | <code>FileSystem</code> | The file system associated with this File. |
36+
37+
<a name="RemoteFile+toString"></a>
38+
39+
### remoteFile.toString()
40+
Helpful toString for debugging and equality check purposes
41+
42+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
43+
<a name="RemoteFile+stat"></a>
44+
45+
### remoteFile.stat(callback)
46+
Returns the stats for the remote entry.
47+
48+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
49+
50+
| Param | Type | Description |
51+
| --- | --- | --- |
52+
| callback | <code>function</code> | Callback with a FileSystemError string or FileSystemStats object. |
53+
54+
<a name="RemoteFile+read"></a>
55+
56+
### remoteFile.read([options], callback)
57+
Reads a remote file.
58+
59+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
60+
61+
| Param | Type | Description |
62+
| --- | --- | --- |
63+
| [options] | <code>Object</code> | Currently unused. |
64+
| callback | <code>function</code> | Callback that is passed the FileSystemError string or the file's contents and its stats. |
65+
66+
<a name="RemoteFile+write"></a>
67+
68+
### remoteFile.write(data, [options], [callback])
69+
Write a file.
70+
71+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
72+
73+
| Param | Type | Description |
74+
| --- | --- | --- |
75+
| data | <code>string</code> | Data to write. |
76+
| [options] | <code>object</code> | Currently unused. |
77+
| [callback] | <code>function</code> | Callback that is passed the FileSystemError string or the file's new stats. |
78+
79+
<a name="RemoteFile+exists"></a>
80+
81+
### remoteFile.exists(callback)
82+
Check if the remote file exists or not
83+
84+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
85+
86+
| Param | Type |
87+
| --- | --- |
88+
| callback | <code>function</code> |
89+
90+
<a name="RemoteFile+unlink"></a>
91+
92+
### remoteFile.unlink(callback)
93+
Unlink the remote file
94+
95+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
96+
97+
| Param | Type |
98+
| --- | --- |
99+
| callback | <code>function</code> |
100+
101+
<a name="RemoteFile+rename"></a>
102+
103+
### remoteFile.rename(callback)
104+
Rename the remote file
105+
106+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
107+
108+
| Param | Type |
109+
| --- | --- |
110+
| callback | <code>function</code> |
111+
112+
<a name="RemoteFile+moveToTrash"></a>
113+
114+
### remoteFile.moveToTrash(callback)
115+
Move the remote file to trash
116+
117+
**Kind**: instance method of [<code>RemoteFile</code>](#RemoteFile)
118+
119+
| Param | Type |
120+
| --- | --- |
121+
| callback | <code>function</code> |
122+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
### Import :
2+
```js
3+
const WatchedRoot = brackets.getModule("filesystem/WatchedRoot")
4+
```
5+
6+
<a name="WatchedRoot"></a>
7+
8+
## WatchedRoot
9+
**Kind**: global class
10+
11+
* [WatchedRoot](#WatchedRoot)
12+
* [new WatchedRoot(entry, filter, filterGitIgnore)](#new_WatchedRoot_new)
13+
* _instance_
14+
* [.entry](#WatchedRoot+entry) : <code>File</code> \| <code>Directory</code>
15+
* [.filter](#WatchedRoot+filter) : <code>function</code>
16+
* [.filterGitIgnore](#WatchedRoot+filterGitIgnore) : <code>string</code> \| <code>Array.&lt;string&gt;</code>
17+
* [.status](#WatchedRoot+status) : <code>number</code>
18+
* _static_
19+
* [.INACTIVE](#WatchedRoot.INACTIVE) : <code>number</code>
20+
* [.STARTING](#WatchedRoot.STARTING) : <code>number</code>
21+
* [.ACTIVE](#WatchedRoot.ACTIVE) : <code>number</code>
22+
23+
<a name="new_WatchedRoot_new"></a>
24+
25+
### new WatchedRoot(entry, filter, filterGitIgnore)
26+
Represents file or directory structure watched by the FileSystem. If the
27+
entry is a directory, all children (that pass the supplied filter function)
28+
are also watched. A WatchedRoot object begins and ends its life in the
29+
INACTIVE state. While in the process of starting up watchers, the WatchedRoot
30+
is in the STARTING state. When watchers are ready, the WatchedRoot enters
31+
the ACTIVE state.
32+
33+
See the FileSystem class for more details.
34+
35+
36+
| Param | Type |
37+
| --- | --- |
38+
| entry | <code>File</code> \| <code>Directory</code> |
39+
| filter | <code>function</code> |
40+
| filterGitIgnore | <code>string</code> \| <code>Array.&lt;string&gt;</code> |
41+
42+
<a name="WatchedRoot+entry"></a>
43+
44+
### watchedRoot.entry : <code>File</code> \| <code>Directory</code>
45+
**Kind**: instance property of [<code>WatchedRoot</code>](#WatchedRoot)
46+
<a name="WatchedRoot+filter"></a>
47+
48+
### watchedRoot.filter : <code>function</code>
49+
**Kind**: instance property of [<code>WatchedRoot</code>](#WatchedRoot)
50+
<a name="WatchedRoot+filterGitIgnore"></a>
51+
52+
### watchedRoot.filterGitIgnore : <code>string</code> \| <code>Array.&lt;string&gt;</code>
53+
**Kind**: instance property of [<code>WatchedRoot</code>](#WatchedRoot)
54+
<a name="WatchedRoot+status"></a>
55+
56+
### watchedRoot.status : <code>number</code>
57+
**Kind**: instance property of [<code>WatchedRoot</code>](#WatchedRoot)
58+
<a name="WatchedRoot.INACTIVE"></a>
59+
60+
### WatchedRoot.INACTIVE : <code>number</code>
61+
WatchedRoot inactive
62+
63+
**Kind**: static constant of [<code>WatchedRoot</code>](#WatchedRoot)
64+
<a name="WatchedRoot.STARTING"></a>
65+
66+
### WatchedRoot.STARTING : <code>number</code>
67+
WatchedRoot starting
68+
69+
**Kind**: static constant of [<code>WatchedRoot</code>](#WatchedRoot)
70+
<a name="WatchedRoot.ACTIVE"></a>
71+
72+
### WatchedRoot.ACTIVE : <code>number</code>
73+
WatchedRoot active
74+
75+
**Kind**: static constant of [<code>WatchedRoot</code>](#WatchedRoot)

src/features/PriorityBasedRegistration.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@
2222
*/
2323

2424
/* eslint-disable indent */
25+
26+
// @INCLUDE_IN_API_DOCS
27+
2528
define(function (require, exports, module) {
2629

2730

2831
var PreferencesManager = require("preferences/PreferencesManager");
2932

3033
/**
3134
* Comparator to sort providers from high to low priority
35+
* @private
3236
*/
3337
function _providerSort(a, b) {
3438
return b.priority - a.priority;
@@ -108,6 +112,13 @@ define(function (require, exports, module) {
108112
};
109113

110114

115+
/**
116+
* Gets the list of providers for a specific language ID, including global providers.
117+
* Filters out providers that are disabled in the preferences.
118+
*
119+
* @param {string} languageId language ID for which to get the providers
120+
* @return {Array.<Object>} sorted list of active providers for given language
121+
*/
111122
RegistrationHandler.prototype.getProvidersForLanguageId = function (languageId) {
112123
var providers = (this._providers[languageId] || []).concat(this._providers.all || [])
113124
.sort(_providerSort);

src/filesystem/FileSystemError.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,39 @@
1919
*
2020
*/
2121

22-
/**
23-
* FileSystemError describes the errors that can occur when using the FileSystem, File,
24-
* and Directory modules.
25-
*
26-
* Error values are strings. Any "falsy" value: null, undefined or "" means "no error".
27-
*/
28-
define(function (require, exports, module) {
22+
// @INCLUDE_IN_API_DOCS
2923

24+
define(function (require, exports, module) {
3025

3126
/**
27+
* @module FileSystemError FileSystemError
28+
*
29+
*
30+
* FileSystemError describes the errors that can occur when using the FileSystem, File,
31+
* and Directory modules.
32+
*
33+
* Error values are strings. Any "falsy" value: null, undefined or "" means "no error".
34+
*
3235
* Enumerated File System Errors
33-
* @module
34-
* @enum {string}
36+
* ```js
37+
* UNKNOWN: "Unknown",
38+
* INVALID_PARAMS: "InvalidParams",
39+
* NOT_FOUND: "NotFound",
40+
* NOT_READABLE: "NotReadable",
41+
* UNSUPPORTED_ENCODING: "UnsupportedEncoding",
42+
* NOT_SUPPORTED: "NotSupported",
43+
* NOT_WRITABLE: "NotWritable",
44+
* OUT_OF_SPACE: "OutOfSpace",
45+
* TOO_MANY_ENTRIES: "TooManyEntries",
46+
* ALREADY_EXISTS: "AlreadyExists",
47+
* CONTENTS_MODIFIED: "ContentsModified",
48+
* ROOT_NOT_WATCHED: "RootNotBeingWatched",
49+
* EXCEEDS_MAX_FILE_SIZE: "ExceedsMaxFileSize",
50+
* NETWORK_DRIVE_NOT_SUPPORTED: "NetworkDriveNotSupported",
51+
* ENCODE_FILE_FAILED: "EncodeFileFailed",
52+
* DECODE_FILE_FAILED: "DecodeFileFailed",
53+
* UNSUPPORTED_UTF16_ENCODING: "UnsupportedUTF16Encoding"
54+
* ```
3555
*/
3656
module.exports = {
3757
UNKNOWN: "Unknown",

0 commit comments

Comments
 (0)