@lvce-editor/editor-worker 15.0.0 → 15.1.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.
@@ -1294,8 +1294,11 @@ const createLazyRpc = rpcId => {
1294
1294
  };
1295
1295
 
1296
1296
  // TODO add tests for this
1297
- const activateByEvent = async event => {
1298
- await invoke$b('ExtensionHostManagement.activateByEvent', event);
1297
+ const activateByEvent = async (event, assetDir, platform) => {
1298
+ string(event);
1299
+ string(assetDir);
1300
+ number(platform);
1301
+ await invoke$b('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
1299
1302
  };
1300
1303
 
1301
1304
  const codeGeneratorAccept = state => {
@@ -3128,7 +3131,9 @@ const getLanguageId$1 = (uri, languages) => {
3128
3131
  };
3129
3132
 
3130
3133
  const getLanguages = async (platform, assetDir) => {
3131
- const languages = await invoke$c('Languages.getLanguages', platform, assetDir);
3134
+ number(platform);
3135
+ string(assetDir);
3136
+ const languages = await invoke$c('Extensions.getLanguages', platform, assetDir);
3132
3137
  return languages;
3133
3138
  };
3134
3139
 
@@ -3147,25 +3152,34 @@ const OnTabCompletion = 'onTabCompletion';
3147
3152
 
3148
3153
  const execute = async ({
3149
3154
  args,
3155
+ assetDir,
3150
3156
  editor,
3151
3157
  event,
3152
3158
  method,
3153
3159
  noProviderFoundMessage,
3154
- noProviderFoundResult = undefined
3160
+ noProviderFoundResult = undefined,
3161
+ platform
3155
3162
  }) => {
3156
3163
  const fullEvent = `${event}:${editor.languageId}`;
3157
- await activateByEvent(fullEvent);
3164
+ await activateByEvent(fullEvent, assetDir, platform);
3158
3165
  const result = await invoke$6(method, editor.uid, ...args);
3159
3166
  return result;
3160
3167
  };
3161
3168
 
3162
3169
  const executeDiagnosticProvider = editor => {
3170
+ const {
3171
+ assetDir,
3172
+ platform
3173
+ } = editor;
3163
3174
  return execute({
3164
3175
  args: [],
3176
+ assetDir,
3165
3177
  editor,
3166
3178
  event: OnDiagnostic,
3167
3179
  method: 'ExtensionHost.executeDiagnosticProvider',
3168
- noProviderFoundMessage: 'no diagnostic provider found'});
3180
+ noProviderFoundMessage: 'no diagnostic provider found',
3181
+ platform
3182
+ });
3169
3183
  };
3170
3184
 
3171
3185
  const getDiagnosticType = diagnostic => {
@@ -3289,6 +3303,7 @@ const createEditor = async ({
3289
3303
  const languages = await getLanguages(platform, assetDir);
3290
3304
  const computedlanguageId = getLanguageId$1(uri, languages);
3291
3305
  const editor = {
3306
+ assetDir,
3292
3307
  charWidth,
3293
3308
  columnWidth: 0,
3294
3309
  completionState: '',
@@ -3330,6 +3345,7 @@ const createEditor = async ({
3330
3345
  minLineY: 0,
3331
3346
  numberOfVisiblelines: 0,
3332
3347
  numberOfVisibleLines: 0,
3348
+ platform,
3333
3349
  primarySelectionIndex: 0,
3334
3350
  rowHeight,
3335
3351
  savedSelections,
@@ -7601,12 +7617,16 @@ const tabCompletion = async editor => {
7601
7617
  };
7602
7618
 
7603
7619
  const getBlockComment = async (editor, offset) => {
7620
+ const {
7621
+ assetDir,
7622
+ platform
7623
+ } = editor;
7604
7624
  // TODO ask extension host worker,
7605
7625
  // execute block comment provider with
7606
7626
  // uri, language id, offset
7607
7627
  // and the extension returns a matching block comment or undefined
7608
7628
  try {
7609
- await activateByEvent(`onLanguage:${editor.languageId}`);
7629
+ await activateByEvent(`onLanguage:${editor.languageId}`, assetDir, platform);
7610
7630
  // @ts-ignore
7611
7631
  const blockComment = await invoke$6(`ExtensionHostCommment.execute`, editor.uid, offset);
7612
7632
  if (blockComment) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "15.0.0",
3
+ "version": "15.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"