新增语言插件

This commit is contained in:
何童崇 2022-06-06 10:12:51 +08:00
parent 8b6a969173
commit 31a3a7051a
7 changed files with 2949 additions and 182 deletions

View File

@ -1,82 +1,104 @@
import React from 'react';
import React ,{Fragment}from 'react';
import { Switch } from 'antd';
import { EditorRenderer } from 'alex';
function CloudIDE() {
import html from './extensions/alex-ext-public.html-language-features-worker.js';
import css from './extensions/alex-ext-public.css-language-features-worker.js';
import json from './extensions/alex-ext-public.typescript-language-features-worker.js';
import typescript from './extensions/alex-ext-public.json-language-features-worker.js';
import markdown from './extensions/alex-ext-public.markdown-language-features-worker.js';
import { getUrl } from 'educoder';
import changeThemePlugin from './changeTheme';
function CloudIDE({download_url}) {
const group = 'Gitlink';
const repo = 'forgeplus';
// const [ideStyle,setIdeStyle]=useState('ide-light');
async function changeStyle(v) {
const commands = changeThemePlugin.commands;
if (commands) {
await commands.executeCommand(
'ChangeThemePlugin.changeTheme',
v ? 'ide-light' : 'ide-dark'
);
}
}
return (
<div className="welcome-main">
<EditorRenderer
appConfig={{
//
workspaceDir: `${group}/${repo}`,
defaultPreferences: {
// ide-dark
'general.theme': 'ide-light',
// 'general.theme': 'ide-dark',
//
'editor.forceReadOnly': false,
//
'editor.scrollBeyondLastLine': false,
}
}}
runtimeConfig={{
//
biz: 'gitlink',
// editor null
scenario: null,
// editor none
startupEditor: 'none',
// editor tab
hideEditorTab: true,
}}
editorConfig={{
stretchHeight: true,
disableEditorSearch: true,
}}
//
documentModel={{
// code code
type: 'code',
// tag
ref: 'master',
//
owner: group,
//
name: repo,
//
filepath: 'robots.ts',
//
readFile: async (filepath) => {
if (!filepath) {
return;
}
//
const res = await fetch('https://gist.githubusercontent.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js');
return res.arrayBuffer();
},
// utf8 gbk
encoding: 'utf8',
onFilepathChange: (changedFilepath) => {
if (changedFilepath) {
console.log(`路由跳转到 ${changedFilepath}`)
}
},
//
// lineNumber: [0, 1],
onLineNumberChange: line => {
if (typeof line === 'number') {
console.log(`#L${line}`)
} else {
console.log(`#L${line[0]}-${line[1]}`)
}
},
}}
/>
<Fragment>
<div className="ideStyle">
<Switch checkedChildren="light" unCheckedChildren="dark" defaultChecked onChange={changeStyle}></Switch>
</div>
<EditorRenderer
appConfig={{
//
plugins: [changeThemePlugin],
workspaceDir: `${group}/${repo}`,
defaultPreferences: {
// ide-dark
// 'general.theme': 'ide-light',
'general.theme': 'ide-light',
//
'editor.forceReadOnly': true,
//
'editor.scrollBeyondLastLine': false,
},
extensionMetadata: [html, css, json, typescript, markdown],
}}
runtimeConfig={{
//
biz: 'gitlink',
// editor null
scenario: null,
// editor none
startupEditor: 'none',
// editor tab
hideEditorTab: true,
}}
editorConfig={{
stretchHeight: true,
disableEditorSearch: true,
}}
//
documentModel={{
// code code
type: 'code',
// tag
ref: 'master',
//
owner: group,
//
name: repo,
//
filepath: 'robots.ts',
//
readFile: async (filepath) => {
if (!filepath) {
return;
}
//
// const res = await fetch('https://gist.githubusercontent.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js');
const res = await fetch(`${getUrl()}/attachments/entries/get_file?download_url=${download_url}`);
return res.arrayBuffer();
},
// utf8 gbk
encoding: 'utf8',
onFilepathChange: (changedFilepath) => {
if (changedFilepath) {
console.log(`路由跳转到 ${changedFilepath}`)
}
},
//
// lineNumber: [0, 1],
onLineNumberChange: line => {
if (typeof line === 'number') {
console.log(`#L${line}`)
} else {
console.log(`#L${line[0]}-${line[1]}`)
}
},
}}
/>
</Fragment>
)
}
export default CloudIDE;

View File

@ -0,0 +1,724 @@
module.exports = {
extension: {
publisher: 'alex-ext-public',
name: 'css-language-features-worker',
version: '1.53.0-patch.1',
},
packageJSON: {
name: 'css-language-features-worker',
publisher: 'alex',
version: '1.53.0-patch.1',
displayName: '%displayName%',
description: '%description%',
icon: 'icons/css.png',
activationEvents: [
'onLanguage:css',
'onLanguage:less',
'onLanguage:scss',
'onCommand:_css.applyCodeAction',
],
kaitianContributes: {
workerMain: 'client/dist/browser/cssClientMain.js',
},
contributes: {
configuration: [
{
order: 22,
id: 'css',
title: '%css.title%',
properties: {
'css.customData': {
type: 'array',
markdownDescription: '%css.customData.desc%',
default: [],
items: {
type: 'string',
},
scope: 'resource',
},
'css.completion.triggerPropertyValueCompletion': {
type: 'boolean',
scope: 'resource',
default: true,
description:
'%css.completion.triggerPropertyValueCompletion.desc%',
},
'css.completion.completePropertyWithSemicolon': {
type: 'boolean',
scope: 'resource',
default: true,
description:
'%css.completion.completePropertyWithSemicolon.desc%',
},
'css.validate': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%css.validate.desc%',
},
'css.lint.compatibleVendorPrefixes': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.compatibleVendorPrefixes.desc%',
},
'css.lint.vendorPrefix': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%css.lint.vendorPrefix.desc%',
},
'css.lint.duplicateProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.duplicateProperties.desc%',
},
'css.lint.emptyRules': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%css.lint.emptyRules.desc%',
},
'css.lint.importStatement': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.importStatement.desc%',
},
'css.lint.boxModel': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%css.lint.boxModel.desc%',
},
'css.lint.universalSelector': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%css.lint.universalSelector.desc%',
},
'css.lint.zeroUnits': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.zeroUnits.desc%',
},
'css.lint.fontFaceProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
markdownDescription: '%css.lint.fontFaceProperties.desc%',
},
'css.lint.hexColorLength': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'error',
description: '%css.lint.hexColorLength.desc%',
},
'css.lint.argumentsInColorFunction': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'error',
description: '%css.lint.argumentsInColorFunction.desc%',
},
'css.lint.unknownProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%css.lint.unknownProperties.desc%',
},
'css.lint.validProperties': {
type: 'array',
uniqueItems: true,
items: {
type: 'string',
},
scope: 'resource',
default: [],
description: '%css.lint.validProperties.desc%',
},
'css.lint.ieHack': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.ieHack.desc%',
},
'css.lint.unknownVendorSpecificProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.unknownVendorSpecificProperties.desc%',
},
'css.lint.propertyIgnoredDueToDisplay': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
markdownDescription:
'%css.lint.propertyIgnoredDueToDisplay.desc%',
},
'css.lint.important': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%css.lint.important.desc%',
},
'css.lint.float': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%css.lint.float.desc%',
},
'css.lint.idSelector': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%css.lint.idSelector.desc%',
},
'css.lint.unknownAtRules': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%css.lint.unknownAtRules.desc%',
},
'css.trace.server': {
type: 'string',
scope: 'window',
enum: ['off', 'messages', 'verbose'],
default: 'off',
description: '%css.trace.server.desc%',
},
},
},
{
id: 'scss',
order: 24,
title: '%scss.title%',
properties: {
'scss.completion.triggerPropertyValueCompletion': {
type: 'boolean',
scope: 'resource',
default: true,
description:
'%scss.completion.triggerPropertyValueCompletion.desc%',
},
'scss.completion.completePropertyWithSemicolon': {
type: 'boolean',
scope: 'resource',
default: true,
description:
'%scss.completion.completePropertyWithSemicolon.desc%',
},
'scss.validate': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%scss.validate.desc%',
},
'scss.lint.compatibleVendorPrefixes': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.compatibleVendorPrefixes.desc%',
},
'scss.lint.vendorPrefix': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%scss.lint.vendorPrefix.desc%',
},
'scss.lint.duplicateProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.duplicateProperties.desc%',
},
'scss.lint.emptyRules': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%scss.lint.emptyRules.desc%',
},
'scss.lint.importStatement': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.importStatement.desc%',
},
'scss.lint.boxModel': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%scss.lint.boxModel.desc%',
},
'scss.lint.universalSelector': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%scss.lint.universalSelector.desc%',
},
'scss.lint.zeroUnits': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.zeroUnits.desc%',
},
'scss.lint.fontFaceProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
markdownDescription: '%scss.lint.fontFaceProperties.desc%',
},
'scss.lint.hexColorLength': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'error',
description: '%scss.lint.hexColorLength.desc%',
},
'scss.lint.argumentsInColorFunction': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'error',
description: '%scss.lint.argumentsInColorFunction.desc%',
},
'scss.lint.unknownProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%scss.lint.unknownProperties.desc%',
},
'scss.lint.validProperties': {
type: 'array',
uniqueItems: true,
items: {
type: 'string',
},
scope: 'resource',
default: [],
description: '%scss.lint.validProperties.desc%',
},
'scss.lint.ieHack': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.ieHack.desc%',
},
'scss.lint.unknownVendorSpecificProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.unknownVendorSpecificProperties.desc%',
},
'scss.lint.propertyIgnoredDueToDisplay': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
markdownDescription:
'%scss.lint.propertyIgnoredDueToDisplay.desc%',
},
'scss.lint.important': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%scss.lint.important.desc%',
},
'scss.lint.float': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%scss.lint.float.desc%',
},
'scss.lint.idSelector': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%scss.lint.idSelector.desc%',
},
'scss.lint.unknownAtRules': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%scss.lint.unknownAtRules.desc%',
},
},
},
{
id: 'less',
order: 23,
type: 'object',
title: '%less.title%',
properties: {
'less.completion.triggerPropertyValueCompletion': {
type: 'boolean',
scope: 'resource',
default: true,
description:
'%less.completion.triggerPropertyValueCompletion.desc%',
},
'less.completion.completePropertyWithSemicolon': {
type: 'boolean',
scope: 'resource',
default: true,
description:
'%less.completion.completePropertyWithSemicolon.desc%',
},
'less.validate': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%less.validate.desc%',
},
'less.lint.compatibleVendorPrefixes': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.compatibleVendorPrefixes.desc%',
},
'less.lint.vendorPrefix': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%less.lint.vendorPrefix.desc%',
},
'less.lint.duplicateProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.duplicateProperties.desc%',
},
'less.lint.emptyRules': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%less.lint.emptyRules.desc%',
},
'less.lint.importStatement': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.importStatement.desc%',
},
'less.lint.boxModel': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%less.lint.boxModel.desc%',
},
'less.lint.universalSelector': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%less.lint.universalSelector.desc%',
},
'less.lint.zeroUnits': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.zeroUnits.desc%',
},
'less.lint.fontFaceProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
markdownDescription: '%less.lint.fontFaceProperties.desc%',
},
'less.lint.hexColorLength': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'error',
description: '%less.lint.hexColorLength.desc%',
},
'less.lint.argumentsInColorFunction': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'error',
description: '%less.lint.argumentsInColorFunction.desc%',
},
'less.lint.unknownProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%less.lint.unknownProperties.desc%',
},
'less.lint.validProperties': {
type: 'array',
uniqueItems: true,
items: {
type: 'string',
},
scope: 'resource',
default: [],
description: '%less.lint.validProperties.desc%',
},
'less.lint.ieHack': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.ieHack.desc%',
},
'less.lint.unknownVendorSpecificProperties': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.unknownVendorSpecificProperties.desc%',
},
'less.lint.propertyIgnoredDueToDisplay': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
markdownDescription:
'%less.lint.propertyIgnoredDueToDisplay.desc%',
},
'less.lint.important': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%less.lint.important.desc%',
},
'less.lint.float': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
markdownDescription: '%less.lint.float.desc%',
},
'less.lint.idSelector': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'ignore',
description: '%less.lint.idSelector.desc%',
},
'less.lint.unknownAtRules': {
type: 'string',
scope: 'resource',
enum: ['ignore', 'warning', 'error'],
default: 'warning',
description: '%less.lint.unknownAtRules.desc%',
},
},
},
],
configurationDefaults: {
'[css]': {
'editor.suggest.insertMode': 'replace',
},
'[scss]': {
'editor.suggest.insertMode': 'replace',
},
'[less]': {
'editor.suggest.insertMode': 'replace',
},
},
jsonValidation: [
{
fileMatch: '*.css-data.json',
url: 'https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/master/docs/customData.schema.json',
},
{
fileMatch: 'package.json',
url: './schemas/package.schema.json',
},
],
workerMain: 'client/dist/browser/cssClientMain.js',
},
},
defaultPkgNlsJSON: {
displayName: 'CSS Language Features',
description: 'Provides rich language support for CSS, LESS and SCSS files.',
'css.title': 'CSS',
'css.customData.desc':
'A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.',
'css.completion.triggerPropertyValueCompletion.desc':
'By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.',
'css.completion.completePropertyWithSemicolon.desc':
'Insert semicolon at end of line when completing CSS properties',
'css.lint.argumentsInColorFunction.desc': 'Invalid number of parameters.',
'css.lint.boxModel.desc':
'Do not use `width` or `height` when using `padding` or `border`.',
'css.lint.compatibleVendorPrefixes.desc':
'When using a vendor-specific prefix make sure to also include all other vendor-specific properties.',
'css.lint.duplicateProperties.desc':
'Do not use duplicate style definitions.',
'css.lint.emptyRules.desc': 'Do not use empty rulesets.',
'css.lint.float.desc':
'Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.',
'css.lint.fontFaceProperties.desc':
'`@font-face` rule must define `src` and `font-family` properties.',
'css.lint.hexColorLength.desc':
'Hex colors must consist of three or six hex numbers.',
'css.lint.idSelector.desc':
'Selectors should not contain IDs because these rules are too tightly coupled with the HTML.',
'css.lint.ieHack.desc':
'IE hacks are only necessary when supporting IE7 and older.',
'css.lint.important.desc':
'Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.',
'css.lint.importStatement.desc':
'Import statements do not load in parallel.',
'css.lint.propertyIgnoredDueToDisplay.desc':
'Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.',
'css.lint.universalSelector.desc':
'The universal selector (`*`) is known to be slow.',
'css.lint.unknownAtRules.desc': 'Unknown at-rule.',
'css.lint.unknownProperties.desc': 'Unknown property.',
'css.lint.validProperties.desc':
'A list of properties that are not validated against the `unknownProperties` rule.',
'css.lint.unknownVendorSpecificProperties.desc':
'Unknown vendor specific property.',
'css.lint.vendorPrefix.desc':
'When using a vendor-specific prefix, also include the standard property.',
'css.lint.zeroUnits.desc': 'No unit for zero needed.',
'css.trace.server.desc':
'Traces the communication between VS Code and the CSS language server.',
'css.validate.title': 'Controls CSS validation and problem severities.',
'css.validate.desc': 'Enables or disables all validations.',
'less.title': 'LESS',
'less.completion.triggerPropertyValueCompletion.desc':
'By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.',
'less.completion.completePropertyWithSemicolon.desc':
'Insert semicolon at end of line when completing CSS properties',
'less.lint.argumentsInColorFunction.desc': 'Invalid number of parameters.',
'less.lint.boxModel.desc':
'Do not use `width` or `height` when using `padding` or `border`.',
'less.lint.compatibleVendorPrefixes.desc':
'When using a vendor-specific prefix make sure to also include all other vendor-specific properties.',
'less.lint.duplicateProperties.desc':
'Do not use duplicate style definitions.',
'less.lint.emptyRules.desc': 'Do not use empty rulesets.',
'less.lint.float.desc':
'Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.',
'less.lint.fontFaceProperties.desc':
'`@font-face` rule must define `src` and `font-family` properties.',
'less.lint.hexColorLength.desc':
'Hex colors must consist of three or six hex numbers.',
'less.lint.idSelector.desc':
'Selectors should not contain IDs because these rules are too tightly coupled with the HTML.',
'less.lint.ieHack.desc':
'IE hacks are only necessary when supporting IE7 and older.',
'less.lint.important.desc':
'Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.',
'less.lint.importStatement.desc':
'Import statements do not load in parallel.',
'less.lint.propertyIgnoredDueToDisplay.desc':
'Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.',
'less.lint.universalSelector.desc':
'The universal selector (`*`) is known to be slow.',
'less.lint.unknownAtRules.desc': 'Unknown at-rule.',
'less.lint.unknownProperties.desc': 'Unknown property.',
'less.lint.validProperties.desc':
'A list of properties that are not validated against the `unknownProperties` rule.',
'less.lint.unknownVendorSpecificProperties.desc':
'Unknown vendor specific property.',
'less.lint.vendorPrefix.desc':
'When using a vendor-specific prefix, also include the standard property.',
'less.lint.zeroUnits.desc': 'No unit for zero needed.',
'less.validate.title': 'Controls LESS validation and problem severities.',
'less.validate.desc': 'Enables or disables all validations.',
'scss.title': 'SCSS (Sass)',
'scss.completion.triggerPropertyValueCompletion.desc':
'By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.',
'scss.completion.completePropertyWithSemicolon.desc':
'Insert semicolon at end of line when completing CSS properties',
'scss.lint.argumentsInColorFunction.desc': 'Invalid number of parameters.',
'scss.lint.boxModel.desc':
'Do not use `width` or `height` when using `padding` or `border`.',
'scss.lint.compatibleVendorPrefixes.desc':
'When using a vendor-specific prefix make sure to also include all other vendor-specific properties.',
'scss.lint.duplicateProperties.desc':
'Do not use duplicate style definitions.',
'scss.lint.emptyRules.desc': 'Do not use empty rulesets.',
'scss.lint.float.desc':
'Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.',
'scss.lint.fontFaceProperties.desc':
'`@font-face` rule must define `src` and `font-family` properties.',
'scss.lint.hexColorLength.desc':
'Hex colors must consist of three or six hex numbers.',
'scss.lint.idSelector.desc':
'Selectors should not contain IDs because these rules are too tightly coupled with the HTML.',
'scss.lint.ieHack.desc':
'IE hacks are only necessary when supporting IE7 and older.',
'scss.lint.important.desc':
'Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.',
'scss.lint.importStatement.desc':
'Import statements do not load in parallel.',
'scss.lint.propertyIgnoredDueToDisplay.desc':
'Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.',
'scss.lint.universalSelector.desc':
'The universal selector (`*`) is known to be slow.',
'scss.lint.unknownAtRules.desc': 'Unknown at-rule.',
'scss.lint.unknownProperties.desc': 'Unknown property.',
'scss.lint.validProperties.desc':
'A list of properties that are not validated against the `unknownProperties` rule.',
'scss.lint.unknownVendorSpecificProperties.desc':
'Unknown vendor specific property.',
'scss.lint.vendorPrefix.desc':
'When using a vendor-specific prefix, also include the standard property.',
'scss.lint.zeroUnits.desc': 'No unit for zero needed.',
'scss.validate.title': 'Controls SCSS validation and problem severities.',
'scss.validate.desc': 'Enables or disables all validations.',
'css.colorDecorators.enable.deprecationMessage':
'The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.',
'scss.colorDecorators.enable.deprecationMessage':
'The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.',
'less.colorDecorators.enable.deprecationMessage':
'The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.',
},
pkgNlsJSON: {},
nlsList: [],
extendConfig: {},
mode: 'public',
};

View File

@ -0,0 +1,273 @@
module.exports = {
extension: {
publisher: 'alex-ext-public',
name: 'html-language-features-worker',
version: '1.53.0-patch.1',
},
packageJSON: {
name: 'html-language-features-worker',
publisher: 'alex',
version: '1.53.0-patch.1',
displayName: '%displayName%',
description: '%description%',
icon: 'icons/html.png',
activationEvents: ['onLanguage:html', 'onLanguage:handlebars'],
kaitianContributes: {
workerMain: 'client/dist/browser/htmlClientMain.js',
},
contributes: {
configuration: {
id: 'html',
order: 20,
type: 'object',
title: 'HTML',
properties: {
'html.customData': {
type: 'array',
markdownDescription: '%html.customData.desc%',
default: [],
items: {
type: 'string',
},
scope: 'resource',
},
'html.format.enable': {
type: 'boolean',
scope: 'window',
default: true,
description: '%html.format.enable.desc%',
},
'html.format.wrapLineLength': {
type: 'integer',
scope: 'resource',
default: 120,
description: '%html.format.wrapLineLength.desc%',
},
'html.format.unformatted': {
type: ['string', 'null'],
scope: 'resource',
default: 'wbr',
markdownDescription: '%html.format.unformatted.desc%',
},
'html.format.contentUnformatted': {
type: ['string', 'null'],
scope: 'resource',
default: 'pre,code,textarea',
markdownDescription: '%html.format.contentUnformatted.desc%',
},
'html.format.indentInnerHtml': {
type: 'boolean',
scope: 'resource',
default: false,
markdownDescription: '%html.format.indentInnerHtml.desc%',
},
'html.format.preserveNewLines': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.format.preserveNewLines.desc%',
},
'html.format.maxPreserveNewLines': {
type: ['number', 'null'],
scope: 'resource',
default: null,
markdownDescription: '%html.format.maxPreserveNewLines.desc%',
},
'html.format.indentHandlebars': {
type: 'boolean',
scope: 'resource',
default: false,
markdownDescription: '%html.format.indentHandlebars.desc%',
},
'html.format.endWithNewline': {
type: 'boolean',
scope: 'resource',
default: false,
description: '%html.format.endWithNewline.desc%',
},
'html.format.extraLiners': {
type: ['string', 'null'],
scope: 'resource',
default: 'head, body, /html',
markdownDescription: '%html.format.extraLiners.desc%',
},
'html.format.wrapAttributes': {
type: 'string',
scope: 'resource',
default: 'auto',
enum: [
'auto',
'force',
'force-aligned',
'force-expand-multiline',
'aligned-multiple',
'preserve',
'preserve-aligned',
],
enumDescriptions: [
'%html.format.wrapAttributes.auto%',
'%html.format.wrapAttributes.force%',
'%html.format.wrapAttributes.forcealign%',
'%html.format.wrapAttributes.forcemultiline%',
'%html.format.wrapAttributes.alignedmultiple%',
'%html.format.wrapAttributes.preserve%',
'%html.format.wrapAttributes.preservealigned%',
],
description: '%html.format.wrapAttributes.desc%',
},
'html.format.wrapAttributesIndentSize': {
type: ['number', 'null'],
scope: 'resource',
default: null,
description: '%html.format.wrapAttributesIndentSize.desc%',
},
'html.format.templating': {
type: ['boolean'],
scope: 'resource',
default: false,
description: '%html.format.templating.desc%',
},
'html.format.unformattedContentDelimiter': {
type: ['string'],
scope: 'resource',
default: '',
markdownDescription:
'%html.format.unformattedContentDelimiter.desc%',
},
'html.suggest.html5': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.suggest.html5.desc%',
},
'html.validate.scripts': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.validate.scripts%',
},
'html.validate.styles': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.validate.styles%',
},
'html.autoClosingTags': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.autoClosingTags%',
},
'html.hover.documentation': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.hover.documentation%',
},
'html.hover.references': {
type: 'boolean',
scope: 'resource',
default: true,
description: '%html.hover.references%',
},
'html.mirrorCursorOnMatchingTag': {
type: 'boolean',
scope: 'resource',
default: false,
description: '%html.mirrorCursorOnMatchingTag%',
deprecationMessage:
'%html.mirrorCursorOnMatchingTagDeprecationMessage%',
},
'html.trace.server': {
type: 'string',
scope: 'window',
enum: ['off', 'messages', 'verbose'],
default: 'off',
description: '%html.trace.server.desc%',
},
},
},
configurationDefaults: {
'[html]': {
'editor.suggest.insertMode': 'replace',
},
'[handlebars]': {
'editor.suggest.insertMode': 'replace',
},
},
jsonValidation: [
{
fileMatch: '*.html-data.json',
url: 'https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/master/docs/customData.schema.json',
},
{
fileMatch: 'package.json',
url: './schemas/package.schema.json',
},
],
workerMain: 'client/dist/browser/htmlClientMain.js',
},
},
defaultPkgNlsJSON: {
displayName: 'HTML Language Features',
description: 'Provides rich language support for HTML and Handlebar files',
'html.customData.desc':
'A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-html-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its HTML support for the custom HTML tags, attributes and attribute values you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.',
'html.format.enable.desc': 'Enable/disable default HTML formatter.',
'html.format.wrapLineLength.desc':
'Maximum amount of characters per line (0 = disable).',
'html.format.unformatted.desc':
"List of tags, comma separated, that shouldn't be reformatted. `null` defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.",
'html.format.contentUnformatted.desc':
"List of tags, comma separated, where the content shouldn't be reformatted. `null` defaults to the `pre` tag.",
'html.format.indentInnerHtml.desc':
'Indent `<head>` and `<body>` sections.',
'html.format.preserveNewLines.desc':
'Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.',
'html.format.maxPreserveNewLines.desc':
'Maximum number of line breaks to be preserved in one chunk. Use `null` for unlimited.',
'html.format.indentHandlebars.desc':
'Format and indent `{{#foo}}` and `{{/foo}}`.',
'html.format.endWithNewline.desc': 'End with a newline.',
'html.format.extraLiners.desc':
'List of tags, comma separated, that should have an extra newline before them. `null` defaults to `"head, body, /html"`.',
'html.format.wrapAttributes.desc': 'Wrap attributes.',
'html.format.wrapAttributes.auto':
'Wrap attributes only when line length is exceeded.',
'html.format.wrapAttributes.force': 'Wrap each attribute except first.',
'html.format.wrapAttributes.forcealign':
'Wrap each attribute except first and keep aligned.',
'html.format.wrapAttributes.forcemultiline': 'Wrap each attribute.',
'html.format.wrapAttributes.alignedmultiple':
'Wrap when line length is exceeded, align attributes vertically.',
'html.format.wrapAttributes.preserve': 'Preserve wrapping of attributes',
'html.format.wrapAttributes.preservealigned':
'Preserve wrapping of attributes but align.',
'html.format.templating.desc':
'Honor django, erb, handlebars and php templating language tags.',
'html.format.unformattedContentDelimiter.desc':
'Keep text content together between this string.',
'html.format.wrapAttributesIndentSize.desc':
"Alignment size when using 'force aligned' and 'aligned multiple' in `#html.format.wrapAttributes#` or `null` to use the default indent size.",
'html.suggest.html5.desc':
'Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.',
'html.trace.server.desc':
'Traces the communication between VS Code and the HTML language server.',
'html.validate.scripts':
'Controls whether the built-in HTML language support validates embedded scripts.',
'html.validate.styles':
'Controls whether the built-in HTML language support validates embedded styles.',
'html.autoClosingTags': 'Enable/disable autoclosing of HTML tags.',
'html.mirrorCursorOnMatchingTag':
'Enable/disable mirroring cursor on matching HTML tag.',
'html.mirrorCursorOnMatchingTagDeprecationMessage':
'Deprecated in favor of `editor.linkedEditing`',
'html.hover.documentation':
'Show tag and attribute documentation in hover.',
'html.hover.references': 'Show references to MDN in hover.',
},
pkgNlsJSON: {},
nlsList: [],
extendConfig: {},
mode: 'public',
};

View File

@ -0,0 +1,147 @@
module.exports = {
extension: {
publisher: 'alex-ext-public',
name: 'json-language-features-worker',
version: '1.53.0-patch.1',
},
packageJSON: {
name: 'json-language-features-worker',
publisher: 'alex',
version: '1.53.0-patch.1',
displayName: '%displayName%',
description: '%description%',
icon: 'icons/json.png',
activationEvents: ['onLanguage:json', 'onLanguage:jsonc'],
kaitianContributes: {
workerMain: 'client/dist/browser/jsonClientMain.js',
},
contributes: {
configuration: {
id: 'json',
order: 20,
type: 'object',
title: 'JSON',
properties: {
'json.schemas': {
type: 'array',
scope: 'resource',
description: '%json.schemas.desc%',
items: {
type: 'object',
default: {
fileMatch: ['/myfile'],
url: 'schemaURL',
},
properties: {
url: {
type: 'string',
default: '/user.schema.json',
description: '%json.schemas.url.desc%',
},
fileMatch: {
type: 'array',
items: {
type: 'string',
default: 'MyFile.json',
description: '%json.schemas.fileMatch.item.desc%',
},
minItems: 1,
description: '%json.schemas.fileMatch.desc%',
},
schema: {
$ref: 'http://json-schema.org/draft-07/schema#',
description: '%json.schemas.schema.desc%',
},
},
},
},
'json.format.enable': {
type: 'boolean',
scope: 'window',
default: true,
description: '%json.format.enable.desc%',
},
'json.trace.server': {
type: 'string',
scope: 'window',
enum: ['off', 'messages', 'verbose'],
default: 'off',
description: '%json.tracing.desc%',
},
'json.colorDecorators.enable': {
type: 'boolean',
scope: 'window',
default: true,
description: '%json.colorDecorators.enable.desc%',
deprecationMessage:
'%json.colorDecorators.enable.deprecationMessage%',
},
'json.maxItemsComputed': {
type: 'number',
default: 5000,
description: '%json.maxItemsComputed.desc%',
},
'json.schemaDownload.enable': {
type: 'boolean',
default: true,
description: '%json.enableSchemaDownload.desc%',
tags: ['usesOnlineServices'],
},
},
},
configurationDefaults: {
'[json]': {
'editor.quickSuggestions': {
strings: true,
},
'editor.suggest.insertMode': 'replace',
},
'[jsonc]': {
'editor.quickSuggestions': {
strings: true,
},
'editor.suggest.insertMode': 'replace',
},
},
jsonValidation: [
{
fileMatch: '*.schema.json',
url: 'http://json-schema.org/draft-07/schema#',
},
],
workerMain: 'client/dist/browser/jsonClientMain.js',
},
},
defaultPkgNlsJSON: {
displayName: 'JSON Language Features',
description: 'Provides rich language support for JSON files.',
'json.schemas.desc':
'Associate schemas to JSON files in the current project',
'json.schemas.url.desc':
'A URL to a schema or a relative path to a schema in the current directory',
'json.schemas.fileMatch.desc':
"An array of file patterns to match against when resolving JSON files to schemas. `*` can be used as a wildcard. Exclusion patterns can also be defined and start with '!'. A file matches when there is at least one matching pattern and the last matching pattern is not an exclusion pattern.",
'json.schemas.fileMatch.item.desc':
"A file pattern that can contain '*' to match against when resolving JSON files to schemas.",
'json.schemas.schema.desc':
'The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.',
'json.format.enable.desc': 'Enable/disable default JSON formatter',
'json.tracing.desc':
'Traces the communication between VS Code and the JSON language server.',
'json.colorDecorators.enable.desc': 'Enables or disables color decorators',
'json.colorDecorators.enable.deprecationMessage':
'The setting `json.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.',
'json.schemaResolutionErrorMessage': 'Unable to resolve schema.',
'json.clickToRetry': 'Click to retry.',
'json.maxItemsComputed.desc':
'The maximum number of outline symbols and folding regions computed (limited for performance reasons).',
'json.maxItemsExceededInformation.desc':
'Show notification when exceeding the maximum number of outline symbols and folding regions.',
'json.enableSchemaDownload.desc':
'When enabled, JSON schemas can be fetched from http and https locations.',
},
pkgNlsJSON: {},
nlsList: [],
extendConfig: {},
mode: 'public',
};

View File

@ -0,0 +1,346 @@
module.exports = {
extension: {
publisher: 'alex-ext-public',
name: 'markdown-language-features-worker',
version: '1.53.0-patch.1',
},
packageJSON: {
name: 'markdown-language-features-worker',
publisher: 'alex',
version: '1.53.0-patch.1',
displayName: '%displayName%',
description: '%description%',
icon: 'icon.png',
activationEvents: [
'onLanguage:markdown',
'onCommand:markdown.preview.toggleLock',
'onCommand:markdown.preview.refresh',
'onCommand:markdown.showPreview',
'onCommand:markdown.showPreviewToSide',
'onCommand:markdown.showLockedPreviewToSide',
'onCommand:markdown.showSource',
'onCommand:markdown.showPreviewSecuritySelector',
'onCommand:markdown.api.render',
'onWebviewPanel:markdown.preview',
'onCustomEditor:vscode.markdown.preview.editor',
],
kaitianContributes: {
workerMain: './dist/browser/extension.js',
},
contributes: {
commands: [
{
command: 'markdown.showPreview',
title: '%markdown.preview.title%',
category: 'Markdown',
icon: {
light: './media/preview-light.svg',
dark: './media/preview-dark.svg',
},
},
{
command: 'markdown.showPreviewToSide',
title: '%markdown.previewSide.title%',
category: 'Markdown',
icon: '$(open-preview)',
},
{
command: 'markdown.showLockedPreviewToSide',
title: '%markdown.showLockedPreviewToSide.title%',
category: 'Markdown',
icon: '$(open-preview)',
},
{
command: 'markdown.showSource',
title: '%markdown.showSource.title%',
category: 'Markdown',
icon: '$(go-to-file)',
},
{
command: 'markdown.showPreviewSecuritySelector',
title: '%markdown.showPreviewSecuritySelector.title%',
category: 'Markdown',
},
{
command: 'markdown.preview.refresh',
title: '%markdown.preview.refresh.title%',
category: 'Markdown',
},
{
command: 'markdown.preview.toggleLock',
title: '%markdown.preview.toggleLock.title%',
category: 'Markdown',
},
],
menus: {
'editor/title': [
{
command: 'markdown.showPreviewToSide',
when: 'editorLangId == markdown && !notebookEditorFocused',
alt: 'markdown.showPreview',
group: 'navigation',
},
{
command: 'markdown.showSource',
when: 'markdownPreviewFocus',
group: 'navigation',
},
{
command: 'markdown.preview.refresh',
when: 'markdownPreviewFocus',
group: '1_markdown',
},
{
command: 'markdown.preview.toggleLock',
when: 'markdownPreviewFocus',
group: '1_markdown',
},
{
command: 'markdown.showPreviewSecuritySelector',
when: 'markdownPreviewFocus',
group: '1_markdown',
},
],
'explorer/context': [
{
command: 'markdown.showPreview',
when: 'resourceLangId == markdown',
group: 'navigation',
},
],
'editor/title/context': [
{
command: 'markdown.showPreview',
when: 'resourceLangId == markdown',
group: '1_open',
},
],
commandPalette: [
{
command: 'markdown.showPreview',
when: 'editorLangId == markdown && !notebookEditorFocused',
group: 'navigation',
},
{
command: 'markdown.showPreviewToSide',
when: 'editorLangId == markdown && !notebookEditorFocused',
group: 'navigation',
},
{
command: 'markdown.showLockedPreviewToSide',
when: 'editorLangId == markdown && !notebookEditorFocused',
group: 'navigation',
},
{
command: 'markdown.showSource',
when: 'markdownPreviewFocus',
group: 'navigation',
},
{
command: 'markdown.showPreviewSecuritySelector',
when: 'editorLangId == markdown && !notebookEditorFocused',
},
{
command: 'markdown.showPreviewSecuritySelector',
when: 'markdownPreviewFocus',
},
{
command: 'markdown.preview.toggleLock',
when: 'markdownPreviewFocus',
},
{
command: 'markdown.preview.refresh',
when: 'editorLangId == markdown && !notebookEditorFocused',
},
{
command: 'markdown.preview.refresh',
when: 'markdownPreviewFocus',
},
],
},
keybindings: [
{
command: 'markdown.showPreview',
key: 'shift+ctrl+v',
mac: 'shift+cmd+v',
when: 'editorLangId == markdown && !notebookEditorFocused',
},
{
command: 'markdown.showPreviewToSide',
key: 'ctrl+k v',
mac: 'cmd+k v',
when: 'editorLangId == markdown && !notebookEditorFocused',
},
],
configuration: {
type: 'object',
title: 'Markdown',
order: 20,
properties: {
'markdown.styles': {
type: 'array',
items: {
type: 'string',
},
default: [],
description: '%markdown.styles.dec%',
scope: 'resource',
},
'markdown.preview.breaks': {
type: 'boolean',
default: false,
description: '%markdown.preview.breaks.desc%',
scope: 'resource',
},
'markdown.preview.linkify': {
type: 'boolean',
default: true,
description: '%markdown.preview.linkify%',
scope: 'resource',
},
'markdown.preview.fontFamily': {
type: 'string',
default:
"-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",
description: '%markdown.preview.fontFamily.desc%',
scope: 'resource',
},
'markdown.preview.fontSize': {
type: 'number',
default: 14,
description: '%markdown.preview.fontSize.desc%',
scope: 'resource',
},
'markdown.preview.lineHeight': {
type: 'number',
default: 1.6,
description: '%markdown.preview.lineHeight.desc%',
scope: 'resource',
},
'markdown.preview.scrollPreviewWithEditor': {
type: 'boolean',
default: true,
description: '%markdown.preview.scrollPreviewWithEditor.desc%',
scope: 'resource',
},
'markdown.preview.markEditorSelection': {
type: 'boolean',
default: true,
description: '%markdown.preview.markEditorSelection.desc%',
scope: 'resource',
},
'markdown.preview.scrollEditorWithPreview': {
type: 'boolean',
default: true,
description: '%markdown.preview.scrollEditorWithPreview.desc%',
scope: 'resource',
},
'markdown.preview.doubleClickToSwitchToEditor': {
type: 'boolean',
default: true,
description: '%markdown.preview.doubleClickToSwitchToEditor.desc%',
scope: 'resource',
},
'markdown.preview.openMarkdownLinks': {
type: 'string',
default: 'inPreview',
description:
'%configuration.markdown.preview.openMarkdownLinks.description%',
scope: 'resource',
enum: ['inPreview', 'inEditor'],
enumDescriptions: [
'%configuration.markdown.preview.openMarkdownLinks.inPreview%',
'%configuration.markdown.preview.openMarkdownLinks.inEditor%',
],
},
'markdown.links.openLocation': {
type: 'string',
default: 'currentGroup',
description:
'%configuration.markdown.links.openLocation.description%',
scope: 'resource',
enum: ['currentGroup', 'beside'],
enumDescriptions: [
'%configuration.markdown.links.openLocation.currentGroup%',
'%configuration.markdown.links.openLocation.beside%',
],
},
'markdown.trace': {
type: 'string',
enum: ['off', 'verbose'],
default: 'off',
description: '%markdown.trace.desc%',
scope: 'window',
},
},
},
configurationDefaults: {
'[markdown]': {
'editor.wordWrap': 'on',
'editor.quickSuggestions': false,
},
},
jsonValidation: [
{
fileMatch: 'package.json',
url: './schemas/package.schema.json',
},
],
'markdown.previewStyles': [
'./media/markdown.css',
'./media/highlight.css',
],
'markdown.previewScripts': ['./media/index.js'],
workerMain: './dist/browser/extension.js',
},
},
defaultPkgNlsJSON: {
displayName: 'Markdown Language Features',
description: 'Provides rich language support for Markdown.',
'markdown.preview.breaks.desc':
"Sets how line-breaks are rendered in the markdown preview. Setting it to 'true' creates a <br> for newlines inside paragraphs.",
'markdown.preview.linkify':
'Enable or disable conversion of URL-like text to links in the markdown preview.',
'markdown.preview.doubleClickToSwitchToEditor.desc':
'Double click in the markdown preview to switch to the editor.',
'markdown.preview.fontFamily.desc':
'Controls the font family used in the markdown preview.',
'markdown.preview.fontSize.desc':
'Controls the font size in pixels used in the markdown preview.',
'markdown.preview.lineHeight.desc':
'Controls the line height used in the markdown preview. This number is relative to the font size.',
'markdown.preview.markEditorSelection.desc':
'Mark the current editor selection in the markdown preview.',
'markdown.preview.scrollEditorWithPreview.desc':
'When a markdown preview is scrolled, update the view of the editor.',
'markdown.preview.scrollPreviewWithEditor.desc':
'When a markdown editor is scrolled, update the view of the preview.',
'markdown.preview.title': 'Open Preview',
'markdown.previewSide.title': 'Open Preview to the Side',
'markdown.showLockedPreviewToSide.title': 'Open Locked Preview to the Side',
'markdown.showSource.title': 'Show Source',
'markdown.styles.dec':
"A list of URLs or local paths to CSS style sheets to use from the markdown preview. Relative paths are interpreted relative to the folder open in the explorer. If there is no open folder, they are interpreted relative to the location of the markdown file. All '\\' need to be written as '\\\\'.",
'markdown.showPreviewSecuritySelector.title':
'Change Preview Security Settings',
'markdown.trace.desc': 'Enable debug logging for the markdown extension.',
'markdown.preview.refresh.title': 'Refresh Preview',
'markdown.preview.toggleLock.title': 'Toggle Preview Locking',
'configuration.markdown.preview.openMarkdownLinks.description':
'Controls how links to other markdown files in the markdown preview should be opened.',
'configuration.markdown.preview.openMarkdownLinks.inEditor':
'Try to open links in the editor',
'configuration.markdown.preview.openMarkdownLinks.inPreview':
'Try to open links in the markdown preview',
'configuration.markdown.links.openLocation.description':
'Controls where links in markdown files should be opened.',
'configuration.markdown.links.openLocation.currentGroup':
'Open links in the active editor group.',
'configuration.markdown.links.openLocation.beside':
'Open links beside the active editor.',
},
pkgNlsJSON: {},
nlsList: [],
extendConfig: {},
mode: 'public',
};

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,11 @@
import React, { Component, Fragment } from "react";
import { Switch } from 'antd';
import { UnControlled as CodeMirror } from 'react-codemirror2';
import { EditorRenderer } from 'alex';
import { getUrl } from 'educoder';
import 'codemirror/addon/selection/active-line.js';
import 'codemirror/mode/javascript/javascript.js';
import 'codemirror/mode/clike/clike';
import 'codemirror/mode/css/css';
import changeThemePlugin from './changeTheme';
import UserSubmitComponent from "./UserSubmitComponent";
import CloudIDE from "./cloudIDE";
import "./index.css";
import "./editor.css";
@ -20,7 +17,6 @@ class m_editor extends Component {
editorValue: this.props.content,
changeValue: this.props.content,
prevHeight: 0,
ideStyle: 'ide-light',
};
}
componentDidUpdate = (prevProps) => {
@ -36,35 +32,9 @@ class m_editor extends Component {
});
};
changeStyle = async(v) => {
// this.setState({
// ideStyle: v ? 'ide-light' : 'ide-dark'
// });
const commands = changeThemePlugin.commands;
if (commands) {
await commands.executeCommand(
'ChangeThemePlugin.changeTheme',
v ? 'ide-light' : 'ide-dark'
);
// await commands.executeCommand('theme.toggle');
}
}
changeTheme= async() =>{
const commands = changeThemePlugin.commands;
if (commands) {
await commands.executeCommand(
'ChangeThemePlugin.changeTheme',
'ide-dark'
);
// await commands.executeCommand('theme.toggle');
}
}
render() {
const { editorValue, changeValue, ideStyle } = this.state;
const { editorValue, changeValue } = this.state;
const { readOnly, editorType, currentBranch, descName, checkName, detail } = this.props;
console.log(ideStyle);
const editor_options = {
lineNumbers: "on",
lineWrapping: true, //强制换行
@ -87,9 +57,6 @@ class m_editor extends Component {
},
};
const group = 'Gitlink';
const repo = 'forgeplus';
let download_url = detail && detail.download_url;
return (
<Fragment>
@ -101,80 +68,7 @@ class m_editor extends Component {
options={editor_options}
onChange={this.changeEditor}
/> :
<Fragment>
<div className="ideStyle">
<Switch checkedChildren="light" unCheckedChildren="dark" defaultChecked onChange={this.changeStyle}></Switch>
</div>
<EditorRenderer
appConfig={{
// 工作空间目录
plugins: [changeThemePlugin],
workspaceDir: `${group}/${repo}`,
defaultPreferences: {
// 默认主题,如果暗色为 ide-dark
// 'general.theme': 'ide-light',
'general.theme': ideStyle,
// 编辑器只读
'editor.forceReadOnly': true,
// 最后一行禁止继续滚动
'editor.scrollBeyondLastLine': false,
}
}}
runtimeConfig={{
// 业务标识
biz: 'gitlink',
// 在 editor 下推荐传 null此时不会持久化缓存工作空间数据
scenario: null,
// 启动时显示的编辑器editor 下传 none 即可
startupEditor: 'none',
// 隐藏 editor tab
hideEditorTab: true,
}}
editorConfig={{
stretchHeight: true,
disableEditorSearch: true,
}}
// 文档模型,以下数据变更时会更新打开的编辑器
documentModel={{
// 类型code 下为 code保持不变
type: 'code',
// 分支或 tag
ref: 'master',
// 仓库群组和用户
owner: group,
// 仓库名
name: repo,
// 仓库文件路径
filepath: 'robots.ts',
// 读取文件接口
readFile: async (filepath) => {
if (!filepath) {
return;
}
// 请求接口
// const res = await fetch('https://gist.githubusercontent.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js');
const res = await fetch(`${getUrl()}/attachments/entries/get_file?download_url=${download_url}`);
return res.arrayBuffer();
},
// 文件编码,和标准工作空间支持编码类型一致,简单场景只传 utf8 或 gbk 即可
encoding: 'utf8',
onFilepathChange: (changedFilepath) => {
if (changedFilepath) {
console.log(`路由跳转到 ${changedFilepath}`)
}
},
// 指定当前选中多少行
// lineNumber: [0, 1],
onLineNumberChange: line => {
if (typeof line === 'number') {
console.log(`#L${line}`)
} else {
console.log(`#L${line[0]}-${line[1]}`)
}
},
}}
/>
</Fragment>
<CloudIDE download_url={download_url}/>
}
</div>
{!readOnly && (