mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
VS Code merge to df8fe74bd55313de0dd2303bc47a4aab0ca56b0e (#17979)
* Merge from vscode 504f934659740e9d41501cad9f162b54d7745ad9 * delete unused folders * distro * Bump build node version * update chokidar * FIx hygiene errors * distro * Fix extension lint issues * Remove strict-vscode * Add copyright header exemptions * Bump vscode-extension-telemetry to fix webpacking issue with zone.js * distro * Fix failing tests (revert marked.js back to current one until we decide to update) * Skip searchmodel test * Fix mac build * temp debug script loading * Try disabling coverage * log error too * Revert "log error too" This reverts commit af0183e5d4ab458fdf44b88fbfab9908d090526f. * Revert "temp debug script loading" This reverts commit 3d687d541c76db2c5b55626c78ae448d3c25089c. * Add comments explaining coverage disabling * Fix ansi_up loading issue * Merge latest from ads * Use newer option * Fix compile * add debug logging warn * Always log stack * log more * undo debug * Update to use correct base path (+cleanup) * distro * fix compile errors * Remove strict-vscode * Fix sql editors not showing * Show db dropdown input & fix styling * Fix more info in gallery * Fix gallery asset requests * Delete unused workflow * Fix tapable resolutions for smoke test compile error * Fix smoke compile * Disable crash reporting * Disable interactive Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -12,22 +12,84 @@ import * as filter from 'gulp-filter';
|
||||
import * as _ from 'underscore';
|
||||
import * as util from './util';
|
||||
|
||||
type DarwinDocumentSuffix = 'document' | 'script' | 'file' | 'source code';
|
||||
type DarwinDocumentType = {
|
||||
name: string,
|
||||
role: string,
|
||||
ostypes: string[],
|
||||
extensions: string[],
|
||||
iconFile: string,
|
||||
};
|
||||
|
||||
function isDocumentSuffix(str?: string): str is DarwinDocumentSuffix {
|
||||
return str === 'document' || str === 'script' || str === 'file' || str === 'source code';
|
||||
}
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
|
||||
const commit = util.getVersion(root);
|
||||
|
||||
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
|
||||
|
||||
function darwinBundleDocumentType(extensions: string[], icon: string) {
|
||||
/**
|
||||
* Generate a `DarwinDocumentType` given a list of file extensions, an icon name, and an optional suffix or file type name.
|
||||
* @param extensions A list of file extensions, such as `['bat', 'cmd']`
|
||||
* @param icon A sentence-cased file type name that matches the lowercase name of a darwin icon resource.
|
||||
* For example, `'HTML'` instead of `'html'`, or `'Java'` instead of `'java'`.
|
||||
* This parameter is lowercased before it is used to reference an icon file.
|
||||
* @param nameOrSuffix An optional suffix or a string to use as the file type. If a suffix is provided,
|
||||
* it is used with the icon parameter to generate a file type string. If nothing is provided,
|
||||
* `'document'` is used with the icon parameter to generate file type string.
|
||||
*
|
||||
* For example, if you call `darwinBundleDocumentType(..., 'HTML')`, the resulting file type is `"HTML document"`,
|
||||
* and the `'html'` darwin icon is used.
|
||||
*
|
||||
* If you call `darwinBundleDocumentType(..., 'Javascript', 'file')`, the resulting file type is `"Javascript file"`.
|
||||
* and the `'javascript'` darwin icon is used.
|
||||
*
|
||||
* If you call `darwinBundleDocumentType(..., 'bat', 'Windows command script')`, the file type is `"Windows command script"`,
|
||||
* and the `'bat'` darwin icon is used.
|
||||
*/
|
||||
function darwinBundleDocumentType(extensions: string[], icon: string, nameOrSuffix?: string | DarwinDocumentSuffix): DarwinDocumentType {
|
||||
// If given a suffix, generate a name from it. If not given anything, default to 'document'
|
||||
if (isDocumentSuffix(nameOrSuffix) || !nameOrSuffix) {
|
||||
nameOrSuffix = icon.charAt(0).toUpperCase() + icon.slice(1) + ' ' + (nameOrSuffix ?? 'document');
|
||||
}
|
||||
|
||||
return {
|
||||
name: product.nameLong + ' document',
|
||||
name: nameOrSuffix,
|
||||
role: 'Editor',
|
||||
ostypes: ['TEXT', 'utxt', 'TUTX', '****'],
|
||||
extensions: extensions,
|
||||
iconFile: icon
|
||||
iconFile: 'resources/darwin/' + icon + '.icns'
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate several `DarwinDocumentType`s with unique names and a shared icon.
|
||||
* @param types A map of file type names to their associated file extensions.
|
||||
* @param icon A darwin icon resource to use. For example, `'HTML'` would refer to `resources/darwin/html.icns`
|
||||
*
|
||||
* Examples:
|
||||
* ```
|
||||
* darwinBundleDocumentTypes({ 'C header file': 'h', 'C source code': 'c' },'c')
|
||||
* darwinBundleDocumentTypes({ 'React source code': ['jsx', 'tsx'] }, 'react')
|
||||
* ```
|
||||
*/
|
||||
// {{SQL CARBON EDIT}} Remove unused
|
||||
// function darwinBundleDocumentTypes(types: { [name: string]: string | string[] }, icon: string): DarwinDocumentType[] {
|
||||
// return Object.keys(types).map((name: string): DarwinDocumentType => {
|
||||
// const extensions = types[name];
|
||||
// return {
|
||||
// name: name,
|
||||
// role: 'Editor',
|
||||
// ostypes: ['TEXT', 'utxt', 'TUTX', '****'],
|
||||
// extensions: Array.isArray(extensions) ? extensions : [extensions],
|
||||
// iconFile: 'resources/darwin/' + icon + '.icns',
|
||||
// } as DarwinDocumentType;
|
||||
// });
|
||||
// }
|
||||
|
||||
export const config = {
|
||||
version: util.getElectronVersion(),
|
||||
productAppName: product.nameLong,
|
||||
@@ -39,7 +101,7 @@ export const config = {
|
||||
darwinHelpBookFolder: 'VS Code HelpBook',
|
||||
darwinHelpBookName: 'VS Code HelpBook',
|
||||
darwinBundleDocumentTypes: [
|
||||
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], 'resources/darwin/code_file.icns'),
|
||||
darwinBundleDocumentType(['csv', 'json', 'sqlplan', 'sql', 'xml'], 'code_file'),
|
||||
],
|
||||
darwinBundleURLTypes: [{
|
||||
role: 'Viewer',
|
||||
|
||||
Reference in New Issue
Block a user