|
| 1 | +package vscextension.facade |
| 2 | + |
| 3 | +import scala.scalajs.js.annotation.JSImport |
| 4 | +import scala.scalajs.js |
| 5 | + |
| 6 | +import typings.vscode.mod as vscode |
| 7 | +import typings.vscode.mod.Command |
| 8 | +import scala.scalajs.js.Promise |
| 9 | + |
| 10 | +/** a dialog in the editor that users can accept or reject |
| 11 | + * |
| 12 | + * part of the |
| 13 | + * |
| 14 | + * https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts |
| 15 | + */ |
| 16 | + |
| 17 | +object InlineEdit { |
| 18 | + |
| 19 | + @js.native |
| 20 | + @JSImport("vscode", "InlineEdit") |
| 21 | + class InlineEdit extends js.Object { |
| 22 | + def this(text: String, range: vscode.Selection) = this() |
| 23 | + val text: String = js.native |
| 24 | + val range: vscode.Selection = js.native |
| 25 | + |
| 26 | + val showRange: Range = js.native |
| 27 | + val accepted: Command = js.native |
| 28 | + val rejected: Command = js.native |
| 29 | + val shown: Command = js.native |
| 30 | + val commands: Command = js.native |
| 31 | + val action: Command = js.native |
| 32 | + } |
| 33 | + |
| 34 | + @js.native |
| 35 | + trait InlineEditContext extends js.Object { |
| 36 | + val triggerKind: vscode.CodeActionTriggerKind = js.native |
| 37 | + } |
| 38 | + |
| 39 | +// @js.native |
| 40 | + trait InlineEditProvider extends js.Object { |
| 41 | + def provideInlineEdits( |
| 42 | + document: vscode.TextDocument, |
| 43 | + content: InlineEditContext, |
| 44 | + token: vscode.CancellationToken |
| 45 | + ): js.Promise[js.Array[InlineEdit]] |
| 46 | + } |
| 47 | + |
| 48 | + @JSImport("vscode", "languages") |
| 49 | + @js.native |
| 50 | + object languages extends js.Object { |
| 51 | + def registerInlineEditProvider(selector: vscode.DocumentSelector, provider: InlineEditProvider): vscode.Disposable = |
| 52 | + js.native |
| 53 | + } |
| 54 | + |
| 55 | +} |
0 commit comments