Skip to content

Commit

Permalink
Add the workspace/foldingRange/refresh method (#1812)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-claeys authored Sep 18, 2023
1 parent b667e73 commit 29aaf34
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _data/linkableTypes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@
link: '#foldingRangeKind'
- type: 'FoldingRange'
link: '#foldingRange'
- type: 'workspace/foldingRange/refresh'
link: '#workspace_foldingRange_refresh'
- type: 'FoldingRangeWorkspaceClientCapabilities'
link: '#foldingRangeWorkspaceClientCapabilities'
- type: 'textDocument/selectionRange'
link: '#textDocument_selectionRange'
- type: 'SelectionRangeClientCapabilities'
Expand Down Expand Up @@ -764,6 +768,8 @@
link: '#inlayHintKind'
- type: 'InlayHintWorkspaceClientCapabilities'
link: '#inlayHintWorkspaceClientCapabilities'
- type: 'workspace/inlayHint/refresh'
link: '#workspace_inlayHint_refresh'
- type: 'InlineValueClientCapabilities'
link: '#inlineValueClientCapabilities'
- type: 'InlineValueOptions'
Expand All @@ -784,6 +790,8 @@
link: '#inlineValue'
- type: 'InlineValueWorkspaceClientCapabilities'
link: '#inlineValueWorkspaceClientCapabilities'
- type: 'workspace/inlineValue/refresh'
link: '#workspace_inlineValue_refresh'
- type: 'NotebookDocument'
link: '#notebookDocument'
- type: 'NotebookCell'
Expand Down Expand Up @@ -866,6 +874,8 @@
link: '#workspaceDocumentDiagnosticReport'
- type: 'WorkspaceDiagnosticReportPartialResult'
link: '#workspaceDiagnosticReportPartialResult'
- type: 'workspace/diagnostic/refresh'
link: '#diagnostic_refresh'
- type: 'textDocument/inlineCompletion'
link: '#textDocument_inlineCompletion'
- type: 'InlineCompletionClientCapabilities'
Expand Down
6 changes: 6 additions & 0 deletions _data/specification-3-18-toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,16 @@
anchor: codeLens_refresh
- title: Folding Range
anchor: textDocument_foldingRange
- title: Folding Range Refresh
anchor: workspace_foldingRange_refresh
- title: Selection Range
anchor: textDocument_selectionRange
- title: Document Symbols
anchor: textDocument_documentSymbol
- title: Semantic Tokens
anchor: textDocument_semanticTokens
- title: Semantic Tokens Refresh
anchor: semanticTokens_refreshRequest
- title: Inline Value
anchor: textDocument_inlineValue
- title: Inline Value Refresh
Expand All @@ -205,6 +209,8 @@
anchor: textDocument_publishDiagnostics
- title: Pull Diagnostics
anchor: textDocument_pullDiagnostics
- title: Diagnostics Refresh
anchor: diagnostic_refresh
- title: Signature Help
anchor: textDocument_signatureHelp
- title: Code Action
Expand Down
41 changes: 41 additions & 0 deletions _specifications/lsp/3.18/language/foldingRange.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,44 @@ export interface FoldingRange {

* partial result: `FoldingRange[]`
* error: code and message set in case an exception happens during the 'textDocument/foldingRange' request

#### <a href="#workspace_foldingRange_refresh" name="workspace_foldingRange_refresh" class="anchor">Folding Range Refresh Request (:arrow_right_hook:)</a>

> *Since version 3.18.0*
The `workspace/foldingRange/refresh` request is sent from the server to the client. Servers can use it to ask clients to refresh the folding ranges currently shown in editors. As a result the client should ask the server to recompute the folding ranges for these editors. This is useful if a server detects a configuration change which requires a re-calculation of all folding ranges. Note that the client still has the freedom to delay the re-calculation of the folding ranges if for example an editor is currently not visible.

_Client Capability_:

* property name (optional): `workspace.foldingRange`
* property type: `FoldingRangeWorkspaceClientCapabilities` defined as follows:

<div class="anchorHolder"><a href="#foldingRangeWorkspaceClientCapabilities" name="foldingRangeWorkspaceClientCapabilities" class="linkableAnchor"></a></div>

```typescript
export interface FoldingRangeWorkspaceClientCapabilities {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
*
* Note that this event is global and will force the client to refresh all
* folding ranges currently shown. It should be used with absolute care and is
* useful for situation where a server for example detect a project wide
* change that requires such a calculation.
*
* @since 3.18.0
* @proposed
*/
refreshSupport?: boolean;
}
```

_Request_:

* method: `workspace/foldingRange/refresh`
* params: none

_Response_:

* result: void
* error: code and message set in case an exception happens during the 'workspace/foldingRange/refresh' request

0 comments on commit 29aaf34

Please sign in to comment.