Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/API-Reference/JSUtils/Session.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ the "currentIndex" property index of the hint the cursor is on, may be

### session.getJavascriptText() ⇒ <code>String</code>
Get the javascript text of the file open in the editor for this Session.
For a javascript file, this is just the text of the file. For an HTML file,
For a javascript file, this is just the text of the file. For an HTML/PHP file,
this will be only the text in the script tags. This is so that we can pass
just the javascript text to tern, and avoid confusing it with HTML tags, since it
only knows how to parse javascript.
Expand Down
99 changes: 98 additions & 1 deletion docs/API-Reference/features/SelectionViewManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,106 @@ performing any operations.
to be shown to the user. The div contents can be later updated as and when more details are available.
1. Note that the SelectionView could be hidden/removed any time by the SelectionViewManager.
1. If multiple providers returns a valid popup, all of them are displayed.

* [features/SelectionViewManager](#module_features/SelectionViewManager)
* [.getVisibleSelectionBounds(editor, bounds)](#module_features/SelectionViewManager..getVisibleSelectionBounds) ⇒ <code>Object</code> \| <code>null</code>
* [.positionPreview(editor, [refreshBounds])](#module_features/SelectionViewManager..positionPreview)
* [.suspendPreviewLayout()](#module_features/SelectionViewManager..suspendPreviewLayout)
* [.restorePreviewLayout()](#module_features/SelectionViewManager..restorePreviewLayout)
* [.schedulePreviewLayout()](#module_features/SelectionViewManager..schedulePreviewLayout)
* [.onPanelResizeStart(event)](#module_features/SelectionViewManager..onPanelResizeStart)
* [.onPanelResizeEnd(event)](#module_features/SelectionViewManager..onPanelResizeEnd)
* [.showPreview(editor, selectionObj)](#module_features/SelectionViewManager..showPreview) ⇒ <code>Promise.&lt;void&gt;</code>
* [.onEditorScroll()](#module_features/SelectionViewManager..onEditorScroll)
* [.isSelectionViewShown()](#module_features/SelectionViewManager..isSelectionViewShown) ⇒ <code>boolean</code>

<a name="module_features/SelectionViewManager..getVisibleSelectionBounds"></a>

### features/SelectionViewManager.getVisibleSelectionBounds(editor, bounds) ⇒ <code>Object</code> \| <code>null</code>
Measure the visible selection highlights, including wrapped lines and partial viewport selections.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
**Returns**: <code>Object</code> \| <code>null</code> - Visible bounds and highlight rectangles, or null when none are visible.

| Param | Type | Description |
| --- | --- | --- |
| editor | <code>Editor</code> | Editor containing the selection. |
| bounds | <code>Object</code> | Visible editor bounds in window coordinates. |

<a name="module_features/SelectionViewManager..positionPreview"></a>

### features/SelectionViewManager.positionPreview(editor, [refreshBounds])
Prefer below-right, then above-right, and overlap only when no outside placement fits.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)

| Param | Type | Description |
| --- | --- | --- |
| editor | <code>Editor</code> | Editor whose visible bounds constrain the popup. |
| [refreshBounds] | <code>boolean</code> | Remeasure selection highlights after an editor layout change. |

<a name="module_features/SelectionViewManager..suspendPreviewLayout"></a>

### features/SelectionViewManager.suspendPreviewLayout()
Hide the popup without discarding its controls, and cancel any pending layout measurements.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
<a name="module_features/SelectionViewManager..restorePreviewLayout"></a>

### features/SelectionViewManager.restorePreviewLayout()
Remeasure once after resizing finishes, then reveal the existing popup at its new position.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
<a name="module_features/SelectionViewManager..schedulePreviewLayout"></a>

### features/SelectionViewManager.schedulePreviewLayout()
Wait for layout events to settle when there is no explicit panel-resize lifecycle.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
<a name="module_features/SelectionViewManager..onPanelResizeStart"></a>

### features/SelectionViewManager.onPanelResizeStart(event)
Suspend positioning throughout a panel drag, including any forwarded resize events.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)

| Param | Type | Description |
| --- | --- | --- |
| event | <code>jQuery.Event</code> | Resize-start event whose target identifies the resizing panel. |

<a name="module_features/SelectionViewManager..onPanelResizeEnd"></a>

### features/SelectionViewManager.onPanelResizeEnd(event)
Restore the popup after all panels participating in the drag have finished resizing.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)

| Param | Type | Description |
| --- | --- | --- |
| event | <code>jQuery.Event</code> | Resize-end event for the panel that finished resizing. |

<a name="module_features/SelectionViewManager..showPreview"></a>

### features/SelectionViewManager.showPreview(editor, selectionObj) ⇒ <code>Promise.&lt;void&gt;</code>
Render only the latest provider result; dismissed requests cannot reopen the popup.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
**Returns**: <code>Promise.&lt;void&gt;</code> - Resolves after the provider results have been considered.

| Param | Type | Description |
| --- | --- | --- |
| editor | <code>Editor</code> | Editor providing the selected text. |
| selectionObj | <code>Array.&lt;Object&gt;</code> | Selected ranges supplied to providers. |

<a name="module_features/SelectionViewManager..onEditorScroll"></a>

### features/SelectionViewManager.onEditorScroll()
Dismiss on editor viewport scrolling, except while workspace layout is being restored.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
<a name="module_features/SelectionViewManager..isSelectionViewShown"></a>

### features/SelectionViewManager.isSelectionViewShown() ⇒ <code>boolean</code>
If quickview is displayed and visible on screen
Whether the selection popup is visible, excluding temporary suspension during layout changes.

**Kind**: inner method of [<code>features/SelectionViewManager</code>](#module_features/SelectionViewManager)
29 changes: 20 additions & 9 deletions docs/API-Reference/language/CodeInspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,11 @@ Scrolls to the problem line

<a name="run"></a>

## run(providerName)
Run inspector applicable to current document. Updates status bar indicator and refreshes error list in
bottom panel. Does not run if inspection is disabled or if a providerName is given and does not
match the current doc's provider name.
## run()
Run inspectors for the current document and publish results from the latest unchanged scan.
Does not scan while inspection is disabled. Keeps valid fixes available until a current scan replaces them.

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| providerName | <code>string</code> | name of the provider that is requesting a run |

<a name="toggleEnabled"></a>

## toggleEnabled(enabled, doNotSave)
Expand All @@ -134,6 +128,23 @@ Enable or disable all inspection.
| enabled | <code>boolean</code> | Enabled state. If omitted, the state is toggled. |
| doNotSave | <code>boolean</code> | true if the preference should not be saved to user settings. This is generally for events triggered by project-level settings. |

<a name="_fixProblem"></a>

## \_fixProblem(fixID)
Apply one fix if its document and text still match the displayed inspection results.

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| fixID | <code>string</code> | ID assigned to the displayed fix. |

<a name="_fixAllProblems"></a>

## \_fixAllProblems()
Apply all displayed fixes only to the document version that was inspected.

**Kind**: global function
<a name="Error"></a>

## Error : <code>Object</code>
Expand Down
14 changes: 14 additions & 0 deletions docs/API-Reference/project/ProjectManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,20 @@ path lies outside the project, or if it doesn't exist.
| --- | --- | --- |
| entry | <code>File</code> \| <code>Directory</code> | File or Directory to show |

<a name="isInFileTree"></a>

## isInFileTree(fullPath) ⇒ <code>boolean</code>
Whether the file tree currently has a node for the path. A file written outside the
FileSystem API is not in the tree until the watcher or a refresh adds it, and a file in a
folder that was never expanded is not in it either; `showInTree` expands the folders first.

**Kind**: global function
**Returns**: <code>boolean</code> - true if the tree has the node

| Param | Type | Description |
| --- | --- | --- |
| fullPath | <code>string</code> | Absolute path of a file or folder |

<a name="openProject"></a>

## openProject([path]) ⇒ <code>$.Promise</code>
Expand Down
35 changes: 35 additions & 0 deletions docs/API-Reference/utils/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Removes all pending promises from the queue.
Value passed to fail() handlers that have been triggered due to withTimeout()'s timeout

**Kind**: global variable
<a name="RETRY_DEFAULT_DELAYS_MS"></a>

## RETRY\_DEFAULT\_DELAYS\_MS
The waits retry() puts between attempts when none are given: 5 s, 15 s, 30 s, 60 s.

**Kind**: global constant
<a name="doInParallel"></a>

## doInParallel(items, beginProcessItem, failFast) ⇒ <code>$.Promise</code>
Expand Down Expand Up @@ -205,6 +211,35 @@ fail() (with Async.ERROR_TIMEOUT) is called based on value of resolveTimeout.
| timeout | <code>number</code> | |
| [resolveTimeout] | <code>boolean</code> | If true, then resolve deferred on timeout, otherwise reject. Default is false. |

<a name="retry"></a>

## retry(operation, [options]) ⇒ <code>Promise</code>
Runs an operation again when it fails, waiting longer before each retry. Meant for calls
that may hit a network blip or a service that is restarting: the first retry is quick and
the later ones are spaced out, so a short outage is ridden out without hammering the other
side. Each wait is jittered so many clients recovering at once do not retry in step.

The operation is called with the attempt number, starting at 1, and returns a Promise (a
plain value or another thenable, such as a jQuery promise, is adopted with Promise.resolve).
A thrown error or a rejection counts as a failure. Always returns a native Promise: it
resolves with the first successful value and rejects with the last failure once the attempts
are used up, or as soon as `shouldRetry` says a failure is not worth retrying, or when the
signal aborts.

**Kind**: global function

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| operation | <code>function</code> | | called with the attempt number (1-based) |
| [options] | <code>Object</code> | | |
| [options.attempts] | <code>number</code> | <code>5</code> | how many times to try in all, the first included |
| [options.delaysMs] | <code>number</code> \| <code>Array.&lt;number&gt;</code> | <code>[5000, 15000, 30000, 60000]</code> | the wait before each retry. A number is a fixed wait; an array gives the waits in order, and its last value repeats when there are more retries than entries. |
| [options.jitter] | <code>number</code> | <code>0.25</code> | each wait is varied at random by up to this fraction either way; 0 disables it |
| [options.shouldRetry] | <code>function</code> | | given the failure and the attempt that failed; return false to stop at once. Every failure is retried by default. |
| [options.onRetry] | <code>function</code> | | told the failure, the attempt that failed and the wait in ms before each retry, for logging |
| [options.timeoutMs] | <code>number</code> | | a cap on each attempt; one that runs longer fails with Async.ERROR_TIMEOUT and is retried like any other failure |
| [options.signal] | <code>AbortSignal</code> | | aborting it ends the waiting and rejects with the signal's reason |

<a name="waitForAll"></a>

## waitForAll(promises, [failOnReject], [timeout]) ⇒ <code>$.Promise</code>
Expand Down
8 changes: 4 additions & 4 deletions docs/API-Reference/widgets/NotificationUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ let notification1 = NotificationUI.createFromTemplate(
| title | <code>string</code> | The title for the notification. |
| template | <code>string</code> \| <code>Element</code> | A string template or HTML Element to use as the dialog HTML. |
| [elementID] | <code>String</code> | optional id string if provided will show the notification pointing to the element. If no element is specified, it will be managed as a generic notification. |
| [options] | <code>Object</code> | optional, supported * options are: * `allowedPlacements` - Optional String array with values restricting where the notification will be shown. Values can be a mix of `['top', 'bottom', 'left', 'right']` * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. |
| [options] | <code>Object</code> | optional, supported * options are: * `allowedPlacements` - Optional String array with values restricting where the notification will be shown. Values can be a mix of `['top', 'bottom', 'left', 'right']` * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. The countdown pauses while the mouse is over the notification. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. |

<a name="module_widgets/NotificationUI..createToastFromTemplate"></a>

Expand All @@ -146,7 +146,7 @@ let notification1 = NotificationUI.createToastFromTemplate( "Title here",
| --- | --- | --- |
| title | <code>string</code> | The title for the notification. |
| template | <code>string</code> \| <code>Element</code> | A string template or HTML Element to use as the dialog HTML. |
| [options] | <code>Object</code> | optional, supported * options are: * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. * `instantOpen` - To instantly open the popup without any open animation delays |
| [options] | <code>Object</code> | optional, supported * options are: * `autoCloseTimeS` - Time in seconds after which the notification should be auto closed. Default is never. The countdown pauses while the mouse is over the notification. * `dismissOnClick` - when clicked, the notification is closed. Default is true(dismiss). * `toastStyle` - To style the toast notification for error, warning, info etc. Can be one of `NotificationUI.NOTIFICATION_STYLES_CSS_CLASS.*` or your own css class name. * `instantOpen` - To instantly open the popup without any open animation delays |

<a name="module_widgets/NotificationUI..showToastOn"></a>

Expand All @@ -168,7 +168,7 @@ NotificationUI.showToastOn(document.getElementById("my-panel"), "Hello!", {
| --- | --- | --- |
| containerOrSelector | <code>Element</code> \| <code>string</code> | A DOM element or CSS selector for the parent container. The container should have `position: relative` or `absolute` so the toast is positioned correctly. |
| template | <code>string</code> \| <code>Element</code> | HTML string or DOM Element for the toast content. |
| [options] | <code>Object</code> | optional, supported options: * `autoCloseTimeS` - Time in seconds after which the toast auto-closes. Default is 5. * `dismissOnClick` - If true, clicking the toast dismisses it. Default is true. |
| [options] | <code>Object</code> | optional, supported options: * `autoCloseTimeS` - Time in seconds after which the toast auto-closes. Default is 5. The countdown pauses while the mouse is over the toast. * `dismissOnClick` - If true, clicking the toast dismisses it. Default is true. |

<a name="module_widgets/NotificationUI..showHUD"></a>

Expand All @@ -188,7 +188,7 @@ NotificationUI.showHUD("fa-solid fa-magnifying-glass-plus", "110%");
| --- | --- | --- |
| iconClass | <code>string</code> | Font Awesome class string for the icon (e.g. "fa-solid fa-magnifying-glass-plus"). |
| label | <code>string</code> | Text to display below the icon (e.g. "110%"). |
| [options] | <code>Object</code> | optional, supported options: * `autoCloseTimeS` - Time in seconds after which the HUD auto-closes. Default is 1. |
| [options] | <code>Object</code> | optional, supported options: * `autoCloseTimeS` - Time in seconds after which the HUD auto-closes. Default is 1. The countdown pauses while the mouse is over the HUD. |

<a name="module_widgets/NotificationUI..hideRichTooltip"></a>

Expand Down
Loading
Loading