@codingame/monaco-vscode-rollup-vsix-plugin 5.1.2-segmenter.1 → 5.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "5.1.2-segmenter.1",
3
+ "version": "5.2.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "rollup-vsix-plugin.js",
19
19
  "types": "rollup-vsix-plugin.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@5.1.2-segmenter.1",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@5.2.0",
22
22
  "css-url-parser": "^1.1.3",
23
23
  "memfs": "^4.9.2",
24
24
  "mime-types": "^2.1.35",
@@ -7602,7 +7602,13 @@ function assertPatternsInput(input) {
7602
7602
  }
7603
7603
  var out = FastGlob;
7604
7604
 
7605
+ const plainTextExtensions = [
7606
+ '.d.ts'
7607
+ ];
7605
7608
  function lookupMime(path) {
7609
+ if (plainTextExtensions.some(e => path.endsWith(e))) {
7610
+ return 'text/plain';
7611
+ }
7606
7612
  const mimeType = mime.lookup(path);
7607
7613
  if (mimeType === false) {
7608
7614
  return undefined;
@@ -7616,11 +7622,12 @@ function getPaths(filePath) {
7616
7622
  }
7617
7623
  return paths;
7618
7624
  }
7619
- function toResource(path) {
7625
+ function toResource(resourcePath, fs, cwd) {
7620
7626
  return {
7621
- path,
7622
- extensionPaths: getPaths(path),
7623
- mimeType: lookupMime(path)
7627
+ path: resourcePath,
7628
+ extensionPaths: getPaths(resourcePath),
7629
+ mimeType: lookupMime(resourcePath),
7630
+ size: fs.statSync(path$a.resolve(cwd, resourcePath)).size
7624
7631
  };
7625
7632
  }
7626
7633
  function extractCommandResources(command) {
@@ -7717,16 +7724,16 @@ async function extractResourcesFromExtensionManifestContribute(contribute, fs, c
7717
7724
  return resources.filter((resource, index, list) => !resource.startsWith('$(') && !list.slice(0, index).some(o => o === resource));
7718
7725
  }
7719
7726
  async function getExtensionResources(manifest, fs, cwd) {
7720
- if (manifest.browser != null) {
7727
+ if (manifest.browser != null || manifest.contributes?.typescriptServerPlugins != null) {
7721
7728
  // there is some js in the extension, it's impossible to predict which file will be used, bundle everything
7722
7729
  return (await out.glob('**/*', {
7723
7730
  fs: fs,
7724
7731
  cwd,
7725
7732
  onlyFiles: true
7726
- })).map(toResource);
7733
+ })).map(p => toResource(p, fs, cwd));
7727
7734
  }
7728
7735
  else {
7729
- return (await extractResourcesFromExtensionManifest(manifest, fs, cwd)).map(toResource);
7736
+ return (await extractResourcesFromExtensionManifest(manifest, fs, cwd)).map(p => toResource(p, fs, cwd));
7730
7737
  }
7731
7738
  }
7732
7739
  async function extractResourcesFromExtensionManifest(manifest, fs, cwd) {
@@ -7871,7 +7878,8 @@ function plugin({ include = '**/*.vsix', exclude, transformManifest = manifest =
7871
7878
  return resource.extensionPaths.map(extensionPath => ({
7872
7879
  pathInExtension: getVsixPath(extensionPath),
7873
7880
  url,
7874
- mimeType: resource.mimeType
7881
+ mimeType: resource.mimeType,
7882
+ size: resource.size
7875
7883
  }));
7876
7884
  }))).flat();
7877
7885
  return `
@@ -7881,8 +7889,11 @@ const manifest = ${JSON.stringify(manifest)}
7881
7889
 
7882
7890
  const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, ${JSON.stringify({ system: true, readmePath, changelogPath })})
7883
7891
 
7884
- ${pathMapping.map(({ pathInExtension, url, mimeType }) => (`
7885
- registerFileUrl('${pathInExtension}', ${url}${mimeType != null ? `, '${mimeType}'` : ''})`)).join('\n')}
7892
+ ${pathMapping.map(({ pathInExtension, url, mimeType, size }) => (`
7893
+ registerFileUrl('${pathInExtension}', ${url}, ${JSON.stringify({
7894
+ mimeType,
7895
+ size
7896
+ })})`)).join('\n')}
7886
7897
 
7887
7898
  export { whenReady }
7888
7899
  `;
@@ -1002,6 +1002,264 @@ interface IViewsWelcome {
1002
1002
  */
1003
1003
  readonly enablement?: string;
1004
1004
  }
1005
+ interface INamedProblemPattern extends IProblemPattern {
1006
+ /**
1007
+ * The name of the problem pattern.
1008
+ */
1009
+ name: string;
1010
+ /**
1011
+ * A human readable label
1012
+ */
1013
+ label?: string;
1014
+ }
1015
+ interface ICheckedProblemPattern extends IProblemPattern {
1016
+ /**
1017
+ * The regular expression to find a problem in the console output of an
1018
+ * executed task.
1019
+ */
1020
+ regexp: string;
1021
+ }
1022
+ type MultiLineCheckedProblemPattern = ICheckedProblemPattern[];
1023
+ interface INamedMultiLineCheckedProblemPattern {
1024
+ /**
1025
+ * The name of the problem pattern.
1026
+ */
1027
+ name: string;
1028
+ /**
1029
+ * A human readable label
1030
+ */
1031
+ label?: string;
1032
+ /**
1033
+ * The actual patterns
1034
+ */
1035
+ patterns: MultiLineCheckedProblemPattern;
1036
+ }
1037
+ type NamedProblemPatterns = (INamedProblemPattern | INamedMultiLineCheckedProblemPattern)[];
1038
+ interface IProblemPattern {
1039
+ /**
1040
+ * The regular expression to find a problem in the console output of an
1041
+ * executed task.
1042
+ */
1043
+ regexp?: string;
1044
+ /**
1045
+ * Whether the pattern matches a whole file, or a location (file/line)
1046
+ *
1047
+ * The default is to match for a location. Only valid on the
1048
+ * first problem pattern in a multi line problem matcher.
1049
+ */
1050
+ kind?: string;
1051
+ /**
1052
+ * The match group index of the filename.
1053
+ * If omitted 1 is used.
1054
+ */
1055
+ file?: number;
1056
+ /**
1057
+ * The match group index of the problem's location. Valid location
1058
+ * patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn).
1059
+ * If omitted the line and column properties are used.
1060
+ */
1061
+ location?: number;
1062
+ /**
1063
+ * The match group index of the problem's line in the source file.
1064
+ *
1065
+ * Defaults to 2.
1066
+ */
1067
+ line?: number;
1068
+ /**
1069
+ * The match group index of the problem's column in the source file.
1070
+ *
1071
+ * Defaults to 3.
1072
+ */
1073
+ column?: number;
1074
+ /**
1075
+ * The match group index of the problem's end line in the source file.
1076
+ *
1077
+ * Defaults to undefined. No end line is captured.
1078
+ */
1079
+ endLine?: number;
1080
+ /**
1081
+ * The match group index of the problem's end column in the source file.
1082
+ *
1083
+ * Defaults to undefined. No end column is captured.
1084
+ */
1085
+ endColumn?: number;
1086
+ /**
1087
+ * The match group index of the problem's severity.
1088
+ *
1089
+ * Defaults to undefined. In this case the problem matcher's severity
1090
+ * is used.
1091
+ */
1092
+ severity?: number;
1093
+ /**
1094
+ * The match group index of the problem's code.
1095
+ *
1096
+ * Defaults to undefined. No code is captured.
1097
+ */
1098
+ code?: number;
1099
+ /**
1100
+ * The match group index of the message. If omitted it defaults
1101
+ * to 4 if location is specified. Otherwise it defaults to 5.
1102
+ */
1103
+ message?: number;
1104
+ /**
1105
+ * Specifies if the last pattern in a multi line problem matcher should
1106
+ * loop as long as it does match a line consequently. Only valid on the
1107
+ * last problem pattern in a multi line problem matcher.
1108
+ */
1109
+ loop?: boolean;
1110
+ }
1111
+ /**
1112
+ * A watching pattern
1113
+ */
1114
+ interface IWatchingPattern {
1115
+ /**
1116
+ * The actual regular expression
1117
+ */
1118
+ regexp?: string;
1119
+ /**
1120
+ * The match group index of the filename. If provided the expression
1121
+ * is matched for that file only.
1122
+ */
1123
+ file?: number;
1124
+ }
1125
+ /**
1126
+ * A description to track the start and end of a watching task.
1127
+ */
1128
+ interface IBackgroundMonitor {
1129
+ /**
1130
+ * If set to true the watcher is in active mode when the task
1131
+ * starts. This is equals of issuing a line that matches the
1132
+ * beginsPattern.
1133
+ */
1134
+ activeOnStart?: boolean;
1135
+ /**
1136
+ * If matched in the output the start of a watching task is signaled.
1137
+ */
1138
+ beginsPattern?: string | IWatchingPattern;
1139
+ /**
1140
+ * If matched in the output the end of a watching task is signaled.
1141
+ */
1142
+ endsPattern?: string | IWatchingPattern;
1143
+ }
1144
+ interface INamedProblemMatcher {
1145
+ /**
1146
+ * This name can be used to refer to the
1147
+ * problem matcher from within a task.
1148
+ */
1149
+ name: string;
1150
+ /**
1151
+ * A human readable label.
1152
+ */
1153
+ label?: string;
1154
+ /**
1155
+ * The name of a base problem matcher to use. If specified the
1156
+ * base problem matcher will be used as a template and properties
1157
+ * specified here will replace properties of the base problem
1158
+ * matcher
1159
+ */
1160
+ base?: string;
1161
+ /**
1162
+ * The owner of the produced VSCode problem. This is typically
1163
+ * the identifier of a VSCode language service if the problems are
1164
+ * to be merged with the one produced by the language service
1165
+ * or a generated internal id. Defaults to the generated internal id.
1166
+ */
1167
+ owner?: string;
1168
+ /**
1169
+ * A human-readable string describing the source of this problem.
1170
+ * E.g. 'typescript' or 'super lint'.
1171
+ */
1172
+ source?: string;
1173
+ /**
1174
+ * Specifies to which kind of documents the problems found by this
1175
+ * matcher are applied. Valid values are:
1176
+ *
1177
+ * "allDocuments": problems found in all documents are applied.
1178
+ * "openDocuments": problems found in documents that are open
1179
+ * are applied.
1180
+ * "closedDocuments": problems found in closed documents are
1181
+ * applied.
1182
+ */
1183
+ applyTo?: string;
1184
+ /**
1185
+ * The severity of the VSCode problem produced by this problem matcher.
1186
+ *
1187
+ * Valid values are:
1188
+ * "error": to produce errors.
1189
+ * "warning": to produce warnings.
1190
+ * "info": to produce infos.
1191
+ *
1192
+ * The value is used if a pattern doesn't specify a severity match group.
1193
+ * Defaults to "error" if omitted.
1194
+ */
1195
+ severity?: string;
1196
+ /**
1197
+ * Defines how filename reported in a problem pattern
1198
+ * should be read. Valid values are:
1199
+ * - "absolute": the filename is always treated absolute.
1200
+ * - "relative": the filename is always treated relative to
1201
+ * the current working directory. This is the default.
1202
+ * - ["relative", "path value"]: the filename is always
1203
+ * treated relative to the given path value.
1204
+ * - "autodetect": the filename is treated relative to
1205
+ * the current workspace directory, and if the file
1206
+ * does not exist, it is treated as absolute.
1207
+ * - ["autodetect", "path value"]: the filename is treated
1208
+ * relative to the given path value, and if it does not
1209
+ * exist, it is treated as absolute.
1210
+ * - ["search", { include?: "" | []; exclude?: "" | [] }]: The filename
1211
+ * needs to be searched under the directories named by the "include"
1212
+ * property and their nested subdirectories. With "exclude" property
1213
+ * present, the directories should be removed from the search. When
1214
+ * `include` is not unprovided, the current workspace directory should
1215
+ * be used as the default.
1216
+ */
1217
+ fileLocation?: string | string[] | ['search', ISearchFileLocationArgs];
1218
+ /**
1219
+ * The name of a predefined problem pattern, the inline definition
1220
+ * of a problem pattern or an array of problem patterns to match
1221
+ * problems spread over multiple lines.
1222
+ */
1223
+ pattern?: string | IProblemPattern | IProblemPattern[];
1224
+ /**
1225
+ * A regular expression signaling that a watched tasks begins executing
1226
+ * triggered through file watching.
1227
+ */
1228
+ watchedTaskBeginsRegExp?: string;
1229
+ /**
1230
+ * A regular expression signaling that a watched tasks ends executing.
1231
+ */
1232
+ watchedTaskEndsRegExp?: string;
1233
+ /**
1234
+ * @deprecated Use background instead.
1235
+ */
1236
+ watching?: IBackgroundMonitor;
1237
+ background?: IBackgroundMonitor;
1238
+ }
1239
+ type ISearchFileLocationArgs = {
1240
+ include?: string | string[];
1241
+ exclude?: string | string[];
1242
+ };
1243
+ interface ITypescriptServerPlugin {
1244
+ /**
1245
+ * Name of the plugin as listed in the package.json.
1246
+ */
1247
+ name: string;
1248
+ /**
1249
+ * Should the plugin be loaded when using workspace versions of TypeScript?
1250
+ */
1251
+ enableForWorkspaceTypeScriptVersions: boolean;
1252
+ }
1253
+ interface IHtmlLanguageParticipant {
1254
+ /**
1255
+ * The id of the language that participates with HTML language server.
1256
+ */
1257
+ languageId: string;
1258
+ /**
1259
+ * Whether the language participates with HTML auto insertions. If not specified, defaults to <code>true</code>.
1260
+ */
1261
+ autoInsert: boolean;
1262
+ }
1005
1263
  interface IExtensionContributions {
1006
1264
  /**
1007
1265
  * Contributes terminal functionality.
@@ -1168,6 +1426,28 @@ interface IExtensionContributions {
1168
1426
  * Contributed views welcome content. Welcome content will be rendered in tree based views whenever they have no meaningful content to display, ie. the File Explorer when no folder is open. Such content is useful as in-product documentation to drive users to use certain features before they are available. A good example would be a `Clone Repository` button in the File Explorer welcome view.
1169
1427
  */
1170
1428
  readonly viewsWelcome?: IViewsWelcome[];
1429
+ /**
1430
+ * Contributes problem matchers
1431
+ */
1432
+ readonly problemMatchers?: INamedProblemMatcher[];
1433
+ /**
1434
+ * Contributes problem patterns
1435
+ */
1436
+ readonly problemPatterns?: NamedProblemPatterns;
1437
+ /**
1438
+ * Contributed TypeScript server plugins.
1439
+ */
1440
+ readonly typescriptServerPlugins?: ITypescriptServerPlugin[];
1441
+ /**
1442
+ * A list of languages that participate with the HTML language server.
1443
+ */
1444
+ readonly htmlLanguageParticipants?: IHtmlLanguageParticipant[];
1445
+ readonly html?: {
1446
+ customData?: string[];
1447
+ };
1448
+ readonly css?: {
1449
+ customData?: string[];
1450
+ };
1171
1451
  }
1172
1452
  interface IExtensionCapabilities {
1173
1453
  readonly virtualWorkspaces?: ExtensionVirtualWorkspaceSupport;
@@ -1226,4 +1506,4 @@ interface IRelaxedExtensionManifest {
1226
1506
  }
1227
1507
  type IExtensionManifest = Readonly<IRelaxedExtensionManifest>;
1228
1508
 
1229
- export type { ExtensionUntrustedWorkspaceSupport, ExtensionVirtualWorkspaceSupport, IAuthenticationContribution, IBreakpoint, ICodeActionContribution, ICodeActionContributionAction, IColor, IColorTheme, ICommand, IConfiguration, IDebugVisualizationContribution, IDebugger, IDocumentation, IDocumentationRefactoring, IExtensionCapabilities, IExtensionContributions, IExtensionManifest, IGrammar, IIcon, IIconTheme, IInteractiveSession, IJSONValidation, IKeyBinding, ILanguage, ILocalizationContribution, IMenu, INotebookEntry, INotebookRendererContribution, IProductTheme, IRelaxedExtensionManifest, IRemoteHelp, ISemanticTokenModifiers, ISemanticTokenScopes, ISemanticTokenTypes, ISnippet, IStartEntry, IStatusBarItem, ISubMenu, ITaskDefinitions, ITerminal, ITerminalQuickFix, ITranslation, IView, IViewContainer, IViewsWelcome, IWalkthrough, IWalkthroughStep, LimitedWorkspaceSupportType, NotebookPreload };
1509
+ export type { ExtensionUntrustedWorkspaceSupport, ExtensionVirtualWorkspaceSupport, IAuthenticationContribution, IBackgroundMonitor, IBreakpoint, ICheckedProblemPattern, ICodeActionContribution, ICodeActionContributionAction, IColor, IColorTheme, ICommand, IConfiguration, IDebugVisualizationContribution, IDebugger, IDocumentation, IDocumentationRefactoring, IExtensionCapabilities, IExtensionContributions, IExtensionManifest, IGrammar, IHtmlLanguageParticipant, IIcon, IIconTheme, IInteractiveSession, IJSONValidation, IKeyBinding, ILanguage, ILocalizationContribution, IMenu, INamedMultiLineCheckedProblemPattern, INamedProblemMatcher, INamedProblemPattern, INotebookEntry, INotebookRendererContribution, IProblemPattern, IProductTheme, IRelaxedExtensionManifest, IRemoteHelp, ISearchFileLocationArgs, ISemanticTokenModifiers, ISemanticTokenScopes, ISemanticTokenTypes, ISnippet, IStartEntry, IStatusBarItem, ISubMenu, ITaskDefinitions, ITerminal, ITerminalQuickFix, ITranslation, ITypescriptServerPlugin, IView, IViewContainer, IViewsWelcome, IWalkthrough, IWalkthroughStep, IWatchingPattern, LimitedWorkspaceSupportType, MultiLineCheckedProblemPattern, NamedProblemPatterns, NotebookPreload };