@theia/plugin-ext 1.53.2 → 1.54.0

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 (287) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +10 -1
  2. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  4. package/lib/common/plugin-api-rpc.d.ts +7 -6
  5. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  6. package/lib/common/plugin-api-rpc.js.map +1 -1
  7. package/lib/common/test-types.d.ts +11 -1
  8. package/lib/common/test-types.d.ts.map +1 -1
  9. package/lib/common/test-types.js +9 -1
  10. package/lib/common/test-types.js.map +1 -1
  11. package/lib/main/browser/authentication-main.d.ts +6 -6
  12. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  13. package/lib/main/browser/authentication-main.js +15 -9
  14. package/lib/main/browser/authentication-main.js.map +1 -1
  15. package/lib/main/browser/command-registry-main.d.ts +0 -1
  16. package/lib/main/browser/command-registry-main.d.ts.map +1 -1
  17. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +5 -3
  18. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  19. package/lib/main/browser/custom-editors/custom-editor-opener.js +16 -3
  20. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  21. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +0 -1
  22. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  23. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
  24. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
  25. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -2
  26. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
  27. package/lib/main/browser/debug/plugin-debug-service.d.ts +0 -1
  28. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  29. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  30. package/lib/main/browser/editors-and-documents-main.js +14 -2
  31. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  32. package/lib/main/browser/languages-main.d.ts +0 -1
  33. package/lib/main/browser/languages-main.d.ts.map +1 -1
  34. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
  35. package/lib/main/browser/menus/plugin-menu-command-adapter.js +2 -2
  36. package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
  37. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
  38. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +2 -0
  39. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
  40. package/lib/main/browser/notebooks/notebooks-main.d.ts +0 -1
  41. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  42. package/lib/main/browser/quick-open-main.d.ts +0 -1
  43. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  44. package/lib/main/browser/tabs/tabs-main.d.ts +1 -1
  45. package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
  46. package/lib/main/browser/tabs/tabs-main.js +1 -1
  47. package/lib/main/browser/tabs/tabs-main.js.map +1 -1
  48. package/lib/main/browser/terminal-main.d.ts +0 -1
  49. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  50. package/lib/main/browser/test-main.d.ts.map +1 -1
  51. package/lib/main/browser/test-main.js.map +1 -1
  52. package/lib/main/browser/text-editor-main.d.ts +6 -3
  53. package/lib/main/browser/text-editor-main.d.ts.map +1 -1
  54. package/lib/main/browser/text-editor-main.js +39 -5
  55. package/lib/main/browser/text-editor-main.js.map +1 -1
  56. package/lib/main/browser/view/tree-view-decorator-service.d.ts +0 -1
  57. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  58. package/lib/main/browser/view/tree-view-widget.d.ts +0 -1
  59. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  60. package/lib/main/browser/view/tree-views-main.d.ts +0 -1
  61. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  62. package/lib/main/browser/webview/webview.d.ts +0 -1
  63. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  64. package/lib/main/browser/webview-views/webview-views-main.d.ts +0 -1
  65. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  66. package/lib/main/browser/webviews-main.d.ts +0 -1
  67. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  68. package/lib/main/browser/workspace-main.d.ts +0 -1
  69. package/lib/main/browser/workspace-main.d.ts.map +1 -1
  70. package/lib/plugin/authentication-ext.d.ts +3 -3
  71. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  72. package/lib/plugin/authentication-ext.js +8 -5
  73. package/lib/plugin/authentication-ext.js.map +1 -1
  74. package/lib/plugin/clipboard-ext.d.ts +0 -1
  75. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  76. package/lib/plugin/command-registry.d.ts +0 -1
  77. package/lib/plugin/command-registry.d.ts.map +1 -1
  78. package/lib/plugin/comments.d.ts +0 -1
  79. package/lib/plugin/comments.d.ts.map +1 -1
  80. package/lib/plugin/custom-editors.d.ts +0 -1
  81. package/lib/plugin/custom-editors.d.ts.map +1 -1
  82. package/lib/plugin/debug/debug-ext.d.ts +0 -1
  83. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  84. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +0 -1
  85. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
  86. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +0 -1
  87. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  88. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +0 -1
  89. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
  90. package/lib/plugin/decorations.d.ts +0 -1
  91. package/lib/plugin/decorations.d.ts.map +1 -1
  92. package/lib/plugin/dialogs.d.ts +0 -1
  93. package/lib/plugin/dialogs.d.ts.map +1 -1
  94. package/lib/plugin/document-data.d.ts +0 -1
  95. package/lib/plugin/document-data.d.ts.map +1 -1
  96. package/lib/plugin/documents.d.ts +0 -1
  97. package/lib/plugin/documents.d.ts.map +1 -1
  98. package/lib/plugin/env.d.ts +0 -1
  99. package/lib/plugin/env.d.ts.map +1 -1
  100. package/lib/plugin/file-system-event-service-ext-impl.d.ts +0 -1
  101. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  102. package/lib/plugin/file-system-ext-impl.d.ts +0 -1
  103. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  104. package/lib/plugin/label-service.d.ts +0 -1
  105. package/lib/plugin/label-service.d.ts.map +1 -1
  106. package/lib/plugin/languages/call-hierarchy.d.ts +0 -1
  107. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  108. package/lib/plugin/languages/code-action.d.ts +0 -1
  109. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  110. package/lib/plugin/languages/color.d.ts +0 -1
  111. package/lib/plugin/languages/color.d.ts.map +1 -1
  112. package/lib/plugin/languages/completion.d.ts +0 -1
  113. package/lib/plugin/languages/completion.d.ts.map +1 -1
  114. package/lib/plugin/languages/declaration.d.ts +0 -1
  115. package/lib/plugin/languages/declaration.d.ts.map +1 -1
  116. package/lib/plugin/languages/definition.d.ts +0 -1
  117. package/lib/plugin/languages/definition.d.ts.map +1 -1
  118. package/lib/plugin/languages/diagnostics.d.ts +0 -1
  119. package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
  120. package/lib/plugin/languages/document-drop-edit.d.ts +0 -1
  121. package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
  122. package/lib/plugin/languages/document-formatting.d.ts +0 -1
  123. package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
  124. package/lib/plugin/languages/document-highlight.d.ts +0 -1
  125. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  126. package/lib/plugin/languages/evaluatable-expression.d.ts +0 -1
  127. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
  128. package/lib/plugin/languages/folding.d.ts +0 -1
  129. package/lib/plugin/languages/folding.d.ts.map +1 -1
  130. package/lib/plugin/languages/hover.d.ts +0 -1
  131. package/lib/plugin/languages/hover.d.ts.map +1 -1
  132. package/lib/plugin/languages/implementation.d.ts +0 -1
  133. package/lib/plugin/languages/implementation.d.ts.map +1 -1
  134. package/lib/plugin/languages/inlay-hints.d.ts +0 -1
  135. package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
  136. package/lib/plugin/languages/inline-completion.d.ts +0 -1
  137. package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
  138. package/lib/plugin/languages/inline-values.d.ts +0 -1
  139. package/lib/plugin/languages/inline-values.d.ts.map +1 -1
  140. package/lib/plugin/languages/lens.d.ts +0 -1
  141. package/lib/plugin/languages/lens.d.ts.map +1 -1
  142. package/lib/plugin/languages/link-provider.d.ts +0 -1
  143. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  144. package/lib/plugin/languages/linked-editing-range.d.ts +0 -1
  145. package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
  146. package/lib/plugin/languages/on-type-formatting.d.ts +0 -1
  147. package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
  148. package/lib/plugin/languages/outline.d.ts +0 -1
  149. package/lib/plugin/languages/outline.d.ts.map +1 -1
  150. package/lib/plugin/languages/range-formatting.d.ts +0 -1
  151. package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
  152. package/lib/plugin/languages/reference.d.ts +0 -1
  153. package/lib/plugin/languages/reference.d.ts.map +1 -1
  154. package/lib/plugin/languages/rename.d.ts +0 -1
  155. package/lib/plugin/languages/rename.d.ts.map +1 -1
  156. package/lib/plugin/languages/selection-range.d.ts +0 -1
  157. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  158. package/lib/plugin/languages/semantic-highlighting.d.ts +0 -1
  159. package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
  160. package/lib/plugin/languages/signature.d.ts +0 -1
  161. package/lib/plugin/languages/signature.d.ts.map +1 -1
  162. package/lib/plugin/languages/type-definition.d.ts +0 -1
  163. package/lib/plugin/languages/type-definition.d.ts.map +1 -1
  164. package/lib/plugin/languages/type-hierarchy.d.ts +0 -1
  165. package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
  166. package/lib/plugin/languages/util.d.ts +0 -1
  167. package/lib/plugin/languages/util.d.ts.map +1 -1
  168. package/lib/plugin/languages/workspace-symbol.d.ts +0 -1
  169. package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
  170. package/lib/plugin/languages-utils.d.ts +0 -1
  171. package/lib/plugin/languages-utils.d.ts.map +1 -1
  172. package/lib/plugin/languages.d.ts +0 -1
  173. package/lib/plugin/languages.d.ts.map +1 -1
  174. package/lib/plugin/markdown-string.d.ts +0 -1
  175. package/lib/plugin/markdown-string.d.ts.map +1 -1
  176. package/lib/plugin/message-registry.d.ts +0 -1
  177. package/lib/plugin/message-registry.d.ts.map +1 -1
  178. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +0 -1
  179. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
  180. package/lib/plugin/notebook/notebook-document.d.ts +0 -1
  181. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  182. package/lib/plugin/notebook/notebook-documents.d.ts +0 -1
  183. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
  184. package/lib/plugin/notebook/notebook-editor.d.ts +0 -1
  185. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
  186. package/lib/plugin/notebook/notebook-editors.d.ts +0 -1
  187. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
  188. package/lib/plugin/notebook/notebook-kernels.d.ts +0 -1
  189. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  190. package/lib/plugin/notebook/notebook-renderers.d.ts +0 -1
  191. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  192. package/lib/plugin/notebook/notebooks.d.ts +1 -1
  193. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  194. package/lib/plugin/notebook/notebooks.js +22 -2
  195. package/lib/plugin/notebook/notebooks.js.map +1 -1
  196. package/lib/plugin/notification.d.ts +0 -1
  197. package/lib/plugin/notification.d.ts.map +1 -1
  198. package/lib/plugin/output-channel/log-output-channel.d.ts +0 -1
  199. package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
  200. package/lib/plugin/output-channel/output-channel-item.d.ts +0 -1
  201. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  202. package/lib/plugin/output-channel-registry.d.ts +0 -1
  203. package/lib/plugin/output-channel-registry.d.ts.map +1 -1
  204. package/lib/plugin/plugin-context.d.ts +0 -1
  205. package/lib/plugin/plugin-context.d.ts.map +1 -1
  206. package/lib/plugin/plugin-context.js +4 -0
  207. package/lib/plugin/plugin-context.js.map +1 -1
  208. package/lib/plugin/plugin-manager.d.ts +0 -1
  209. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  210. package/lib/plugin/plugin-storage.d.ts +0 -1
  211. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  212. package/lib/plugin/preference-registry.d.ts +0 -1
  213. package/lib/plugin/preference-registry.d.ts.map +1 -1
  214. package/lib/plugin/quick-open.d.ts +0 -1
  215. package/lib/plugin/quick-open.d.ts.map +1 -1
  216. package/lib/plugin/scm.d.ts +0 -1
  217. package/lib/plugin/scm.d.ts.map +1 -1
  218. package/lib/plugin/secrets-ext.d.ts +0 -1
  219. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  220. package/lib/plugin/status-bar/status-bar-item.d.ts +0 -1
  221. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  222. package/lib/plugin/status-bar-message-registry.d.ts +0 -1
  223. package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
  224. package/lib/plugin/tabs.d.ts +0 -1
  225. package/lib/plugin/tabs.d.ts.map +1 -1
  226. package/lib/plugin/tasks/task-provider.d.ts +0 -1
  227. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  228. package/lib/plugin/tasks/tasks.d.ts +0 -1
  229. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  230. package/lib/plugin/terminal-ext.d.ts +1 -1
  231. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  232. package/lib/plugin/terminal-ext.js +1 -0
  233. package/lib/plugin/terminal-ext.js.map +1 -1
  234. package/lib/plugin/test-item.d.ts +0 -1
  235. package/lib/plugin/test-item.d.ts.map +1 -1
  236. package/lib/plugin/tests.d.ts +8 -2
  237. package/lib/plugin/tests.d.ts.map +1 -1
  238. package/lib/plugin/tests.js +24 -1
  239. package/lib/plugin/tests.js.map +1 -1
  240. package/lib/plugin/text-editor.d.ts +1 -2
  241. package/lib/plugin/text-editor.d.ts.map +1 -1
  242. package/lib/plugin/text-editor.js.map +1 -1
  243. package/lib/plugin/text-editors.d.ts +0 -1
  244. package/lib/plugin/text-editors.d.ts.map +1 -1
  245. package/lib/plugin/timeline.d.ts +0 -1
  246. package/lib/plugin/timeline.d.ts.map +1 -1
  247. package/lib/plugin/tree/tree-views.d.ts +0 -1
  248. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  249. package/lib/plugin/type-converters.d.ts +13 -2
  250. package/lib/plugin/type-converters.d.ts.map +1 -1
  251. package/lib/plugin/type-converters.js +55 -5
  252. package/lib/plugin/type-converters.js.map +1 -1
  253. package/lib/plugin/types-impl.d.ts +7 -1
  254. package/lib/plugin/types-impl.d.ts.map +1 -1
  255. package/lib/plugin/types-impl.js +9 -1
  256. package/lib/plugin/types-impl.js.map +1 -1
  257. package/lib/plugin/uri-ext.d.ts +0 -1
  258. package/lib/plugin/uri-ext.d.ts.map +1 -1
  259. package/lib/plugin/webview-views.d.ts +0 -1
  260. package/lib/plugin/webview-views.d.ts.map +1 -1
  261. package/lib/plugin/webviews.d.ts +0 -1
  262. package/lib/plugin/webviews.d.ts.map +1 -1
  263. package/lib/plugin/window-state.d.ts +0 -1
  264. package/lib/plugin/window-state.d.ts.map +1 -1
  265. package/lib/plugin/workspace.d.ts +0 -1
  266. package/lib/plugin/workspace.d.ts.map +1 -1
  267. package/package.json +29 -29
  268. package/src/common/plugin-api-rpc-model.ts +11 -0
  269. package/src/common/plugin-api-rpc.ts +7 -5
  270. package/src/common/test-types.ts +15 -1
  271. package/src/main/browser/authentication-main.ts +24 -11
  272. package/src/main/browser/custom-editors/custom-editor-opener.tsx +19 -4
  273. package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +7 -3
  274. package/src/main/browser/editors-and-documents-main.ts +25 -2
  275. package/src/main/browser/menus/plugin-menu-command-adapter.ts +2 -2
  276. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +4 -1
  277. package/src/main/browser/tabs/tabs-main.ts +6 -2
  278. package/src/main/browser/test-main.ts +4 -1
  279. package/src/main/browser/text-editor-main.ts +55 -14
  280. package/src/plugin/authentication-ext.ts +9 -5
  281. package/src/plugin/notebook/notebooks.ts +21 -0
  282. package/src/plugin/plugin-context.ts +6 -1
  283. package/src/plugin/terminal-ext.ts +1 -0
  284. package/src/plugin/tests.ts +34 -3
  285. package/src/plugin/text-editor.ts +1 -1
  286. package/src/plugin/type-converters.ts +58 -6
  287. package/src/plugin/types-impl.ts +10 -1
@@ -72,6 +72,17 @@ export interface Range {
72
72
  readonly endColumn: number;
73
73
  }
74
74
 
75
+ export interface Position {
76
+ /**
77
+ * line number (starts at 1)
78
+ */
79
+ readonly lineNumber: number,
80
+ /**
81
+ * column (starts at 1)
82
+ */
83
+ readonly column: number
84
+ }
85
+
75
86
  export { MarkdownStringDTO as MarkdownString };
76
87
 
77
88
  export interface SerializedDocumentFilter {
@@ -805,9 +805,9 @@ export interface RegisterTreeDataProviderOptions {
805
805
  }
806
806
 
807
807
  export interface TreeViewRevealOptions {
808
- select: boolean
809
- focus: boolean
810
- expand: boolean | number
808
+ readonly select: boolean
809
+ readonly focus: boolean
810
+ readonly expand: boolean | number
811
811
  }
812
812
 
813
813
  export interface TreeViewsMain {
@@ -2398,13 +2398,14 @@ export interface TasksMain {
2398
2398
  }
2399
2399
 
2400
2400
  export interface AuthenticationExt {
2401
- $getSessions(id: string, scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>>;
2402
- $createSession(id: string, scopes: string[]): Promise<theia.AuthenticationSession>;
2401
+ $getSessions(providerId: string, scopes: string[] | undefined, options: theia.AuthenticationProviderSessionOptions): Promise<ReadonlyArray<theia.AuthenticationSession>>;
2402
+ $createSession(id: string, scopes: string[], options: theia.AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession>;
2403
2403
  $removeSession(id: string, sessionId: string): Promise<void>;
2404
2404
  $onDidChangeAuthenticationSessions(provider: theia.AuthenticationProviderInformation): Promise<void>;
2405
2405
  }
2406
2406
 
2407
2407
  export interface AuthenticationMain {
2408
+ $getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]>;
2408
2409
  $registerAuthenticationProvider(id: string, label: string, supportsMultipleAccounts: boolean): void;
2409
2410
  $unregisterAuthenticationProvider(id: string): void;
2410
2411
  $onDidChangeSessions(providerId: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent): void;
@@ -2672,6 +2673,7 @@ export interface NotebookDocumentsExt {
2672
2673
 
2673
2674
  export interface NotebookDocumentsAndEditorsExt {
2674
2675
  $acceptDocumentsAndEditorsDelta(delta: NotebookDocumentsAndEditorsDelta): Promise<void>;
2676
+ $acceptActiveCellEditorChange(newActiveEditor: string | null): void;
2675
2677
  }
2676
2678
 
2677
2679
  export interface NotebookDocumentsAndEditorsMain extends Disposable {
@@ -27,6 +27,7 @@ import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
27
27
  import { UriComponents } from './uri-components';
28
28
  import { Location, Range } from './plugin-api-rpc-model';
29
29
  import { isObject } from '@theia/core';
30
+ import * as languageProtocol from '@theia/core/shared/vscode-languageserver-protocol';
30
31
 
31
32
  export enum TestRunProfileKind {
32
33
  Run = 1,
@@ -74,17 +75,30 @@ export interface TestFailureDTO extends TestStateChangeDTO {
74
75
  readonly duration?: number;
75
76
  }
76
77
 
78
+ export namespace TestFailureDTO {
79
+ export function is(ref: unknown): ref is TestFailureDTO {
80
+ return isObject<TestFailureDTO>(ref)
81
+ && (ref.state === TestExecutionState.Failed || ref.state === TestExecutionState.Errored);
82
+ }
83
+ }
77
84
  export interface TestSuccessDTO extends TestStateChangeDTO {
78
85
  readonly state: TestExecutionState.Passed;
79
86
  readonly duration?: number;
80
87
  }
81
88
 
89
+ export interface TestMessageStackFrameDTO {
90
+ uri?: languageProtocol.DocumentUri;
91
+ position?: languageProtocol.Position;
92
+ label: string;
93
+ }
94
+
82
95
  export interface TestMessageDTO {
83
96
  readonly expected?: string;
84
97
  readonly actual?: string;
85
- readonly location?: Location;
98
+ readonly location?: languageProtocol.Location;
86
99
  readonly message: string | MarkdownString;
87
100
  readonly contextValue?: string;
101
+ readonly stackTrace?: TestMessageStackFrameDTO[];
88
102
  }
89
103
 
90
104
  export interface TestItemDTO {
@@ -27,7 +27,10 @@ import { MessageService } from '@theia/core/lib/common/message-service';
27
27
  import { ConfirmDialog, Dialog, StorageService } from '@theia/core/lib/browser';
28
28
  import {
29
29
  AuthenticationProvider,
30
+ AuthenticationProviderSessionOptions,
30
31
  AuthenticationService,
32
+ AuthenticationSession,
33
+ AuthenticationSessionAccountInformation,
31
34
  readAllowedExtensions
32
35
  } from '@theia/core/lib/browser/authentication-service';
33
36
  import { QuickPickService } from '@theia/core/lib/common/quick-pick-service';
@@ -77,9 +80,13 @@ export class AuthenticationMainImpl implements AuthenticationMain {
77
80
  return this.authenticationService.requestNewSession(providerId, scopes, extensionId, extensionName);
78
81
  }
79
82
 
83
+ $getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
84
+ return this.authenticationService.getSessions(providerId).then(sessions => sessions.map(session => session.account));
85
+ }
86
+
80
87
  async $getSession(providerId: string, scopes: string[], extensionId: string, extensionName: string,
81
88
  options: theia.AuthenticationGetSessionOptions): Promise<theia.AuthenticationSession | undefined> {
82
- const sessions = await this.authenticationService.getSessions(providerId, scopes);
89
+ const sessions = await this.authenticationService.getSessions(providerId, scopes, options?.account);
83
90
 
84
91
  // Error cases
85
92
  if (options.forceNewSession && !sessions.length) {
@@ -140,26 +147,32 @@ export class AuthenticationMainImpl implements AuthenticationMain {
140
147
  }
141
148
 
142
149
  protected async selectSession(providerId: string, providerName: string, extensionId: string, extensionName: string,
143
- potentialSessions: Readonly<theia.AuthenticationSession[]>, scopes: string[], clearSessionPreference: boolean): Promise<theia.AuthenticationSession> {
150
+ potentialSessions: Readonly<AuthenticationSession[]>, scopes: string[], clearSessionPreference: boolean): Promise<theia.AuthenticationSession> {
151
+
144
152
  if (!potentialSessions.length) {
145
153
  throw new Error('No potential sessions found');
146
154
  }
147
155
 
148
156
  return new Promise(async (resolve, reject) => {
149
- const items: QuickPickValue<{ session?: theia.AuthenticationSession }>[] = potentialSessions.map(session => ({
157
+ const items: QuickPickValue<{ session?: AuthenticationSession, account?: AuthenticationSessionAccountInformation }>[] = potentialSessions.map(session => ({
150
158
  label: session.account.label,
151
159
  value: { session }
152
160
  }));
153
161
  items.push({
154
162
  label: nls.localizeByDefault('Sign in to another account'),
155
- value: { session: undefined }
163
+ value: {}
156
164
  });
165
+
166
+ // VS Code has code here that pushes accounts that have no active sessions. However, since we do not store
167
+ // any accounts that don't have sessions, we dont' do this.
157
168
  const selected = await this.quickPickService.show(items,
158
169
  {
159
170
  title: nls.localizeByDefault("The extension '{0}' wants to access a {1} account", extensionName, providerName),
160
171
  ignoreFocusOut: true
161
172
  });
162
173
  if (selected) {
174
+
175
+ // if we ever have accounts without sessions, pass the account to the login call
163
176
  const session = selected.value?.session ?? await this.authenticationService.login(providerId, scopes);
164
177
  const accountName = session.account.label;
165
178
 
@@ -318,13 +331,13 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
318
331
  }
319
332
  }
320
333
 
321
- async getSessions(scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>> {
322
- return this.proxy.$getSessions(this.id, scopes);
334
+ async getSessions(scopes?: string[], account?: AuthenticationSessionAccountInformation): Promise<ReadonlyArray<theia.AuthenticationSession>> {
335
+ return this.proxy.$getSessions(this.id, scopes, { account: account });
323
336
  }
324
337
 
325
338
  async updateSessionItems(event: theia.AuthenticationProviderAuthenticationSessionsChangeEvent): Promise<void> {
326
339
  const { added, removed } = event;
327
- const session = await this.proxy.$getSessions(this.id);
340
+ const session = await this.proxy.$getSessions(this.id, undefined, {});
328
341
  const addedSessions = added ? session.filter(s => added.some(addedSession => addedSession.id === s.id)) : [];
329
342
 
330
343
  removed?.forEach(removedSession => {
@@ -347,16 +360,16 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
347
360
  addedSessions.forEach(s => this.registerSession(s));
348
361
  }
349
362
 
350
- async login(scopes: string[]): Promise<theia.AuthenticationSession> {
351
- return this.createSession(scopes);
363
+ async login(scopes: string[], options: AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession> {
364
+ return this.createSession(scopes, options);
352
365
  }
353
366
 
354
367
  async logout(sessionId: string): Promise<void> {
355
368
  return this.removeSession(sessionId);
356
369
  }
357
370
 
358
- createSession(scopes: string[]): Thenable<theia.AuthenticationSession> {
359
- return this.proxy.$createSession(this.id, scopes);
371
+ createSession(scopes: string[], options: AuthenticationProviderSessionOptions): Thenable<theia.AuthenticationSession> {
372
+ return this.proxy.$createSession(this.id, scopes, options);
360
373
  }
361
374
 
362
375
  removeSession(sessionId: string): Thenable<void> {
@@ -15,7 +15,9 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import URI from '@theia/core/lib/common/uri';
18
- import { ApplicationShell, DiffUris, OpenHandler, SplitWidget, Widget, WidgetManager, WidgetOpenerOptions } from '@theia/core/lib/browser';
18
+ import {
19
+ ApplicationShell, DiffUris, OpenHandler, OpenerOptions, PreferenceService, SplitWidget, Widget, WidgetManager, WidgetOpenerOptions, getDefaultHandler, defaultHandlerPriority
20
+ } from '@theia/core/lib/browser';
19
21
  import { CustomEditor, CustomEditorPriority, CustomEditorSelector } from '../../../common';
20
22
  import { CustomEditorWidget } from './custom-editor-widget';
21
23
  import { PluginCustomEditorRegistry } from './plugin-custom-editor-registry';
@@ -35,7 +37,8 @@ export class CustomEditorOpener implements OpenHandler {
35
37
  private readonly editor: CustomEditor,
36
38
  protected readonly shell: ApplicationShell,
37
39
  protected readonly widgetManager: WidgetManager,
38
- protected readonly editorRegistry: PluginCustomEditorRegistry
40
+ protected readonly editorRegistry: PluginCustomEditorRegistry,
41
+ protected readonly preferenceService: PreferenceService
39
42
  ) {
40
43
  this.id = CustomEditorOpener.toCustomEditorId(this.editor.viewType);
41
44
  this.label = this.editor.displayName;
@@ -45,14 +48,26 @@ export class CustomEditorOpener implements OpenHandler {
45
48
  return `custom-editor-${editorViewType}`;
46
49
  }
47
50
 
48
- canHandle(uri: URI): number {
51
+ canHandle(uri: URI, options?: OpenerOptions): number {
52
+ let priority = 0;
49
53
  const { selector } = this.editor;
50
54
  if (DiffUris.isDiffUri(uri)) {
51
55
  const [left, right] = DiffUris.decode(uri);
52
56
  if (this.matches(selector, right) && this.matches(selector, left)) {
53
- return this.getPriority();
57
+ priority = this.getPriority();
54
58
  }
55
59
  } else if (this.matches(selector, uri)) {
60
+ if (getDefaultHandler(uri, this.preferenceService) === this.editor.viewType) {
61
+ priority = defaultHandlerPriority;
62
+ } else {
63
+ priority = this.getPriority();
64
+ }
65
+ }
66
+ return priority;
67
+ }
68
+
69
+ canOpenWith(uri: URI): number {
70
+ if (this.matches(this.editor.selector, uri)) {
56
71
  return this.getPriority();
57
72
  }
58
73
  return 0;
@@ -20,7 +20,7 @@ import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposa
20
20
  import { Deferred } from '@theia/core/lib/common/promise-util';
21
21
  import { CustomEditorOpener } from './custom-editor-opener';
22
22
  import { Emitter } from '@theia/core';
23
- import { ApplicationShell, DefaultOpenerService, OpenWithService, WidgetManager } from '@theia/core/lib/browser';
23
+ import { ApplicationShell, DefaultOpenerService, OpenWithService, PreferenceService, WidgetManager } from '@theia/core/lib/browser';
24
24
  import { CustomEditorWidget } from './custom-editor-widget';
25
25
 
26
26
  @injectable()
@@ -44,6 +44,9 @@ export class PluginCustomEditorRegistry {
44
44
  @inject(OpenWithService)
45
45
  protected readonly openWithService: OpenWithService;
46
46
 
47
+ @inject(PreferenceService)
48
+ protected readonly preferenceService: PreferenceService;
49
+
47
50
  @postConstruct()
48
51
  protected init(): void {
49
52
  this.widgetManager.onDidCreateWidget(({ factoryId, widget }) => {
@@ -76,7 +79,8 @@ export class PluginCustomEditorRegistry {
76
79
  editor,
77
80
  this.shell,
78
81
  this.widgetManager,
79
- this
82
+ this,
83
+ this.preferenceService
80
84
  );
81
85
  toDispose.push(this.defaultOpenerService.addHandler(editorOpenHandler));
82
86
  toDispose.push(
@@ -84,7 +88,7 @@ export class PluginCustomEditorRegistry {
84
88
  id: editor.viewType,
85
89
  label: editorOpenHandler.label,
86
90
  providerName: plugin.metadata.model.displayName,
87
- canHandle: uri => editorOpenHandler.canHandle(uri),
91
+ canHandle: uri => editorOpenHandler.canOpenWith(uri),
88
92
  open: uri => editorOpenHandler.open(uri)
89
93
  })
90
94
  );
@@ -34,6 +34,8 @@ import { DisposableCollection, Emitter, URI } from '@theia/core';
34
34
  import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
35
35
  import { SaveableService } from '@theia/core/lib/browser/saveable-service';
36
36
  import { TabsMainImpl } from './tabs/tabs-main';
37
+ import { NotebookCellEditorService, NotebookEditorWidgetService } from '@theia/notebook/lib/browser';
38
+ import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
37
39
 
38
40
  export class EditorsAndDocumentsMain implements Disposable {
39
41
 
@@ -67,7 +69,11 @@ export class EditorsAndDocumentsMain implements Disposable {
67
69
  this.modelService = container.get(EditorModelService);
68
70
  this.saveResourceService = container.get(SaveableService);
69
71
 
70
- this.stateComputer = new EditorAndDocumentStateComputer(d => this.onDelta(d), this.editorManager, this.modelService, tabsMain);
72
+ this.stateComputer = new EditorAndDocumentStateComputer(d => this.onDelta(d),
73
+ this.editorManager,
74
+ container.get(NotebookCellEditorService),
75
+ container.get(NotebookEditorWidgetService),
76
+ this.modelService, tabsMain);
71
77
  this.toDispose.push(this.stateComputer);
72
78
  this.toDispose.push(this.onTextEditorAddEmitter);
73
79
  this.toDispose.push(this.onTextEditorRemoveEmitter);
@@ -218,6 +224,8 @@ class EditorAndDocumentStateComputer implements Disposable {
218
224
  constructor(
219
225
  private callback: (delta: EditorAndDocumentStateDelta) => void,
220
226
  private readonly editorService: EditorManager,
227
+ private readonly cellEditorService: NotebookCellEditorService,
228
+ private readonly notebookWidgetService: NotebookEditorWidgetService,
221
229
  private readonly modelService: EditorModelService,
222
230
  private readonly tabsMain: TabsMainImpl
223
231
  ) { }
@@ -240,6 +248,16 @@ class EditorAndDocumentStateComputer implements Disposable {
240
248
  this.toDispose.push(this.modelService.onModelAdded(this.onModelAdded, this));
241
249
  this.toDispose.push(this.modelService.onModelRemoved(() => this.update()));
242
250
 
251
+ this.toDispose.push(this.cellEditorService.onDidChangeCellEditors(() => this.update()));
252
+
253
+ this.toDispose.push(this.notebookWidgetService.onDidChangeFocusedEditor(() => {
254
+ this.currentState = this.currentState && new EditorAndDocumentState(
255
+ this.currentState.documents,
256
+ this.currentState.editors,
257
+ undefined
258
+ );
259
+ }));
260
+
243
261
  for (const widget of this.editorService.all) {
244
262
  this.onTextEditorAdd(widget);
245
263
  }
@@ -318,6 +336,11 @@ class EditorAndDocumentStateComputer implements Disposable {
318
336
  }
319
337
  }
320
338
 
339
+ for (const editor of this.cellEditorService.allCellEditors) {
340
+ const editorSnapshot = new EditorSnapshot(editor);
341
+ editors.set(editorSnapshot.id, editorSnapshot);
342
+ };
343
+
321
344
  const newState = new EditorAndDocumentState(models, editors, activeId);
322
345
  const delta = EditorAndDocumentState.compute(this.currentState, newState);
323
346
  if (!delta.isEmpty) {
@@ -384,7 +407,7 @@ class EditorAndDocumentState {
384
407
 
385
408
  class EditorSnapshot {
386
409
  readonly id: string;
387
- constructor(readonly editor: MonacoEditor) {
410
+ constructor(readonly editor: MonacoEditor | SimpleMonacoEditor) {
388
411
  this.id = `${editor.getControl().getId()},${editor.getControl().getModel()!.id}`;
389
412
  }
390
413
  }
@@ -32,7 +32,6 @@ import { TreeViewWidget } from '../view/tree-view-widget';
32
32
  import { CodeEditorWidgetUtil, codeToTheiaMappings, ContributionPoint } from './vscode-theia-menu-mappings';
33
33
  import { TAB_BAR_TOOLBAR_CONTEXT_MENU } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
34
34
  import { TestItem, TestMessage } from '@theia/test/lib/browser/test-service';
35
- import { fromLocation } from '../hierarchy/hierarchy-types-converters';
36
35
 
37
36
  export type ArgumentAdapter = (...args: unknown[]) => unknown[];
38
37
 
@@ -315,7 +314,8 @@ export class PluginMenuCommandAdapter implements MenuCommandAdapter {
315
314
  actual: testMessage.actual,
316
315
  expected: testMessage.expected,
317
316
  contextValue: testMessage.contextValue,
318
- location: testMessage.location ? fromLocation(testMessage.location) : undefined
317
+ location: testMessage.location,
318
+ stackTrace: testMessage.stackTrace
319
319
  };
320
320
  return [TestMessageArg.create(testItemReference, testMessageDTO)];
321
321
  }
@@ -21,7 +21,7 @@
21
21
  import { Disposable, DisposableCollection } from '@theia/core';
22
22
  import { interfaces } from '@theia/core/shared/inversify';
23
23
  import { UriComponents } from '@theia/core/lib/common/uri';
24
- import { NotebookEditorWidget, NotebookService, NotebookEditorWidgetService } from '@theia/notebook/lib/browser';
24
+ import { NotebookEditorWidget, NotebookService, NotebookEditorWidgetService, NotebookCellEditorService } from '@theia/notebook/lib/browser';
25
25
  import { NotebookModel } from '@theia/notebook/lib/browser/view-model/notebook-model';
26
26
  import { MAIN_RPC_CONTEXT, NotebookDocumentsAndEditorsDelta, NotebookDocumentsAndEditorsMain, NotebookEditorAddData, NotebookModelAddedData, NotebooksExt } from '../../../common';
27
27
  import { RPCProtocol } from '../../../common/rpc-protocol';
@@ -105,6 +105,9 @@ export class NotebooksAndEditorsMain implements NotebookDocumentsAndEditorsMain
105
105
  this.notebookService = container.get(NotebookService);
106
106
  this.notebookEditorService = container.get(NotebookEditorWidgetService);
107
107
  this.WidgetManager = container.get(WidgetManager);
108
+ const notebookCellEditorService = container.get(NotebookCellEditorService);
109
+
110
+ notebookCellEditorService.onDidChangeFocusedCellEditor(editor => this.proxy.$acceptActiveCellEditorChange(editor?.uri.toString() ?? null), this, this.disposables);
108
111
 
109
112
  this.notebookService.onDidAddNotebookDocument(async () => this.updateState(), this, this.disposables);
110
113
  this.notebookService.onDidRemoveNotebookDocument(async () => this.updateState(), this, this.disposables);
@@ -231,9 +231,13 @@ export class TabsMainImpl implements TabsMain, Disposable {
231
231
  return { kind: TabInputKind.UnknownInput };
232
232
  }
233
233
 
234
- protected connectToSignal<T>(disposableList: DisposableCollection, signal: { connect(listener: T, context: unknown): void, disconnect(listener: T): void }, listener: T): void {
234
+ protected connectToSignal<T>(disposableList: DisposableCollection,
235
+ signal: {
236
+ connect(listener: T, context: unknown): void,
237
+ disconnect(listener: T, context: unknown): void
238
+ }, listener: T): void {
235
239
  signal.connect(listener, this);
236
- disposableList.push(Disposable.create(() => signal.disconnect(listener)));
240
+ disposableList.push(Disposable.create(() => signal.disconnect(listener, this)));
237
241
  }
238
242
 
239
243
  protected tabDtosEqual(a: TabDto, b: TabDto): boolean {
@@ -27,7 +27,10 @@ import { CancellationToken, Disposable, Event, URI } from '@theia/core';
27
27
  import { MAIN_RPC_CONTEXT, TestControllerUpdate, TestingExt, TestingMain } from '../../common';
28
28
  import { RPCProtocol } from '../../common/rpc-protocol';
29
29
  import { interfaces } from '@theia/core/shared/inversify';
30
- import { TestExecutionState, TestItemDTO, TestItemReference, TestOutputDTO, TestRunDTO, TestRunProfileDTO, TestStateChangeDTO } from '../../common/test-types';
30
+ import {
31
+ TestExecutionState, TestItemDTO, TestItemReference, TestOutputDTO,
32
+ TestRunDTO, TestRunProfileDTO, TestStateChangeDTO
33
+ } from '../../common/test-types';
31
34
  import { TestRunProfileKind } from '../../plugin/types-impl';
32
35
  import { CommandRegistryMainImpl } from './command-registry-main';
33
36
 
@@ -33,11 +33,14 @@ import { Range } from '../../common/plugin-api-rpc-model';
33
33
  import { Emitter, Event } from '@theia/core';
34
34
  import { TextEditorCursorStyle, cursorStyleToString } from '../../common/editor-options';
35
35
  import { TextEditorLineNumbersStyle, EndOfLine } from '../../plugin/types-impl';
36
+ import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
37
+ import { EndOfLineSequence, ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
38
+ import { EditorOption, RenderLineNumbersType } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
36
39
 
37
40
  export class TextEditorMain implements Disposable {
38
41
 
39
42
  private properties: TextEditorPropertiesMain | undefined;
40
- private editor: MonacoEditor | undefined;
43
+ private editor: MonacoEditor | SimpleMonacoEditor | undefined;
41
44
 
42
45
  private readonly onPropertiesChangedEmitter = new Emitter<EditorChangedPropertiesData>();
43
46
 
@@ -48,8 +51,8 @@ export class TextEditorMain implements Disposable {
48
51
 
49
52
  constructor(
50
53
  private id: string,
51
- private model: monaco.editor.IModel,
52
- editor: MonacoEditor
54
+ private model: monaco.editor.IModel | ITextModel,
55
+ editor: MonacoEditor | SimpleMonacoEditor
53
56
  ) {
54
57
  this.toDispose.push(this.model.onDidChangeOptions(() =>
55
58
  this.updateProperties(undefined)
@@ -76,7 +79,7 @@ export class TextEditorMain implements Disposable {
76
79
 
77
80
  protected readonly toDisposeOnEditor = new DisposableCollection();
78
81
 
79
- private setEditor(editor?: MonacoEditor): void {
82
+ private setEditor(editor?: MonacoEditor | SimpleMonacoEditor): void {
80
83
  if (this.editor === editor) {
81
84
  return;
82
85
  }
@@ -115,7 +118,7 @@ export class TextEditorMain implements Disposable {
115
118
  return this.id;
116
119
  }
117
120
 
118
- getModel(): monaco.editor.IModel {
121
+ getModel(): monaco.editor.IModel | ITextModel {
119
122
  return this.model;
120
123
  }
121
124
 
@@ -208,7 +211,7 @@ export class TextEditorMain implements Disposable {
208
211
  }
209
212
 
210
213
  revealRange(range: monaco.Range, revealType: TextEditorRevealType): void {
211
- if (!this.editor) {
214
+ if (!this.editor || this.editor instanceof SimpleMonacoEditor) {
212
215
  return;
213
216
  }
214
217
  switch (revealType) {
@@ -240,10 +243,14 @@ export class TextEditorMain implements Disposable {
240
243
  return false;
241
244
  }
242
245
 
243
- if (opts.setEndOfLine === EndOfLine.CRLF) {
246
+ if (opts.setEndOfLine === EndOfLine.CRLF && !this.isSimpleWidget(this.model)) {
244
247
  this.model.setEOL(monaco.editor.EndOfLineSequence.CRLF);
245
- } else if (opts.setEndOfLine === EndOfLine.LF) {
248
+ } else if (opts.setEndOfLine === EndOfLine.LF && !this.isSimpleWidget(this.model)) {
246
249
  this.model.setEOL(monaco.editor.EndOfLineSequence.LF);
250
+ } else if (opts.setEndOfLine === EndOfLine.CRLF && this.isSimpleWidget(this.model)) {
251
+ this.model.setEOL(EndOfLineSequence.CRLF);
252
+ } else if (opts.setEndOfLine === EndOfLine.LF && this.isSimpleWidget(this.model)) {
253
+ this.model.setEOL(EndOfLineSequence.CRLF);
247
254
  }
248
255
 
249
256
  const editOperations: monaco.editor.IIdentifiedSingleEditOperation[] = [];
@@ -311,6 +318,10 @@ export class TextEditorMain implements Disposable {
311
318
  private static toMonacoSelections(selection: Selection): monaco.Selection {
312
319
  return new monaco.Selection(selection.selectionStartLineNumber, selection.selectionStartColumn, selection.positionLineNumber, selection.positionColumn);
313
320
  }
321
+
322
+ private isSimpleWidget(model: monaco.editor.IModel | ITextModel): model is ITextModel {
323
+ return !!(model as ITextModel).isForSimpleWidget;
324
+ }
314
325
  }
315
326
 
316
327
  // TODO move to monaco typings!
@@ -362,17 +373,26 @@ export class TextEditorPropertiesMain {
362
373
  return undefined;
363
374
  }
364
375
 
365
- static readFromEditor(prevProperties: TextEditorPropertiesMain | undefined, model: monaco.editor.IModel, editor: MonacoEditor): TextEditorPropertiesMain {
376
+ static readFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
377
+ model: monaco.editor.IModel | ITextModel,
378
+ editor: MonacoEditor | SimpleMonacoEditor): TextEditorPropertiesMain {
379
+
366
380
  const selections = TextEditorPropertiesMain.getSelectionsFromEditor(prevProperties, editor);
367
381
  const options = TextEditorPropertiesMain.getOptionsFromEditor(prevProperties, model, editor);
368
382
  const visibleRanges = TextEditorPropertiesMain.getVisibleRangesFromEditor(prevProperties, editor);
369
383
  return new TextEditorPropertiesMain(selections, options, visibleRanges);
370
384
  }
371
385
 
372
- private static getSelectionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor): monaco.Selection[] {
386
+ private static getSelectionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor | SimpleMonacoEditor): monaco.Selection[] {
373
387
  let result: monaco.Selection[] | undefined = undefined;
374
- if (editor) {
388
+ if (editor && editor instanceof MonacoEditor) {
375
389
  result = editor.getControl().getSelections() || undefined;
390
+ } else if (editor && editor instanceof SimpleMonacoEditor) {
391
+ result = editor.getControl().getSelections()?.map(selection => new monaco.Selection(
392
+ selection.startLineNumber,
393
+ selection.startColumn,
394
+ selection.positionLineNumber,
395
+ selection.positionColumn));
376
396
  }
377
397
 
378
398
  if (!result && prevProperties) {
@@ -385,14 +405,16 @@ export class TextEditorPropertiesMain {
385
405
  return result;
386
406
  }
387
407
 
388
- private static getOptionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, model: monaco.editor.IModel, editor: MonacoEditor): TextEditorConfiguration {
408
+ private static getOptionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
409
+ model: monaco.editor.IModel | ITextModel,
410
+ editor: MonacoEditor | SimpleMonacoEditor): TextEditorConfiguration {
389
411
  if (model.isDisposed()) {
390
412
  return prevProperties!.options;
391
413
  }
392
414
 
393
415
  let cursorStyle: TextEditorCursorStyle;
394
416
  let lineNumbers: TextEditorLineNumbersStyle;
395
- if (editor) {
417
+ if (editor && editor instanceof MonacoEditor) {
396
418
  const editorOptions = editor.getControl().getOptions();
397
419
  const lineNumbersOpts = editorOptions.get(monaco.editor.EditorOption.lineNumbers);
398
420
  cursorStyle = editorOptions.get(monaco.editor.EditorOption.cursorStyle);
@@ -410,6 +432,25 @@ export class TextEditorPropertiesMain {
410
432
  lineNumbers = TextEditorLineNumbersStyle.On;
411
433
  break;
412
434
  }
435
+ } else if (editor && editor instanceof SimpleMonacoEditor) {
436
+ const editorOptions = editor.getControl().getOptions();
437
+ const lineNumbersOpts = editorOptions.get(EditorOption.lineNumbers);
438
+ cursorStyle = editorOptions.get(EditorOption.cursorStyle);
439
+ switch (lineNumbersOpts.renderType) {
440
+ case RenderLineNumbersType.Off:
441
+ lineNumbers = TextEditorLineNumbersStyle.Off;
442
+ break;
443
+ case RenderLineNumbersType.Relative:
444
+ lineNumbers = TextEditorLineNumbersStyle.Relative;
445
+ break;
446
+ case RenderLineNumbersType.Interval:
447
+ lineNumbers = TextEditorLineNumbersStyle.Interval;
448
+ break;
449
+ default:
450
+ lineNumbers = TextEditorLineNumbersStyle.On;
451
+ break;
452
+ }
453
+
413
454
  } else if (prevProperties) {
414
455
  cursorStyle = prevProperties.options.cursorStyle;
415
456
  lineNumbers = prevProperties.options.lineNumbers;
@@ -428,7 +469,7 @@ export class TextEditorPropertiesMain {
428
469
  };
429
470
  }
430
471
 
431
- private static getVisibleRangesFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor): monaco.Range[] {
472
+ private static getVisibleRangesFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor | SimpleMonacoEditor): monaco.Range[] {
432
473
  if (editor) {
433
474
  return editor.getControl().getVisibleRanges();
434
475
  }
@@ -57,6 +57,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
57
57
  return this.proxy.$getSession(providerId, scopes, extensionId, extensionName, options);
58
58
  }
59
59
 
60
+ getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
61
+ return this.proxy.$getAccounts(providerId);
62
+ }
63
+
60
64
  registerAuthenticationProvider(id: string, label: string, provider: theia.AuthenticationProvider, options?: theia.AuthenticationProviderOptions): theia.Disposable {
61
65
  if (this.authenticationProviders.get(id)) {
62
66
  throw new Error(`An authentication provider with id '${id}' is already registered.`);
@@ -64,7 +68,7 @@ export class AuthenticationExtImpl implements AuthenticationExt {
64
68
 
65
69
  this.authenticationProviders.set(id, provider);
66
70
 
67
- provider.getSessions().then(sessions => { // sessions might have been restored from secret storage
71
+ provider.getSessions(undefined, {}).then(sessions => { // sessions might have been restored from secret storage
68
72
  if (sessions.length > 0) {
69
73
  this.proxy.$onDidChangeSessions(id, {
70
74
  added: sessions,
@@ -87,10 +91,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
87
91
  });
88
92
  }
89
93
 
90
- $createSession(providerId: string, scopes: string[]): Promise<theia.AuthenticationSession> {
94
+ $createSession(providerId: string, scopes: string[], options: theia.AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession> {
91
95
  const authProvider = this.authenticationProviders.get(providerId);
92
96
  if (authProvider) {
93
- return Promise.resolve(authProvider.createSession(scopes));
97
+ return Promise.resolve(authProvider.createSession(scopes, options));
94
98
  }
95
99
 
96
100
  throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
@@ -105,10 +109,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
105
109
  throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
106
110
  }
107
111
 
108
- async $getSessions(providerId: string, scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>> {
112
+ async $getSessions(providerId: string, scopes: string[] | undefined, options: theia.AuthenticationProviderSessionOptions): Promise<ReadonlyArray<theia.AuthenticationSession>> {
109
113
  const authProvider = this.authenticationProviders.get(providerId);
110
114
  if (authProvider) {
111
- const sessions = await authProvider.getSessions(scopes);
115
+ const sessions = await authProvider.getSessions(scopes, options);
112
116
 
113
117
  /* Wrap the session object received from the plugin to prevent serialization mismatches
114
118
  e.g. if the plugin object is constructed with the help of getters they won't be serialized: