@codingame/monaco-vscode-api 1.85.0 → 1.85.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/README.md +31 -13
  2. package/contributions.js +1 -0
  3. package/missing-services.js +396 -68
  4. package/monaco-editor-treemending.patch +957 -950
  5. package/package.json +8 -7
  6. package/service-override/tools/editor.js +1 -1
  7. package/services.js +10 -6
  8. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
  9. package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
  10. package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
  11. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +140 -0
  12. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
  13. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
  14. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
  15. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
  16. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
  17. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
  18. package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
  19. package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
  20. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
  21. package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
  22. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
  23. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
  24. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  25. package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
  26. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
  27. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
  28. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
  29. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
  32. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
  47. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
  48. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
  49. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
  50. package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
  51. package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
  52. package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
  53. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
  54. package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
  55. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
  56. package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
  57. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
  58. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
  59. package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
  60. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
  61. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
  62. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
  63. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
  64. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
  65. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
  66. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
  67. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
  68. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
  69. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
  70. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
  71. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
  72. package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
  73. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
  74. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
  75. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
  76. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
  77. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
  78. package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
  79. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
  80. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
  81. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
  82. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
  83. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
  84. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +73 -2
  85. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
  86. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
  87. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
  88. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
  89. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
  90. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
  91. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
  92. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
  93. package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
  94. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
  95. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
  96. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
  97. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
  98. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
  99. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
  100. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
  101. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
  102. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
  103. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
  104. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
  105. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
  106. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
  107. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
  108. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
  109. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
  110. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
  111. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
  112. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
  113. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
  114. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
  115. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
  116. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
  117. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
  118. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
  119. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
  120. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
  121. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
  122. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
  123. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
  132. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
  134. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
  135. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
  136. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
  138. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
  142. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
  144. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
  145. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
  146. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
  147. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
  148. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
  150. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
  175. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
  176. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
  177. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
  180. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
  181. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
  182. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
  183. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
  184. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
  194. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
  195. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
  196. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
  197. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
  198. package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
  199. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
  200. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
  201. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
  202. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
  203. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
  204. package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
  205. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
  206. package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
  207. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
  208. package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
  209. package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
  210. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
  211. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
  212. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
  213. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
  214. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
  215. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
  216. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
  217. package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
  218. package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
  219. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
  220. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
  221. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
  222. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
  223. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
  224. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
  225. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
  226. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
  227. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
  228. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
  229. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
  230. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
  231. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +20 -1
  232. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
  233. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
  234. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
  235. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
  236. package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
  237. package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
  238. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
  239. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
  240. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
  241. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
  242. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
  243. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
  244. package/vscode/src/vs/workbench/services/search/common/search.js +3 -3
  245. package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
  246. package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
  247. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
  248. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
  249. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
  250. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
  251. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
  252. package/assets/break.mp3 +0 -0
  253. package/assets/chatRequestSent.mp3 +0 -0
  254. package/assets/chatResponsePending.mp3 +0 -0
  255. package/assets/chatResponseReceived1.mp3 +0 -0
  256. package/assets/chatResponseReceived2.mp3 +0 -0
  257. package/assets/chatResponseReceived3.mp3 +0 -0
  258. package/assets/chatResponseReceived4.mp3 +0 -0
  259. package/assets/clear.mp3 +0 -0
  260. package/assets/defaultIcon.png +0 -0
  261. package/assets/diffLineDeleted.mp3 +0 -0
  262. package/assets/diffLineInserted.mp3 +0 -0
  263. package/assets/diffLineModified.mp3 +0 -0
  264. package/assets/error.mp3 +0 -0
  265. package/assets/fake.html +0 -10
  266. package/assets/foldedAreas.mp3 +0 -0
  267. package/assets/format.mp3 +0 -0
  268. package/assets/index-no-csp.html +0 -1226
  269. package/assets/index.html +0 -1227
  270. package/assets/quickFixes.mp3 +0 -0
  271. package/assets/save.mp3 +0 -0
  272. package/assets/service-worker.js +0 -457
  273. package/assets/taskCompleted.mp3 +0 -0
  274. package/assets/taskFailed.mp3 +0 -0
  275. package/assets/terminalBell.mp3 +0 -0
  276. package/assets/warning.mp3 +0 -0
  277. package/assets/webWorkerExtensionHostIframe.html +0 -123
  278. package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
  279. package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
  280. package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
  281. package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
  282. package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
  283. package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
  284. package/vscode/src/vs/platform/url/common/urlService.js +0 -17
  285. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
  286. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
  287. package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
  288. package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
  289. package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
  290. package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
  291. package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
  292. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
  293. package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
  294. package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
  295. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
  296. package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
  297. package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
  298. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
@@ -0,0 +1,1942 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import './media/tunnelView.css.js';
3
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
4
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
5
+ import { IViewsService, IViewDescriptorService } from '../../../common/views.js';
6
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
7
+ import { IContextViewService, IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
8
+ import { ContextKeyExpr, RawContextKey, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
9
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
10
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
11
+ import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
12
+ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
13
+ import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
14
+ import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
15
+ import { DisposableStore, toDisposable, Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
16
+ import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
17
+ import { IconLabel } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js';
18
+ import { ActionRunner } from 'monaco-editor/esm/vs/base/common/actions.js';
19
+ import { MenuId, MenuRegistry, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
20
+ import { createAndFillInActionBarActions, createActionViewItem } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
21
+ import { TUNNEL_VIEW_ID, TunnelType, IRemoteExplorerService, TunnelEditId } from '../../../services/remote/common/remoteExplorerService.js';
22
+ import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
23
+ import { INotificationService, Severity } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
24
+ import { InputBox } from 'monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js';
25
+ import { createSingleCallFunction } from 'monaco-editor/esm/vs/base/common/functional.js';
26
+ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
27
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
28
+ import { ViewPane } from '../../../browser/parts/views/viewPane.js';
29
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
30
+ import { TunnelProtocol, TunnelPrivacyId, ITunnelService, isLocalhost, isAllInterfaces } from '../../../../platform/tunnel/common/tunnel.js';
31
+ import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
32
+ import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
33
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
34
+ import { ActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
35
+ import { labelPortIcon, forwardPortIcon, stopForwardIcon, copyAddressIcon, openBrowserIcon, openPreviewIcon, privatePortIcon, forwardedPortWithProcessIcon, forwardedPortWithoutProcessIcon, portsViewIcon } from './remoteIcons.js';
36
+ import { IExternalUriOpenerService } from '../../externalUriOpener/common/externalUriOpenerService.js';
37
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
38
+ import { isMacintosh } from 'monaco-editor/esm/vs/base/common/platform.js';
39
+ import { WorkbenchTable } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
40
+ import { Button } from 'monaco-editor/esm/vs/base/browser/ui/button/button.js';
41
+ import { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
42
+ import { MarkdownString } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
43
+ import { IHoverService } from '../../../services/hover/browser/hover.js';
44
+ import { STATUS_BAR_REMOTE_ITEM_BACKGROUND } from '../../../common/theme.js';
45
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
46
+ import { defaultButtonStyles, defaultInputBoxStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
47
+ import { makeAddress, forwardedPortsViewEnabled, parseAddress, TunnelCloseReason, mapHasAddressLocalhostOrAllInterfaces, TunnelSource } from '../../../services/remote/common/tunnelModel.js';
48
+ var TunnelPanel_1;
49
+ const openPreviewEnabledContext = ( new RawContextKey('openPreviewEnabled', false));
50
+ class TunnelTreeVirtualDelegate {
51
+ constructor(remoteExplorerService) {
52
+ this.remoteExplorerService = remoteExplorerService;
53
+ this.headerRowHeight = 22;
54
+ }
55
+ getHeight(row) {
56
+ return (row.tunnelType === TunnelType.Add && !this.remoteExplorerService.getEditableData(undefined)) ? 30 : 22;
57
+ }
58
+ }
59
+ let TunnelViewModel = class TunnelViewModel {
60
+ constructor(remoteExplorerService, tunnelService) {
61
+ this.remoteExplorerService = remoteExplorerService;
62
+ this.tunnelService = tunnelService;
63
+ this._candidates = ( new Map());
64
+ this.input = {
65
+ label: ( nls.localizeWithPath(
66
+ 'vs/workbench/contrib/remote/browser/tunnelView',
67
+ 'remote.tunnelsView.addPort',
68
+ "Add Port"
69
+ )),
70
+ icon: undefined,
71
+ tunnelType: TunnelType.Add,
72
+ hasRunningProcess: false,
73
+ remoteHost: '',
74
+ remotePort: 0,
75
+ processDescription: '',
76
+ tooltipPostfix: '',
77
+ iconTooltip: '',
78
+ portTooltip: '',
79
+ processTooltip: '',
80
+ originTooltip: '',
81
+ privacyTooltip: '',
82
+ source: { source: TunnelSource.User, description: '' },
83
+ protocol: TunnelProtocol.Http,
84
+ privacy: {
85
+ id: TunnelPrivacyId.Private,
86
+ themeIcon: privatePortIcon.id,
87
+ label: ( nls.localizeWithPath(
88
+ 'vs/workbench/contrib/remote/browser/tunnelView',
89
+ 'tunnelPrivacy.private',
90
+ "Private"
91
+ ))
92
+ },
93
+ strip: () => undefined
94
+ };
95
+ this.model = remoteExplorerService.tunnelModel;
96
+ this.onForwardedPortsChanged = Event.any(this.model.onForwardPort, this.model.onClosePort, this.model.onPortName, this.model.onCandidatesChanged);
97
+ }
98
+ get all() {
99
+ const result = [];
100
+ this._candidates = ( new Map());
101
+ this.model.candidates.forEach(candidate => {
102
+ this._candidates.set(makeAddress(candidate.host, candidate.port), candidate);
103
+ });
104
+ if ((this.model.forwarded.size > 0) || this.remoteExplorerService.getEditableData(undefined)) {
105
+ result.push(...this.forwarded);
106
+ }
107
+ if (this.model.detected.size > 0) {
108
+ result.push(...this.detected);
109
+ }
110
+ result.push(this.input);
111
+ return result;
112
+ }
113
+ addProcessInfoFromCandidate(tunnelItem) {
114
+ const key = makeAddress(tunnelItem.remoteHost, tunnelItem.remotePort);
115
+ if (( this._candidates.has(key))) {
116
+ tunnelItem.processDescription = this._candidates.get(key).detail;
117
+ }
118
+ }
119
+ get forwarded() {
120
+ const forwarded = ( Array.from(( this.model.forwarded.values())).map(tunnel => {
121
+ const tunnelItem = TunnelItem.createFromTunnel(this.remoteExplorerService, this.tunnelService, tunnel);
122
+ this.addProcessInfoFromCandidate(tunnelItem);
123
+ return tunnelItem;
124
+ })).sort((a, b) => {
125
+ if (a.remotePort === b.remotePort) {
126
+ return a.remoteHost < b.remoteHost ? -1 : 1;
127
+ }
128
+ else {
129
+ return a.remotePort < b.remotePort ? -1 : 1;
130
+ }
131
+ });
132
+ return forwarded;
133
+ }
134
+ get detected() {
135
+ return ( Array.from(( this.model.detected.values())).map(tunnel => {
136
+ const tunnelItem = TunnelItem.createFromTunnel(this.remoteExplorerService, this.tunnelService, tunnel, TunnelType.Detected, false);
137
+ this.addProcessInfoFromCandidate(tunnelItem);
138
+ return tunnelItem;
139
+ }));
140
+ }
141
+ isEmpty() {
142
+ return (this.detected.length === 0) &&
143
+ ((this.forwarded.length === 0) || (this.forwarded.length === 1 &&
144
+ (this.forwarded[0].tunnelType === TunnelType.Add) && !this.remoteExplorerService.getEditableData(undefined)));
145
+ }
146
+ };
147
+ TunnelViewModel = ( __decorate([
148
+ ( __param(0, IRemoteExplorerService)),
149
+ ( __param(1, ITunnelService))
150
+ ], TunnelViewModel));
151
+ function emptyCell(item) {
152
+ return { label: '', tunnel: item, editId: TunnelEditId.None, tooltip: '' };
153
+ }
154
+ class IconColumn {
155
+ constructor() {
156
+ this.label = '';
157
+ this.tooltip = '';
158
+ this.weight = 1;
159
+ this.minimumWidth = 40;
160
+ this.maximumWidth = 40;
161
+ this.templateId = 'actionbar';
162
+ }
163
+ project(row) {
164
+ if (row.tunnelType === TunnelType.Add) {
165
+ return emptyCell(row);
166
+ }
167
+ const icon = row.processDescription ? forwardedPortWithProcessIcon : forwardedPortWithoutProcessIcon;
168
+ let tooltip = '';
169
+ if (row instanceof TunnelItem) {
170
+ tooltip = `${row.iconTooltip} ${row.tooltipPostfix}`;
171
+ }
172
+ return {
173
+ label: '', icon, tunnel: row, editId: TunnelEditId.None, tooltip
174
+ };
175
+ }
176
+ }
177
+ class PortColumn {
178
+ constructor() {
179
+ this.label = ( nls.localizeWithPath(
180
+ 'vs/workbench/contrib/remote/browser/tunnelView',
181
+ 'tunnel.portColumn.label',
182
+ "Port"
183
+ ));
184
+ this.tooltip = ( nls.localizeWithPath(
185
+ 'vs/workbench/contrib/remote/browser/tunnelView',
186
+ 'tunnel.portColumn.tooltip',
187
+ "The label and remote port number of the forwarded port."
188
+ ));
189
+ this.weight = 1;
190
+ this.templateId = 'actionbar';
191
+ }
192
+ project(row) {
193
+ const isAdd = row.tunnelType === TunnelType.Add;
194
+ const label = row.label;
195
+ let tooltip = '';
196
+ if (row instanceof TunnelItem && !isAdd) {
197
+ tooltip = `${row.portTooltip} ${row.tooltipPostfix}`;
198
+ }
199
+ else {
200
+ tooltip = label;
201
+ }
202
+ return {
203
+ label, tunnel: row, menuId: MenuId.TunnelPortInline,
204
+ editId: row.tunnelType === TunnelType.Add ? TunnelEditId.New : TunnelEditId.Label, tooltip
205
+ };
206
+ }
207
+ }
208
+ class LocalAddressColumn {
209
+ constructor() {
210
+ this.label = ( nls.localizeWithPath(
211
+ 'vs/workbench/contrib/remote/browser/tunnelView',
212
+ 'tunnel.addressColumn.label',
213
+ "Forwarded Address"
214
+ ));
215
+ this.tooltip = ( nls.localizeWithPath(
216
+ 'vs/workbench/contrib/remote/browser/tunnelView',
217
+ 'tunnel.addressColumn.tooltip',
218
+ "The address that the forwarded port is available at."
219
+ ));
220
+ this.weight = 1;
221
+ this.templateId = 'actionbar';
222
+ }
223
+ project(row) {
224
+ if (row.tunnelType === TunnelType.Add) {
225
+ return emptyCell(row);
226
+ }
227
+ const label = row.localAddress ?? '';
228
+ let tooltip = label;
229
+ if (row instanceof TunnelItem) {
230
+ tooltip = row.tooltipPostfix;
231
+ }
232
+ return {
233
+ label,
234
+ menuId: MenuId.TunnelLocalAddressInline,
235
+ tunnel: row,
236
+ editId: TunnelEditId.LocalPort,
237
+ tooltip,
238
+ markdownTooltip: label ? LocalAddressColumn.getHoverText(label) : undefined
239
+ };
240
+ }
241
+ static getHoverText(localAddress) {
242
+ return function (configurationService) {
243
+ const editorConf = configurationService.getValue('editor');
244
+ let clickLabel = '';
245
+ if (editorConf.multiCursorModifier === 'ctrlCmd') {
246
+ if (isMacintosh) {
247
+ clickLabel = ( nls.localizeWithPath(
248
+ 'vs/workbench/contrib/remote/browser/tunnelView',
249
+ 'portsLink.followLinkAlt.mac',
250
+ "option + click"
251
+ ));
252
+ }
253
+ else {
254
+ clickLabel = ( nls.localizeWithPath(
255
+ 'vs/workbench/contrib/remote/browser/tunnelView',
256
+ 'portsLink.followLinkAlt',
257
+ "alt + click"
258
+ ));
259
+ }
260
+ }
261
+ else {
262
+ if (isMacintosh) {
263
+ clickLabel = ( nls.localizeWithPath(
264
+ 'vs/workbench/contrib/remote/browser/tunnelView',
265
+ 'portsLink.followLinkCmd',
266
+ "cmd + click"
267
+ ));
268
+ }
269
+ else {
270
+ clickLabel = ( nls.localizeWithPath(
271
+ 'vs/workbench/contrib/remote/browser/tunnelView',
272
+ 'portsLink.followLinkCtrl',
273
+ "ctrl + click"
274
+ ));
275
+ }
276
+ }
277
+ const markdown = ( new MarkdownString('', true));
278
+ const uri = localAddress.startsWith('http') ? localAddress : `http://${localAddress}`;
279
+ return markdown.appendLink(uri, 'Follow link').appendMarkdown(` (${clickLabel})`);
280
+ };
281
+ }
282
+ }
283
+ class RunningProcessColumn {
284
+ constructor() {
285
+ this.label = ( nls.localizeWithPath(
286
+ 'vs/workbench/contrib/remote/browser/tunnelView',
287
+ 'tunnel.processColumn.label',
288
+ "Running Process"
289
+ ));
290
+ this.tooltip = ( nls.localizeWithPath(
291
+ 'vs/workbench/contrib/remote/browser/tunnelView',
292
+ 'tunnel.processColumn.tooltip',
293
+ "The command line of the process that is using the port."
294
+ ));
295
+ this.weight = 2;
296
+ this.templateId = 'actionbar';
297
+ }
298
+ project(row) {
299
+ if (row.tunnelType === TunnelType.Add) {
300
+ return emptyCell(row);
301
+ }
302
+ const label = row.processDescription ?? '';
303
+ return { label, tunnel: row, editId: TunnelEditId.None, tooltip: row instanceof TunnelItem ? row.processTooltip : '' };
304
+ }
305
+ }
306
+ class OriginColumn {
307
+ constructor() {
308
+ this.label = ( nls.localizeWithPath(
309
+ 'vs/workbench/contrib/remote/browser/tunnelView',
310
+ 'tunnel.originColumn.label',
311
+ "Origin"
312
+ ));
313
+ this.tooltip = ( nls.localizeWithPath(
314
+ 'vs/workbench/contrib/remote/browser/tunnelView',
315
+ 'tunnel.originColumn.tooltip',
316
+ "The source that a forwarded port originates from. Can be an extension, user forwarded, statically forwarded, or automatically forwarded."
317
+ ));
318
+ this.weight = 1;
319
+ this.templateId = 'actionbar';
320
+ }
321
+ project(row) {
322
+ if (row.tunnelType === TunnelType.Add) {
323
+ return emptyCell(row);
324
+ }
325
+ const label = row.source.description;
326
+ const tooltip = `${row instanceof TunnelItem ? row.originTooltip : ''}. ${row instanceof TunnelItem ? row.tooltipPostfix : ''}`;
327
+ return { label, menuId: MenuId.TunnelOriginInline, tunnel: row, editId: TunnelEditId.None, tooltip };
328
+ }
329
+ }
330
+ class PrivacyColumn {
331
+ constructor() {
332
+ this.label = ( nls.localizeWithPath(
333
+ 'vs/workbench/contrib/remote/browser/tunnelView',
334
+ 'tunnel.privacyColumn.label',
335
+ "Visibility"
336
+ ));
337
+ this.tooltip = ( nls.localizeWithPath(
338
+ 'vs/workbench/contrib/remote/browser/tunnelView',
339
+ 'tunnel.privacyColumn.tooltip',
340
+ "The availability of the forwarded port."
341
+ ));
342
+ this.weight = 1;
343
+ this.templateId = 'actionbar';
344
+ }
345
+ project(row) {
346
+ if (row.tunnelType === TunnelType.Add) {
347
+ return emptyCell(row);
348
+ }
349
+ const label = row.privacy?.label;
350
+ let tooltip = '';
351
+ if (row instanceof TunnelItem) {
352
+ tooltip = `${row.privacy.label} ${row.tooltipPostfix}`;
353
+ }
354
+ return { label, tunnel: row, icon: { id: row.privacy.themeIcon }, editId: TunnelEditId.None, tooltip };
355
+ }
356
+ }
357
+ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
358
+ constructor(instantiationService, contextKeyService, menuService, contextViewService, remoteExplorerService, commandService, configurationService, hoverService) {
359
+ super();
360
+ this.instantiationService = instantiationService;
361
+ this.contextKeyService = contextKeyService;
362
+ this.menuService = menuService;
363
+ this.contextViewService = contextViewService;
364
+ this.remoteExplorerService = remoteExplorerService;
365
+ this.commandService = commandService;
366
+ this.configurationService = configurationService;
367
+ this.hoverService = hoverService;
368
+ this.templateId = 'actionbar';
369
+ }
370
+ set actionRunner(actionRunner) {
371
+ this._actionRunner = actionRunner;
372
+ }
373
+ renderTemplate(container) {
374
+ const cell = dom.append(container, dom.$('.ports-view-actionbar-cell'));
375
+ const icon = dom.append(cell, dom.$('.ports-view-actionbar-cell-icon'));
376
+ const label = ( new IconLabel(cell, {
377
+ supportHighlights: true,
378
+ hoverDelegate: {
379
+ showHover: (options) => this.hoverService.showHover(options),
380
+ delay: this.configurationService.getValue('workbench.hover.delay')
381
+ }
382
+ }));
383
+ const actionsContainer = dom.append(cell, dom.$('.actions'));
384
+ const actionBar = ( new ActionBar(actionsContainer, {
385
+ actionViewItemProvider: createActionViewItem.bind(undefined, this.instantiationService)
386
+ }));
387
+ return { label, icon, actionBar, container: cell, elementDisposable: Disposable.None };
388
+ }
389
+ renderElement(element, index, templateData) {
390
+ templateData.actionBar.clear();
391
+ templateData.icon.className = 'ports-view-actionbar-cell-icon';
392
+ templateData.icon.style.display = 'none';
393
+ templateData.label.setLabel('');
394
+ templateData.label.element.style.display = 'none';
395
+ templateData.container.style.height = '22px';
396
+ if (templateData.button) {
397
+ templateData.button.element.style.display = 'none';
398
+ templateData.button.dispose();
399
+ }
400
+ templateData.container.style.paddingLeft = '0px';
401
+ templateData.elementDisposable.dispose();
402
+ let editableData;
403
+ if (element.editId === TunnelEditId.New && (editableData = this.remoteExplorerService.getEditableData(undefined))) {
404
+ this.renderInputBox(templateData.container, editableData);
405
+ }
406
+ else {
407
+ editableData = this.remoteExplorerService.getEditableData(element.tunnel, element.editId);
408
+ if (editableData) {
409
+ this.renderInputBox(templateData.container, editableData);
410
+ }
411
+ else if ((element.tunnel.tunnelType === TunnelType.Add) && (element.menuId === MenuId.TunnelPortInline)) {
412
+ this.renderButton(element, templateData);
413
+ }
414
+ else {
415
+ this.renderActionBarItem(element, templateData);
416
+ }
417
+ }
418
+ }
419
+ renderButton(element, templateData) {
420
+ templateData.container.style.paddingLeft = '7px';
421
+ templateData.container.style.height = '28px';
422
+ templateData.button = this._register(( new Button(templateData.container, defaultButtonStyles)));
423
+ templateData.button.label = element.label;
424
+ templateData.button.element.title = element.tooltip;
425
+ this._register(templateData.button.onDidClick(() => {
426
+ this.commandService.executeCommand(ForwardPortAction.INLINE_ID);
427
+ }));
428
+ }
429
+ tunnelContext(tunnel) {
430
+ let context;
431
+ if (tunnel instanceof TunnelItem) {
432
+ context = tunnel.strip();
433
+ }
434
+ if (!context) {
435
+ context = {
436
+ tunnelType: tunnel.tunnelType,
437
+ remoteHost: tunnel.remoteHost,
438
+ remotePort: tunnel.remotePort,
439
+ localAddress: tunnel.localAddress,
440
+ protocol: tunnel.protocol,
441
+ localUri: tunnel.localUri,
442
+ localPort: tunnel.localPort,
443
+ name: tunnel.name,
444
+ closeable: tunnel.closeable,
445
+ source: tunnel.source,
446
+ privacy: tunnel.privacy,
447
+ processDescription: tunnel.processDescription,
448
+ label: tunnel.label
449
+ };
450
+ }
451
+ return context;
452
+ }
453
+ renderActionBarItem(element, templateData) {
454
+ templateData.label.element.style.display = 'flex';
455
+ templateData.label.setLabel(element.label, undefined, {
456
+ title: element.markdownTooltip ?
457
+ { markdown: element.markdownTooltip(this.configurationService), markdownNotSupportedFallback: element.tooltip }
458
+ : element.tooltip,
459
+ extraClasses: element.menuId === MenuId.TunnelLocalAddressInline ? ['ports-view-actionbar-cell-localaddress'] : undefined
460
+ });
461
+ templateData.actionBar.context = this.tunnelContext(element.tunnel);
462
+ templateData.container.style.paddingLeft = '10px';
463
+ const context = [
464
+ ['view', TUNNEL_VIEW_ID],
465
+ [TunnelTypeContextKey.key, element.tunnel.tunnelType],
466
+ [TunnelCloseableContextKey.key, element.tunnel.closeable],
467
+ [TunnelPrivacyContextKey.key, element.tunnel.privacy.id],
468
+ [TunnelProtocolContextKey.key, element.tunnel.protocol]
469
+ ];
470
+ const contextKeyService = this.contextKeyService.createOverlay(context);
471
+ const disposableStore = ( new DisposableStore());
472
+ templateData.elementDisposable = disposableStore;
473
+ if (element.menuId) {
474
+ const menu = disposableStore.add(this.menuService.createMenu(element.menuId, contextKeyService));
475
+ let actions = [];
476
+ createAndFillInActionBarActions(menu, { shouldForwardArgs: true }, actions);
477
+ if (actions) {
478
+ const labelActions = actions.filter(action => action.id.toLowerCase().indexOf('label') >= 0);
479
+ if (labelActions.length > 1) {
480
+ labelActions.sort((a, b) => a.label.length - b.label.length);
481
+ labelActions.pop();
482
+ actions = actions.filter(action => labelActions.indexOf(action) < 0);
483
+ }
484
+ templateData.actionBar.push(actions, { icon: true, label: false });
485
+ if (this._actionRunner) {
486
+ templateData.actionBar.actionRunner = this._actionRunner;
487
+ }
488
+ }
489
+ }
490
+ if (element.icon) {
491
+ templateData.icon.className = `ports-view-actionbar-cell-icon ${ThemeIcon.asClassName(element.icon)}`;
492
+ templateData.icon.title = element.tooltip;
493
+ templateData.icon.style.display = 'inline';
494
+ }
495
+ }
496
+ renderInputBox(container, editableData) {
497
+ if (this.inputDone) {
498
+ this.inputDone(false, false);
499
+ this.inputDone = undefined;
500
+ }
501
+ container.style.paddingLeft = '5px';
502
+ const value = editableData.startingValue || '';
503
+ const inputBox = ( new InputBox(container, this.contextViewService, {
504
+ ariaLabel: ( nls.localizeWithPath(
505
+ 'vs/workbench/contrib/remote/browser/tunnelView',
506
+ 'remote.tunnelsView.input',
507
+ "Press Enter to confirm or Escape to cancel."
508
+ )),
509
+ validationOptions: {
510
+ validation: (value) => {
511
+ const message = editableData.validationMessage(value);
512
+ if (!message) {
513
+ return null;
514
+ }
515
+ return {
516
+ content: message.content,
517
+ formatContent: true,
518
+ type: message.severity === Severity.Error ? 3 : 1
519
+ };
520
+ }
521
+ },
522
+ placeholder: editableData.placeholder || '',
523
+ inputBoxStyles: defaultInputBoxStyles
524
+ }));
525
+ inputBox.value = value;
526
+ inputBox.focus();
527
+ inputBox.select({ start: 0, end: editableData.startingValue ? editableData.startingValue.length : 0 });
528
+ const done = createSingleCallFunction(async (success, finishEditing) => {
529
+ dispose(toDispose);
530
+ if (this.inputDone) {
531
+ this.inputDone = undefined;
532
+ }
533
+ inputBox.element.style.display = 'none';
534
+ const inputValue = inputBox.value;
535
+ if (finishEditing) {
536
+ return editableData.onFinish(inputValue, success);
537
+ }
538
+ });
539
+ this.inputDone = done;
540
+ const toDispose = [
541
+ inputBox,
542
+ dom.addStandardDisposableListener(inputBox.inputElement, dom.EventType.KEY_DOWN, async (e) => {
543
+ if (e.equals(3 )) {
544
+ e.stopPropagation();
545
+ if (inputBox.validate() !== 3 ) {
546
+ return done(true, true);
547
+ }
548
+ else {
549
+ return done(false, true);
550
+ }
551
+ }
552
+ else if (e.equals(9 )) {
553
+ e.preventDefault();
554
+ e.stopPropagation();
555
+ return done(false, true);
556
+ }
557
+ }),
558
+ dom.addDisposableListener(inputBox.inputElement, dom.EventType.BLUR, () => {
559
+ return done(inputBox.validate() !== 3 , true);
560
+ })
561
+ ];
562
+ return toDisposable(() => {
563
+ done(false, false);
564
+ });
565
+ }
566
+ disposeElement(element, index, templateData, height) {
567
+ templateData.elementDisposable.dispose();
568
+ }
569
+ disposeTemplate(templateData) {
570
+ templateData.label.dispose();
571
+ templateData.actionBar.dispose();
572
+ templateData.elementDisposable.dispose();
573
+ templateData.button?.dispose();
574
+ }
575
+ };
576
+ ActionBarRenderer = ( __decorate([
577
+ ( __param(0, IInstantiationService)),
578
+ ( __param(1, IContextKeyService)),
579
+ ( __param(2, IMenuService)),
580
+ ( __param(3, IContextViewService)),
581
+ ( __param(4, IRemoteExplorerService)),
582
+ ( __param(5, ICommandService)),
583
+ ( __param(6, IConfigurationService)),
584
+ ( __param(7, IHoverService))
585
+ ], ActionBarRenderer));
586
+ class TunnelItem {
587
+ static createFromTunnel(remoteExplorerService, tunnelService, tunnel, type = TunnelType.Forwarded, closeable) {
588
+ return ( new TunnelItem(
589
+ type,
590
+ tunnel.remoteHost,
591
+ tunnel.remotePort,
592
+ tunnel.source,
593
+ !!tunnel.hasRunningProcess,
594
+ tunnel.protocol,
595
+ tunnel.localUri,
596
+ tunnel.localAddress,
597
+ tunnel.localPort,
598
+ closeable === undefined ? tunnel.closeable : closeable,
599
+ tunnel.name,
600
+ tunnel.runningProcess,
601
+ tunnel.pid,
602
+ tunnel.privacy,
603
+ remoteExplorerService,
604
+ tunnelService
605
+ ));
606
+ }
607
+ strip() {
608
+ return ( new TunnelItem(
609
+ this.tunnelType,
610
+ this.remoteHost,
611
+ this.remotePort,
612
+ this.source,
613
+ this.hasRunningProcess,
614
+ this.protocol,
615
+ this.localUri,
616
+ this.localAddress,
617
+ this.localPort,
618
+ this.closeable,
619
+ this.name,
620
+ this.runningProcess,
621
+ this.pid,
622
+ this._privacy
623
+ ));
624
+ }
625
+ constructor(tunnelType, remoteHost, remotePort, source, hasRunningProcess, protocol, localUri, localAddress, localPort, closeable, name, runningProcess, pid, _privacy, remoteExplorerService, tunnelService) {
626
+ this.tunnelType = tunnelType;
627
+ this.remoteHost = remoteHost;
628
+ this.remotePort = remotePort;
629
+ this.source = source;
630
+ this.hasRunningProcess = hasRunningProcess;
631
+ this.protocol = protocol;
632
+ this.localUri = localUri;
633
+ this.localAddress = localAddress;
634
+ this.localPort = localPort;
635
+ this.closeable = closeable;
636
+ this.name = name;
637
+ this.runningProcess = runningProcess;
638
+ this.pid = pid;
639
+ this._privacy = _privacy;
640
+ this.remoteExplorerService = remoteExplorerService;
641
+ this.tunnelService = tunnelService;
642
+ }
643
+ get label() {
644
+ if (this.tunnelType === TunnelType.Add && this.name) {
645
+ return this.name;
646
+ }
647
+ const portNumberLabel = (isLocalhost(this.remoteHost) || isAllInterfaces(this.remoteHost))
648
+ ? `${this.remotePort}`
649
+ : `${this.remoteHost}:${this.remotePort}`;
650
+ if (this.name) {
651
+ return `${this.name} (${portNumberLabel})`;
652
+ }
653
+ else {
654
+ return portNumberLabel;
655
+ }
656
+ }
657
+ set processDescription(description) {
658
+ this.runningProcess = description;
659
+ }
660
+ get processDescription() {
661
+ let description = '';
662
+ if (this.runningProcess) {
663
+ if (this.pid && this.remoteExplorerService?.namedProcesses.has(this.pid)) {
664
+ description = this.remoteExplorerService.namedProcesses.get(this.pid);
665
+ }
666
+ else {
667
+ description = this.runningProcess.replace(/\0/g, ' ').trim();
668
+ }
669
+ if (this.pid) {
670
+ description += ` (${this.pid})`;
671
+ }
672
+ }
673
+ else if (this.hasRunningProcess) {
674
+ description = ( nls.localizeWithPath(
675
+ 'vs/workbench/contrib/remote/browser/tunnelView',
676
+ 'tunnelView.runningProcess.inacessable',
677
+ "Process information unavailable"
678
+ ));
679
+ }
680
+ return description;
681
+ }
682
+ get tooltipPostfix() {
683
+ let information;
684
+ if (this.localAddress) {
685
+ information = ( nls.localizeWithPath(
686
+ 'vs/workbench/contrib/remote/browser/tunnelView',
687
+ 'remote.tunnel.tooltipForwarded',
688
+ "Remote port {0}:{1} forwarded to local address {2}. ",
689
+ this.remoteHost,
690
+ this.remotePort,
691
+ this.localAddress
692
+ ));
693
+ }
694
+ else {
695
+ information = ( nls.localizeWithPath(
696
+ 'vs/workbench/contrib/remote/browser/tunnelView',
697
+ 'remote.tunnel.tooltipCandidate',
698
+ "Remote port {0}:{1} not forwarded. ",
699
+ this.remoteHost,
700
+ this.remotePort
701
+ ));
702
+ }
703
+ return information;
704
+ }
705
+ get iconTooltip() {
706
+ const isAdd = this.tunnelType === TunnelType.Add;
707
+ if (!isAdd) {
708
+ return `${this.processDescription ? ( nls.localizeWithPath(
709
+ 'vs/workbench/contrib/remote/browser/tunnelView',
710
+ 'tunnel.iconColumn.running',
711
+ "Port has running process."
712
+ )) :
713
+ ( nls.localizeWithPath(
714
+ 'vs/workbench/contrib/remote/browser/tunnelView',
715
+ 'tunnel.iconColumn.notRunning',
716
+ "No running process."
717
+ ))}`;
718
+ }
719
+ else {
720
+ return this.label;
721
+ }
722
+ }
723
+ get portTooltip() {
724
+ const isAdd = this.tunnelType === TunnelType.Add;
725
+ if (!isAdd) {
726
+ return `${this.name ? ( nls.localizeWithPath(
727
+ 'vs/workbench/contrib/remote/browser/tunnelView',
728
+ 'remote.tunnel.tooltipName',
729
+ "Port labeled {0}. ",
730
+ this.name
731
+ )) : ''}`;
732
+ }
733
+ else {
734
+ return '';
735
+ }
736
+ }
737
+ get processTooltip() {
738
+ return this.processDescription ?? '';
739
+ }
740
+ get originTooltip() {
741
+ return this.source.description;
742
+ }
743
+ get privacy() {
744
+ if (this.tunnelService?.privacyOptions) {
745
+ return this.tunnelService?.privacyOptions.find(element => element.id === this._privacy) ??
746
+ {
747
+ id: '',
748
+ themeIcon: Codicon.question.id,
749
+ label: ( nls.localizeWithPath(
750
+ 'vs/workbench/contrib/remote/browser/tunnelView',
751
+ 'tunnelPrivacy.unknown',
752
+ "Unknown"
753
+ ))
754
+ };
755
+ }
756
+ else {
757
+ return {
758
+ id: TunnelPrivacyId.Private,
759
+ themeIcon: privatePortIcon.id,
760
+ label: ( nls.localizeWithPath(
761
+ 'vs/workbench/contrib/remote/browser/tunnelView',
762
+ 'tunnelPrivacy.private',
763
+ "Private"
764
+ ))
765
+ };
766
+ }
767
+ }
768
+ }
769
+ const TunnelTypeContextKey = ( new RawContextKey('tunnelType', TunnelType.Add, true));
770
+ const TunnelCloseableContextKey = ( new RawContextKey('tunnelCloseable', false, true));
771
+ const TunnelPrivacyContextKey = ( new RawContextKey('tunnelPrivacy', undefined, true));
772
+ const TunnelPrivacyEnabledContextKey = ( new RawContextKey('tunnelPrivacyEnabled', false, true));
773
+ const TunnelProtocolContextKey = ( new RawContextKey('tunnelProtocol', TunnelProtocol.Http, true));
774
+ const TunnelViewFocusContextKey = ( new RawContextKey('tunnelViewFocus', false, ( nls.localizeWithPath(
775
+ 'vs/workbench/contrib/remote/browser/tunnelView',
776
+ 'tunnel.focusContext',
777
+ "Whether the Ports view has focus."
778
+ ))));
779
+ const TunnelViewSelectionKeyName = 'tunnelViewSelection';
780
+ const TunnelViewSelectionContextKey = ( new RawContextKey(TunnelViewSelectionKeyName, undefined, true));
781
+ const TunnelViewMultiSelectionKeyName = 'tunnelViewMultiSelection';
782
+ const TunnelViewMultiSelectionContextKey = ( new RawContextKey(TunnelViewMultiSelectionKeyName, undefined, true));
783
+ const PortChangableContextKey = ( new RawContextKey('portChangable', false, true));
784
+ let TunnelPanel = class TunnelPanel extends ViewPane {
785
+ static { TunnelPanel_1 = this; }
786
+ static { this.ID = TUNNEL_VIEW_ID; }
787
+ static { this.TITLE = ( nls.localize2WithPath('vs/workbench/contrib/remote/browser/tunnelView', 'remote.tunnel', "Ports")); }
788
+ constructor(viewModel, options, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, menuService, themeService, remoteExplorerService, telemetryService, tunnelService, contextViewService, hoverService) {
789
+ super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
790
+ this.viewModel = viewModel;
791
+ this.quickInputService = quickInputService;
792
+ this.commandService = commandService;
793
+ this.menuService = menuService;
794
+ this.remoteExplorerService = remoteExplorerService;
795
+ this.tunnelService = tunnelService;
796
+ this.contextViewService = contextViewService;
797
+ this.hoverService = hoverService;
798
+ this.tableDisposables = this._register(( new DisposableStore()));
799
+ this.isEditing = false;
800
+ this.titleActions = [];
801
+ this.lastFocus = [];
802
+ this.height = 0;
803
+ this.width = 0;
804
+ this.tunnelTypeContext = TunnelTypeContextKey.bindTo(contextKeyService);
805
+ this.tunnelCloseableContext = TunnelCloseableContextKey.bindTo(contextKeyService);
806
+ this.tunnelPrivacyContext = TunnelPrivacyContextKey.bindTo(contextKeyService);
807
+ this.tunnelPrivacyEnabledContext = TunnelPrivacyEnabledContextKey.bindTo(contextKeyService);
808
+ this.tunnelPrivacyEnabledContext.set(tunnelService.canChangePrivacy);
809
+ this.tunnelProtocolContext = TunnelProtocolContextKey.bindTo(contextKeyService);
810
+ this.tunnelViewFocusContext = TunnelViewFocusContextKey.bindTo(contextKeyService);
811
+ this.tunnelViewSelectionContext = TunnelViewSelectionContextKey.bindTo(contextKeyService);
812
+ this.tunnelViewMultiSelectionContext = TunnelViewMultiSelectionContextKey.bindTo(contextKeyService);
813
+ this.portChangableContextKey = PortChangableContextKey.bindTo(contextKeyService);
814
+ const overlayContextKeyService = this.contextKeyService.createOverlay([['view', TunnelPanel_1.ID]]);
815
+ const titleMenu = this._register(this.menuService.createMenu(MenuId.TunnelTitle, overlayContextKeyService));
816
+ const updateActions = () => {
817
+ this.titleActions = [];
818
+ createAndFillInActionBarActions(titleMenu, undefined, this.titleActions);
819
+ this.updateActions();
820
+ };
821
+ this._register(titleMenu.onDidChange(updateActions));
822
+ updateActions();
823
+ this._register(toDisposable(() => {
824
+ this.titleActions = [];
825
+ }));
826
+ this.registerPrivacyActions();
827
+ this._register(Event.once(this.tunnelService.onAddedTunnelProvider)(() => {
828
+ if (this.tunnelPrivacyEnabledContext.get() === false) {
829
+ this.tunnelPrivacyEnabledContext.set(tunnelService.canChangePrivacy);
830
+ updateActions();
831
+ this.registerPrivacyActions();
832
+ this.createTable();
833
+ this.table.layout(this.height, this.width);
834
+ }
835
+ }));
836
+ }
837
+ registerPrivacyActions() {
838
+ for (const privacyOption of this.tunnelService.privacyOptions) {
839
+ const optionId = `remote.tunnel.privacy${privacyOption.id}`;
840
+ CommandsRegistry.registerCommand(optionId, ChangeTunnelPrivacyAction.handler(privacyOption.id));
841
+ MenuRegistry.appendMenuItem(MenuId.TunnelPrivacy, ({
842
+ order: 0,
843
+ command: {
844
+ id: optionId,
845
+ title: privacyOption.label,
846
+ toggled: ( TunnelPrivacyContextKey.isEqualTo(privacyOption.id))
847
+ }
848
+ }));
849
+ }
850
+ }
851
+ get portCount() {
852
+ return this.remoteExplorerService.tunnelModel.forwarded.size + this.remoteExplorerService.tunnelModel.detected.size;
853
+ }
854
+ createTable() {
855
+ if (!this.panelContainer) {
856
+ return;
857
+ }
858
+ this.tableDisposables.clear();
859
+ dom.clearNode(this.panelContainer);
860
+ const widgetContainer = dom.append(this.panelContainer, dom.$('.customview-tree'));
861
+ widgetContainer.classList.add('ports-view');
862
+ widgetContainer.classList.add('file-icon-themable-tree', 'show-file-icons');
863
+ const actionBarRenderer = ( new ActionBarRenderer(
864
+ this.instantiationService,
865
+ this.contextKeyService,
866
+ this.menuService,
867
+ this.contextViewService,
868
+ this.remoteExplorerService,
869
+ this.commandService,
870
+ this.configurationService,
871
+ this.hoverService
872
+ ));
873
+ const columns = [( new IconColumn()), ( new PortColumn()), ( new LocalAddressColumn()), ( new RunningProcessColumn())];
874
+ if (this.tunnelService.canChangePrivacy) {
875
+ columns.push(( new PrivacyColumn()));
876
+ }
877
+ columns.push(( new OriginColumn()));
878
+ this.table = this.instantiationService.createInstance(WorkbenchTable, 'RemoteTunnels', widgetContainer, ( new TunnelTreeVirtualDelegate(this.remoteExplorerService)), columns, [actionBarRenderer], {
879
+ keyboardNavigationLabelProvider: {
880
+ getKeyboardNavigationLabel: (item) => {
881
+ return item.label;
882
+ }
883
+ },
884
+ multipleSelectionSupport: true,
885
+ accessibilityProvider: {
886
+ getAriaLabel: (item) => {
887
+ if (item instanceof TunnelItem) {
888
+ return `${item.tooltipPostfix} ${item.portTooltip} ${item.iconTooltip} ${item.processTooltip} ${item.originTooltip} ${this.tunnelService.canChangePrivacy ? item.privacy.label : ''}`;
889
+ }
890
+ else {
891
+ return item.label;
892
+ }
893
+ },
894
+ getWidgetAriaLabel: () => ( nls.localizeWithPath(
895
+ 'vs/workbench/contrib/remote/browser/tunnelView',
896
+ 'tunnelView',
897
+ "Tunnel View"
898
+ ))
899
+ },
900
+ openOnSingleClick: true
901
+ });
902
+ const actionRunner = ( new ActionRunner());
903
+ actionBarRenderer.actionRunner = actionRunner;
904
+ this.tableDisposables.add(this.table);
905
+ this.tableDisposables.add(this.table.onContextMenu(e => this.onContextMenu(e, actionRunner)));
906
+ this.tableDisposables.add(this.table.onMouseDblClick(e => this.onMouseDblClick(e)));
907
+ this.tableDisposables.add(this.table.onDidChangeFocus(e => this.onFocusChanged(e)));
908
+ this.tableDisposables.add(this.table.onDidChangeSelection(e => this.onSelectionChanged(e)));
909
+ this.tableDisposables.add(this.table.onDidFocus(() => this.tunnelViewFocusContext.set(true)));
910
+ this.tableDisposables.add(this.table.onDidBlur(() => this.tunnelViewFocusContext.set(false)));
911
+ const rerender = () => this.table.splice(0, Number.POSITIVE_INFINITY, this.viewModel.all);
912
+ rerender();
913
+ let lastPortCount = this.portCount;
914
+ this.tableDisposables.add(Event.debounce(this.viewModel.onForwardedPortsChanged, (_last, e) => e, 50)(() => {
915
+ const newPortCount = this.portCount;
916
+ if (((lastPortCount === 0) || (newPortCount === 0)) && (lastPortCount !== newPortCount)) {
917
+ this._onDidChangeViewWelcomeState.fire();
918
+ }
919
+ lastPortCount = newPortCount;
920
+ rerender();
921
+ }));
922
+ this.tableDisposables.add(this.table.onMouseClick(e => {
923
+ if (this.hasOpenLinkModifier(e.browserEvent)) {
924
+ const selection = this.table.getSelectedElements();
925
+ if ((selection.length === 0) ||
926
+ ((selection.length === 1) && (selection[0] === e.element))) {
927
+ this.commandService.executeCommand(OpenPortInBrowserAction.ID, e.element);
928
+ }
929
+ }
930
+ }));
931
+ this.tableDisposables.add(this.table.onDidOpen(e => {
932
+ if (!e.element || (e.element.tunnelType !== TunnelType.Forwarded)) {
933
+ return;
934
+ }
935
+ if (e.browserEvent?.type === 'dblclick') {
936
+ this.commandService.executeCommand(LabelTunnelAction.ID);
937
+ }
938
+ }));
939
+ this.tableDisposables.add(this.remoteExplorerService.onDidChangeEditable(e => {
940
+ this.isEditing = !!this.remoteExplorerService.getEditableData(e?.tunnel, e?.editId);
941
+ this._onDidChangeViewWelcomeState.fire();
942
+ if (!this.isEditing) {
943
+ widgetContainer.classList.remove('highlight');
944
+ }
945
+ rerender();
946
+ if (this.isEditing) {
947
+ widgetContainer.classList.add('highlight');
948
+ if (!e) {
949
+ this.table.reveal(this.table.indexOf(this.viewModel.input));
950
+ }
951
+ }
952
+ else {
953
+ if (e && (e.tunnel.tunnelType !== TunnelType.Add)) {
954
+ this.table.setFocus(this.lastFocus);
955
+ }
956
+ this.focus();
957
+ }
958
+ }));
959
+ }
960
+ renderBody(container) {
961
+ super.renderBody(container);
962
+ this.panelContainer = dom.append(container, dom.$('.tree-explorer-viewlet-tree-view'));
963
+ this.createTable();
964
+ }
965
+ shouldShowWelcome() {
966
+ return this.viewModel.isEmpty() && !this.isEditing;
967
+ }
968
+ focus() {
969
+ super.focus();
970
+ this.table.domFocus();
971
+ }
972
+ onFocusChanged(event) {
973
+ if (event.indexes.length > 0 && event.elements.length > 0) {
974
+ this.lastFocus = [...event.indexes];
975
+ }
976
+ const elements = event.elements;
977
+ const item = elements && elements.length ? elements[0] : undefined;
978
+ if (item) {
979
+ this.tunnelViewSelectionContext.set(makeAddress(item.remoteHost, item.remotePort));
980
+ this.tunnelTypeContext.set(item.tunnelType);
981
+ this.tunnelCloseableContext.set(!!item.closeable);
982
+ this.tunnelPrivacyContext.set(item.privacy.id);
983
+ this.tunnelProtocolContext.set(item.protocol === TunnelProtocol.Https ? TunnelProtocol.Https : TunnelProtocol.Https);
984
+ this.portChangableContextKey.set(!!item.localPort);
985
+ }
986
+ else {
987
+ this.tunnelTypeContext.reset();
988
+ this.tunnelViewSelectionContext.reset();
989
+ this.tunnelCloseableContext.reset();
990
+ this.tunnelPrivacyContext.reset();
991
+ this.tunnelProtocolContext.reset();
992
+ this.portChangableContextKey.reset();
993
+ }
994
+ }
995
+ hasOpenLinkModifier(e) {
996
+ const editorConf = this.configurationService.getValue('editor');
997
+ let modifierKey = false;
998
+ if (editorConf.multiCursorModifier === 'ctrlCmd') {
999
+ modifierKey = e.altKey;
1000
+ }
1001
+ else {
1002
+ if (isMacintosh) {
1003
+ modifierKey = e.metaKey;
1004
+ }
1005
+ else {
1006
+ modifierKey = e.ctrlKey;
1007
+ }
1008
+ }
1009
+ return modifierKey;
1010
+ }
1011
+ onSelectionChanged(event) {
1012
+ const elements = event.elements;
1013
+ if (elements.length > 1) {
1014
+ this.tunnelViewMultiSelectionContext.set(( elements.map(element => makeAddress(element.remoteHost, element.remotePort))));
1015
+ }
1016
+ else {
1017
+ this.tunnelViewMultiSelectionContext.set(undefined);
1018
+ }
1019
+ }
1020
+ onContextMenu(event, actionRunner) {
1021
+ if ((event.element !== undefined) && !(event.element instanceof TunnelItem)) {
1022
+ return;
1023
+ }
1024
+ event.browserEvent.preventDefault();
1025
+ event.browserEvent.stopPropagation();
1026
+ const node = event.element;
1027
+ if (node) {
1028
+ this.table.setFocus([this.table.indexOf(node)]);
1029
+ this.tunnelTypeContext.set(node.tunnelType);
1030
+ this.tunnelCloseableContext.set(!!node.closeable);
1031
+ this.tunnelPrivacyContext.set(node.privacy.id);
1032
+ this.tunnelProtocolContext.set(node.protocol);
1033
+ this.portChangableContextKey.set(!!node.localPort);
1034
+ }
1035
+ else {
1036
+ this.tunnelTypeContext.set(TunnelType.Add);
1037
+ this.tunnelCloseableContext.set(false);
1038
+ this.tunnelPrivacyContext.set(undefined);
1039
+ this.tunnelProtocolContext.set(undefined);
1040
+ this.portChangableContextKey.set(false);
1041
+ }
1042
+ this.contextMenuService.showContextMenu({
1043
+ menuId: MenuId.TunnelContext,
1044
+ menuActionOptions: { shouldForwardArgs: true },
1045
+ contextKeyService: this.table.contextKeyService,
1046
+ getAnchor: () => event.anchor,
1047
+ getActionViewItem: (action) => {
1048
+ const keybinding = this.keybindingService.lookupKeybinding(action.id);
1049
+ if (keybinding) {
1050
+ return ( new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel() }));
1051
+ }
1052
+ return undefined;
1053
+ },
1054
+ onHide: (wasCancelled) => {
1055
+ if (wasCancelled) {
1056
+ this.table.domFocus();
1057
+ }
1058
+ },
1059
+ getActionsContext: () => node?.strip(),
1060
+ actionRunner
1061
+ });
1062
+ }
1063
+ onMouseDblClick(e) {
1064
+ if (!e.element) {
1065
+ this.commandService.executeCommand(ForwardPortAction.INLINE_ID);
1066
+ }
1067
+ }
1068
+ layoutBody(height, width) {
1069
+ this.height = height;
1070
+ this.width = width;
1071
+ super.layoutBody(height, width);
1072
+ this.table.layout(height, width);
1073
+ }
1074
+ };
1075
+ TunnelPanel = TunnelPanel_1 = ( __decorate([
1076
+ ( __param(2, IKeybindingService)),
1077
+ ( __param(3, IContextMenuService)),
1078
+ ( __param(4, IContextKeyService)),
1079
+ ( __param(5, IConfigurationService)),
1080
+ ( __param(6, IInstantiationService)),
1081
+ ( __param(7, IViewDescriptorService)),
1082
+ ( __param(8, IOpenerService)),
1083
+ ( __param(9, IQuickInputService)),
1084
+ ( __param(10, ICommandService)),
1085
+ ( __param(11, IMenuService)),
1086
+ ( __param(12, IThemeService)),
1087
+ ( __param(13, IRemoteExplorerService)),
1088
+ ( __param(14, ITelemetryService)),
1089
+ ( __param(15, ITunnelService)),
1090
+ ( __param(16, IContextViewService)),
1091
+ ( __param(17, IHoverService))
1092
+ ], TunnelPanel));
1093
+ class TunnelPanelDescriptor {
1094
+ constructor(viewModel, environmentService) {
1095
+ this.id = TunnelPanel.ID;
1096
+ this.name = TunnelPanel.TITLE;
1097
+ this.canToggleVisibility = true;
1098
+ this.hideByDefault = false;
1099
+ this.group = 'details@0';
1100
+ this.order = -500;
1101
+ this.canMoveView = true;
1102
+ this.containerIcon = portsViewIcon;
1103
+ this.ctorDescriptor = ( new SyncDescriptor(TunnelPanel, [viewModel]));
1104
+ this.remoteAuthority = environmentService.remoteAuthority ? environmentService.remoteAuthority.split('+')[0] : undefined;
1105
+ }
1106
+ }
1107
+ function isITunnelItem(item) {
1108
+ return item && item.tunnelType && item.remoteHost && item.source;
1109
+ }
1110
+ var LabelTunnelAction;
1111
+ ( (function(LabelTunnelAction) {
1112
+ LabelTunnelAction.ID = 'remote.tunnel.label';
1113
+ LabelTunnelAction.LABEL = ( nls.localizeWithPath(
1114
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1115
+ 'remote.tunnel.label',
1116
+ "Set Port Label"
1117
+ ));
1118
+ LabelTunnelAction.COMMAND_ID_KEYWORD = 'label';
1119
+ function handler() {
1120
+ return async (accessor, arg) => {
1121
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1122
+ let tunnelContext;
1123
+ if (isITunnelItem(arg)) {
1124
+ tunnelContext = arg;
1125
+ }
1126
+ else {
1127
+ const context = accessor.get(IContextKeyService).getContextKeyValue(TunnelViewSelectionKeyName);
1128
+ const tunnel = context ? remoteExplorerService.tunnelModel.forwarded.get(context) : undefined;
1129
+ if (tunnel) {
1130
+ const tunnelService = accessor.get(ITunnelService);
1131
+ tunnelContext = TunnelItem.createFromTunnel(remoteExplorerService, tunnelService, tunnel);
1132
+ }
1133
+ }
1134
+ if (tunnelContext) {
1135
+ const tunnelItem = tunnelContext;
1136
+ return ( new Promise(resolve => {
1137
+ const startingValue = tunnelItem.name ? tunnelItem.name : `${tunnelItem.remotePort}`;
1138
+ remoteExplorerService.setEditable(tunnelItem, TunnelEditId.Label, {
1139
+ onFinish: async (value, success) => {
1140
+ value = value.trim();
1141
+ remoteExplorerService.setEditable(tunnelItem, TunnelEditId.Label, null);
1142
+ const changed = success && (value !== startingValue);
1143
+ if (changed) {
1144
+ await remoteExplorerService.tunnelModel.name(tunnelItem.remoteHost, tunnelItem.remotePort, value);
1145
+ }
1146
+ resolve(changed ? { port: tunnelItem.remotePort, label: value } : undefined);
1147
+ },
1148
+ validationMessage: () => null,
1149
+ placeholder: ( nls.localizeWithPath(
1150
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1151
+ 'remote.tunnelsView.labelPlaceholder',
1152
+ "Port label"
1153
+ )),
1154
+ startingValue
1155
+ });
1156
+ }));
1157
+ }
1158
+ return undefined;
1159
+ };
1160
+ }
1161
+ LabelTunnelAction.handler = handler;
1162
+ })(LabelTunnelAction || (LabelTunnelAction = {})));
1163
+ const invalidPortString = ( nls.localizeWithPath(
1164
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1165
+ 'remote.tunnelsView.portNumberValid',
1166
+ "Forwarded port should be a number or a host:port."
1167
+ ));
1168
+ const maxPortNumber = 65536;
1169
+ const invalidPortNumberString = ( nls.localizeWithPath(
1170
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1171
+ 'remote.tunnelsView.portNumberToHigh',
1172
+ "Port number must be \u2265 0 and < {0}.",
1173
+ maxPortNumber
1174
+ ));
1175
+ const requiresSudoString = ( nls.localizeWithPath(
1176
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1177
+ 'remote.tunnelView.inlineElevationMessage',
1178
+ "May Require Sudo"
1179
+ ));
1180
+ const alreadyForwarded = ( nls.localizeWithPath(
1181
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1182
+ 'remote.tunnelView.alreadyForwarded',
1183
+ "Port is already forwarded"
1184
+ ));
1185
+ var ForwardPortAction;
1186
+ ( (function(ForwardPortAction) {
1187
+ ForwardPortAction.INLINE_ID = 'remote.tunnel.forwardInline';
1188
+ ForwardPortAction.COMMANDPALETTE_ID = 'remote.tunnel.forwardCommandPalette';
1189
+ ForwardPortAction.LABEL = { value: ( nls.localizeWithPath(
1190
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1191
+ 'remote.tunnel.forward',
1192
+ "Forward a Port"
1193
+ )), original: 'Forward a Port' };
1194
+ ForwardPortAction.TREEITEM_LABEL = ( nls.localizeWithPath(
1195
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1196
+ 'remote.tunnel.forwardItem',
1197
+ "Forward Port"
1198
+ ));
1199
+ const forwardPrompt = ( nls.localizeWithPath(
1200
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1201
+ 'remote.tunnel.forwardPrompt',
1202
+ "Port number or address (eg. 3000 or 10.10.10.10:2000)."
1203
+ ));
1204
+ function validateInput(remoteExplorerService, tunnelService, value, canElevate) {
1205
+ const parsed = parseAddress(value);
1206
+ if (!parsed) {
1207
+ return { content: invalidPortString, severity: Severity.Error };
1208
+ }
1209
+ else if (parsed.port >= maxPortNumber) {
1210
+ return { content: invalidPortNumberString, severity: Severity.Error };
1211
+ }
1212
+ else if (canElevate && tunnelService.isPortPrivileged(parsed.port)) {
1213
+ return { content: requiresSudoString, severity: Severity.Info };
1214
+ }
1215
+ else if (mapHasAddressLocalhostOrAllInterfaces(remoteExplorerService.tunnelModel.forwarded, parsed.host, parsed.port)) {
1216
+ return { content: alreadyForwarded, severity: Severity.Error };
1217
+ }
1218
+ return null;
1219
+ }
1220
+ function error(notificationService, tunnelOrError, host, port) {
1221
+ if (!tunnelOrError) {
1222
+ notificationService.warn(( nls.localizeWithPath(
1223
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1224
+ 'remote.tunnel.forwardError',
1225
+ "Unable to forward {0}:{1}. The host may not be available or that remote port may already be forwarded",
1226
+ host,
1227
+ port
1228
+ )));
1229
+ }
1230
+ else if (typeof tunnelOrError === 'string') {
1231
+ notificationService.warn(( nls.localizeWithPath(
1232
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1233
+ 'remote.tunnel.forwardErrorProvided',
1234
+ "Unable to forward {0}:{1}. {2}",
1235
+ host,
1236
+ port,
1237
+ tunnelOrError
1238
+ )));
1239
+ }
1240
+ }
1241
+ function inlineHandler() {
1242
+ return async (accessor, arg) => {
1243
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1244
+ const notificationService = accessor.get(INotificationService);
1245
+ const tunnelService = accessor.get(ITunnelService);
1246
+ remoteExplorerService.setEditable(undefined, TunnelEditId.New, {
1247
+ onFinish: async (value, success) => {
1248
+ remoteExplorerService.setEditable(undefined, TunnelEditId.New, null);
1249
+ let parsed;
1250
+ if (success && (parsed = parseAddress(value))) {
1251
+ remoteExplorerService.forward({
1252
+ remote: { host: parsed.host, port: parsed.port },
1253
+ elevateIfNeeded: true
1254
+ }).then(tunnelOrError => error(notificationService, tunnelOrError, parsed.host, parsed.port));
1255
+ }
1256
+ },
1257
+ validationMessage: (value) => validateInput(remoteExplorerService, tunnelService, value, tunnelService.canElevate),
1258
+ placeholder: forwardPrompt
1259
+ });
1260
+ };
1261
+ }
1262
+ ForwardPortAction.inlineHandler = inlineHandler;
1263
+ function commandPaletteHandler() {
1264
+ return async (accessor, arg) => {
1265
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1266
+ const notificationService = accessor.get(INotificationService);
1267
+ const viewsService = accessor.get(IViewsService);
1268
+ const quickInputService = accessor.get(IQuickInputService);
1269
+ const tunnelService = accessor.get(ITunnelService);
1270
+ await viewsService.openView(TunnelPanel.ID, true);
1271
+ const value = await quickInputService.input({
1272
+ prompt: forwardPrompt,
1273
+ validateInput: (value) => Promise.resolve(validateInput(remoteExplorerService, tunnelService, value, tunnelService.canElevate))
1274
+ });
1275
+ let parsed;
1276
+ if (value && (parsed = parseAddress(value))) {
1277
+ remoteExplorerService.forward({
1278
+ remote: { host: parsed.host, port: parsed.port },
1279
+ elevateIfNeeded: true
1280
+ }).then(tunnel => error(notificationService, tunnel, parsed.host, parsed.port));
1281
+ }
1282
+ };
1283
+ }
1284
+ ForwardPortAction.commandPaletteHandler = commandPaletteHandler;
1285
+ })(ForwardPortAction || (ForwardPortAction = {})));
1286
+ function makeTunnelPicks(tunnels, remoteExplorerService, tunnelService) {
1287
+ const picks = ( tunnels.map(forwarded => {
1288
+ const item = TunnelItem.createFromTunnel(remoteExplorerService, tunnelService, forwarded);
1289
+ return {
1290
+ label: item.label,
1291
+ description: item.processDescription,
1292
+ tunnel: item
1293
+ };
1294
+ }));
1295
+ if (picks.length === 0) {
1296
+ picks.push({
1297
+ label: ( nls.localizeWithPath(
1298
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1299
+ 'remote.tunnel.closeNoPorts',
1300
+ "No ports currently forwarded. Try running the {0} command",
1301
+ ForwardPortAction.LABEL.value
1302
+ ))
1303
+ });
1304
+ }
1305
+ return picks;
1306
+ }
1307
+ var ClosePortAction;
1308
+ ( (function(ClosePortAction) {
1309
+ ClosePortAction.INLINE_ID = 'remote.tunnel.closeInline';
1310
+ ClosePortAction.COMMANDPALETTE_ID = 'remote.tunnel.closeCommandPalette';
1311
+ ClosePortAction.LABEL = { value: ( nls.localizeWithPath(
1312
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1313
+ 'remote.tunnel.close',
1314
+ "Stop Forwarding Port"
1315
+ )), original: 'Stop Forwarding Port' };
1316
+ function inlineHandler() {
1317
+ return async (accessor, arg) => {
1318
+ const contextKeyService = accessor.get(IContextKeyService);
1319
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1320
+ let ports = [];
1321
+ const multiSelectContext = contextKeyService.getContextKeyValue(TunnelViewMultiSelectionKeyName);
1322
+ if (multiSelectContext) {
1323
+ multiSelectContext.forEach(context => {
1324
+ const tunnel = remoteExplorerService.tunnelModel.forwarded.get(context);
1325
+ if (tunnel) {
1326
+ ports?.push(tunnel);
1327
+ }
1328
+ });
1329
+ }
1330
+ else if (isITunnelItem(arg)) {
1331
+ ports = [arg];
1332
+ }
1333
+ else {
1334
+ const context = contextKeyService.getContextKeyValue(TunnelViewSelectionKeyName);
1335
+ const tunnel = context ? remoteExplorerService.tunnelModel.forwarded.get(context) : undefined;
1336
+ if (tunnel) {
1337
+ ports = [tunnel];
1338
+ }
1339
+ }
1340
+ if (!ports || ports.length === 0) {
1341
+ return;
1342
+ }
1343
+ return Promise.all(( ports.map(
1344
+ port => remoteExplorerService.close({ host: port.remoteHost, port: port.remotePort }, TunnelCloseReason.User)
1345
+ )));
1346
+ };
1347
+ }
1348
+ ClosePortAction.inlineHandler = inlineHandler;
1349
+ function commandPaletteHandler() {
1350
+ return async (accessor) => {
1351
+ const quickInputService = accessor.get(IQuickInputService);
1352
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1353
+ const tunnelService = accessor.get(ITunnelService);
1354
+ const commandService = accessor.get(ICommandService);
1355
+ const picks = makeTunnelPicks(Array.from(( remoteExplorerService.tunnelModel.forwarded.values())).filter(tunnel => tunnel.closeable), remoteExplorerService, tunnelService);
1356
+ const result = await quickInputService.pick(picks, { placeHolder: ( nls.localizeWithPath(
1357
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1358
+ 'remote.tunnel.closePlaceholder',
1359
+ "Choose a port to stop forwarding"
1360
+ )) });
1361
+ if (result && result.tunnel) {
1362
+ await remoteExplorerService.close({ host: result.tunnel.remoteHost, port: result.tunnel.remotePort }, TunnelCloseReason.User);
1363
+ }
1364
+ else if (result) {
1365
+ await commandService.executeCommand(ForwardPortAction.COMMANDPALETTE_ID);
1366
+ }
1367
+ };
1368
+ }
1369
+ ClosePortAction.commandPaletteHandler = commandPaletteHandler;
1370
+ })(ClosePortAction || (ClosePortAction = {})));
1371
+ var OpenPortInBrowserAction;
1372
+ ( (function(OpenPortInBrowserAction) {
1373
+ OpenPortInBrowserAction.ID = 'remote.tunnel.open';
1374
+ OpenPortInBrowserAction.LABEL = ( nls.localizeWithPath(
1375
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1376
+ 'remote.tunnel.open',
1377
+ "Open in Browser"
1378
+ ));
1379
+ function handler() {
1380
+ return async (accessor, arg) => {
1381
+ let key;
1382
+ if (isITunnelItem(arg)) {
1383
+ key = makeAddress(arg.remoteHost, arg.remotePort);
1384
+ }
1385
+ else if (arg.tunnelRemoteHost && arg.tunnelRemotePort) {
1386
+ key = makeAddress(arg.tunnelRemoteHost, arg.tunnelRemotePort);
1387
+ }
1388
+ if (key) {
1389
+ const model = accessor.get(IRemoteExplorerService).tunnelModel;
1390
+ const openerService = accessor.get(IOpenerService);
1391
+ return run(model, openerService, key);
1392
+ }
1393
+ };
1394
+ }
1395
+ OpenPortInBrowserAction.handler = handler;
1396
+ function run(model, openerService, key) {
1397
+ const tunnel = model.forwarded.get(key) || model.detected.get(key);
1398
+ if (tunnel) {
1399
+ return openerService.open(tunnel.localUri, { allowContributedOpeners: false });
1400
+ }
1401
+ return Promise.resolve();
1402
+ }
1403
+ OpenPortInBrowserAction.run = run;
1404
+ })(OpenPortInBrowserAction || (OpenPortInBrowserAction = {})));
1405
+ var OpenPortInPreviewAction;
1406
+ ( (function(OpenPortInPreviewAction) {
1407
+ OpenPortInPreviewAction.ID = 'remote.tunnel.openPreview';
1408
+ OpenPortInPreviewAction.LABEL = ( nls.localizeWithPath(
1409
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1410
+ 'remote.tunnel.openPreview',
1411
+ "Preview in Editor"
1412
+ ));
1413
+ function handler() {
1414
+ return async (accessor, arg) => {
1415
+ let key;
1416
+ if (isITunnelItem(arg)) {
1417
+ key = makeAddress(arg.remoteHost, arg.remotePort);
1418
+ }
1419
+ else if (arg.tunnelRemoteHost && arg.tunnelRemotePort) {
1420
+ key = makeAddress(arg.tunnelRemoteHost, arg.tunnelRemotePort);
1421
+ }
1422
+ if (key) {
1423
+ const model = accessor.get(IRemoteExplorerService).tunnelModel;
1424
+ const openerService = accessor.get(IOpenerService);
1425
+ const externalOpenerService = accessor.get(IExternalUriOpenerService);
1426
+ return run(model, openerService, externalOpenerService, key);
1427
+ }
1428
+ };
1429
+ }
1430
+ OpenPortInPreviewAction.handler = handler;
1431
+ async function run(model, openerService, externalOpenerService, key) {
1432
+ const tunnel = model.forwarded.get(key) || model.detected.get(key);
1433
+ if (tunnel) {
1434
+ const remoteHost = tunnel.remoteHost.includes(':') ? `[${tunnel.remoteHost}]` : tunnel.remoteHost;
1435
+ const sourceUri = ( URI.parse(`http://${remoteHost}:${tunnel.remotePort}`));
1436
+ const opener = await externalOpenerService.getOpener(tunnel.localUri, { sourceUri }, ( new CancellationTokenSource()).token);
1437
+ if (opener) {
1438
+ return opener.openExternalUri(tunnel.localUri, { sourceUri }, ( new CancellationTokenSource()).token);
1439
+ }
1440
+ return openerService.open(tunnel.localUri);
1441
+ }
1442
+ return Promise.resolve();
1443
+ }
1444
+ OpenPortInPreviewAction.run = run;
1445
+ })(OpenPortInPreviewAction || (OpenPortInPreviewAction = {})));
1446
+ var OpenPortInBrowserCommandPaletteAction;
1447
+ ( (function(OpenPortInBrowserCommandPaletteAction) {
1448
+ OpenPortInBrowserCommandPaletteAction.ID = 'remote.tunnel.openCommandPalette';
1449
+ OpenPortInBrowserCommandPaletteAction.LABEL = ( nls.localizeWithPath(
1450
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1451
+ 'remote.tunnel.openCommandPalette',
1452
+ "Open Port in Browser"
1453
+ ));
1454
+ function handler() {
1455
+ return async (accessor, arg) => {
1456
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1457
+ const tunnelService = accessor.get(ITunnelService);
1458
+ const model = remoteExplorerService.tunnelModel;
1459
+ const quickPickService = accessor.get(IQuickInputService);
1460
+ const openerService = accessor.get(IOpenerService);
1461
+ const commandService = accessor.get(ICommandService);
1462
+ const options = ( [...model.forwarded, ...model.detected].map(value => {
1463
+ const tunnelItem = TunnelItem.createFromTunnel(remoteExplorerService, tunnelService, value[1]);
1464
+ return {
1465
+ label: tunnelItem.label,
1466
+ description: tunnelItem.processDescription,
1467
+ tunnel: tunnelItem
1468
+ };
1469
+ }));
1470
+ if (options.length === 0) {
1471
+ options.push({
1472
+ label: ( nls.localizeWithPath(
1473
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1474
+ 'remote.tunnel.openCommandPaletteNone',
1475
+ "No ports currently forwarded. Open the Ports view to get started."
1476
+ ))
1477
+ });
1478
+ }
1479
+ else {
1480
+ options.push({
1481
+ label: ( nls.localizeWithPath(
1482
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1483
+ 'remote.tunnel.openCommandPaletteView',
1484
+ "Open the Ports view..."
1485
+ ))
1486
+ });
1487
+ }
1488
+ const picked = await quickPickService.pick(options, { placeHolder: ( nls.localizeWithPath(
1489
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1490
+ 'remote.tunnel.openCommandPalettePick',
1491
+ "Choose the port to open"
1492
+ )) });
1493
+ if (picked && picked.tunnel) {
1494
+ return OpenPortInBrowserAction.run(model, openerService, makeAddress(picked.tunnel.remoteHost, picked.tunnel.remotePort));
1495
+ }
1496
+ else if (picked) {
1497
+ return commandService.executeCommand(`${TUNNEL_VIEW_ID}.focus`);
1498
+ }
1499
+ };
1500
+ }
1501
+ OpenPortInBrowserCommandPaletteAction.handler = handler;
1502
+ })(
1503
+ OpenPortInBrowserCommandPaletteAction || (OpenPortInBrowserCommandPaletteAction = {})
1504
+ ));
1505
+ var CopyAddressAction;
1506
+ ( (function(CopyAddressAction) {
1507
+ CopyAddressAction.INLINE_ID = 'remote.tunnel.copyAddressInline';
1508
+ CopyAddressAction.COMMANDPALETTE_ID = 'remote.tunnel.copyAddressCommandPalette';
1509
+ CopyAddressAction.INLINE_LABEL = ( nls.localizeWithPath(
1510
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1511
+ 'remote.tunnel.copyAddressInline',
1512
+ "Copy Local Address"
1513
+ ));
1514
+ CopyAddressAction.COMMANDPALETTE_LABEL = ( nls.localizeWithPath(
1515
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1516
+ 'remote.tunnel.copyAddressCommandPalette',
1517
+ "Copy Forwarded Port Address"
1518
+ ));
1519
+ async function copyAddress(remoteExplorerService, clipboardService, tunnelItem) {
1520
+ const address = remoteExplorerService.tunnelModel.address(tunnelItem.remoteHost, tunnelItem.remotePort);
1521
+ if (address) {
1522
+ await clipboardService.writeText(( address.toString()));
1523
+ }
1524
+ }
1525
+ function inlineHandler() {
1526
+ return async (accessor, arg) => {
1527
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1528
+ let tunnelItem;
1529
+ if (isITunnelItem(arg)) {
1530
+ tunnelItem = arg;
1531
+ }
1532
+ else {
1533
+ const context = accessor.get(IContextKeyService).getContextKeyValue(TunnelViewSelectionKeyName);
1534
+ tunnelItem = context ? remoteExplorerService.tunnelModel.forwarded.get(context) : undefined;
1535
+ }
1536
+ if (tunnelItem) {
1537
+ return copyAddress(remoteExplorerService, accessor.get(IClipboardService), tunnelItem);
1538
+ }
1539
+ };
1540
+ }
1541
+ CopyAddressAction.inlineHandler = inlineHandler;
1542
+ function commandPaletteHandler() {
1543
+ return async (accessor, arg) => {
1544
+ const quickInputService = accessor.get(IQuickInputService);
1545
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1546
+ const tunnelService = accessor.get(ITunnelService);
1547
+ const commandService = accessor.get(ICommandService);
1548
+ const clipboardService = accessor.get(IClipboardService);
1549
+ const tunnels = Array.from(( remoteExplorerService.tunnelModel.forwarded.values())).concat(Array.from(( remoteExplorerService.tunnelModel.detected.values())));
1550
+ const result = await quickInputService.pick(makeTunnelPicks(tunnels, remoteExplorerService, tunnelService), { placeHolder: ( nls.localizeWithPath(
1551
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1552
+ 'remote.tunnel.copyAddressPlaceholdter',
1553
+ "Choose a forwarded port"
1554
+ )) });
1555
+ if (result && result.tunnel) {
1556
+ await copyAddress(remoteExplorerService, clipboardService, result.tunnel);
1557
+ }
1558
+ else if (result) {
1559
+ await commandService.executeCommand(ForwardPortAction.COMMANDPALETTE_ID);
1560
+ }
1561
+ };
1562
+ }
1563
+ CopyAddressAction.commandPaletteHandler = commandPaletteHandler;
1564
+ })(CopyAddressAction || (CopyAddressAction = {})));
1565
+ var ChangeLocalPortAction;
1566
+ ( (function(ChangeLocalPortAction) {
1567
+ ChangeLocalPortAction.ID = 'remote.tunnel.changeLocalPort';
1568
+ ChangeLocalPortAction.LABEL = ( nls.localizeWithPath(
1569
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1570
+ 'remote.tunnel.changeLocalPort',
1571
+ "Change Local Address Port"
1572
+ ));
1573
+ function validateInput(tunnelService, value, canElevate) {
1574
+ if (!value.match(/^[0-9]+$/)) {
1575
+ return { content: ( nls.localizeWithPath(
1576
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1577
+ 'remote.tunnelsView.portShouldBeNumber',
1578
+ "Local port should be a number."
1579
+ )), severity: Severity.Error };
1580
+ }
1581
+ else if (Number(value) >= maxPortNumber) {
1582
+ return { content: invalidPortNumberString, severity: Severity.Error };
1583
+ }
1584
+ else if (canElevate && tunnelService.isPortPrivileged(Number(value))) {
1585
+ return { content: requiresSudoString, severity: Severity.Info };
1586
+ }
1587
+ return null;
1588
+ }
1589
+ function handler() {
1590
+ return async (accessor, arg) => {
1591
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1592
+ const notificationService = accessor.get(INotificationService);
1593
+ const tunnelService = accessor.get(ITunnelService);
1594
+ let tunnelContext;
1595
+ if (isITunnelItem(arg)) {
1596
+ tunnelContext = arg;
1597
+ }
1598
+ else {
1599
+ const context = accessor.get(IContextKeyService).getContextKeyValue(TunnelViewSelectionKeyName);
1600
+ const tunnel = context ? remoteExplorerService.tunnelModel.forwarded.get(context) : undefined;
1601
+ if (tunnel) {
1602
+ const tunnelService = accessor.get(ITunnelService);
1603
+ tunnelContext = TunnelItem.createFromTunnel(remoteExplorerService, tunnelService, tunnel);
1604
+ }
1605
+ }
1606
+ if (tunnelContext) {
1607
+ const tunnelItem = tunnelContext;
1608
+ remoteExplorerService.setEditable(tunnelItem, TunnelEditId.LocalPort, {
1609
+ onFinish: async (value, success) => {
1610
+ remoteExplorerService.setEditable(tunnelItem, TunnelEditId.LocalPort, null);
1611
+ if (success) {
1612
+ await remoteExplorerService.close({ host: tunnelItem.remoteHost, port: tunnelItem.remotePort }, TunnelCloseReason.Other);
1613
+ const numberValue = Number(value);
1614
+ const newForward = await remoteExplorerService.forward({
1615
+ remote: { host: tunnelItem.remoteHost, port: tunnelItem.remotePort },
1616
+ local: numberValue,
1617
+ name: tunnelItem.name,
1618
+ elevateIfNeeded: true,
1619
+ source: tunnelItem.source
1620
+ });
1621
+ if (newForward && (typeof newForward !== 'string') && newForward.tunnelLocalPort !== numberValue) {
1622
+ notificationService.warn(( nls.localizeWithPath(
1623
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1624
+ 'remote.tunnel.changeLocalPortNumber',
1625
+ "The local port {0} is not available. Port number {1} has been used instead",
1626
+ value,
1627
+ newForward.tunnelLocalPort ?? newForward.localAddress
1628
+ )));
1629
+ }
1630
+ }
1631
+ },
1632
+ validationMessage: (value) => validateInput(tunnelService, value, tunnelService.canElevate),
1633
+ placeholder: ( nls.localizeWithPath(
1634
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1635
+ 'remote.tunnelsView.changePort',
1636
+ "New local port"
1637
+ ))
1638
+ });
1639
+ }
1640
+ };
1641
+ }
1642
+ ChangeLocalPortAction.handler = handler;
1643
+ })(ChangeLocalPortAction || (ChangeLocalPortAction = {})));
1644
+ var ChangeTunnelPrivacyAction;
1645
+ ( (function(ChangeTunnelPrivacyAction) {
1646
+ function handler(privacyId) {
1647
+ return async (accessor, arg) => {
1648
+ if (isITunnelItem(arg)) {
1649
+ const remoteExplorerService = accessor.get(IRemoteExplorerService);
1650
+ await remoteExplorerService.close({ host: arg.remoteHost, port: arg.remotePort }, TunnelCloseReason.Other);
1651
+ return remoteExplorerService.forward({
1652
+ remote: { host: arg.remoteHost, port: arg.remotePort },
1653
+ local: arg.localPort,
1654
+ name: arg.name,
1655
+ elevateIfNeeded: true,
1656
+ privacy: privacyId,
1657
+ source: arg.source
1658
+ });
1659
+ }
1660
+ return undefined;
1661
+ };
1662
+ }
1663
+ ChangeTunnelPrivacyAction.handler = handler;
1664
+ })(ChangeTunnelPrivacyAction || (ChangeTunnelPrivacyAction = {})));
1665
+ var SetTunnelProtocolAction;
1666
+ ( (function(SetTunnelProtocolAction) {
1667
+ SetTunnelProtocolAction.ID_HTTP = 'remote.tunnel.setProtocolHttp';
1668
+ SetTunnelProtocolAction.ID_HTTPS = 'remote.tunnel.setProtocolHttps';
1669
+ SetTunnelProtocolAction.LABEL_HTTP = ( nls.localizeWithPath(
1670
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1671
+ 'remote.tunnel.protocolHttp',
1672
+ "HTTP"
1673
+ ));
1674
+ SetTunnelProtocolAction.LABEL_HTTPS = ( nls.localizeWithPath(
1675
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1676
+ 'remote.tunnel.protocolHttps',
1677
+ "HTTPS"
1678
+ ));
1679
+ async function handler(arg, protocol, remoteExplorerService) {
1680
+ if (isITunnelItem(arg)) {
1681
+ const attributes = {
1682
+ protocol
1683
+ };
1684
+ return remoteExplorerService.tunnelModel.configPortsAttributes.addAttributes(arg.remotePort, attributes, 4 );
1685
+ }
1686
+ }
1687
+ function handlerHttp() {
1688
+ return async (accessor, arg) => {
1689
+ return handler(arg, TunnelProtocol.Http, accessor.get(IRemoteExplorerService));
1690
+ };
1691
+ }
1692
+ SetTunnelProtocolAction.handlerHttp = handlerHttp;
1693
+ function handlerHttps() {
1694
+ return async (accessor, arg) => {
1695
+ return handler(arg, TunnelProtocol.Https, accessor.get(IRemoteExplorerService));
1696
+ };
1697
+ }
1698
+ SetTunnelProtocolAction.handlerHttps = handlerHttps;
1699
+ })(SetTunnelProtocolAction || (SetTunnelProtocolAction = {})));
1700
+ const tunnelViewCommandsWeightBonus = 10;
1701
+ const isForwardedExpr = ( TunnelTypeContextKey.isEqualTo(TunnelType.Forwarded));
1702
+ const isForwardedOrDetectedExpr = ( ContextKeyExpr.or(isForwardedExpr, ( TunnelTypeContextKey.isEqualTo(TunnelType.Detected))));
1703
+ const isNotMultiSelectionExpr = ( TunnelViewMultiSelectionContextKey.isEqualTo(undefined));
1704
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
1705
+ id: LabelTunnelAction.ID,
1706
+ weight: 200 + tunnelViewCommandsWeightBonus,
1707
+ when: ( ContextKeyExpr.and(TunnelViewFocusContextKey, isForwardedExpr, isNotMultiSelectionExpr)),
1708
+ primary: 60 ,
1709
+ mac: {
1710
+ primary: 3
1711
+ },
1712
+ handler: LabelTunnelAction.handler()
1713
+ });
1714
+ CommandsRegistry.registerCommand(ForwardPortAction.INLINE_ID, ForwardPortAction.inlineHandler());
1715
+ CommandsRegistry.registerCommand(ForwardPortAction.COMMANDPALETTE_ID, ForwardPortAction.commandPaletteHandler());
1716
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
1717
+ id: ClosePortAction.INLINE_ID,
1718
+ weight: 200 + tunnelViewCommandsWeightBonus,
1719
+ when: ( ContextKeyExpr.and(TunnelCloseableContextKey, TunnelViewFocusContextKey)),
1720
+ primary: 20 ,
1721
+ mac: {
1722
+ primary: 2048 | 1 ,
1723
+ secondary: [20 ]
1724
+ },
1725
+ handler: ClosePortAction.inlineHandler()
1726
+ });
1727
+ CommandsRegistry.registerCommand(ClosePortAction.COMMANDPALETTE_ID, ClosePortAction.commandPaletteHandler());
1728
+ CommandsRegistry.registerCommand(OpenPortInBrowserAction.ID, OpenPortInBrowserAction.handler());
1729
+ CommandsRegistry.registerCommand(OpenPortInPreviewAction.ID, OpenPortInPreviewAction.handler());
1730
+ CommandsRegistry.registerCommand(OpenPortInBrowserCommandPaletteAction.ID, OpenPortInBrowserCommandPaletteAction.handler());
1731
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
1732
+ id: CopyAddressAction.INLINE_ID,
1733
+ weight: 200 + tunnelViewCommandsWeightBonus,
1734
+ when: ( ContextKeyExpr.and(
1735
+ TunnelViewFocusContextKey,
1736
+ isForwardedOrDetectedExpr,
1737
+ isNotMultiSelectionExpr
1738
+ )),
1739
+ primary: 2048 | 33 ,
1740
+ handler: CopyAddressAction.inlineHandler()
1741
+ });
1742
+ CommandsRegistry.registerCommand(CopyAddressAction.COMMANDPALETTE_ID, CopyAddressAction.commandPaletteHandler());
1743
+ CommandsRegistry.registerCommand(ChangeLocalPortAction.ID, ChangeLocalPortAction.handler());
1744
+ CommandsRegistry.registerCommand(SetTunnelProtocolAction.ID_HTTP, SetTunnelProtocolAction.handlerHttp());
1745
+ CommandsRegistry.registerCommand(SetTunnelProtocolAction.ID_HTTPS, SetTunnelProtocolAction.handlerHttps());
1746
+ MenuRegistry.appendMenuItem(MenuId.CommandPalette, ({
1747
+ command: {
1748
+ id: ClosePortAction.COMMANDPALETTE_ID,
1749
+ title: ClosePortAction.LABEL
1750
+ },
1751
+ when: forwardedPortsViewEnabled
1752
+ }));
1753
+ MenuRegistry.appendMenuItem(MenuId.CommandPalette, ({
1754
+ command: {
1755
+ id: ForwardPortAction.COMMANDPALETTE_ID,
1756
+ title: ForwardPortAction.LABEL
1757
+ },
1758
+ when: forwardedPortsViewEnabled
1759
+ }));
1760
+ MenuRegistry.appendMenuItem(MenuId.CommandPalette, ({
1761
+ command: {
1762
+ id: CopyAddressAction.COMMANDPALETTE_ID,
1763
+ title: CopyAddressAction.COMMANDPALETTE_LABEL
1764
+ },
1765
+ when: forwardedPortsViewEnabled
1766
+ }));
1767
+ MenuRegistry.appendMenuItem(MenuId.CommandPalette, ({
1768
+ command: {
1769
+ id: OpenPortInBrowserCommandPaletteAction.ID,
1770
+ title: OpenPortInBrowserCommandPaletteAction.LABEL
1771
+ },
1772
+ when: forwardedPortsViewEnabled
1773
+ }));
1774
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1775
+ group: '._open',
1776
+ order: 0,
1777
+ command: {
1778
+ id: OpenPortInBrowserAction.ID,
1779
+ title: OpenPortInBrowserAction.LABEL,
1780
+ },
1781
+ when: ( ContextKeyExpr.and(isForwardedOrDetectedExpr, isNotMultiSelectionExpr))
1782
+ }));
1783
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1784
+ group: '._open',
1785
+ order: 1,
1786
+ command: {
1787
+ id: OpenPortInPreviewAction.ID,
1788
+ title: OpenPortInPreviewAction.LABEL,
1789
+ },
1790
+ when: ( ContextKeyExpr.and(isForwardedOrDetectedExpr, isNotMultiSelectionExpr))
1791
+ }));
1792
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1793
+ group: '0_manage',
1794
+ order: 1,
1795
+ command: {
1796
+ id: LabelTunnelAction.ID,
1797
+ title: LabelTunnelAction.LABEL,
1798
+ icon: labelPortIcon
1799
+ },
1800
+ when: ( ContextKeyExpr.and(isForwardedExpr, isNotMultiSelectionExpr))
1801
+ }));
1802
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1803
+ group: '2_localaddress',
1804
+ order: 0,
1805
+ command: {
1806
+ id: CopyAddressAction.INLINE_ID,
1807
+ title: CopyAddressAction.INLINE_LABEL,
1808
+ },
1809
+ when: ( ContextKeyExpr.and(isForwardedOrDetectedExpr, isNotMultiSelectionExpr))
1810
+ }));
1811
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1812
+ group: '2_localaddress',
1813
+ order: 1,
1814
+ command: {
1815
+ id: ChangeLocalPortAction.ID,
1816
+ title: ChangeLocalPortAction.LABEL,
1817
+ },
1818
+ when: ( ContextKeyExpr.and(isForwardedExpr, PortChangableContextKey, isNotMultiSelectionExpr))
1819
+ }));
1820
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1821
+ group: '2_localaddress',
1822
+ order: 2,
1823
+ submenu: MenuId.TunnelPrivacy,
1824
+ title: ( nls.localizeWithPath(
1825
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1826
+ 'tunnelContext.privacyMenu',
1827
+ "Port Visibility"
1828
+ )),
1829
+ when: ( ContextKeyExpr.and(isForwardedExpr, TunnelPrivacyEnabledContextKey))
1830
+ }));
1831
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1832
+ group: '2_localaddress',
1833
+ order: 3,
1834
+ submenu: MenuId.TunnelProtocol,
1835
+ title: ( nls.localizeWithPath(
1836
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1837
+ 'tunnelContext.protocolMenu',
1838
+ "Change Port Protocol"
1839
+ )),
1840
+ when: ( ContextKeyExpr.and(isForwardedExpr, isNotMultiSelectionExpr))
1841
+ }));
1842
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1843
+ group: '3_forward',
1844
+ order: 0,
1845
+ command: {
1846
+ id: ClosePortAction.INLINE_ID,
1847
+ title: ClosePortAction.LABEL,
1848
+ },
1849
+ when: TunnelCloseableContextKey
1850
+ }));
1851
+ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
1852
+ group: '3_forward',
1853
+ order: 1,
1854
+ command: {
1855
+ id: ForwardPortAction.INLINE_ID,
1856
+ title: ForwardPortAction.LABEL,
1857
+ },
1858
+ }));
1859
+ MenuRegistry.appendMenuItem(MenuId.TunnelProtocol, ({
1860
+ order: 0,
1861
+ command: {
1862
+ id: SetTunnelProtocolAction.ID_HTTP,
1863
+ title: SetTunnelProtocolAction.LABEL_HTTP,
1864
+ toggled: ( TunnelProtocolContextKey.isEqualTo(TunnelProtocol.Http))
1865
+ }
1866
+ }));
1867
+ MenuRegistry.appendMenuItem(MenuId.TunnelProtocol, ({
1868
+ order: 1,
1869
+ command: {
1870
+ id: SetTunnelProtocolAction.ID_HTTPS,
1871
+ title: SetTunnelProtocolAction.LABEL_HTTPS,
1872
+ toggled: ( TunnelProtocolContextKey.isEqualTo(TunnelProtocol.Https))
1873
+ }
1874
+ }));
1875
+ MenuRegistry.appendMenuItem(MenuId.TunnelPortInline, ({
1876
+ group: '0_manage',
1877
+ order: 0,
1878
+ command: {
1879
+ id: ForwardPortAction.INLINE_ID,
1880
+ title: ForwardPortAction.TREEITEM_LABEL,
1881
+ icon: forwardPortIcon
1882
+ },
1883
+ when: ( TunnelTypeContextKey.isEqualTo(TunnelType.Candidate))
1884
+ }));
1885
+ MenuRegistry.appendMenuItem(MenuId.TunnelPortInline, ({
1886
+ group: '0_manage',
1887
+ order: 4,
1888
+ command: {
1889
+ id: LabelTunnelAction.ID,
1890
+ title: LabelTunnelAction.LABEL,
1891
+ icon: labelPortIcon
1892
+ },
1893
+ when: isForwardedExpr
1894
+ }));
1895
+ MenuRegistry.appendMenuItem(MenuId.TunnelPortInline, ({
1896
+ group: '0_manage',
1897
+ order: 5,
1898
+ command: {
1899
+ id: ClosePortAction.INLINE_ID,
1900
+ title: ClosePortAction.LABEL,
1901
+ icon: stopForwardIcon
1902
+ },
1903
+ when: TunnelCloseableContextKey
1904
+ }));
1905
+ MenuRegistry.appendMenuItem(MenuId.TunnelLocalAddressInline, ({
1906
+ order: -1,
1907
+ command: {
1908
+ id: CopyAddressAction.INLINE_ID,
1909
+ title: CopyAddressAction.INLINE_LABEL,
1910
+ icon: copyAddressIcon
1911
+ },
1912
+ when: isForwardedOrDetectedExpr
1913
+ }));
1914
+ MenuRegistry.appendMenuItem(MenuId.TunnelLocalAddressInline, ({
1915
+ order: 0,
1916
+ command: {
1917
+ id: OpenPortInBrowserAction.ID,
1918
+ title: OpenPortInBrowserAction.LABEL,
1919
+ icon: openBrowserIcon
1920
+ },
1921
+ when: isForwardedOrDetectedExpr
1922
+ }));
1923
+ MenuRegistry.appendMenuItem(MenuId.TunnelLocalAddressInline, ({
1924
+ order: 1,
1925
+ command: {
1926
+ id: OpenPortInPreviewAction.ID,
1927
+ title: OpenPortInPreviewAction.LABEL,
1928
+ icon: openPreviewIcon
1929
+ },
1930
+ when: isForwardedOrDetectedExpr
1931
+ }));
1932
+ registerColor('ports.iconRunningProcessForeground', {
1933
+ light: STATUS_BAR_REMOTE_ITEM_BACKGROUND,
1934
+ dark: STATUS_BAR_REMOTE_ITEM_BACKGROUND,
1935
+ hcDark: STATUS_BAR_REMOTE_ITEM_BACKGROUND,
1936
+ hcLight: STATUS_BAR_REMOTE_ITEM_BACKGROUND
1937
+ }, ( nls.localizeWithPath(
1938
+ 'vs/workbench/contrib/remote/browser/tunnelView',
1939
+ 'portWithRunningProcess.foreground',
1940
+ "The color of the icon for a port that has an associated running process."
1941
+ )));
1942
+ export { ForwardPortAction, OpenPortInBrowserAction, OpenPortInPreviewAction, TunnelPanel, TunnelPanelDescriptor, TunnelViewModel, openPreviewEnabledContext };