Skip to content

Commit a01d549

Browse files
committed
fix(docs): use typedef for execFileWithInput return type to unbreak mdx build
jsdoc-to-markdown copied the inline object return type {code, stdout, stderr} verbatim into the generated heading, and Docusaurus parses md as MDX where a bare {...} is a JSX expression - acorn fails and the docs site build errors out. A named ExecFileResult typedef generates a brace-free linked heading plus a property table. Also picks up the previously uncommitted regenerated docs for WorkingSetView.refreshSelection.
1 parent acd5015 commit a01d549

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

docs/API-Reference/project/WorkingSetView.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
const WorkingSetView = brackets.getModule("project/WorkingSetView")
44
```
55

6+
<a name="refreshSelection"></a>
7+
8+
## refreshSelection()
9+
Recomputes the selection marker of all Pane View List Views and scrolls
10+
the selected item into view. Needed after the working set becomes visible
11+
again, as marker positions computed while it was display:none are all 0.
12+
13+
**Kind**: global function
614
<a name="refresh"></a>
715

816
## refresh()

docs/API-Reference/utils/NodeUtils.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ This is only available in the native app.
123123

124124
<a name="execFileWithInput"></a>
125125

126-
## execFileWithInput(command, [args], [options]) ⇒ <code>Promise.&lt;{code: number, stdout: string, stderr: string}&gt;</code>
126+
## execFileWithInput(command, [args], [options]) ⇒ [<code>Promise.&lt;ExecFileResult&gt;</code>](#ExecFileResult)
127127
Runs an executable with the given args, feeding it text on stdin and capturing its output -
128128
a one-shot filter-style invocation (e.g. `ruff format -` for the Python beautifier). No
129129
shell is involved. Resolves with the exit code rather than rejecting on non-zero, so
@@ -271,3 +271,15 @@ operation - the promise then rejects with a "cancelled" error.
271271
| --- | --- | --- |
272272
| cancel | <code>function</code> | aborts the in-flight operation |
273273

274+
<a name="ExecFileResult"></a>
275+
276+
## ExecFileResult : <code>Object</code>
277+
**Kind**: global typedef
278+
**Properties**
279+
280+
| Name | Type | Description |
281+
| --- | --- | --- |
282+
| code | <code>number</code> | the process's exit code |
283+
| stdout | <code>string</code> | |
284+
| stderr | <code>string</code> | |
285+

src/utils/NodeUtils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ define(function (require, exports, module) {
233233
return utilsConnector.execPeer("setExecutableBits", {filePath});
234234
}
235235

236+
/**
237+
* @typedef {Object} ExecFileResult
238+
* @property {number} code - the process's exit code
239+
* @property {string} stdout
240+
* @property {string} stderr
241+
*/
242+
236243
/**
237244
* Runs an executable with the given args, feeding it text on stdin and capturing its output -
238245
* a one-shot filter-style invocation (e.g. `ruff format -` for the Python beautifier). No
@@ -246,7 +253,7 @@ define(function (require, exports, module) {
246253
* @param {string} [options.stdinText] - written to the process's stdin, then closed
247254
* @param {string} [options.cwd] - working directory
248255
* @param {number} [options.timeoutMs] - kill the process and reject after this long
249-
* @return {Promise<{code: number, stdout: string, stderr: string}>}
256+
* @return {Promise<ExecFileResult>}
250257
*/
251258
async function execFileWithInput(command, args, options) {
252259
if(!Phoenix.isNativeApp) {

0 commit comments

Comments
 (0)