@@ -7,7 +7,7 @@ Extensions can register to provide content with `NewFileContentManager.registerC
77
88## Usage
99
10- Let's say whenever a user creates a new js file, we have to prefill the contents to "console.log("hello") "
10+ Let's say whenever a user creates a new js file, we have to prefill the contents to "sample content "
1111
1212``` js
1313const NewFileContentManager = brackets .getModule (" features/NewFileContentManager" );
@@ -17,7 +17,7 @@ NewFileContentManager.registerContentProvider(exports, ["js"], 1);
1717
1818// provide a helpful name for the ContentProvider. This will be useful if you have to debug.
1919exports .CONTENT_PROVIDER_NAME = " extension.someName" ;
20- // now implement the getContent function that will be invoked when ever creates a new empty file.
20+ // now implement the getContent function that will be invoked when ever user creates a new empty file.
2121exports .getContent = function (fullPath ) {
2222 return new Promise ((resolve , reject )=> {
2323 resolve (" sample content" );
@@ -96,10 +96,18 @@ all the content providers. If no text is returned by any providers, it will retu
9696
9797### Parameters
9898
99- * ` fullPath `
99+ * ` fullPath ` ** [ string ] [ 1 ] **
100100
101- Returns ** [ Promise ] [ 1 ] < [ string ] [ 2 ] > ** The text contents
101+ ### Examples
102102
103- [ 1 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
103+ To get the default content given a path
104104
105- [ 2 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
105+ ``` javascript
106+ NewFileContentManager .getInitialContentForFile (" /path/to/file.jsx" );
107+ ```
108+
109+ Returns ** [ Promise] [ 2 ] <[ string] [ 1 ] >** The text contents
110+
111+ [ 1 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
112+
113+ [ 2 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
0 commit comments