diff --git a/.travis.yml b/.travis.yml index 75f3bf843c6..07c1ba2c9a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,5 +38,6 @@ script: - gulp hygiene - gulp electron - gulp compile + - gulp optimize-vscode - ./scripts/test.sh - ./scripts/test-integration.sh diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index d5d2f3ee130..23cf349d5fa 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -75,6 +75,7 @@ var copyrightFilter = [ '!**/*.sh', '!**/*.txt', '!**/*.xpm', + '!extensions/markdown/media/tomorrow.css' ]; var tslintFilter = [ diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 27f837a935a..67fc67e9fa1 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -27,13 +27,9 @@ var root = path.dirname(__dirname); var build = path.join(root, '.build'); var commit = util.getVersion(root); -var baseModules = [ - 'applicationinsights', 'assert', 'child_process', 'chokidar', 'crypto', 'emmet', - 'events', 'fs', 'getmac', 'glob', 'graceful-fs', 'http', 'http-proxy-agent', - 'https', 'https-proxy-agent', 'iconv-lite', 'electron', 'net', - 'os', 'path', 'pty.js', 'readline', 'sax', 'semver', 'stream', 'string_decoder', 'url', 'term.js', - 'vscode-textmate', 'winreg', 'yauzl', 'native-keymap', 'zlib', 'minimist', 'xterm' -]; +var dependencies = Object.keys(shrinkwrap.dependencies); +var baseModules = Object.keys(process.binding('natives')).filter(function (n) { return !/^_|\//.test(n); }); +var nodeModules = ['electron'].concat(dependencies).concat(baseModules); // Build @@ -57,7 +53,6 @@ var vscodeResources = [ 'out-build/vs/base/worker/workerMainCompatibility.html', 'out-build/vs/base/worker/workerMain.{js,js.map}', 'out-build/vs/base/browser/ui/octiconLabel/octicons/**', - 'out-build/vs/languages/markdown/common/*.css', 'out-build/vs/workbench/browser/media/*-theme.css', 'out-build/vs/workbench/electron-browser/index.html', 'out-build/vs/workbench/parts/debug/**/*.json', @@ -65,7 +60,6 @@ var vscodeResources = [ 'out-build/vs/workbench/parts/git/**/*.html', 'out-build/vs/workbench/parts/git/**/*.sh', 'out-build/vs/workbench/parts/html/browser/webview.html', - 'out-build/vs/workbench/parts/markdown/**/*.md', 'out-build/vs/workbench/parts/tasks/**/*.json', 'out-build/vs/workbench/parts/terminal/electron-browser/terminalProcess.js', 'out-build/vs/workbench/services/files/**/*.exe', @@ -84,7 +78,7 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil entryPoints: vscodeEntryPoints, otherSources: [], resources: vscodeResources, - loaderConfig: common.loaderConfig(baseModules), + loaderConfig: common.loaderConfig(nodeModules), header: BUNDLED_FILE_HEADER, out: 'out-vscode' })); @@ -173,10 +167,11 @@ function packageTask(platform, arch, opts) { '!extensions/*/{client,server}/out/**/test/**', '!extensions/*/{client,server}/out/**/typings/**', '!extensions/**/.vscode/**', + '!extensions/**/tsconfig.json', '!extensions/typescript/bin/**', '!extensions/vscode-api-tests/**', '!extensions/vscode-colorize-tests/**', - '!extensions/css/server/out/data/**' + '!extensions/css/server/out/data/buildscripts/**' ], { base: '.' }); var sources = es.merge(src, extensions) @@ -199,7 +194,7 @@ function packageTask(platform, arch, opts) { var license = gulp.src(['Credits_*', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' }); var api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts')); - var depsSrc = _.flatten(Object.keys(shrinkwrap.dependencies) + var depsSrc = _.flatten(dependencies .map(function (d) { return ['node_modules/' + d + '/**', '!node_modules/' + d + '/**/{test,tests}/**']; })); var deps = gulp.src(depsSrc, { base: '.', dot: true }) diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index 82b8ba4a43d..4ca3735197c 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -53,7 +53,11 @@ declare module monaco { declare module monaco.editor { #includeAll(vs/editor/browser/standalone/standaloneEditor;modes.=>languages.): -#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions +#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor +export interface ICommandHandler { + (...args:any[]): void; +} +#include(vs/platform/keybinding/common/keybindingService): IKeybindingContextKey #include(vs/editor/browser/standalone/standaloneServices): IEditorOverrideServices #include(vs/platform/markers/common/markers): IMarkerData #include(vs/editor/browser/standalone/colorizer): IColorizerOptions, IColorizerElementOptions @@ -77,12 +81,6 @@ declare module monaco.languages { declare module monaco.worker { - export interface IMirrorModel { - uri: Uri; - version: number; - getText(): string; - } - - export var mirrorModels: IMirrorModel[]; +#includeAll(vs/editor/common/services/editorSimpleWorker;): } \ No newline at end of file diff --git a/build/monaco/package.json b/build/monaco/package.json index 3f3ec9396c5..7e6d2be7ba7 100644 --- a/build/monaco/package.json +++ b/build/monaco/package.json @@ -1,7 +1,7 @@ { "name": "monaco-editor-core", "private": true, - "version": "0.3.1", + "version": "0.4.2", "description": "A browser based code editor", "author": "Microsoft Corporation", "license": "MIT", diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js index 1a73f1e0ab9..37af6ff2a41 100644 --- a/build/npm/postinstall.js +++ b/build/npm/postinstall.js @@ -11,6 +11,7 @@ const extensions = [ 'vscode-colorize-tests', 'json', 'configuration-editing', + 'markdown', 'typescript', 'php', 'javascript', diff --git a/extensions/configuration-editing/package.json b/extensions/configuration-editing/package.json index 1d9eb637535..bbc17790276 100644 --- a/extensions/configuration-editing/package.json +++ b/extensions/configuration-editing/package.json @@ -17,6 +17,6 @@ "watch": "gulp watch-extension:configuration-editing" }, "dependencies": { - "jsonc-parser": "^0.2.1" + "jsonc-parser": "^0.2.2" } } diff --git a/extensions/css/server/src/cssLanguageService.ts b/extensions/css/server/src/cssLanguageService.ts index 2901f52b261..df699692691 100644 --- a/extensions/css/server/src/cssLanguageService.ts +++ b/extensions/css/server/src/cssLanguageService.ts @@ -43,11 +43,11 @@ export interface LanguageSettings { let cssParser = new Parser(); let cssCompletion = new CSSCompletion(); let cssHover = new CSSHover(); -let cssValidation = new CSSValidation(); let cssNavigation = new CSSNavigation(); let cssCodeActions = new CSSCodeActions(); export function getCSSLanguageService() : LanguageService { + let cssValidation = new CSSValidation(); // an instance per language service return { configure: cssValidation.configure.bind(cssValidation), doValidation: cssValidation.doValidation.bind(cssValidation), diff --git a/extensions/css/server/src/services/cssCompletion.ts b/extensions/css/server/src/services/cssCompletion.ts index d3d2ac4b25d..85fd37e7384 100644 --- a/extensions/css/server/src/services/cssCompletion.ts +++ b/extensions/css/server/src/services/cssCompletion.ts @@ -206,10 +206,13 @@ export class CSSCompletion { public getUnitProposals(entry: languageFacts.IEntry, result: CompletionList): CompletionList { let currentWord = '0'; if (this.currentWord.length > 0) { - let numMatch = this.currentWord.match(/-?\d[\.\d+]*/); + let numMatch = this.currentWord.match(/^-?\d[\.\d+]*/); if (numMatch) { currentWord = numMatch[0]; + result.isIncomplete = currentWord.length === this.currentWord.length; } + } else if (this.currentWord.length === 0) { + result.isIncomplete = true; } entry.restrictions.forEach((restriction) => { let units = languageFacts.units[restriction]; @@ -223,7 +226,6 @@ export class CSSCompletion { }); } }); - result.isIncomplete = true; return result; } diff --git a/extensions/css/server/src/services/cssValidation.ts b/extensions/css/server/src/services/cssValidation.ts index 8a2e0669313..55247969f89 100644 --- a/extensions/css/server/src/services/cssValidation.ts +++ b/extensions/css/server/src/services/cssValidation.ts @@ -42,6 +42,7 @@ export class CSSValidation { let range = Range.create(document.positionAt(marker.getOffset()), document.positionAt(marker.getOffset() + marker.getLength())); return { code: marker.getRule().id, + source: document.languageId, message: marker.getMessage(), severity: marker.getLevel() === nodes.Level.Warning ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error, range: range diff --git a/extensions/css/server/src/test/scss/scssCompletion.test.ts b/extensions/css/server/src/test/scss/scssCompletion.test.ts index a65357da0bb..619336c36a9 100644 --- a/extensions/css/server/src/test/scss/scssCompletion.test.ts +++ b/extensions/css/server/src/test/scss/scssCompletion.test.ts @@ -8,7 +8,6 @@ import * as assert from 'assert'; import {SCSSParser} from '../../parser/scssParser'; import {SCSSCompletion} from '../../services/scssCompletion'; -import * as nodes from '../../parser/cssNodes'; import {TextDocument, Position} from 'vscode-languageserver'; import {assertCompletion, ItemDescription} from '../css/completion.test'; diff --git a/extensions/ini/package.json b/extensions/ini/package.json index 882bb0c2325..14d80776a12 100644 --- a/extensions/ini/package.json +++ b/extensions/ini/package.json @@ -6,7 +6,7 @@ "contributes": { "languages": [{ "id": "ini", - "extensions": [ ".desktop", ".ini", ".properties", ".gitconfig" ], + "extensions": [ ".ini", ".properties", ".gitconfig" ], "filenames": ["config", ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig"], "aliases": [ "Ini", "ini" ], "configuration": "./ini.configuration.json" diff --git a/extensions/javascript/package.json b/extensions/javascript/package.json index b1fd77b9a87..63d55f7ed91 100644 --- a/extensions/javascript/package.json +++ b/extensions/javascript/package.json @@ -10,7 +10,7 @@ "dependencies": { "vscode-nls": "^1.0.4", "request-light": "^0.1.0", - "jsonc-parser": "^0.2.0" + "jsonc-parser": "^0.2.2" }, "scripts": { "compile": "gulp compile-extension:javascript", diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage b/extensions/javascript/syntaxes/JavaScript.tmLanguage index 5092179c69b..0a59bccde92 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage +++ b/extensions/javascript/syntaxes/JavaScript.tmLanguage @@ -193,7 +193,7 @@ control-statement match - (?<!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default)\b + (?<!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default|yield)\b name keyword.control.js @@ -1815,6 +1815,110 @@ + ternary-expression + + begin + (?=\?) + end + (?=$|[;,]) + patterns + + + include + #ternary-operator + + + include + #ternary-expression-type + + + + ternary-expression-type + + name + meta.expression.js + patterns + + + include + #string + + + include + #regex + + + include + #template + + + include + #comment + + + include + #literal + + + include + #paren-expression + + + include + #ternary-expression + + + include + #import-operator + + + include + #expression-operator + + + include + #imply-operator + + + include + #relational-operator + + + include + #arithmetic-operator + + + include + #logic-operator + + + include + #assignment-operator + + + include + #type-primitive + + + include + #function-call + + + + ternary-operator + + begin + (\?) + end + (:) + patterns + + + include + #ternary-expression-type + + + this-literal match @@ -2206,6 +2310,10 @@ meta.var-single-variable.expr.js patterns + + include + #ternary-expression + include #type-annotation diff --git a/extensions/json/server/package.json b/extensions/json/server/package.json index ab47aa2efc5..d4db5625a96 100644 --- a/extensions/json/server/package.json +++ b/extensions/json/server/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "request-light": "^0.1.0", - "jsonc-parser": "^0.2.0", + "jsonc-parser": "^0.2.2", "vscode-languageserver": "^2.2.0", "vscode-nls": "^1.0.4" }, diff --git a/extensions/json/server/src/jsonCompletion.ts b/extensions/json/server/src/jsonCompletion.ts index 5c7130122e9..0cf688b49b3 100644 --- a/extensions/json/server/src/jsonCompletion.ts +++ b/extensions/json/server/src/jsonCompletion.ts @@ -10,7 +10,7 @@ import SchemaService = require('./jsonSchemaService'); import JsonSchema = require('./jsonSchema'); import {IJSONWorkerContribution} from './jsonContributions'; -import {CompletionItem, CompletionItemKind, CompletionList, TextDocument, Position, Range, TextEdit, RemoteConsole} from 'vscode-languageserver'; +import {CompletionItem, CompletionItemKind, CompletionList, TextDocument, Position, Range, TextEdit} from 'vscode-languageserver'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); @@ -26,12 +26,10 @@ export class JSONCompletion { private schemaService: SchemaService.IJSONSchemaService; private contributions: IJSONWorkerContribution[]; - private console: RemoteConsole; - constructor(schemaService: SchemaService.IJSONSchemaService, console: RemoteConsole, contributions: IJSONWorkerContribution[] = []) { + constructor(schemaService: SchemaService.IJSONSchemaService, contributions: IJSONWorkerContribution[] = []) { this.schemaService = schemaService; this.contributions = contributions; - this.console = console; } public doResolve(item: CompletionItem) : Thenable { @@ -80,10 +78,10 @@ export class JSONCompletion { result.isIncomplete = true; }, error: (message: string) => { - this.console.error(message); + console.error(message); }, log: (message: string) => { - this.console.log(message); + console.log(message); } }; diff --git a/extensions/json/server/src/jsonDocumentSymbols.ts b/extensions/json/server/src/jsonDocumentSymbols.ts index 9597fdad830..e0937f35ac4 100644 --- a/extensions/json/server/src/jsonDocumentSymbols.ts +++ b/extensions/json/server/src/jsonDocumentSymbols.ts @@ -14,7 +14,7 @@ export class JSONDocumentSymbols { constructor() { } - public compute(document: TextDocument, doc: Parser.JSONDocument): Promise { + public findDocumentSymbols(document: TextDocument, doc: Parser.JSONDocument): Promise { let root = doc.root; if (!root) { diff --git a/extensions/json/server/src/jsonLanguageService.ts b/extensions/json/server/src/jsonLanguageService.ts new file mode 100644 index 00000000000..2b0c7028679 --- /dev/null +++ b/extensions/json/server/src/jsonLanguageService.ts @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import {TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, + TextEdit, FormattingOptions} from 'vscode-languageserver'; + +import {JSONCompletion} from './jsonCompletion'; +import {JSONHover} from './jsonHover'; +import {JSONValidation} from './jsonValidation'; +import {IJSONSchema} from './jsonSchema'; +import {JSONDocumentSymbols} from './jsonDocumentSymbols'; +import {parse as parseJSON, JSONDocument} from './jsonParser'; +import {schemaContributions} from './configuration'; +import {XHROptions, XHRResponse} from 'request-light'; +import {JSONSchemaService} from './jsonSchemaService'; +import {IJSONWorkerContribution} from './jsonContributions'; +import {format as formatJSON} from './jsonFormatter'; + +export interface LanguageService { + configure(schemaConfiguration: JSONSchemaConfiguration[]): void; + doValidation(document: TextDocument, jsonDocument: JSONDocument): Thenable; + parseJSONDocument(document: TextDocument): JSONDocument; + resetSchema(uri: string): boolean; + doResolve(item: CompletionItem): Thenable; + doComplete(document: TextDocument, position: Position, doc: JSONDocument): Thenable; + findDocumentSymbols(document: TextDocument, doc: JSONDocument): Promise; + doHover(document: TextDocument, position: Position, doc: JSONDocument): Thenable; + format(document: TextDocument, range: Range, options: FormattingOptions): Thenable; +} + +export interface JSONSchemaConfiguration { + uri: string; + fileMatch?: string[]; + schema?: IJSONSchema; +} + +export interface TelemetryService { + log(key: string, data: any): void; +} + +export interface WorkspaceContextService { + resolveRelativePath(relativePath: string, resource: string): string; +} + +export interface RequestService { + (options: XHROptions): Thenable; +} + +export function getLanguageService(contributions: IJSONWorkerContribution[], request: RequestService, workspaceContext: WorkspaceContextService, telemetry: TelemetryService): LanguageService { + let jsonSchemaService = new JSONSchemaService(request, workspaceContext, telemetry); + jsonSchemaService.setSchemaContributions(schemaContributions); + + let jsonCompletion = new JSONCompletion(jsonSchemaService, contributions); + let jsonHover = new JSONHover(jsonSchemaService, contributions); + let jsonDocumentSymbols = new JSONDocumentSymbols(); + let jsonValidation = new JSONValidation(jsonSchemaService); + + return { + configure: (schemaConf: JSONSchemaConfiguration[]) => { + schemaConf.forEach(settings => { + jsonSchemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema); + }); + }, + resetSchema: (uri: string) => { + return jsonSchemaService.onResourceChange(uri); + }, + doValidation: jsonValidation.doValidation.bind(jsonValidation), + parseJSONDocument: (document: TextDocument) => parseJSON(document.getText()), + doResolve: jsonCompletion.doResolve.bind(jsonCompletion), + doComplete: jsonCompletion.doComplete.bind(jsonCompletion), + findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols), + doHover: jsonHover.doHover.bind(jsonHover), + format: (document, range, options) => Promise.resolve(formatJSON(document, range, options)) + }; +} diff --git a/extensions/json/server/src/jsonSchemaService.ts b/extensions/json/server/src/jsonSchemaService.ts index 2dcfd5491ba..60614b7adf8 100644 --- a/extensions/json/server/src/jsonSchemaService.ts +++ b/extensions/json/server/src/jsonSchemaService.ts @@ -6,11 +6,11 @@ import Json = require('jsonc-parser'); import {IJSONSchema, IJSONSchemaMap} from './jsonSchema'; -import {XHROptions, XHRResponse, getErrorStatusDescription} from 'request-light'; +import {XHRResponse, getErrorStatusDescription} from 'request-light'; import URI from './utils/uri'; import Strings = require('./utils/strings'); import Parser = require('./jsonParser'); -import {RemoteConsole} from 'vscode-languageserver'; +import {TelemetryService, RequestService, WorkspaceContextService} from './jsonLanguageService'; import * as nls from 'vscode-nls'; @@ -128,7 +128,7 @@ class SchemaHandle implements ISchemaHandle { public getResolvedSchema(): Thenable { if (!this.resolvedSchema) { this.resolvedSchema = this.getUnresolvedSchema().then(unresolved => { - return this.service.resolveSchemaContent(unresolved); + return this.service.resolveSchemaContent(unresolved, this.url); }); } return this.resolvedSchema; @@ -201,18 +201,6 @@ export class ResolvedSchema { } } -export interface ITelemetryService { - log(key: string, data: any): void; -} - -export interface IWorkspaceContextService { - resolveRelativePath(relativePath: string, resource: string): string; -} - -export interface IRequestService { - (options: XHROptions): Thenable; -} - export class JSONSchemaService implements IJSONSchemaService { private contributionSchemas: { [id: string]: SchemaHandle }; @@ -222,12 +210,12 @@ export class JSONSchemaService implements IJSONSchemaService { private filePatternAssociations: FilePatternAssociation[]; private filePatternAssociationById: { [id: string]: FilePatternAssociation }; - private contextService: IWorkspaceContextService; + private contextService: WorkspaceContextService; private callOnDispose: Function[]; - private telemetryService: ITelemetryService; - private requestService: IRequestService; + private telemetryService: TelemetryService; + private requestService: RequestService; - constructor(requestService: IRequestService, contextService?: IWorkspaceContextService, telemetryService?: ITelemetryService, private console?: RemoteConsole) { + constructor(requestService: RequestService, contextService?: WorkspaceContextService, telemetryService?: TelemetryService) { this.contextService = contextService; this.requestService = requestService; this.telemetryService = telemetryService; @@ -369,17 +357,21 @@ export class JSONSchemaService implements IJSONSchemaService { ); } - public resolveSchemaContent(schemaToResolve: UnresolvedSchema): Thenable { + public resolveSchemaContent(schemaToResolve: UnresolvedSchema, schemaURL: string): Thenable { let resolveErrors: string[] = schemaToResolve.errors.slice(0); let schema = schemaToResolve.schema; + let contextService = this.contextService; let findSection = (schema: IJSONSchema, path: string): any => { if (!path) { return schema; } let current: any = schema; - path.substr(1).split('/').some((part) => { + if (path[0] === '/') { + path = path.substr(1); + } + path.split('/').some((part) => { current = current[part]; return !current; }); @@ -400,18 +392,21 @@ export class JSONSchemaService implements IJSONSchemaService { delete node.$ref; }; - let resolveExternalLink = (node: any, uri: string, linkPath: string): Thenable => { + let resolveExternalLink = (node: any, uri: string, linkPath: string, parentSchemaURL: string): Thenable => { + if (contextService && !/^\w+:\/\/.*/.test(uri)) { + uri = contextService.resolveRelativePath(uri, parentSchemaURL); + } return this.getOrAddSchemaHandle(uri).getUnresolvedSchema().then(unresolvedSchema => { if (unresolvedSchema.errors.length) { let loc = linkPath ? uri + '#' + linkPath : uri; resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0])); } resolveLink(node, unresolvedSchema.schema, linkPath); - return resolveRefs(node, unresolvedSchema.schema); + return resolveRefs(node, unresolvedSchema.schema, uri); }); }; - let resolveRefs = (node: IJSONSchema, parentSchema: IJSONSchema): Thenable => { + let resolveRefs = (node: IJSONSchema, parentSchema: IJSONSchema, parentSchemaURL: string): Thenable => { let toWalk : IJSONSchema[] = [node]; let seen: IJSONSchema[] = []; @@ -450,7 +445,7 @@ export class JSONSchemaService implements IJSONSchemaService { if (next.$ref) { let segments = next.$ref.split('#', 2); if (segments[0].length > 0) { - openPromises.push(resolveExternalLink(next, segments[0], segments[1])); + openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL)); continue; } else { resolveLink(next, parentSchema, segments[1]); @@ -463,7 +458,7 @@ export class JSONSchemaService implements IJSONSchemaService { return Promise.all(openPromises); }; - return resolveRefs(schema, schema).then(_ => new ResolvedSchema(schema, resolveErrors)); + return resolveRefs(schema, schema, schemaURL).then(_ => new ResolvedSchema(schema, resolveErrors)); } public getSchemaForResource(resource: string, document: Parser.JSONDocument): Thenable { diff --git a/extensions/json/server/src/jsonServerMain.ts b/extensions/json/server/src/jsonServerMain.ts index 1f2e92b006f..fa57e8f72dd 100644 --- a/extensions/json/server/src/jsonServerMain.ts +++ b/extensions/json/server/src/jsonServerMain.ts @@ -6,27 +6,24 @@ import { IPCMessageReader, IPCMessageWriter, createConnection, IConnection, - TextDocuments, TextDocument, Diagnostic, DiagnosticSeverity, - InitializeParams, InitializeResult, NotificationType, RequestType + TextDocuments, TextDocument, InitializeParams, InitializeResult, NotificationType, RequestType } from 'vscode-languageserver'; import {xhr, XHROptions, XHRResponse, configure as configureHttpRequests} from 'request-light'; import path = require('path'); import fs = require('fs'); import URI from './utils/uri'; +import * as URL from 'url'; import Strings = require('./utils/strings'); -import {JSONSchemaService, ISchemaAssociations} from './jsonSchemaService'; -import {parse as parseJSON, ObjectASTNode, JSONDocument} from './jsonParser'; -import {JSONCompletion} from './jsonCompletion'; -import {JSONHover} from './jsonHover'; +import {ISchemaAssociations} from './jsonSchemaService'; +import {JSONDocument} from './jsonParser'; import {IJSONSchema} from './jsonSchema'; -import {JSONDocumentSymbols} from './jsonDocumentSymbols'; -import {format as formatJSON} from './jsonFormatter'; -import {schemaContributions} from './configuration'; import {ProjectJSONContribution} from './jsoncontributions/projectJSONContribution'; import {GlobPatternContribution} from './jsoncontributions/globPatternContribution'; import {FileAssociationContribution} from './jsoncontributions/fileAssociationContribution'; +import {JSONSchemaConfiguration, getLanguageService} from './jsonLanguageService'; + import * as nls from 'vscode-nls'; nls.config(process.env['VSCODE_NLS_CONFIG']); @@ -42,6 +39,9 @@ namespace VSCodeContentRequest { // stdin / stdout for message passing let connection: IConnection = createConnection(new IPCMessageReader(process), new IPCMessageWriter(process)); +console.log = connection.console.log.bind(connection.console); +console.error = connection.console.error.bind(connection.console); + // Create a simple text document manager. The text document manager // supports full document sync only let documents: TextDocuments = new TextDocuments(); @@ -72,11 +72,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { let workspaceContext = { resolveRelativePath: (relativePath: string, resource: string) => { - if (typeof relativePath === 'string' && resource) { - let resourceURI = URI.parse(resource); - return URI.file(path.normalize(path.join(path.dirname(resourceURI.fsPath), relativePath))).toString(); - } - return void 0; + return URL.resolve(resource, relativePath); } }; @@ -115,13 +111,7 @@ let contributions = [ new GlobPatternContribution(), filesAssociationContribution ]; - -let jsonSchemaService = new JSONSchemaService(request, workspaceContext, telemetry, connection.console); -jsonSchemaService.setSchemaContributions(schemaContributions); - -let jsonCompletion = new JSONCompletion(jsonSchemaService, connection.console, contributions); -let jsonHover = new JSONHover(jsonSchemaService, contributions); -let jsonDocumentSymbols = new JSONDocumentSymbols(); +let languageService = getLanguageService(contributions, request, workspaceContext, telemetry); // The content of a text document has changed. This event is emitted // when the text document first opened or when its content has changed. @@ -134,7 +124,7 @@ interface Settings { json: { schemas: JSONSchemaSettings[]; }; - http : { + http: { proxy: string; proxyStrictSSL: boolean; }; @@ -146,8 +136,8 @@ interface JSONSchemaSettings { schema?: IJSONSchema; } -let jsonConfigurationSettings : JSONSchemaSettings[] = void 0; -let schemaAssociations : ISchemaAssociations = void 0; +let jsonConfigurationSettings: JSONSchemaSettings[] = void 0; +let schemaAssociations: ISchemaAssociations = void 0; // The settings have changed. Is send on server activation as well. connection.onDidChangeConfiguration((change) => { @@ -165,13 +155,13 @@ connection.onNotification(SchemaAssociationNotification.type, (associations) => }); function updateConfiguration() { - jsonSchemaService.clearExternalSchemas(); + let schemaConfigs: JSONSchemaConfiguration[] = []; if (schemaAssociations) { for (var pattern in schemaAssociations) { let association = schemaAssociations[pattern]; if (Array.isArray(association)) { - association.forEach(url => { - jsonSchemaService.registerExternalSchema(url, [pattern]); + association.forEach(uri => { + schemaConfigs.push({ uri, fileMatch: [pattern] }); }); } } @@ -179,23 +169,25 @@ function updateConfiguration() { if (jsonConfigurationSettings) { jsonConfigurationSettings.forEach((schema) => { if (schema.fileMatch) { - let url = schema.url; - if (!url && schema.schema) { - url = schema.schema.id; - if (!url) { - url = 'vscode://schemas/custom/' + encodeURIComponent(schema.fileMatch.join('&')); + let uri = schema.url; + if (!uri && schema.schema) { + uri = schema.schema.id; + if (!uri) { + uri = 'vscode://schemas/custom/' + encodeURIComponent(schema.fileMatch.join('&')); } } - if (Strings.startsWith(url, '.') && workspaceRoot) { + if (Strings.startsWith(uri, '.') && workspaceRoot) { // workspace relative path - url = URI.file(path.normalize(path.join(workspaceRoot.fsPath, url))).toString(); + uri = URI.file(path.normalize(path.join(workspaceRoot.fsPath, uri))).toString(); } - if (url) { - jsonSchemaService.registerExternalSchema(url, schema.fileMatch, schema.schema); + if (uri) { + schemaConfigs.push({ uri, fileMatch: schema.fileMatch, schema: schema.schema }); } } }); } + languageService.configure(schemaConfigs); + // Revalidate any open text documents documents.all().forEach(validateTextDocument); } @@ -209,40 +201,7 @@ function validateTextDocument(textDocument: TextDocument): void { } let jsonDocument = getJSONDocument(textDocument); - jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(schema => { - if (schema) { - if (schema.errors.length && jsonDocument.root) { - let astRoot = jsonDocument.root; - let property = astRoot.type === 'object' ? (astRoot).getFirstProperty('$schema') : null; - if (property) { - let node = property.value || property; - jsonDocument.warnings.push({ location: { start: node.start, end: node.end }, message: schema.errors[0] }); - } else { - jsonDocument.warnings.push({ location: { start: astRoot.start, end: astRoot.start + 1 }, message: schema.errors[0] }); - } - } else { - jsonDocument.validate(schema.schema); - } - } - - let diagnostics: Diagnostic[] = []; - let added: { [signature: string]: boolean } = {}; - jsonDocument.errors.concat(jsonDocument.warnings).forEach((error, idx) => { - // remove duplicated messages - let signature = error.location.start + ' ' + error.location.end + ' ' + error.message; - if (!added[signature]) { - added[signature] = true; - let range = { - start: textDocument.positionAt(error.location.start), - end: textDocument.positionAt(error.location.end) - }; - diagnostics.push({ - severity: idx >= jsonDocument.errors.length ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error, - range: range, - message: error.message - }); - } - }); + languageService.doValidation(textDocument, jsonDocument).then(diagnostics => { // Send the computed diagnostics to VSCode. connection.sendDiagnostics({ uri: textDocument.uri, diagnostics }); }); @@ -252,7 +211,7 @@ connection.onDidChangeWatchedFiles((change) => { // Monitored files have changed in VSCode let hasChanges = false; change.changes.forEach(c => { - if (jsonSchemaService.onResourceChange(c.uri)) { + if (languageService.resetSchema(c.uri)) { hasChanges = true; } }); @@ -262,39 +221,39 @@ connection.onDidChangeWatchedFiles((change) => { }); function getJSONDocument(document: TextDocument): JSONDocument { - return parseJSON(document.getText()); + return languageService.parseJSONDocument(document); } connection.onCompletion(textDocumentPosition => { let document = documents.get(textDocumentPosition.textDocument.uri); let jsonDocument = getJSONDocument(document); - return jsonCompletion.doComplete(document, textDocumentPosition.position, jsonDocument); + return languageService.doComplete(document, textDocumentPosition.position, jsonDocument); }); connection.onCompletionResolve(completionItem => { - return jsonCompletion.doResolve(completionItem); + return languageService.doResolve(completionItem); }); connection.onHover(textDocumentPositionParams => { let document = documents.get(textDocumentPositionParams.textDocument.uri); let jsonDocument = getJSONDocument(document); - return jsonHover.doHover(document, textDocumentPositionParams.position, jsonDocument); + return languageService.doHover(document, textDocumentPositionParams.position, jsonDocument); }); connection.onDocumentSymbol(documentSymbolParams => { let document = documents.get(documentSymbolParams.textDocument.uri); let jsonDocument = getJSONDocument(document); - return jsonDocumentSymbols.compute(document, jsonDocument); + return languageService.findDocumentSymbols(document, jsonDocument); }); connection.onDocumentFormatting(formatParams => { let document = documents.get(formatParams.textDocument.uri); - return formatJSON(document, null, formatParams.options); + return languageService.format(document, null, formatParams.options); }); connection.onDocumentRangeFormatting(formatParams => { let document = documents.get(formatParams.textDocument.uri); - return formatJSON(document, formatParams.range, formatParams.options); + return languageService.format(document, formatParams.range, formatParams.options); }); // Listen on the connection diff --git a/extensions/json/server/src/jsonValidation.ts b/extensions/json/server/src/jsonValidation.ts new file mode 100644 index 00000000000..b4cfb5df6d5 --- /dev/null +++ b/extensions/json/server/src/jsonValidation.ts @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import {JSONSchemaService} from './jsonSchemaService'; +import {JSONDocument, ObjectASTNode} from './jsonParser'; +import {TextDocument, Diagnostic, DiagnosticSeverity} from 'vscode-languageserver'; + +export class JSONValidation { + + private jsonSchemaService: JSONSchemaService; + + public constructor(jsonSchemaService: JSONSchemaService) { + this.jsonSchemaService = jsonSchemaService; + } + + public doValidation(textDocument: TextDocument, jsonDocument: JSONDocument) { + return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(schema => { + if (schema) { + if (schema.errors.length && jsonDocument.root) { + let astRoot = jsonDocument.root; + let property = astRoot.type === 'object' ? (astRoot).getFirstProperty('$schema') : null; + if (property) { + let node = property.value || property; + jsonDocument.warnings.push({ location: { start: node.start, end: node.end }, message: schema.errors[0] }); + } else { + jsonDocument.warnings.push({ location: { start: astRoot.start, end: astRoot.start + 1 }, message: schema.errors[0] }); + } + } else { + jsonDocument.validate(schema.schema); + } + } + + let diagnostics: Diagnostic[] = []; + let added: { [signature: string]: boolean } = {}; + jsonDocument.errors.concat(jsonDocument.warnings).forEach((error, idx) => { + // remove duplicated messages + let signature = error.location.start + ' ' + error.location.end + ' ' + error.message; + if (!added[signature]) { + added[signature] = true; + let range = { + start: textDocument.positionAt(error.location.start), + end: textDocument.positionAt(error.location.end) + }; + diagnostics.push({ + severity: idx >= jsonDocument.errors.length ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error, + range: range, + message: error.message + }); + } + }); + return diagnostics; + }); + } +} \ No newline at end of file diff --git a/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts b/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts index 26bc964dd18..624fa992c4c 100644 --- a/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts +++ b/extensions/json/server/src/jsoncontributions/projectJSONContribution.ts @@ -8,7 +8,7 @@ import {MarkedString, CompletionItemKind, CompletionItem} from 'vscode-languages import Strings = require('../utils/strings'); import {XHRResponse, getErrorStatusDescription} from 'request-light'; import {IJSONWorkerContribution, ISuggestionsCollector} from '../jsonContributions'; -import {IRequestService} from '../jsonSchemaService'; +import {RequestService} from '../jsonLanguageService'; import {JSONLocation} from '../jsonLocation'; import * as nls from 'vscode-nls'; @@ -30,12 +30,12 @@ interface NugetServices { export class ProjectJSONContribution implements IJSONWorkerContribution { - private requestService : IRequestService; + private requestService : RequestService; private cachedProjects: { [id: string]: { version: string, description: string, time: number }} = {}; private cacheSize: number = 0; private nugetIndexPromise: Thenable; - public constructor(requestService: IRequestService) { + public constructor(requestService: RequestService) { this.requestService = requestService; } diff --git a/extensions/json/server/src/test/completion.test.ts b/extensions/json/server/src/test/completion.test.ts index fef7aae2928..e25fdeb15f5 100644 --- a/extensions/json/server/src/test/completion.test.ts +++ b/extensions/json/server/src/test/completion.test.ts @@ -36,7 +36,7 @@ suite('JSON Completion', () => { let idx = stringAfter ? value.indexOf(stringAfter) : 0; let schemaService = new SchemaService.JSONSchemaService(requestService); - let completionProvider = new JSONCompletion(schemaService, console); + let completionProvider = new JSONCompletion(schemaService); if (schema) { let id = "http://myschemastore/test1"; schemaService.registerExternalSchema(id, ["*.json"], schema); diff --git a/extensions/json/server/src/test/documentSymbols.test.ts b/extensions/json/server/src/test/documentSymbols.test.ts index 2e41c69b852..83d0eec257d 100644 --- a/extensions/json/server/src/test/documentSymbols.test.ts +++ b/extensions/json/server/src/test/documentSymbols.test.ts @@ -22,7 +22,7 @@ suite('JSON Document Symbols', () => { var document = TextDocument.create(uri, 'json', 0, value); var jsonDoc = Parser.parse(value); - return symbolProvider.compute(document, jsonDoc); + return symbolProvider.findDocumentSymbols(document, jsonDoc); } var assertOutline: any = function(actual: SymbolInformation[], expected: any[], message: string) { diff --git a/extensions/json/server/src/test/schema.test.ts b/extensions/json/server/src/test/schema.test.ts index e4388ff8659..b2f145c1fc2 100644 --- a/extensions/json/server/src/test/schema.test.ts +++ b/extensions/json/server/src/test/schema.test.ts @@ -10,6 +10,7 @@ import JsonSchema = require('../jsonSchema'); import Json = require('jsonc-parser'); import Parser = require('../jsonParser'); import fs = require('fs'); +import url = require('url'); import path = require('path'); import {XHROptions, XHRResponse} from 'request-light'; @@ -43,8 +44,14 @@ suite('JSON Schema', () => { return Promise.reject({ responseText: '', status: 404 }); } + let workspaceContext = { + resolveRelativePath: (relativePath: string, resource: string) => { + return url.resolve(resource, relativePath); + } + }; + test('Resolving $refs', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); service.setSchemaContributions({ schemas: { "https://myschemastore/main" : { id: 'https://myschemastore/main', @@ -73,9 +80,9 @@ suite('JSON Schema', () => { }); }); - + test('Resolving $refs 2', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); service.setSchemaContributions({ schemas: { "http://json.schemastore.org/swagger-2.0" : { id: 'http://json.schemastore.org/swagger-2.0', @@ -112,8 +119,56 @@ suite('JSON Schema', () => { }); + test('Resolving $refs 3', function(testDone) { + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); + service.setSchemaContributions({ schemas: { + "https://myschemastore/main/schema1.json" : { + id: 'https://myschemastore/schema1.json', + type: 'object', + properties: { + p1: { + '$ref': 'schema2.json#/definitions/hello' + }, + p2: { + '$ref': './schema2.json#/definitions/hello' + }, + p3: { + '$ref': '/main/schema2.json#/definitions/hello' + } + } + }, + "https://myschemastore/main/schema2.json" :{ + id: 'https://myschemastore/main/schema2.json', + definitions: { + "hello": { + "type": "string", + "enum": [ "object" ], + } + } + } + }}); + + service.getResolvedSchema('https://myschemastore/main/schema1.json').then(fs => { + assert.deepEqual(fs.schema.properties['p1'], { + type: 'string', + enum: [ "object" ] + }); + assert.deepEqual(fs.schema.properties['p2'], { + type: 'string', + enum: [ "object" ] + }); + assert.deepEqual(fs.schema.properties['p3'], { + type: 'string', + enum: [ "object" ] + }); + }).then(() => testDone(), (error) => { + testDone(error); + }); + + }); + test('FileSchema', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); service.setSchemaContributions({ schemas: { "main" : { @@ -142,7 +197,7 @@ suite('JSON Schema', () => { }); test('Array FileSchema', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); service.setSchemaContributions({ schemas: { "main" : { @@ -174,7 +229,7 @@ suite('JSON Schema', () => { }); test('Missing subschema', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); service.setSchemaContributions({ schemas: { "main" : { @@ -197,7 +252,7 @@ suite('JSON Schema', () => { }); test('Preloaded Schema', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var id = 'https://myschemastore/test1'; var schema : JsonSchema.IJSONSchema = { type: 'object', @@ -225,7 +280,7 @@ suite('JSON Schema', () => { }); test('External Schema', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var id = 'https://myschemastore/test1'; var schema : JsonSchema.IJSONSchema = { type: 'object', @@ -254,7 +309,7 @@ suite('JSON Schema', () => { test('Resolving in-line $refs', function (testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var id = 'https://myschemastore/test1'; var schema:JsonSchema.IJSONSchema = { @@ -292,7 +347,7 @@ suite('JSON Schema', () => { }); test('Resolving in-line $refs automatically for external schemas', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var id = 'https://myschemastore/test1'; var schema:JsonSchema.IJSONSchema = { id: 'main', @@ -329,7 +384,7 @@ suite('JSON Schema', () => { test('Clearing External Schemas', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var id1 = 'http://myschemastore/test1'; var schema1:JsonSchema.IJSONSchema = { type: 'object', @@ -370,7 +425,7 @@ suite('JSON Schema', () => { }); test('Schema contributions', function(testDone) { - var service = new SchemaService.JSONSchemaService(requestServiceMock); + var service = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); service.setSchemaContributions({ schemas: { "http://myschemastore/myschemabar" : { @@ -420,7 +475,7 @@ suite('JSON Schema', () => { test('Resolving circular $refs', function(testDone) { - var service : SchemaService.IJSONSchemaService = new SchemaService.JSONSchemaService(requestServiceMock); + var service : SchemaService.IJSONSchemaService = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var input = { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", @@ -463,7 +518,7 @@ suite('JSON Schema', () => { test('Resolving circular $refs, invalid document', function(testDone) { - var service : SchemaService.IJSONSchemaService = new SchemaService.JSONSchemaService(requestServiceMock); + var service : SchemaService.IJSONSchemaService = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var input = { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", @@ -498,7 +553,7 @@ suite('JSON Schema', () => { test('Validate Azure Resource Dfinition', function(testDone) { - var service : SchemaService.IJSONSchemaService = new SchemaService.JSONSchemaService(requestServiceMock); + var service : SchemaService.IJSONSchemaService = new SchemaService.JSONSchemaService(requestServiceMock, workspaceContext); var input = { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", diff --git a/extensions/make/syntaxes/Makefile.plist b/extensions/make/syntaxes/Makefile.plist index 2e5c5110243..5b6b3591cae 100644 --- a/extensions/make/syntaxes/Makefile.plist +++ b/extensions/make/syntaxes/Makefile.plist @@ -8,6 +8,7 @@ makefile GNUmakefile OCamlMakefile + mk name Makefile @@ -718,4 +719,4 @@ uuid FF1825E8-6B1C-11D9-B883-000D93589AF6 - \ No newline at end of file + diff --git a/extensions/markdown/OSSREADME.json b/extensions/markdown/OSSREADME.json new file mode 100644 index 00000000000..b9590cd2df2 --- /dev/null +++ b/extensions/markdown/OSSREADME.json @@ -0,0 +1,102 @@ +// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: +[ +{ + "name": "chriskempson/tomorrow-theme", + "version": "0.0.0", + "license": "MIT", + "isProd": true, + "repositoryURL": "https://github.com/chriskempson/tomorrow-theme" +}, +{ + "name": "markdown-it/markdown-it", + "version": "0.0.0", + "license": "MIT", + "isProd": true, + "repositoryURL": "https://github.com/markdown-it/markdown-it" +}, +{ + "name": "isagalaev/highlight.js", + "version": "0.0.0", + "license": "BSD", + "isProd": true, + "repositoryURL": "https://github.com/isagalaev/highlight.js", + "licenseDetail": [ + "Copyright (c) 2006, Ivan Sagalaev", + "All rights reserved.", + "Redistribution and use in source and binary forms, with or without", + "modification, are permitted provided that the following conditions are met:", + "", + " * Redistributions of source code must retain the above copyright", + " notice, this list of conditions and the following disclaimer.", + " * Redistributions in binary form must reproduce the above copyright", + " notice, this list of conditions and the following disclaimer in the", + " documentation and/or other materials provided with the distribution.", + " * Neither the name of highlight.js nor the names of its contributors", + " may be used to endorse or promote products derived from this software", + " without specific prior written permission.", + "", + "THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY", + "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED", + "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE", + "DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY", + "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES", + "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;", + "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND", + "ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT", + "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS", + "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + ] +}, +{ + "name": "leff/markdown-it-named-headers", + "version": "0.0.0", + "license": "UNLICENSE", + "isProd": true, + "repositoryURL": "https://github.com/leff/markdown-it-named-headers", + "licenseDetail": [ + "This is free and unencumbered software released into the public domain.", + "", + "Anyone is free to copy, modify, publish, use, compile, sell, or", + "distribute this software, either in source code form or as a compiled", + "binary, for any purpose, commercial or non-commercial, and by any", + "means.", + "", + "In jurisdictions that recognize copyright laws, the author or authors", + "of this software dedicate any and all copyright interest in the", + "software to the public domain. We make this dedication for the benefit", + "of the public at large and to the detriment of our heirs and", + "successors. We intend this dedication to be an overt act of", + "relinquishment in perpetuity of all present and future rights to this", + "software under copyright law.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,", + "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", + "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.", + "IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR", + "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,", + "ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR", + "OTHER DEALINGS IN THE SOFTWARE.", + "", + "For more information, please refer to " + ] +}, +{ + "name": "textmate/markdown.tmbundle", + "version": "0.0.0", + "license": "TextMate Bundle License", + "repositoryURL": "https://github.com/textmate/markdown.tmbundle", + "licenseDetail": [ + "If not otherwise specified (see below), files in this repository fall under the following license:", + "", + "Permission to copy, use, modify, sell and distribute this", + "software is granted. This software is provided \"as is\" without", + "express or implied warranty, and with no claim as to its", + "suitability for any purpose.", + "", + "An exception is made for files in readable text which contain their own license information,", + "or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added", + "to the base-name name of the original file, and an extension of txt, html, or similar. For example", + "\"tidy\" is accompanied by \"tidy-license.txt\"." + ] +} +] diff --git a/extensions/markdown/markdown.configuration.json b/extensions/markdown/markdown.configuration.json new file mode 100644 index 00000000000..29c860e9914 --- /dev/null +++ b/extensions/markdown/markdown.configuration.json @@ -0,0 +1,26 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + "blockComment": [ + "/*", + "*/" + ] + }, + // symbols used as brackets + "brackets": [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ] +} \ No newline at end of file diff --git a/src/vs/workbench/parts/markdown/browser/media/Preview.svg b/extensions/markdown/media/Preview.svg similarity index 100% rename from src/vs/workbench/parts/markdown/browser/media/Preview.svg rename to extensions/markdown/media/Preview.svg diff --git a/src/vs/workbench/parts/markdown/browser/media/Preview_inverse.svg b/extensions/markdown/media/Preview_inverse.svg similarity index 100% rename from src/vs/workbench/parts/markdown/browser/media/Preview_inverse.svg rename to extensions/markdown/media/Preview_inverse.svg diff --git a/src/vs/workbench/parts/files/browser/media/ViewSource.svg b/extensions/markdown/media/ViewSource.svg similarity index 100% rename from src/vs/workbench/parts/files/browser/media/ViewSource.svg rename to extensions/markdown/media/ViewSource.svg diff --git a/src/vs/workbench/parts/files/browser/media/ViewSource_inverse.svg b/extensions/markdown/media/ViewSource_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/browser/media/ViewSource_inverse.svg rename to extensions/markdown/media/ViewSource_inverse.svg diff --git a/src/vs/languages/markdown/common/markdown.css b/extensions/markdown/media/markdown.css similarity index 75% rename from src/vs/languages/markdown/common/markdown.css rename to extensions/markdown/media/markdown.css index 9446360716d..91c557c4d53 100644 --- a/src/vs/languages/markdown/common/markdown.css +++ b/extensions/markdown/media/markdown.css @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ body { - font-family: "Segoe WPC", "Segoe UI", ".SFNSDisplay-Light", "SFUIText-Light", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback"; + font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback"; font-size: 14px; padding-left: 12px; line-height: 22px; @@ -71,8 +71,8 @@ table > tbody > tr + tr > td { } blockquote { - margin: 0 0 0 5px; - padding-left: 10px; + margin: 0 7px 0 5px; + padding: 0 16px 0 10px; border-left: 5px solid; } @@ -95,69 +95,69 @@ code > div { /** Theming */ -.vs { +.vscode-light { color: rgb(30, 30, 30); } -.vs-dark { +.vscode-dark { color: #DDD; } -.hc-black { +.vscode-high-contrast { color: white; } -.vs code { +.vscode-light code { color: #A31515; } -.vs-dark code { +.vscode-dark code { color: #D7BA7D; } -.vs code > div { +.vscode-light code > div { background-color: rgba(220, 220, 220, 0.4); } -.vs-dark code > div { +.vscode-dark code > div { background-color: rgba(10, 10, 10, 0.4); } -.hc-black code > div { +.vscode-high-contrast code > div { background-color: rgb(0, 0, 0); } -.hc-black h1 { +.vscode-high-contrast h1 { border-color: rgb(0, 0, 0); } -.vs table > thead > tr > th { +.vscode-light table > thead > tr > th { border-color: rgba(0, 0, 0, 0.69); } -.vs-dark table > thead > tr > th { +.vscode-dark table > thead > tr > th { border-color: rgba(255, 255, 255, 0.69); } -.vs h1, -.vs hr, -.vs table > tbody > tr + tr > td { +.vscode-light h1, +.vscode-light hr, +.vscode-light table > tbody > tr + tr > td { border-color: rgba(0, 0, 0, 0.18); } -.vs-dark h1, -.vs-dark hr, -.vs-dark table > tbody > tr + tr > td { +.vscode-dark h1, +.vscode-dark hr, +.vscode-dark table > tbody > tr + tr > td { border-color: rgba(255, 255, 255, 0.18); } -.vs blockquote, -.vs-dark blockquote { +.vscode-light blockquote, +.vscode-dark blockquote { background: rgba(127, 127, 127, 0.1); border-color: rgba(0, 122, 204, 0.5); } -.hc-black blockquote { +.vscode-high-contrast blockquote { background: transparent; border-color: #fff; } \ No newline at end of file diff --git a/extensions/markdown/media/tomorrow.css b/extensions/markdown/media/tomorrow.css new file mode 100644 index 00000000000..96edd12b029 --- /dev/null +++ b/extensions/markdown/media/tomorrow.css @@ -0,0 +1,73 @@ +/* Tomorrow Theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ + +/* Tomorrow Comment */ +.hljs-comment, +.hljs-quote { + color: #8e908c; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #c82829; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-built_in, +.hljs-builtin-name, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-meta, +.hljs-link { + color: #f5871f; +} + +/* Tomorrow Yellow */ +.hljs-attribute { + color: #eab700; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #718c00; +} + +/* Tomorrow Blue */ +.hljs-title, +.hljs-section { + color: #4271ae; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #8959a8; +} + +.hljs { + display: block; + overflow-x: auto; + color: #4d4d4c; + padding: 0.5em; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} \ No newline at end of file diff --git a/extensions/markdown/package.json b/extensions/markdown/package.json index 246acdcc002..69be3160b00 100644 --- a/extensions/markdown/package.json +++ b/extensions/markdown/package.json @@ -1,12 +1,115 @@ { - "name": "markdown", - "version": "0.1.0", - "publisher": "vscode", - "engines": { "vscode": "*" }, + "name": "vscode-markdown", + "displayName": "VS Code Markdown", + "description": "Markdown for VS Code", + "version": "0.2.0", + "publisher": "Microsoft", + "engines": { + "vscode": "^1.0.0" + }, + "main": "./out/extension", + "categories": [ + "Languages" + ], + "activationEvents": [ + "onCommand:markdown.showPreview", + "onCommand:markdown.showPreviewToSide" + ], "contributes": { + "languages": [ + { + "id": "markdown", + "aliases": [ + "Markdown", + "markdown" + ], + "extensions": [ + ".md", + ".mdown", + ".markdown", + ".markdn" + ], + "configuration": "./markdown.configuration.json" + } + ], + "grammars": [ + { + "language": "markdown", + "scopeName": "text.html.markdown", + "path": "./syntaxes/markdown.tmLanguage" + } + ], + "commands": [ + { + "command": "markdown.showPreview", + "title": "%markdown.openPreview%", + "category": "%markdown.category%", + "where": ["explorer/context"], + "when": "markdown" + }, + { + "command": "markdown.showPreview", + "title": "%markdown.previewMarkdown.title%", + "category": "%markdown.category%", + "icon": { + "light": "./media/Preview.svg", + "dark": "./media/Preview_inverse.svg" + }, + "where": ["editor/primary"], + "when": "markdown" + }, + { + "command": "markdown.showSource", + "title": "%markdown.previewMarkdown.title%", + "category": "%markdown.category%", + "icon": { + "light": "./media/ViewSource.svg", + "dark": "./media/ViewSource_inverse.svg" + }, + "where": ["editor/primary"], + "when": { "scheme": "markdown" } + }, + { + "command": "markdown.showPreviewToSide", + "title": "%markdown.previewMarkdownSide.title%", + "where": "editor/secondary", + "when": "markdown" + } + ], + "keybindings": [ + { + "command": "markdown.showPreview", + "key": "shift+ctrl+v", + "mac": "shift+cmd+v" + }, + { + "command": "markdown.showPreviewToSide", + "key": "ctrl+k v", + "mac": "cmd+k v" + } + ], "snippets": [{ "language": "markdown", "path": "./snippets/markdown.json" - }] + }], + "configuration": { + "type": "object", + "title": "Markdown preview configuration", + "properties": { + "markdown.styles": { + "type": "array", + "default" : null, + "description": "A list of URLs or local paths to CSS style sheets to use from the markdown preview." + } + } + } + }, + "scripts": { + "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown ./tsconfig.json" + }, + "dependencies": { + "highlight.js": "^9.3.0", + "markdown-it": "^6.0.1", + "markdown-it-named-headers": "0.0.4" } } \ No newline at end of file diff --git a/extensions/markdown/package.nls.json b/extensions/markdown/package.nls.json new file mode 100644 index 00000000000..8c3b2a994bc --- /dev/null +++ b/extensions/markdown/package.nls.json @@ -0,0 +1,6 @@ +{ + "markdown.category" : "Markdown", + "markdown.openPreview" : "Open Preview", + "markdown.previewMarkdown.title" : "Toggle Preview", + "markdown.previewMarkdownSide.title" : "Open Preview to the Side" +} \ No newline at end of file diff --git a/extensions/markdown/src/extension.ts b/extensions/markdown/src/extension.ts new file mode 100644 index 00000000000..99486ad5451 --- /dev/null +++ b/extensions/markdown/src/extension.ts @@ -0,0 +1,198 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as vscode from 'vscode'; +import * as path from 'path'; +import { ExtensionContext, TextDocumentContentProvider, EventEmitter, Event, Uri, ViewColumn } from "vscode"; + +const hljs = require('highlight.js'); +const mdnh = require('markdown-it-named-headers'); +const md = require('markdown-it')({ + html: true, + highlight: function (str, lang) { + if (lang && hljs.getLanguage(lang)) { + try { + return `
${hljs.highlight(lang, str, true).value}
`; + } catch (error) { } + } + return `
${md.utils.escapeHtml(str)}
`; + } +}).use(mdnh, {}); + +export function activate(context: ExtensionContext) { + let provider = new MDDocumentContentProvider(context); + let registration = vscode.workspace.registerTextDocumentContentProvider('markdown', provider); + + let d1 = vscode.commands.registerCommand('markdown.showPreview', showPreview); + let d2 = vscode.commands.registerCommand('markdown.showPreviewToSide', uri => showPreview(uri, true)); + let d3 = vscode.commands.registerCommand('markdown.showSource', showSource); + + context.subscriptions.push(d1, d2, d3, registration); + + vscode.workspace.onDidSaveTextDocument(document => { + if (isMarkdownFile(document)) { + const uri = getMarkdownUri(document.uri); + provider.update(uri); + } + }); + + vscode.workspace.onDidChangeTextDocument(event => { + if (isMarkdownFile(event.document)) { + const uri = getMarkdownUri(event.document.uri); + provider.update(uri); + + } + }); + + vscode.workspace.onDidChangeConfiguration(() => { + vscode.workspace.textDocuments.forEach((document) => { + if (isMarkdownFile) { + provider.update(document.uri); + } + }); + }); +} + +function isMarkdownFile(document: vscode.TextDocument) { + return document.languageId === 'markdown' + && document.uri.scheme !== 'markdown'; // prevent processing of own documents +} + +function getMarkdownUri(uri: Uri) { + return uri.with({ scheme: 'markdown', path: uri.path + '.rendered', query: uri.toString() }); +} + +function showPreview(resource?: Uri, sideBySide: boolean = false) { + + if (!(resource instanceof Uri)) { + if (vscode.window.activeTextEditor) { + // we are relaxed and don't check for markdown files + resource = vscode.window.activeTextEditor.document.uri; + } + } + + if (!(resource instanceof Uri)) { + // nothing found that could be shown + return; + } + + return vscode.commands.executeCommand('vscode.previewHtml', + getMarkdownUri(resource), + getViewColumn(sideBySide), + `Preview '${path.basename(resource.fsPath)}'`); +} + +function getViewColumn(sideBySide): ViewColumn { + const active = vscode.window.activeTextEditor; + if (!active) { + return ViewColumn.One; + } + + if (!sideBySide) { + return active.viewColumn; + } + + switch (active.viewColumn) { + case ViewColumn.One: + return ViewColumn.Two; + case ViewColumn.Two: + return ViewColumn.Three; + } + + return active.viewColumn; +} + +function showSource(mdUri: Uri) { + const docUri = Uri.parse(mdUri.query); + + for (let editor of vscode.window.visibleTextEditors) { + if (editor.document.uri.toString() === docUri.toString()) { + return vscode.window.showTextDocument(editor.document, editor.viewColumn); + } + } + + return vscode.workspace.openTextDocument(docUri).then(doc => { + return vscode.window.showTextDocument(doc); + }); +} + +class MDDocumentContentProvider implements TextDocumentContentProvider { + private _context: ExtensionContext; + private _onDidChange = new EventEmitter(); + private _waiting : boolean; + + constructor(context: ExtensionContext) { + this._context = context; + this._waiting = false; + } + + private getMediaPath(mediaFile) { + return this._context.asAbsolutePath(path.join('media', mediaFile)); + } + + private fixHref(resource: Uri, href: string) { + if (href) { + // Return early if href is already a URL + if (Uri.parse(href).scheme) { + return href; + } + // Otherwise convert to a file URI by joining the href with the resource location + return Uri.file(path.join(path.dirname(resource.fsPath), href)).toString(); + } + return href; + } + + private computeCustomStyleSheetIncludes(uri: Uri): string[] { + const styles = vscode.workspace.getConfiguration('markdown')['styles']; + if (styles && Array.isArray(styles)) { + return styles.map((style) => { + return ``; + }); + } + return []; + } + + public provideTextDocumentContent(uri: Uri): Thenable { + + return vscode.workspace.openTextDocument(Uri.parse(uri.query)).then(document => { + const head = [].concat( + '', + '', + '', + '', + ``, + ``, + this.computeCustomStyleSheetIncludes(uri), + '', + '' + ).join('\n'); + + const body = md.render(document.getText()); + + const tail = [ + '', + '' + ].join('\n'); + + return head + body + tail; + }); + } + + get onDidChange(): Event { + return this._onDidChange.event; + } + + public update(uri: Uri) { + if (!this._waiting) { + this._waiting = true; + setTimeout(() => { + this._waiting = false; + this._onDidChange.fire(uri); + }, 300); + } + } +} \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/media/iframeeditor.css b/extensions/markdown/src/typings/ref.d.ts similarity index 65% rename from src/vs/workbench/browser/parts/editor/media/iframeeditor.css rename to extensions/markdown/src/typings/ref.d.ts index 86f2f2a3543..6d55d0431fa 100644 --- a/src/vs/workbench/browser/parts/editor/media/iframeeditor.css +++ b/extensions/markdown/src/typings/ref.d.ts @@ -3,11 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-workbench .iframe-container .iframe { - box-sizing: border-box; -} - -.monaco-workbench .iframe-container.ipad-touch-enabled { - -webkit-overflow-scrolling: touch; - overflow: auto; -} \ No newline at end of file +/// +/// +/// diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage new file mode 100644 index 00000000000..cd2abcff2dc --- /dev/null +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -0,0 +1,1829 @@ + + + + + fileTypes + + md + mdown + markdown + markdn + + keyEquivalent + ^~M + name + Markdown + patterns + + + include + #block + + + repository + + block + + patterns + + + include + #separator + + + include + #heading + + + include + #blockquote + + + include + #lists + + + include + #raw_block + + + include + #fenced_code_block_css + + + include + #fenced_code_block_basic + + + include + #fenced_code_block_ini + + + include + #fenced_code_block_java + + + include + #fenced_code_block_lua + + + include + #fenced_code_block_makefile + + + include + #fenced_code_block_perl + + + include + #fenced_code_block_r + + + include + #fenced_code_block_ruby + + + include + #fenced_code_block_sql + + + include + #fenced_code_block_vs_net + + + include + #fenced_code_block_xml + + + include + #fenced_code_block_xsl + + + include + #fenced_code_block_yaml + + + include + #fenced_code_block_dosbatch + + + include + #fenced_code_block_clojure + + + include + #fenced_code_block_coffee + + + include + #fenced_code_block_c + + + include + #fenced_code_block_diff + + + include + #fenced_code_block_dockerfile + + + include + #fenced_code_block_git_commit + + + include + #fenced_code_block_git_rebase + + + include + #fenced_code_block_groovy + + + include + #fenced_code_block_jade + + + include + #fenced_code_block_js + + + include + #fenced_code_block_js_regexp + + + include + #fenced_code_block_json + + + include + #fenced_code_block_less + + + include + #fenced_code_block_objc + + + include + #fenced_code_block_perl6 + + + include + #fenced_code_block_powershell + + + include + #fenced_code_block_python + + + include + #fenced_code_block_regexp_python + + + include + #fenced_code_block_shell + + + include + #fenced_code_block_ts + + + include + #fenced_code_block_tsx + + + include + #link-def + + + include + #html + + + include + #paragraph + + + repository + + blockquote + + begin + (^|\G)(>) ? + captures + + 2 + + name + punctuation.definition.quote.markdown + + + name + markup.quote.markdown + patterns + + + include + #block + + + while + (^|\G)(>) ? + + heading + + begin + (?:^|\G)(#{1,6})\s*(?=[\S[^#]]) + captures + + 1 + + name + punctuation.definition.heading.markdown + + + contentName + entity.name.section.markdown + end + \s*(#{1,6})?$\n? + name + markup.heading.${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.markdown + patterns + + + include + #inline + + + + heading-setext + + patterns + + + match + ^(={3,})(?=[ \t]*$\n?) + name + markup.heading.setext.1.markdown + + + match + ^(-{3,})(?=[ \t]*$\n?) + name + markup.heading.setext.2.markdown + + + + html + + patterns + + + begin + (?i)(^|\G)(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del).*</\2\s*>\s*$) + end + $ + patterns + + + include + text.html.basic + + + + + begin + (?i)(^|\G)(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)) + patterns + + + include + text.html.basic + + + while + \G(?!</\2\s*>) + + + + link-def + + captures + + 1 + + name + punctuation.definition.constant.markdown + + 10 + + name + punctuation.definition.string.end.markdown + + 11 + + name + string.other.link.description.title.markdown + + 12 + + name + punctuation.definition.string.begin.markdown + + 13 + + name + punctuation.definition.string.end.markdown + + 2 + + name + constant.other.reference.link.markdown + + 3 + + name + punctuation.definition.constant.markdown + + 4 + + name + punctuation.separator.key-value.markdown + + 5 + + name + punctuation.definition.link.markdown + + 6 + + name + markup.underline.link.markdown + + 7 + + name + punctuation.definition.link.markdown + + 8 + + name + string.other.link.description.title.markdown + + 9 + + name + punctuation.definition.string.begin.markdown + + + match + ^(?x: + \s* # Leading whitespace + (\[)(.+?)(\])(:) # Reference name + [ \t]* # Optional whitespace + (<?)(\S+?)(>?) # The url + [ \t]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in quotes… + | ((").+?(")) # or in parens. + )? # Title is optional + \s* # Optional whitespace + $ + ) + name + meta.link.reference.def.markdown + + list_paragraph + + begin + (^|\G)(?=\S)(?![*+-]\s|[0-9]+\.\s) + name + meta.paragraph.markdown + patterns + + + include + #inline + + + include + text.html.basic + + + include + #heading-setext + + + while + (^|\G)(?!\s*$|#|[ ]{0,3}([-*_][ ]{2,}){3,}[ \t]*$\n?|>|[ ]{0,3}[*+-]|[ ]{0,3}[0-9]+\.) + + lists + + patterns + + + begin + (^|\G)([ ]{0,3})([*+-])([ ]{1,3}|\t) + beginCaptures + + 3 + + name + punctuation.definition.list.markdown + + + comment + Currently does not support un-indented second lines. + name + markup.list.unnumbered.markdown + patterns + + + include + #list_paragraph + + + include + #block + + + while + \G([ ]{4}|\t|$) + + + begin + (^|\G)([ ]{0,3})([0-9]+\.)([ ]{1,3}|\t) + beginCaptures + + 3 + + name + punctuation.definition.list.markdown + + + name + markup.list.numbered.markdown + patterns + + + include + #list_paragraph + + + include + #block + + + while + \G([ ]{4}|\t|$) + + + + paragraph + + begin + (^|\G)(?=\S) + name + meta.paragraph.markdown + patterns + + + include + #inline + + + include + text.html.basic + + + include + #heading-setext + + + while + + + + (^|\G)(?!\s*$|#|[ ]{0,3}((([-*_][ ]{0,2}\2){2,}[ \t]*$\n?)|([*+-]([ ]{1,3}|\t)))|\s*\[.+?\]:|>) + + raw_block + + begin + (^|\G)([ ]{4}|\t) + name + markup.raw.block.markdown + while + (^|\G)([ ]{4}|\t) + + fenced_code_block_css + + begin + (^|\G)\s*([`~]{3,})\s*(css|css.erb)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.css + + + + fenced_code_block_basic + + begin + (^|\G)\s*([`~]{3,})\s*(html|htm|shtml|xhtml|inc|tmpl|tpl)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + text.html.basic + + + + fenced_code_block_ini + + begin + (^|\G)\s*([`~]{3,})\s*(ini|conf)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.ini + + + + fenced_code_block_java + + begin + (^|\G)\s*([`~]{3,})\s*(java|bsh)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.java + + + + fenced_code_block_lua + + begin + (^|\G)\s*([`~]{3,})\s*(lua)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.lua + + + + fenced_code_block_makefile + + begin + (^|\G)\s*([`~]{3,})\s*(Makefile|makefile|GNUmakefile|OCamlMakefile)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.makefile + + + + fenced_code_block_perl + + begin + (^|\G)\s*([`~]{3,})\s*(perl|pl|pm|pod|t|PL|psgi|vcl)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.perl + + + + fenced_code_block_r + + begin + (^|\G)\s*([`~]{3,})\s*(R|r|s|S|Rprofile)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.r + + + + fenced_code_block_ruby + + begin + (^|\G)\s*([`~]{3,})\s*(ruby|rb|rbx|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.ruby + + + + fenced_code_block_sql + + begin + (^|\G)\s*([`~]{3,})\s*(sql|ddl|dml)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.sql + + + + fenced_code_block_vs_net + + begin + (^|\G)\s*([`~]{3,})\s*(vb)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.asp.vb.net + + + + fenced_code_block_xml + + begin + (^|\G)\s*([`~]{3,})\s*(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + text.xml + + + + fenced_code_block_xsl + + begin + (^|\G)\s*([`~]{3,})\s*(xsl|xslt)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + text.xml.xsl + + + + fenced_code_block_yaml + + begin + (^|\G)\s*([`~]{3,})\s*(yaml|yml)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.yaml + + + + fenced_code_block_dosbatch + + begin + (^|\G)\s*([`~]{3,})\s*(bat|batch)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.dosbatch + + + + fenced_code_block_clojure + + begin + (^|\G)\s*([`~]{3,})\s*(clj|cljs|clojure)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.clojure + + + + fenced_code_block_coffee + + begin + (^|\G)\s*([`~]{3,})\s*(coffee|Cakefile|coffee.erb)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.coffee + + + + fenced_code_block_c + + begin + (^|\G)\s*([`~]{3,})\s*(c|h)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.c + + + + fenced_code_block_diff + + begin + (^|\G)\s*([`~]{3,})\s*(patch|diff|rej)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.diff + + + + fenced_code_block_dockerfile + + begin + (^|\G)\s*([`~]{3,})\s*(dockerfile|Dockerfile)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.dockerfile + + + + fenced_code_block_git_commit + + begin + (^|\G)\s*([`~]{3,})\s*(COMMIT_EDITMSG|MERGE_MSG)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + text.git-commit + + + + fenced_code_block_git_rebase + + begin + (^|\G)\s*([`~]{3,})\s*(git-rebase-todo)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + text.git-rebase + + + + fenced_code_block_groovy + + begin + (^|\G)\s*([`~]{3,})\s*(groovy|gvy)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.groovy + + + + fenced_code_block_jade + + begin + (^|\G)\s*([`~]{3,})\s*(jade)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + text.jade + + + + fenced_code_block_js + + begin + (^|\G)\s*([`~]{3,})\s*(js|jsx|javascript)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.js + + + + fenced_code_block_js_regexp + + begin + (^|\G)\s*([`~]{3,})\s*(regexp)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.js.regexp + + + + fenced_code_block_json + + begin + (^|\G)\s*([`~]{3,})\s*(json|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.json + + + + fenced_code_block_less + + begin + (^|\G)\s*([`~]{3,})\s*(less)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.css.less + + + + fenced_code_block_objc + + begin + (^|\G)\s*([`~]{3,})\s*(objectivec|mm|objc|obj-c|m|h)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.objc + + + + fenced_code_block_perl6 + + begin + (^|\G)\s*([`~]{3,})\s*(perl6|p6|pl6|pm6|nqp)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.perl.6 + + + + fenced_code_block_powershell + + begin + (^|\G)\s*([`~]{3,})\s*(powershell|ps1|psm1|psd1)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.powershell + + + + fenced_code_block_python + + begin + (^|\G)\s*([`~]{3,})\s*(python|py|py3|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gyp|gypi)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.python + + + + fenced_code_block_regexp_python + + begin + (^|\G)\s*([`~]{3,})\s*(re)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.regexp.python + + + + fenced_code_block_shell + + begin + (^|\G)\s*([`~]{3,})\s*(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.shell + + + + fenced_code_block_ts + + begin + (^|\G)\s*([`~]{3,})\s*(typescript|ts)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.ts + + + + fenced_code_block_tsx + + begin + (^|\G)\s*([`~]{3,})\s*(tsx)\s*$ + name + markup.fenced_code.block.markdown + end + (^|\G)(\2)\n + patterns + + + include + source.tsx + + + + separator + + match + (^|\G)[ ]{0,3}([-*_])([ ]{0,2}\2){2,}[ \t]*$\n? + name + meta.separator.markdown + + + + inline + + patterns + + + include + #ampersand + + + include + #bracket + + + include + #bold + + + include + #italic + + + include + #raw + + + include + #escape + + + include + #image-inline + + + include + #image-ref + + + include + #link-email + + + include + #link-inet + + + include + #link-inline + + + include + #link-ref + + + include + #link-ref-literal + + + repository + + ampersand + + comment + + Markdown will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + + match + &(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);) + name + meta.other.valid-ampersand.markdown + + bold + + begin + (?x) + (\*\*|__)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [ \t]*+ # Optional whtiespace + <?(.*?)>? # URL + [ \t]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + + captures + + 1 + + name + punctuation.definition.bold.markdown + + + end + (?<=\S)(\1) + name + markup.bold.markdown + patterns + + + applyEndPatternLast + 1 + begin + (?=<[^>]*?>) + end + (?<=>) + patterns + + + include + text.html.basic + + + + + include + #escape + + + include + #ampersand + + + include + #bracket + + + include + #raw + + + include + #italic + + + include + #image-inline + + + include + #link-inline + + + include + #link-inet + + + include + #link-email + + + include + #image-ref + + + include + #link-ref-literal + + + include + #link-ref + + + + bracket + + comment + + Markdown will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + + match + <(?![a-z/?\$!]) + name + meta.other.valid-bracket.markdown + + escape + + match + \\[-`*_#+.!(){}\[\]\\>] + name + constant.character.escape.markdown + + image-inline + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 10 + + name + string.other.link.description.title.markdown + + 11 + + name + punctuation.definition.string.markdown + + 12 + + name + punctuation.definition.string.markdown + + 13 + + name + string.other.link.description.title.markdown + + 14 + + name + punctuation.definition.string.markdown + + 15 + + name + punctuation.definition.string.markdown + + 16 + + name + punctuation.definition.metadata.markdown + + 2 + + name + string.other.link.description.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + invalid.illegal.whitespace.markdown + + 6 + + name + punctuation.definition.metadata.markdown + + 7 + + name + punctuation.definition.link.markdown + + 8 + + name + markup.underline.link.image.markdown + + 9 + + name + punctuation.definition.link.markdown + + + match + (?x: + \! # Images start with ! + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(\S+?)(>?) # The url + [ \t]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + name + meta.image.inline.markdown + + image-ref + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 2 + + name + string.other.link.description.markdown + + 4 + + name + punctuation.definition.string.begin.markdown + + 5 + + name + punctuation.definition.constant.markdown + + 6 + + name + constant.other.reference.link.markdown + + 7 + + name + punctuation.definition.constant.markdown + + + match + \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) + name + meta.image.reference.markdown + + italic + + begin + (?x) + (\*|_)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [ \t]*+ # Optional whtiespace + <?(.*?)>? # URL + [ \t]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | \1\1 # Must be bold closer + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + + captures + + 1 + + name + punctuation.definition.italic.markdown + + + end + (?<=\S)(\1)((?!\1)|(?=\1\1)) + name + markup.italic.markdown + patterns + + + applyEndPatternLast + 1 + begin + (?=<[^>]*?>) + end + (?<=>) + patterns + + + include + text.html.basic + + + + + include + #escape + + + include + #ampersand + + + include + #bracket + + + include + #raw + + + include + #bold + + + include + #image-inline + + + include + #link-inline + + + include + #link-inet + + + include + #link-email + + + include + #image-ref + + + include + #link-ref-literal + + + include + #link-ref + + + + link-email + + captures + + 1 + + name + punctuation.definition.link.markdown + + 2 + + name + markup.underline.link.markdown + + 4 + + name + punctuation.definition.link.markdown + + + match + (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>) + name + meta.link.email.lt-gt.markdown + + link-inet + + captures + + 1 + + name + punctuation.definition.link.markdown + + 2 + + name + markup.underline.link.markdown + + 3 + + name + punctuation.definition.link.markdown + + + match + (<)((?:https?|ftp)://.*?)(>) + name + meta.link.inet.markdown + + link-inline + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 10 + + name + string.other.link.description.title.markdown + + 11 + + name + punctuation.definition.string.begin.markdown + + 12 + + name + punctuation.definition.string.end.markdown + + 13 + + name + string.other.link.description.title.markdown + + 14 + + name + punctuation.definition.string.begin.markdown + + 15 + + name + punctuation.definition.string.end.markdown + + 16 + + name + punctuation.definition.metadata.markdown + + 2 + + name + string.other.link.title.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + invalid.illegal.whitespace.markdown + + 6 + + name + punctuation.definition.metadata.markdown + + 7 + + name + punctuation.definition.link.markdown + + 8 + + name + markup.underline.link.markdown + + 9 + + name + punctuation.definition.link.markdown + + + match + (?x: + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(.*?)(>?) # The url + [ \t]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + name + meta.link.inline.markdown + + link-ref + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 2 + + name + string.other.link.title.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + punctuation.definition.constant.begin.markdown + + 6 + + name + constant.other.reference.link.markdown + + 7 + + name + punctuation.definition.constant.end.markdown + + + match + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) + name + meta.link.reference.markdown + + link-ref-literal + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 2 + + name + string.other.link.title.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + punctuation.definition.constant.begin.markdown + + 6 + + name + punctuation.definition.constant.end.markdown + + + match + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\]) + name + meta.link.reference.literal.markdown + + raw + + captures + + 1 + + name + punctuation.definition.raw.markdown + + 3 + + name + punctuation.definition.raw.markdown + + + match + (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1) + name + markup.raw.inline.markdown + + + + + scopeName + text.html.markdown + uuid + 0A1D9874-B448-11D9-BD50-000D93B6E43C + + diff --git a/extensions/markdown/test/colorize-results/test_md.json b/extensions/markdown/test/colorize-results/test_md.json index c8d5f75d606..7ddb4c2c4a5 100644 --- a/extensions/markdown/test/colorize-results/test_md.json +++ b/extensions/markdown/test/colorize-results/test_md.json @@ -1,84 +1,183 @@ [ { - "c": "# Header 1 #", - "t": "entity.md.name.tag", + "c": "#", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { - "c": "## Header 2 ##", - "t": "entity.md.name.tag", + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { - "c": "### Header 3 ###", - "t": "entity.md.name.tag", + "c": "Header 1", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { - "c": " (Hashes on right are optional)", - "t": "", + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { - "c": "## Markdown plus h2 with a custom ID ##", - "t": "entity.md.name.tag", + "c": "#", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { - "c": " ", - "t": "", + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { - "c": "{#id-goes-here}", - "t": "md.string.target", + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Header 2", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "###", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Header 3 ### (Hashes on right are optional)", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Markdown plus h2 with a custom ID ## {#id-goes-here}", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { "c": "[", - "t": "link.md.string", + "t": "begin.definition.inline.link.markdown.meta.paragraph.punctuation.string", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", @@ -89,18 +188,7 @@ }, { "c": "Link back to H2", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "](#id-goes-here)", - "t": "link.md.string", + "t": "inline.link.markdown.meta.other.paragraph.string.title", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", @@ -109,9 +197,53 @@ "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" } }, + { + "c": "]", + "t": "definition.end.inline.link.markdown.meta.paragraph.punctuation.string", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + } + }, + { + "c": "(", + "t": "definition.inline.link.markdown.meta.metadata.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "#id-goes-here", + "t": "inline.link.markdown.markup.meta.paragraph.underline", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.underline rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.underline rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.underline rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.underline rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.underline rgb(255, 255, 255)" + } + }, + { + "c": ")", + "t": "definition.inline.link.markdown.meta.metadata.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, { "c": "", - "t": "comment.md", + "t": "block.comment.definition.html.markdown.meta.paragraph.punctuation", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)", "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)", @@ -143,8 +275,19 @@ } }, { - "c": "", - "t": "entity.md.name.tag.tag-div", + "t": "any.block.definition.end.html.markdown.meta.paragraph.punctuation.tag", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" } }, { - "c": " ", + "c": "
", "t": "", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -263,30 +450,19 @@ "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, - { - "c": "
", - "t": "entity.md.name.tag.tag-div", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, { "c": " nested div", - "t": "md.string", + "t": "block.markdown.markup.raw", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": " ", + "c": "
", "t": "", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -297,18 +473,7 @@ } }, { - "c": "
", - "t": "entity.md.name.tag.tag-div", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, - { - "c": " ", + "c": " ", "t": "", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -396,7 +506,7 @@ } }, { - "c": " ", + "c": " This is a div _with_ underscores", "t": "", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -407,18 +517,7 @@ } }, { - "c": "", - "t": "entity.md.name.tag.tag-script", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, - { - "c": " This is a div ", + "c": " and a & bold element.", "t": "", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -429,18 +528,7 @@ } }, { - "c": "_with_", - "t": "emphasis.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.emphasis rgb(212, 212, 212)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.emphasis rgb(0, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.emphasis rgb(212, 212, 212)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.emphasis rgb(0, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.emphasis rgb(255, 255, 255)" - } - }, - { - "c": " underscores", + "c": " ", "t": "", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -462,41 +561,8 @@ } }, { - "c": "", - "t": "entity.md.name.tag.tag-b", + "t": "any.block.definition.end.html.markdown.meta.paragraph.punctuation.tag", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" } }, { - "c": "bold", - "t": "", + "c": "*", + "t": "definition.list.markdown.markup.punctuation.unnumbered", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "", - "t": "entity.md.name.tag.tag-b", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, - { - "c": " element.", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": " ", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "", - "t": "entity.md.name.tag.tag-style", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, - { - "c": "", - "t": "entity.md.name.tag.tag-div", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, - { - "c": "* ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, { "c": "Bullet lists are easy too", - "t": "", + "t": "list.markdown.markup.meta.paragraph.unnumbered", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "- ", - "t": "keyword.md", + "c": "-", + "t": "definition.list.markdown.markup.punctuation.unnumbered", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "Another one", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "+ ", - "t": "keyword.md", + "c": " ", + "t": "list.markdown.markup.unnumbered", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "Another one", - "t": "", + "t": "list.markdown.markup.meta.paragraph.unnumbered", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "+", + "t": "definition.list.markdown.markup.punctuation.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Another one", + "t": "list.markdown.markup.meta.paragraph.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "This is a paragraph, which is text surrounded by", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -837,7 +705,7 @@ }, { "c": "whitespace. Paragraphs can be on one", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -848,7 +716,7 @@ }, { "c": "line (or many), and can drone on for hours.", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -859,7 +727,7 @@ }, { "c": "Now some inline markup like ", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -869,19 +737,41 @@ } }, { - "c": "_italics_", - "t": "emphasis.md", + "c": "_", + "t": "definition.italic.markdown.markup.meta.paragraph.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.emphasis rgb(212, 212, 212)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.emphasis rgb(0, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.emphasis rgb(212, 212, 212)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.emphasis rgb(0, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.emphasis rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "italics", + "t": "italic.markdown.markup.meta.paragraph", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "_", + "t": "definition.italic.markdown.markup.meta.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" } }, { "c": ", ", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -891,19 +781,41 @@ } }, { - "c": "**bold**", - "t": "md.strong", + "c": "**", + "t": "bold.definition.markdown.markup.meta.paragraph.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.strong rgb(212, 212, 212)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.strong rgb(0, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.strong rgb(212, 212, 212)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.strong rgb(0, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.strong rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.bold rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.bold rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.bold rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.bold rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.bold rgb(255, 255, 255)" + } + }, + { + "c": "bold", + "t": "bold.markdown.markup.meta.paragraph", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.bold rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.bold rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.bold rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.bold rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.bold rgb(255, 255, 255)" + } + }, + { + "c": "**", + "t": "bold.definition.markdown.markup.meta.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.bold rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.bold rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.bold rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.bold rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.bold rgb(255, 255, 255)" } }, { "c": ",", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -914,7 +826,7 @@ }, { "c": "and ", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -924,13 +836,35 @@ } }, { - "c": "`code()`", - "t": "md.variable", + "c": "`", + "t": "definition.inline.markdown.markup.meta.paragraph.punctuation.raw", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.variable rgb(156, 220, 254)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.variable rgb(0, 16, 128)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.inline.raw rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.inline.raw rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.inline.raw rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.inline.raw rgb(128, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "code()", + "t": "inline.markdown.markup.meta.paragraph.raw", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.inline.raw rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.inline.raw rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.inline.raw rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.inline.raw rgb(128, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "`", + "t": "definition.inline.markdown.markup.meta.paragraph.punctuation.raw", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.inline.raw rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.inline.raw rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.inline.raw rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.inline.raw rgb(128, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, @@ -946,8 +880,52 @@ } }, { - "c": "in_words_are ignored.", - "t": "", + "c": "in", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "_", + "t": "definition.italic.markdown.markup.meta.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "words", + "t": "italic.markdown.markup.meta.paragraph", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "_", + "t": "definition.italic.markdown.markup.meta.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "are ignored.", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -958,7 +936,7 @@ }, { "c": "````application/json", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -968,8 +946,8 @@ } }, { - "c": " ", - "t": "", + "c": " { value: [\"or with a mime type\"] }", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -978,20 +956,9 @@ "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, - { - "c": "{ value: [\"or with a mime type\"] }", - "t": "md.string.target", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" - } - }, { "c": "````", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1002,117 +969,172 @@ }, { "c": ">", - "t": "comment.md", + "t": "definition.markdown.markup.punctuation.quote", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.comment rgb(96, 139, 78)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.comment rgb(0, 128, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.comment rgb(124, 166, 104)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.quote rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.quote rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.quote rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.quote rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": " Blockquotes are like quoted text in email replies", - "t": "", + "c": " ", + "t": "markdown.markup.quote", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.quote rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.quote rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.quote rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.quote rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Blockquotes are like quoted text in email replies", + "t": "markdown.markup.meta.paragraph.quote", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.quote rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.quote rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.quote rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.quote rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": ">>", - "t": "comment.md", + "t": "definition.markdown.markup.punctuation.quote", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.comment rgb(96, 139, 78)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.comment rgb(0, 128, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.comment rgb(124, 166, 104)" - } - }, - { - "c": " And, they can be nested", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.quote rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.quote rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.quote rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.quote rgb(4, 81, 165)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "1. ", - "t": "keyword.md", + "c": " ", + "t": "markdown.markup.quote", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.quote rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.quote rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.quote rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.quote rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "And, they can be nested", + "t": "markdown.markup.meta.paragraph.quote", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.quote rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.quote rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.quote rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.quote rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "1.", + "t": "definition.list.markdown.markup.numbered.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.numbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "A numbered list", - "t": "", + "t": "list.markdown.markup.meta.numbered.paragraph", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "2. ", - "t": "keyword.md", + "c": "2.", + "t": "definition.list.markdown.markup.numbered.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.numbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "Which is numbered", - "t": "", + "t": "list.markdown.markup.meta.numbered.paragraph", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "3. ", - "t": "keyword.md", + "c": "3.", + "t": "definition.list.markdown.markup.numbered.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.numbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "With periods and a space", - "t": "", + "t": "list.markdown.markup.meta.numbered.paragraph", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "And now some code:", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1123,29 +1145,29 @@ }, { "c": " // Code is just text indented a bit", - "t": "md.string", + "t": "block.markdown.markup.raw", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": " which(is_easy) to_remember();", - "t": "md.string", + "t": "block.markdown.markup.raw", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "And a block", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1156,32 +1178,98 @@ }, { "c": "~~~", - "t": "md.string", + "t": "markdown.meta.paragraph", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" - } - }, - { - "c": "// Markdown extra adds un-indented code blocks too", - "t": "md.source.variable", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.variable rgb(156, 220, 254)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.variable rgb(0, 16, 128)", + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", "dark_vs": ".vs-dark .token rgb(212, 212, 212)", "light_vs": ".vs .token rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "if (this_is_more_code == true && !indented) {", - "t": "md.source.variable", + "c": "// Markdown extra adds un-indented code blocks too", + "t": "markdown.meta.paragraph", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.variable rgb(156, 220, 254)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.variable rgb(0, 16, 128)", + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "if (this", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "_", + "t": "definition.italic.markdown.markup.meta.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "is", + "t": "italic.markdown.markup.meta.paragraph", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "_", + "t": "definition.italic.markdown.markup.meta.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.italic rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.italic rgb(0, 0, 128)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.italic rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.italic rgb(0, 0, 128)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.italic rgb(255, 255, 255)" + } + }, + { + "c": "more_code == true ", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "&&", + "t": "markdown.meta.other.paragraph.valid-ampersand", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " !indented) {", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", "dark_vs": ".vs-dark .token rgb(212, 212, 212)", "light_vs": ".vs .token rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" @@ -1189,10 +1277,10 @@ }, { "c": " // tild wrapped code blocks, also not indented", - "t": "md.source.variable", + "t": "markdown.meta.paragraph", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.variable rgb(156, 220, 254)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.variable rgb(0, 16, 128)", + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", "dark_vs": ".vs-dark .token rgb(212, 212, 212)", "light_vs": ".vs .token rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" @@ -1200,10 +1288,10 @@ }, { "c": "}", - "t": "md.source.variable", + "t": "markdown.meta.paragraph", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.variable rgb(156, 220, 254)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.variable rgb(0, 16, 128)", + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", "dark_vs": ".vs-dark .token rgb(212, 212, 212)", "light_vs": ".vs .token rgb(0, 0, 0)", "hc_black": ".hc-black .token rgb(255, 255, 255)" @@ -1211,18 +1299,18 @@ }, { "c": "~~~", - "t": "md.string", + "t": "markdown.meta.paragraph", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "Text with", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1233,7 +1321,7 @@ }, { "c": "two trailing spaces", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1244,7 +1332,7 @@ }, { "c": "(on the right)", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1255,7 +1343,7 @@ }, { "c": "can be used", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1266,7 +1354,7 @@ }, { "c": "for things like poems", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1276,19 +1364,41 @@ } }, { - "c": "### Horizontal rules", - "t": "entity.md.name.tag", + "c": "###", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Horizontal rules", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { "c": "* * * *", - "t": "md.meta.separator", + "t": "markdown.meta.separator", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1299,7 +1409,7 @@ }, { "c": "****", - "t": "md.meta.separator", + "t": "markdown.meta.separator", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1310,18 +1420,29 @@ }, { "c": "--------------------------", - "t": "attribute-name.entity.md.other", + "t": "markdown.meta.separator", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.other.attribute-name rgb(156, 220, 254)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.other.attribute-name rgb(255, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.other.attribute-name rgb(156, 220, 254)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.other.attribute-name rgb(255, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.other.attribute-name rgb(156, 220, 254)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "![", - "t": "link.md.string", + "c": "!", + "t": "image.inline.markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "[", + "t": "begin.definition.image.inline.markdown.meta.paragraph.punctuation.string", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", @@ -1332,18 +1453,7 @@ }, { "c": "picture alt", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "](/images/photo.jpeg \"Title is optional\")", - "t": "link.md.string", + "t": "description.image.inline.link.markdown.meta.other.paragraph.string", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", @@ -1353,19 +1463,151 @@ } }, { - "c": "## Markdown plus tables ##", - "t": "entity.md.name.tag", + "c": "]", + "t": "definition.end.image.inline.markdown.meta.paragraph.punctuation.string", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + } + }, + { + "c": "(", + "t": "definition.image.inline.markdown.meta.metadata.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "/images/photo.jpeg", + "t": "image.inline.link.markdown.markup.meta.paragraph.underline", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.underline rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.underline rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.underline rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.underline rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.underline rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "image.inline.markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "\"", + "t": "definition.description.image.inline.link.markdown.meta.other.paragraph.punctuation.string.title", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + } + }, + { + "c": "Title is optional", + "t": "description.image.inline.link.markdown.meta.other.paragraph.string.title", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + } + }, + { + "c": "\"", + "t": "definition.description.image.inline.link.markdown.meta.other.paragraph.punctuation.string.title", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + } + }, + { + "c": ")", + "t": "definition.image.inline.markdown.meta.metadata.paragraph.punctuation", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Markdown plus tables", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" } }, { "c": "| Header | Header | Right |", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1376,7 +1618,7 @@ }, { "c": "| ------ | ------ | -----: |", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1387,7 +1629,7 @@ }, { "c": "| Cell | Cell | $10 |", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1398,205 +1640,7 @@ }, { "c": "| Cell | Cell | $20 |", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "* ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "Outer pipes on tables are optional", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "* ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "Colon used for alignment (right versus left)", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "## Markdown plus definition lists ##", - "t": "entity.md.name.tag", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" - } - }, - { - "c": "Bottled water", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": ": ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "$ 1.25", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": ": ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "$ 1.55 (Large)", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "Milk", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "Pop", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": ": ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "$ 1.75", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "* ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "Multiple definitions and terms are possible", - "t": "", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "* ", - "t": "keyword.md", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" - } - }, - { - "c": "Definitions can include multiple paragraphs too", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1607,7 +1651,128 @@ }, { "c": "*", - "t": "", + "t": "definition.list.markdown.markup.punctuation.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Outer pipes on tables are optional", + "t": "list.markdown.markup.meta.paragraph.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "*", + "t": "definition.list.markdown.markup.punctuation.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Colon used for alignment (right versus left)", + "t": "list.markdown.markup.meta.paragraph.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Markdown plus definition lists", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "##", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Bottled water", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1617,19 +1782,8 @@ } }, { - "c": "[ABBR]", - "t": "link.md.string", - "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" - } - }, - { - "c": ": Markdown plus abbreviations (produces an ", - "t": "", + "c": ": $ 1.25", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -1639,8 +1793,140 @@ } }, { - "c": "", - "t": "entity.md.name.tag.tag-abbr", + "c": ": $ 1.55 (Large)", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Milk", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Pop", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": ": $ 1.75", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "*", + "t": "definition.list.markdown.markup.punctuation.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Multiple definitions and terms are possible", + "t": "list.markdown.markup.meta.paragraph.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "*", + "t": "definition.list.markdown.markup.punctuation.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.punctuation.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.punctuation.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.punctuation.list rgb(4, 81, 165)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "list.markdown.markup.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Definitions can include multiple paragraphs too", + "t": "list.markdown.markup.meta.paragraph.unnumbered", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.list rgb(103, 150, 230)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.list rgb(4, 81, 165)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.list rgb(103, 150, 230)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.list rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "*[ABBR]: Markdown plus abbreviations (produces an ", + "t": "markdown.meta.paragraph", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "<", + "t": "any.begin.definition.html.inline.markdown.meta.paragraph.punctuation.tag", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "abbr", + "t": "any.entity.html.inline.markdown.meta.name.paragraph.tag", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", @@ -1649,9 +1935,20 @@ "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" } }, + { + "c": ">", + "t": "any.definition.end.html.inline.markdown.meta.paragraph.punctuation.tag", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, { "c": " tag)", - "t": "", + "t": "markdown.meta.paragraph", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", diff --git a/extensions/markdown/tsconfig.json b/extensions/markdown/tsconfig.json new file mode 100644 index 00000000000..23671861401 --- /dev/null +++ b/extensions/markdown/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "outDir": "out", + "noLib": true, + "sourceMap": true, + "rootDir": "." + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/extensions/node-debug/node-debug.azure.json b/extensions/node-debug/node-debug.azure.json index 01d228a4a17..81fcaee940f 100644 --- a/extensions/node-debug/node-debug.azure.json +++ b/extensions/node-debug/node-debug.azure.json @@ -1,6 +1,6 @@ { "account": "monacobuild", "container": "debuggers", - "zip": "f9803b8/node-debug.zip", + "zip": "1e5cde6/node-debug.zip", "output": "" } diff --git a/extensions/rust/syntaxes/rust.json b/extensions/rust/syntaxes/rust.json index 8d01e18a8b0..7d1b5b1e77f 100644 --- a/extensions/rust/syntaxes/rust.json +++ b/extensions/rust/syntaxes/rust.json @@ -138,6 +138,11 @@ "name": "support.type.core.rust", "match": "\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b" }, + "where": { + "comment": "Where clause", + "name": "keyword.other.rust", + "match": "\\bwhere\\b" + }, "std_types": { "comment": "Standard library type", "name": "storage.class.std.rust", @@ -441,13 +446,16 @@ }, { "include": "#const" + }, + { + "include": "#where" } ] }, { "comment": "Type declaration", "begin": "\\b(enum|struct|trait)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "end": "[\\{;]", + "end": "[\\{\\(;]", "beginCaptures": { "1": { "name": "storage.type.rust" @@ -477,6 +485,9 @@ }, { "include": "#pub" + }, + { + "include": "#where" } ] }, @@ -574,6 +585,9 @@ { "name": "storage.type.rust", "match": "\\bfor\\b" + }, + { + "include": "#where" } ] } diff --git a/extensions/rust/test/colorize-fixtures/test-6611.rs b/extensions/rust/test/colorize-fixtures/test-6611.rs new file mode 100644 index 00000000000..0c59a443c2b --- /dev/null +++ b/extensions/rust/test/colorize-fixtures/test-6611.rs @@ -0,0 +1,26 @@ +impl Foo + where A: B +{ } + +impl Foo for C + where A: B +{ } + +impl Foo for C +{ + fn foo -> C + where A: B + { } +} + +fn foo -> C + where A: B +{ } + +struct Foo + where A: B +{ } + +trait Foo : C + where A: B +{ } \ No newline at end of file diff --git a/extensions/rust/test/colorize-results/test-6611_rs.json b/extensions/rust/test/colorize-results/test-6611_rs.json new file mode 100644 index 00000000000..b2b2c6de67a --- /dev/null +++ b/extensions/rust/test/colorize-results/test-6611_rs.json @@ -0,0 +1,673 @@ +[ + { + "c": "impl", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " Foo", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "where", + "t": "keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " A: B", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "{ }", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "impl", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " Foo", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "for", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " C", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "where", + "t": "keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " A: B", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "{ }", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "impl", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " Foo", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "for", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " C", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "{", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "fn", + "t": "fn.keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "foo", + "t": "entity.function.name.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.function rgb(220, 220, 170)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.function rgb(121, 94, 38)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.function rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " -> C", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "where", + "t": "keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " A: B", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " { }", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "}", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "fn", + "t": "fn.keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "foo", + "t": "entity.function.name.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.function rgb(220, 220, 170)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.function rgb(121, 94, 38)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.function rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " -> C", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "where", + "t": "keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " A: B", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "{ }", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "struct", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Foo", + "t": "entity.name.rust.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.type rgb(78, 201, 176)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.type rgb(38, 127, 153)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "where", + "t": "keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " A: B", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "{ }", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "trait", + "t": "rust.storage.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.type rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.type rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.type rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.type rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.type rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "Foo", + "t": "entity.name.rust.type", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.type rgb(78, 201, 176)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.type rgb(38, 127, 153)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "meta.rust.type_params", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " : C", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "where", + "t": "keyword.other.rust", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " A: B", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "{ }", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + } +] \ No newline at end of file diff --git a/extensions/sql/syntaxes/SQL.plist b/extensions/sql/syntaxes/SQL.plist index ea46a924a92..04dedd3fd84 100644 --- a/extensions/sql/syntaxes/SQL.plist +++ b/extensions/sql/syntaxes/SQL.plist @@ -7,6 +7,8 @@ sql ddl dml + dsql + psql keyEquivalent ^~S @@ -762,4 +764,4 @@ uuid C49120AC-6ECC-11D9-ACC8-000D93589AF6 - \ No newline at end of file + diff --git a/extensions/theme-abyss/themes/Abyss.tmTheme b/extensions/theme-abyss/themes/Abyss.tmTheme index 62e5423a5d5..8bcfd908052 100644 --- a/extensions/theme-abyss/themes/Abyss.tmTheme +++ b/extensions/theme-abyss/themes/Abyss.tmTheme @@ -282,6 +282,54 @@ #F8F8F0 + + name + Markup Quote + scope + markup.quote + settings + + foreground + #22aa44 + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #22aa44 + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #9966b8 + + + + name + Markup Setext Header + scope + markup.heading.setext + settings + + fontStyle + + foreground + #ddbb88 + + uuid 96A92F4B-E068-4DC6-9635-F55E7D920420 diff --git a/extensions/theme-defaults/themes/dark_vs.json b/extensions/theme-defaults/themes/dark_vs.json index 87b3dde8f83..0f9d50c1a4e 100644 --- a/extensions/theme-defaults/themes/dark_vs.json +++ b/extensions/theme-defaults/themes/dark_vs.json @@ -101,19 +101,21 @@ { "scope": "markup.bold", "settings": { - "fontStyle": "bold" + "fontStyle": "bold", + "foreground": "#569cd6" } }, { "scope": "markup.heading", "settings": { - "foreground": "#6796e6" + "foreground": "#569cd6" } }, { "scope": "markup.italic", "settings": { - "fontStyle": "italic" + "fontStyle": "italic", + "foreground": "#569cd6" } }, { @@ -133,6 +135,24 @@ "settings": { "foreground": "#569cd6" } + }, + { + "scope": ["markup.punctuation.quote", "markup.punctuation.list"], + "settings": { + "foreground": "#6796e6" + } + }, + { + "scope": ["markup.quote", "markup.list"], + "settings": { + "foreground": "#6796e6" + } + }, + { + "scope": "markup.inline.raw", + "settings": { + "foreground": "#ce9178" + } }, { "scope": "meta.selector", diff --git a/extensions/theme-defaults/themes/light_plus.json b/extensions/theme-defaults/themes/light_plus.json index 31b494f7678..4b31cf49a53 100644 --- a/extensions/theme-defaults/themes/light_plus.json +++ b/extensions/theme-defaults/themes/light_plus.json @@ -48,6 +48,12 @@ "settings": { "foreground": "#001080" } + }, + { + "scope": ["markup.quote", "markup.list"], + "settings": { + "foreground": "#0451a5" + } } ] } \ No newline at end of file diff --git a/extensions/theme-defaults/themes/light_vs.json b/extensions/theme-defaults/themes/light_vs.json index cf4fd0b9449..1b049634d42 100644 --- a/extensions/theme-defaults/themes/light_vs.json +++ b/extensions/theme-defaults/themes/light_vs.json @@ -91,19 +91,22 @@ { "scope": "markup.bold", "settings": { - "fontStyle": "bold" + "fontStyle": "bold", + "foreground": "#000080" + } }, { "scope": "markup.heading", "settings": { - "foreground": "#000080" + "foreground": "#800000" } }, { "scope": "markup.italic", "settings": { - "fontStyle": "italic" + "fontStyle": "italic", + "foreground": "#000080" } }, { @@ -124,6 +127,24 @@ "foreground": "#0451a5" } }, + { + "scope": ["markup.punctuation.quote", "markup.punctuation.list"], + "settings": { + "foreground": "#0451a5" + } + }, + { + "scope": ["markup.quote", "markup.list"], + "settings": { + "foreground": "#000000" + } + }, + { + "scope": "markup.inline.raw", + "settings": { + "foreground": "#800000" + } + }, { "scope": "meta.selector", "settings": { diff --git a/extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme b/extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme index 3498de86a29..adb642871ad 100644 --- a/extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme +++ b/extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme @@ -300,7 +300,7 @@ name Headings scope - markup.heading punctuation.definition.heading, entity.name.section + markup.heading, markup.heading.setext, punctuation.definition.heading, entity.name.section settings fontStyle diff --git a/extensions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme b/extensions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme index 8a7cb1d746f..347aba650a5 100644 --- a/extensions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme +++ b/extensions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme @@ -56,7 +56,7 @@ fontStyle - +
foreground #9AA83A @@ -70,7 +70,7 @@ fontStyle - + foreground #D08442 @@ -84,7 +84,7 @@ fontStyle - + foreground #6089B4 @@ -98,7 +98,7 @@ fontStyle - + foreground #408080 @@ -112,7 +112,7 @@ fontStyle - + foreground #8080FF background @@ -128,7 +128,7 @@ fontStyle - + foreground #6089B4 @@ -142,7 +142,7 @@ fontStyle - + foreground #C7444A @@ -156,7 +156,7 @@ fontStyle - + foreground #9872A2 @@ -170,7 +170,7 @@ fontStyle - + foreground #9B0000 background @@ -186,7 +186,7 @@ fontStyle - + foreground #C7444A @@ -200,7 +200,7 @@ fontStyle - + foreground #CE6700 @@ -214,7 +214,7 @@ fontStyle - + foreground #6089B4 @@ -228,7 +228,7 @@ fontStyle - + foreground #9872A2 @@ -242,7 +242,7 @@ fontStyle - + foreground #9872A2 @@ -256,7 +256,7 @@ fontStyle - + foreground #9872A2 @@ -270,7 +270,7 @@ fontStyle - + foreground #676867 @@ -284,7 +284,7 @@ fontStyle - + foreground #6089B4 @@ -298,7 +298,7 @@ fontStyle - + foreground #FF0080 @@ -312,7 +312,7 @@ fontStyle - + foreground #008200 @@ -326,7 +326,7 @@ fontStyle - + foreground #FF0B00 @@ -340,7 +340,7 @@ fontStyle - + foreground #6089B4 @@ -354,7 +354,7 @@ fontStyle - + foreground #0080FF @@ -368,7 +368,7 @@ fontStyle - + foreground #9872A2 @@ -382,7 +382,7 @@ fontStyle - + foreground #9872A2 @@ -396,7 +396,7 @@ fontStyle - + foreground #9872A2 @@ -410,7 +410,7 @@ fontStyle - + foreground #D0B344 @@ -424,7 +424,7 @@ fontStyle - + foreground #6089B4 @@ -438,7 +438,7 @@ fontStyle - + foreground #9AA83A @@ -452,7 +452,7 @@ fontStyle - + foreground #9AA83A @@ -466,7 +466,7 @@ fontStyle - + foreground #9872A2 @@ -480,7 +480,7 @@ fontStyle - + foreground #D0B344 @@ -494,7 +494,7 @@ fontStyle - + foreground #6089B4 @@ -508,7 +508,7 @@ fontStyle - + foreground #D0B344 @@ -533,7 +533,7 @@ fontStyle - + foreground #9AA83A @@ -547,7 +547,7 @@ fontStyle - + foreground #6089B4 @@ -561,7 +561,7 @@ fontStyle - + foreground #9872A2 @@ -575,7 +575,7 @@ fontStyle - + foreground #676867 @@ -589,7 +589,7 @@ fontStyle - + foreground #C7444A @@ -614,7 +614,7 @@ fontStyle - + foreground #D0B344 @@ -650,7 +650,7 @@ fontStyle - + foreground #D08442 @@ -664,7 +664,7 @@ fontStyle - + foreground #9AA83A @@ -678,7 +678,7 @@ fontStyle - + foreground #D0B344 @@ -692,7 +692,7 @@ fontStyle - + foreground #D9B700 @@ -717,11 +717,83 @@ fontStyle - + foreground #D0B344 + + + name + Markup Quote + scope + markup.quote + settings + + foreground + #9872A2 + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #9AA83A + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #6089B4 + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #FF0080 + + + + name + Markup Headings + scope + markup.heading + settings + + foreground + #D0B344 + + + + name + Markup Setext Header + scope + markup.heading.setext + settings + + fontStyle + + foreground + #D0B344 + + + diff --git a/extensions/theme-monokai/themes/Monokai.tmTheme b/extensions/theme-monokai/themes/Monokai.tmTheme index c179cbe2f97..0f455f8e8a2 100644 --- a/extensions/theme-monokai/themes/Monokai.tmTheme +++ b/extensions/theme-monokai/themes/Monokai.tmTheme @@ -380,6 +380,78 @@ + + name + Markup Quote + scope + markup.quote + settings + + foreground + #F92672 + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #E6DB74 + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #66D9EF + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #FD971F + + + + name + Markup Headings + scope + markup.heading + settings + + foreground + #A6E22E + + + + name + Markup Setext Header + scope + markup.heading.setext + settings + + fontStyle + + foreground + #A6E22E + + + + uuid D8D5E82E-3D5B-46B5-B38E-8C841C21347D diff --git a/extensions/theme-quietlight/themes/QuietLight.tmTheme b/extensions/theme-quietlight/themes/QuietLight.tmTheme index 64e2519b7ba..34ee12f54ca 100644 --- a/extensions/theme-quietlight/themes/QuietLight.tmTheme +++ b/extensions/theme-quietlight/themes/QuietLight.tmTheme @@ -490,8 +490,8 @@ markup.heading settings - fontStyle - bold + foreground + #AA3731 @@ -527,6 +527,52 @@ underline + + name + Markup Quote + scope + markup.quote + settings + + foreground + #7A3E9D + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #4B83CD + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #448C27 + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #AB6526 + + name ----------------------------------- diff --git a/extensions/theme-red/themes/red.tmTheme b/extensions/theme-red/themes/red.tmTheme index fe7d1ef15d9..2e7039551f4 100644 --- a/extensions/theme-red/themes/red.tmTheme +++ b/extensions/theme-red/themes/red.tmTheme @@ -429,6 +429,80 @@ #41a83eff + + + name + Markup Quote + scope + markup.quote + settings + + foreground + #f12727ff + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #ff6262ff + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #fb9a4bff + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #cd8d8dff + + + + name + Markup Headings + scope + markup.heading + settings + + foreground + #fec758ff + + + + name + Markup Setext Header + scope + markup.heading.setext + settings + + fontStyle + + foreground + #fec758ff + + + + + uuid AC0A28C5-65E6-42A6-AD05-4D01735652EE diff --git a/extensions/theme-solarized-dark/themes/Solarized-dark.tmTheme b/extensions/theme-solarized-dark/themes/Solarized-dark.tmTheme index b894e68512d..a798c8d67f9 100644 --- a/extensions/theme-solarized-dark/themes/Solarized-dark.tmTheme +++ b/extensions/theme-solarized-dark/themes/Solarized-dark.tmTheme @@ -303,6 +303,78 @@ settings + + + name + Markup Quote + scope + markup.quote + settings + + foreground + #859900 + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #B58900 + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #D33682 + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #2AA198 + + + + name + Markup Headings + scope + markup.heading + settings + + foreground + #268BD2 + + + + name + Markup Setext Header + scope + markup.heading.setext + settings + + fontStyle + + foreground + #268BD2 + + + uuid F930B0BF-AA03-4232-A30F-CEF749FF8E72 diff --git a/extensions/theme-solarized-light/themes/Solarized-light.tmTheme b/extensions/theme-solarized-light/themes/Solarized-light.tmTheme index 4cfd6088cf9..675ff9698c8 100644 --- a/extensions/theme-solarized-light/themes/Solarized-light.tmTheme +++ b/extensions/theme-solarized-light/themes/Solarized-light.tmTheme @@ -296,6 +296,78 @@ settings + + + name + Markup Quote + scope + markup.quote + settings + + foreground + #859900 + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #B58900 + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #D33682 + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #2AA198 + + + + name + Markup Headings + scope + markup.heading + settings + + foreground + #268BD2 + + + + name + Markup Setext Header + scope + markup.heading.setext + settings + + fontStyle + + foreground + #268BD2 + + + uuid 38E819D9-AE02-452F-9231-ECC3B204AFD7 diff --git a/extensions/theme-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme b/extensions/theme-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme index f6c223ef10c..806b35bdfa5 100644 --- a/extensions/theme-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme +++ b/extensions/theme-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme @@ -238,6 +238,54 @@ #3e999f + + + name + Markup Quote + scope + markup.quote + settings + + foreground + #FFC58F + + + + name + Markup Lists + scope + markup.list + settings + + foreground + #BBDAFF + + + + name + Markup Styling + scope + markup.bold, markup.italic + settings + + foreground + #FFC58F + + + + name + Markup Inline + scope + markup.inline.raw + settings + + fontStyle + + foreground + #FF9DA4 + + + uuid 3F4BB232-3C3A-4396-99C0-06A9573715E9 diff --git a/extensions/typescript/syntaxes/TypeScript.tmLanguage b/extensions/typescript/syntaxes/TypeScript.tmLanguage index aedac611809..890815f0e05 100644 --- a/extensions/typescript/syntaxes/TypeScript.tmLanguage +++ b/extensions/typescript/syntaxes/TypeScript.tmLanguage @@ -224,7 +224,7 @@ control-statement match - (?<!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default)\b + (?<!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default|yield)\b name keyword.control.ts @@ -1448,6 +1448,110 @@ + ternary-expression + + begin + (?=\?) + end + (?=$|[;,]) + patterns + + + include + #ternary-operator + + + include + #ternary-expression-type + + + + ternary-expression-type + + name + meta.expression.ts + patterns + + + include + #string + + + include + #regex + + + include + #template + + + include + #comment + + + include + #literal + + + include + #paren-expression + + + include + #ternary-expression + + + include + #import-operator + + + include + #expression-operator + + + include + #imply-operator + + + include + #relational-operator + + + include + #arithmetic-operator + + + include + #logic-operator + + + include + #assignment-operator + + + include + #type-primitive + + + include + #function-call + + + + ternary-operator + + begin + (\?) + end + (:) + patterns + + + include + #ternary-expression-type + + + this-literal match @@ -1839,6 +1943,10 @@ meta.var-single-variable.expr.ts patterns + + include + #ternary-expression + include #type-annotation diff --git a/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage b/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage index e7dcfe7efb3..b9d77e3f52b 100644 --- a/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage +++ b/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage @@ -192,7 +192,7 @@ control-statement match - (?<!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default)\b + (?<!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default|yield)\b name keyword.control.tsx @@ -1814,6 +1814,110 @@ + ternary-expression + + begin + (?=\?) + end + (?=$|[;,]) + patterns + + + include + #ternary-operator + + + include + #ternary-expression-type + + + + ternary-expression-type + + name + meta.expression.tsx + patterns + + + include + #string + + + include + #regex + + + include + #template + + + include + #comment + + + include + #literal + + + include + #paren-expression + + + include + #ternary-expression + + + include + #import-operator + + + include + #expression-operator + + + include + #imply-operator + + + include + #relational-operator + + + include + #arithmetic-operator + + + include + #logic-operator + + + include + #assignment-operator + + + include + #type-primitive + + + include + #function-call + + + + ternary-operator + + begin + (\?) + end + (:) + patterns + + + include + #ternary-expression-type + + + this-literal match @@ -2205,6 +2309,10 @@ meta.var-single-variable.expr.tsx patterns + + include + #ternary-expression + include #type-annotation diff --git a/extensions/typescript/test/colorize-results/test-issue5431_ts.json b/extensions/typescript/test/colorize-results/test-issue5431_ts.json index 9e6fb81b887..68fd08759bb 100644 --- a/extensions/typescript/test/colorize-results/test-issue5431_ts.json +++ b/extensions/typescript/test/colorize-results/test-issue5431_ts.json @@ -220,7 +220,7 @@ } }, { - "c": " ", + "c": " : ", "t": "block.decl.expr.function.meta.ts.var.var-single-variable", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -231,41 +231,30 @@ } }, { - "c": ": `", - "t": "annotation.block.decl.expr.function.meta.ts.type.var.var-single-variable", + "c": "`", + "t": "block.decl.expr.function.meta.string.template.ts.var.var-single-variable", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.type.annotation rgb(78, 201, 176)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.type.annotation rgb(38, 127, 153)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" } }, { - "c": "$", - "t": "annotation.block.decl.expr.function.meta.name.ts.type.var.var-single-variable", + "c": "${", + "t": "block.decl.element.expr.function.keyword.meta.others.template.ts.var.var-single-variable", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.type.annotation rgb(78, 201, 176)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.type.annotation rgb(38, 127, 153)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "{", - "t": "block.brace.curly.decl.expr.function.meta.ts.var.var-single-variable", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" } }, { "c": "startTime", - "t": "block.decl.expr.function.meta.ts.var.var-single-variable", + "t": "block.decl.element.expr.function.meta.template.ts.var.var-single-variable", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -276,62 +265,40 @@ }, { "c": "}", - "t": "block.brace.curly.decl.expr.function.meta.ts.var.var-single-variable", + "t": "block.decl.element.expr.function.keyword.meta.others.template.ts.var.var-single-variable", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" } }, { - "c": " ", - "t": "block.decl.expr.function.meta.ts.var.var-single-variable", + "c": " - ", + "t": "block.decl.expr.function.meta.string.template.ts.var.var-single-variable", "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" } }, { - "c": "-", - "t": "arithmetic.block.decl.expr.function.keyword.meta.operator.ts.var.var-single-variable", + "c": "${", + "t": "block.decl.element.expr.function.keyword.meta.others.template.ts.var.var-single-variable", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword.operator rgb(212, 212, 212)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword.operator rgb(0, 0, 0)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword.operator rgb(212, 212, 212)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword.operator rgb(0, 0, 0)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword.operator rgb(212, 212, 212)" - } - }, - { - "c": " $", - "t": "block.decl.expr.function.meta.ts.var.var-single-variable", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "{", - "t": "block.brace.curly.decl.expr.function.meta.ts.var.var-single-variable", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" } }, { "c": "endTime", - "t": "block.decl.expr.function.meta.ts.var.var-single-variable", + "t": "block.decl.element.expr.function.meta.template.ts.var.var-single-variable", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -342,7 +309,29 @@ }, { "c": "}", - "t": "block.brace.curly.decl.expr.function.meta.ts.var.var-single-variable", + "t": "block.decl.element.expr.function.keyword.meta.others.template.ts.var.var-single-variable", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": "`", + "t": "block.decl.expr.function.meta.string.template.ts.var.var-single-variable", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + } + }, + { + "c": ";", + "t": "block.decl.function.meta.ts", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", "light_plus": ".vs .token rgb(0, 0, 0)", @@ -352,36 +341,69 @@ } }, { - "c": "`;", - "t": "block.decl.expr.function.meta.string.template.ts.var.var-single-variable", + "c": "\t", + "t": "block.decl.function.meta.ts", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { - "c": "\treturn true;", - "t": "block.decl.expr.function.meta.string.template.ts.var.var-single-variable", + "c": "return", + "t": "block.control.decl.function.keyword.meta.ts", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword.control rgb(197, 134, 192)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword.control rgb(175, 0, 219)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword.control rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword.control rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword.control rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "block.decl.function.meta.ts", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "true", + "t": "block.boolean.constant.decl.function.language.meta.ts", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.constant.language rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.constant.language rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.constant.language rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.constant.language rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.constant.language rgb(86, 156, 214)" + } + }, + { + "c": ";", + "t": "block.decl.function.meta.ts", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, { "c": "}", - "t": "block.decl.expr.function.meta.string.template.ts.var.var-single-variable", + "t": "block.brace.curly.decl.function.meta.ts", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string rgb(163, 21, 21)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string rgb(206, 145, 120)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string rgb(163, 21, 21)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string rgb(206, 145, 120)" + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" } } ] \ No newline at end of file diff --git a/extensions/typescript/test/colorize-results/test-issue5465_ts.json b/extensions/typescript/test/colorize-results/test-issue5465_ts.json index 37cb3f84ae6..c9b02481fcb 100644 --- a/extensions/typescript/test/colorize-results/test-issue5465_ts.json +++ b/extensions/typescript/test/colorize-results/test-issue5465_ts.json @@ -55,7 +55,29 @@ } }, { - "c": "\tyield ", + "c": "\t", + "t": "block.decl.function.meta.ts", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "yield", + "t": "block.control.decl.function.keyword.meta.ts", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword.control rgb(197, 134, 192)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword.control rgb(175, 0, 219)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword.control rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword.control rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword.control rgb(86, 156, 214)" + } + }, + { + "c": " ", "t": "block.decl.function.meta.ts", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -88,7 +110,7 @@ } }, { - "c": "\tyield", + "c": "\t", "t": "block.decl.function.meta.ts", "r": { "dark_plus": ".vs-dark .token rgb(212, 212, 212)", @@ -98,6 +120,17 @@ "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, + { + "c": "yield", + "t": "block.control.decl.function.keyword.meta.ts", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword.control rgb(197, 134, 192)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword.control rgb(175, 0, 219)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword.control rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword.control rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword.control rgb(86, 156, 214)" + } + }, { "c": "*", "t": "arithmetic.block.decl.function.keyword.meta.operator.ts", diff --git a/extensions/xml/syntaxes/XML.plist b/extensions/xml/syntaxes/XML.plist index 7974f7fb250..d2957d723e0 100644 --- a/extensions/xml/syntaxes/XML.plist +++ b/extensions/xml/syntaxes/XML.plist @@ -22,7 +22,7 @@ begin - (<\?)\s*([-_a-zA-Z0-9]+) + (<\?)\s*([-_\p{L}\d]+) captures 1 @@ -44,7 +44,7 @@ match - ([a-zA-Z-]+) + ([\p{L}-]+) name entity.other.attribute-name.xml @@ -60,7 +60,7 @@ begin - (<!)(DOCTYPE)\s+([:a-zA-Z_][:a-zA-Z0-9_.-]*) + (<!)(DOCTYPE)\s+([:\p{L}_][:\p{L}\d_.-]*) captures 1 @@ -109,7 +109,7 @@ begin - (<)((?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+))(?=(\s[^>]*)?></\2>) + (<)((?:([-_\p{L}\d]+)((:)))?([-_\p{L}\d:]+))(?=(\s[^>]*)?></\2>) beginCaptures 1 @@ -139,7 +139,7 @@ end - (>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+)(>) + (>(<))/(?:([-_\p{L}\d]+)((:)))?([-_\p{L}\d:]+)(>) endCaptures 1 @@ -190,7 +190,7 @@ begin - (</?)(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+) + (</?)(?:([-_\p{L}\d]+)((:)))?([-_\p{L}\d:]+) captures 1 @@ -333,7 +333,7 @@ EntityDecl begin - (<!)(ENTITY)\s+(%\s+)?([:a-zA-Z_][:a-zA-Z0-9_.-]*)(\s+(?:SYSTEM|PUBLIC)\s+)? + (<!)(ENTITY)\s+(%\s+)?([:\p{L}_][:\p{L}\d_.-]*)(\s+(?:SYSTEM|PUBLIC)\s+)? captures 1 @@ -435,7 +435,7 @@ match - (&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;) + (&)([:\p{L}_][:\p{L}\d_.-]*|#[\d]+|#x[\da-fA-F]+)(;) name constant.character.entity.xml @@ -483,7 +483,7 @@ match - (%)([:a-zA-Z_][:a-zA-Z0-9_.-]*)(;) + (%)([:\p{L}_][:\p{L}\d_.-]*)(;) name constant.character.parameter-entity.xml @@ -552,7 +552,7 @@ match - (?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9]+)= + (?:([-_\p{L}\d]+)((:)))?([-_\p{L}\d]+)= include diff --git a/extensions/xml/syntaxes/XSL.plist b/extensions/xml/syntaxes/XSL.plist index 1c5843f9797..a76f52629b4 100644 --- a/extensions/xml/syntaxes/XSL.plist +++ b/extensions/xml/syntaxes/XSL.plist @@ -75,7 +75,7 @@ match - (?:([-_a-zA-Z0-9]+)((:)))?([a-zA-Z-]+) + (?:([-_\p{L}\d]+)((:)))?([\p{L}-]+) include diff --git a/extensions/xml/test/colorize-fixtures/test-7115.xml b/extensions/xml/test/colorize-fixtures/test-7115.xml new file mode 100644 index 00000000000..74bf37e9037 --- /dev/null +++ b/extensions/xml/test/colorize-fixtures/test-7115.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/extensions/xml/test/colorize-results/test-7115_xml.json b/extensions/xml/test/colorize-results/test-7115_xml.json new file mode 100644 index 00000000000..5efa5999834 --- /dev/null +++ b/extensions/xml/test/colorize-results/test-7115_xml.json @@ -0,0 +1,585 @@ +[ + { + "c": "", + "t": "definition.meta.preprocessor.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.preprocessor rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.preprocessor rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.preprocessor rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.preprocessor rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.preprocessor rgb(86, 156, 214)" + } + }, + { + "c": "<", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "WorkFine", + "t": "entity.localname.meta.name.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + } + }, + { + "c": ">", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "<", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "NoColorWithNonLatinCharacters_АБВ", + "t": "entity.localname.meta.name.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "meta.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "NextTagnotWork", + "t": "attribute-name.entity.localname.meta.other.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.other.attribute-name rgb(156, 220, 254)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.other.attribute-name rgb(255, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.other.attribute-name rgb(156, 220, 254)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.other.attribute-name rgb(255, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.other.attribute-name rgb(156, 220, 254)" + } + }, + { + "c": "=", + "t": "meta.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "\"", + "t": "begin.definition.double.meta.punctuation.quoted.string.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.tag rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.xml rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.tag rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.xml rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.tag rgb(206, 145, 120)" + } + }, + { + "c": "something", + "t": "double.meta.quoted.string.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.tag rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.xml rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.tag rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.xml rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.tag rgb(206, 145, 120)" + } + }, + { + "c": "\"", + "t": "definition.double.end.meta.punctuation.quoted.string.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.tag rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.xml rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.tag rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.xml rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.tag rgb(206, 145, 120)" + } + }, + { + "c": " ", + "t": "meta.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "Поле", + "t": "attribute-name.entity.localname.meta.other.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.other.attribute-name rgb(156, 220, 254)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.other.attribute-name rgb(255, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.other.attribute-name rgb(156, 220, 254)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.other.attribute-name rgb(255, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.other.attribute-name rgb(156, 220, 254)" + } + }, + { + "c": "=", + "t": "meta.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "\"", + "t": "begin.definition.double.meta.punctuation.quoted.string.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.tag rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.xml rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.tag rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.xml rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.tag rgb(206, 145, 120)" + } + }, + { + "c": "tagnotwork", + "t": "double.meta.quoted.string.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.tag rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.xml rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.tag rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.xml rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.tag rgb(206, 145, 120)" + } + }, + { + "c": "\"", + "t": "definition.double.end.meta.punctuation.quoted.string.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string.tag rgb(206, 145, 120)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.string.xml rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.string.tag rgb(206, 145, 120)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.string.xml rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.string.tag rgb(206, 145, 120)" + } + }, + { + "c": ">", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "<", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "WorkFine", + "t": "entity.localname.meta.name.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + } + }, + { + "c": "/>", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "<", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "Error_АБВГД", + "t": "entity.localname.meta.name.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.tag rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.tag rgb(86, 156, 214)" + } + }, + { + "c": "/>", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": " ", + "t": "", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + }, + { + "c": "", + "t": "definition.meta.punctuation.tag.xml", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.tag rgb(128, 128, 128)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.tag rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.tag rgb(128, 128, 128)" + } + } +] \ No newline at end of file diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 99fcac172e3..5ab5b02f458 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,17 @@ { - "name": "Code", - "version": "1.0.1", + "name": "code-oss-dev", + "version": "1.3.0", "dependencies": { "agent-base": { "version": "1.0.2", "from": "agent-base@>=1.0.1 <1.1.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-1.0.2.tgz" }, + "ansi-regex": { + "version": "2.0.0", + "from": "ansi-regex@latest", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, "anymatch": { "version": "1.3.0", "from": "anymatch@>=1.1.0 <2.0.0", @@ -343,7 +348,14 @@ "pty.js": { "version": "0.3.0", "from": "https://github.com/Tyriar/pty.js/tarball/fffbf86eb9e8051b5b2be4ba9c7b07faa018ce8d", - "resolved": "https://github.com/Tyriar/pty.js/tarball/fffbf86eb9e8051b5b2be4ba9c7b07faa018ce8d" + "resolved": "https://github.com/Tyriar/pty.js/tarball/fffbf86eb9e8051b5b2be4ba9c7b07faa018ce8d", + "dependencies": { + "extend": { + "version": "1.2.1", + "from": "extend@>=1.2.1 <1.3.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz" + } + } }, "randomatic": { "version": "1.1.5", diff --git a/package.json b/package.json index c171ba9fc39..bf7459e2962 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "watch": "gulp watch" }, "dependencies": { + "ansi-regex": "^2.0.0", "applicationinsights": "0.15.6", "chokidar": "1.0.5", "emmet": "1.3.1", @@ -24,13 +25,13 @@ "iconv-lite": "0.4.13", "minimist": "^1.2.0", "native-keymap": "0.1.2", - "pty.js": "https://github.com/Tyriar/pty.js/tarball/prebuilt", + "pty.js": "https://github.com/Tyriar/pty.js/tarball/fffbf86eb9e8051b5b2be4ba9c7b07faa018ce8d", "sax": "1.1.2", "semver": "4.3.6", "vscode-debugprotocol": "1.9.0", "vscode-textmate": "1.1.0", "winreg": "1.2.0", - "xterm": "git+https://github.com/sourcelair/xterm.js.git#9d34ed8", + "xterm": "git+https://github.com/sourcelair/xterm.js.git#09d67a6", "yauzl": "2.3.1" }, "devDependencies": { @@ -82,7 +83,7 @@ "sinon": "^1.17.2", "source-map": "^0.4.4", "tslint": "^3.3.0", - "typescript": "^1.8.0", + "typescript": "^1.8.10", "uglify-js": "2.4.8", "underscore": "^1.8.2", "vinyl": "^0.4.5", diff --git a/resources/linux/code.desktop b/resources/linux/code.desktop index d4f065696b1..4e82b76f7a2 100644 --- a/resources/linux/code.desktop +++ b/resources/linux/code.desktop @@ -10,6 +10,7 @@ StartupWMClass=@@NAME_SHORT@@ Categories=Utility;TextEditor;Development;IDE; MimeType=text/plain; Actions=new-window; +Keywords=vscode; [Desktop Action new-window] Name=New Window diff --git a/resources/linux/debian/control.template b/resources/linux/debian/control.template index f92290eb12b..1d1cc3c4a83 100644 --- a/resources/linux/debian/control.template +++ b/resources/linux/debian/control.template @@ -9,4 +9,4 @@ Homepage: https://code.visualstudio.com/ Installed-Size: @@INSTALLEDSIZE@@ Replaces: visual-studio-@@NAME@@ Description: Code editing. Redefined. - Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. + Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ. diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template index 52abe620fe0..17b1c63b7d9 100644 --- a/resources/linux/rpm/code.spec.template +++ b/resources/linux/rpm/code.spec.template @@ -12,7 +12,7 @@ Requires: glibc >= 2.15 AutoReq: 0 %description -Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. +Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ. %install mkdir -p %{buildroot}/usr/share/@@NAME@@ diff --git a/src/bootstrap.js b/src/bootstrap.js index b029d660f42..ae4e67c1488 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -111,4 +111,19 @@ process.on('uncaughtException', function (err) { } }); +// Kill oneself if one's parent dies. Much drama. +if (process.env['VSCODE_PARENT_PID']) { + const parentPid = Number(process.env['VSCODE_PARENT_PID']); + + if (typeof parentPid === 'number' && !isNaN(parentPid)) { + setInterval(function () { + try { + process.kill(parentPid, 0); // throws an exception if the main process doesn't exist anymore. + } catch (e) { + process.exit(); + } + }, 5000); + } +} + require('./bootstrap-amd').bootstrap(process.env['AMD_ENTRYPOINT']); \ No newline at end of file diff --git a/src/typings/ansi-regex.d.ts b/src/typings/ansi-regex.d.ts new file mode 100644 index 00000000000..8e300497806 --- /dev/null +++ b/src/typings/ansi-regex.d.ts @@ -0,0 +1,5 @@ +declare module 'ansi-regex' { + function result(): RegExp; + module result {} + export = result; +} diff --git a/src/typings/electron.d.ts b/src/typings/electron.d.ts index 1dae7da854f..abd89ba6348 100644 --- a/src/typings/electron.d.ts +++ b/src/typings/electron.d.ts @@ -838,8 +838,9 @@ declare module Electron { * at the current mouse cursor position. * @param x Horizontal coordinate where the menu will be placed. * @param y Vertical coordinate where the menu will be placed. + * @param positioningItem The item to select by default. */ - popup(browserWindow: BrowserWindow, x?: number, y?: number): void; + popup(browserWindow: BrowserWindow, x?: number, y?: number, positioningItem?: number): void; /** * Appends the menuItem to the menu. */ diff --git a/src/vs/workbench/parts/markdown/common/markdown.ts b/src/typings/lib.array-ext.d.ts similarity index 76% rename from src/vs/workbench/parts/markdown/common/markdown.ts rename to src/typings/lib.array-ext.d.ts index 1a5c2a93b1b..59e1c0fc956 100644 --- a/src/vs/workbench/parts/markdown/common/markdown.ts +++ b/src/typings/lib.array-ext.d.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; -export const MARKDOWN_MIME = 'text/x-web-markdown'; -export const MARKDOWN_MODE_ID = 'markdown'; \ No newline at end of file +interface ArrayConstructor { + isArray(arg: any): arg is Array; +} \ No newline at end of file diff --git a/src/vs/base/browser/dnd.ts b/src/vs/base/browser/dnd.ts index 91ae11f9880..766bf046cd3 100644 --- a/src/vs/base/browser/dnd.ts +++ b/src/vs/base/browser/dnd.ts @@ -6,6 +6,7 @@ 'use strict'; import {$} from 'vs/base/browser/builder'; +import URI from 'vs/base/common/uri'; /** * A helper that will execute a provided function when the provided HTMLElement receives @@ -39,4 +40,35 @@ export class DelayedDragHandler { public dispose(): void { this.clearDragTimeout(); } +} + +export function extractResources(e: DragEvent): URI[] { + const resources: URI[] = []; + if (e.dataTransfer.types.length > 0) { + + // Check for in-app DND + const rawData = e.dataTransfer.getData(e.dataTransfer.types[0]); + if (rawData) { + try { + resources.push(URI.parse(rawData)); + } catch (error) { + // Invalid URI + } + } + + // Check for native file transfer + if (e.dataTransfer && e.dataTransfer.files) { + for (let i = 0; i < e.dataTransfer.files.length; i++) { + if (e.dataTransfer.files[i] && e.dataTransfer.files[i].path) { + try { + resources.push(URI.file(e.dataTransfer.files[i].path)); + } catch (error) { + // Invalid URI + } + } + } + } + } + + return resources; } \ No newline at end of file diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index 9af71f672b3..9305281046b 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -7,6 +7,7 @@ import DOM = require('vs/base/browser/dom'); import {defaultGenerator} from 'vs/base/common/idGenerator'; +import {escape} from 'vs/base/common/strings'; import {TPromise} from 'vs/base/common/winjs.base'; import {IHTMLContentElement} from 'vs/base/common/htmlContent'; import {marked} from 'vs/base/common/marked/marked'; @@ -111,7 +112,7 @@ function _renderHtml(content: IHTMLContentElement, options: RenderOptions = {}): }, err => { // ignore }); - return `${code}`; + return `${escape(code)}`; } return code; diff --git a/src/vs/base/browser/ui/actionbar/actionbar.css b/src/vs/base/browser/ui/actionbar/actionbar.css index 6a549db43b8..2cfe0ecafe7 100644 --- a/src/vs/base/browser/ui/actionbar/actionbar.css +++ b/src/vs/base/browser/ui/actionbar/actionbar.css @@ -129,49 +129,6 @@ background-color: #C33; } -/* Actions widget */ - -.monaco-actions-widget { - position: relative; -} - -.monaco-actions-widget .more { - position: absolute; - top: 0; - right: 1em; - font-weight: bold; - cursor: pointer; - display: none; -} - -.monaco-actions-widget .more.active { - -ms-transform: translate(0, -3px); - -webkit-transform: translate(0, -3px); - -moz-transform: translate(0, -3px); - -o-transform: translate(0, -3px); - transform: translate(0, -3px); -} - -.monaco-actions-widget .primary { - display: none; -} - -.monaco-actions-widget.hasPrimary .primary { - display: inherit; -} - -.monaco-actions-widget.hasSecondary .more { - display: inherit; -} - -.monaco-actions-widget .secondary.monaco-action-bar { - display: none; -} - -.monaco-actions-widget.more .secondary.monaco-action-bar { - display: inherit; -} - /* Action Items */ .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ diff --git a/src/vs/base/browser/ui/actionbar/actionbar.ts b/src/vs/base/browser/ui/actionbar/actionbar.ts index 831a81a23d0..8c73c19bfde 100644 --- a/src/vs/base/browser/ui/actionbar/actionbar.ts +++ b/src/vs/base/browser/ui/actionbar/actionbar.ts @@ -49,7 +49,6 @@ export class BaseActionItem extends EventEmitter implements IActionItem { if (action instanceof Action) { let l = (action).addBulkListener2((events: EmitterEvent[]) => { - if (!this.builder) { // we have not been rendered yet, so there // is no point in updating the UI @@ -57,7 +56,6 @@ export class BaseActionItem extends EventEmitter implements IActionItem { } events.forEach((event: EmitterEvent) => { - switch (event.getType()) { case Action.ENABLED: this._updateEnabled(); @@ -113,20 +111,24 @@ export class BaseActionItem extends EventEmitter implements IActionItem { this.builder = $(container); this.gesture = new Gesture(container); - this.builder.on(DOM.EventType.CLICK, (event: Event) => { this.onClick(event); }); - this.builder.on(EventType.Tap, e => { this.onClick(e); }); + this.builder.on(DOM.EventType.CLICK, (event: Event) => this.onClick(event)); + this.builder.on(EventType.Tap, e => this.onClick(e)); if (platform.isMacintosh) { - this.builder.on(DOM.EventType.CONTEXT_MENU, (event: Event) => { this.onClick(event); }); // https://github.com/Microsoft/vscode/issues/1011 + this.builder.on(DOM.EventType.CONTEXT_MENU, (event: Event) => this.onClick(event)); // https://github.com/Microsoft/vscode/issues/1011 } - this.builder.on('mousedown', (e: MouseEvent) => { + this.builder.on(DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => { + DOM.EventHelper.stop(e); + if (e.button === 0 && this._action.enabled) { this.builder.addClass('active'); } }); - this.builder.on(['mouseup', 'mouseout'], (e: MouseEvent) => { + this.builder.on([DOM.EventType.MOUSE_UP, DOM.EventType.MOUSE_OUT], (e: MouseEvent) => { + DOM.EventHelper.stop(e); + if (e.button === 0 && this._action.enabled) { this.builder.removeClass('active'); } @@ -135,6 +137,7 @@ export class BaseActionItem extends EventEmitter implements IActionItem { public onClick(event: Event): void { DOM.EventHelper.stop(event, true); + let context: any; if (types.isUndefinedOrNull(this._context)) { context = event; @@ -270,7 +273,7 @@ export class ActionItem extends BaseActionItem { title = this.getAction().label; if (this.options.keybinding) { - title = nls.localize({ key: 'titleLabel', comment: ['action title', 'action keybinding']}, "{0} ({1})", title, this.options.keybinding); + title = nls.localize({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, "{0} ({1})", title, this.options.keybinding); } } @@ -512,7 +515,7 @@ export class ActionBar extends EventEmitter implements IActionRunner { public setAriaLabel(label: string): void { if (label) { this.actionsList.setAttribute('aria-label', label); - } else{ + } else { this.actionsList.removeAttribute('aria-label'); } } diff --git a/src/vs/base/common/sortedList.ts b/src/vs/base/common/sortedList.ts deleted file mode 100644 index c15d6ecbba5..00000000000 --- a/src/vs/base/common/sortedList.ts +++ /dev/null @@ -1,256 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import Arrays = require('vs/base/common/arrays'); - -export interface IIterator { - current: TValue; - moveNext(): boolean; - hasNext(): boolean; - reset(): void; - dispose(): void; -} - -export interface IIterable { - getIterator(): IIterator; -} - -export interface ISortedList extends IIterable> { - /** - * Number of elements in a sorted list. - * O(1) - */ - count: number; - - /** - * Gets the value associated with the specified key. - * Returns null if there is no value associated with the key. - * O(log n) - */ - getValue(key: TKey): TValue; - - /** - * Gets an iterator over values. - * O(1) - */ - getValues(): IIterator; - - /** - * Gets the value at the specified index. - * Returns null if index is out of bounds. - * O(1) - */ - getValueByIndex(index: number): TValue; - - /** - * Gets the key at the specified index. - * Returns null if index is out of bounds. - * O(1) - */ - getKey(index: number): TKey; - - /** - * Gets an iterator over keys. - * O(1) - */ - getKeys(): IIterator; - - /** - * Returns the zero-based index of the specified key in a SortedList object. - * Returns -1 if the key is not found. - * O(log n) - */ - indexOfKey(key: TKey): number; - - /** - * Adds the specified key and value to the sorted list. - * O(n) - */ - add(key: TKey, value: TValue): void; - - /** - * Removes a value from the sorted list. - * Returns true if the value got removed, false otherwise. - * O(n) - */ - remove(key: TKey): boolean; -} - -export interface KeyValue { - key: TKey; - value: TValue; -} - -export class SortedList implements ISortedList { - - private static DEFAULT_COMPARATOR = function(first: TKey, second: TKey) { - return first < second ? -1 : first > second ? 1 : 0; - }; - - private keys: TKey[]; - private values: TValue[]; - private comparator: (first: TKey, second: TKey) => number; - - constructor(comparator?: (first: TKey, second: TKey) => number) { - this.keys = []; - this.values = []; - this.comparator = comparator || SortedList.DEFAULT_COMPARATOR; - } - - public get count(): number { - return this.keys.length; - } - - public getValueByIndex(index: number): TValue { - if (0 <= index && index < this.values.length) { - return this.values[index]; - } - - return null; - } - - public getKey(index: number): TKey { - if (0 <= index && index < this.keys.length) { - return this.keys[index]; - } - - return null; - } - - public getKeys(): IIterator { - return new ListIterator(this.keys); - } - - public getValue(key: TKey): TValue { - if (!key) { - throw new Error('Key must be defined.'); - } - var indexOfKey = this.indexOfKey(key); - if (indexOfKey >= 0) { - return this.values[indexOfKey]; - } - - return null; - } - - public getValues(): IIterator { - return new ListIterator(this.values); - } - - public indexOfKey(key: TKey): number { - if (!key) { - throw new Error('Key must be defined.'); - } - return Math.max(-1, Arrays.binarySearch(this.keys, key, this.comparator)); - } - - public add(key: TKey, value: TValue): void { - if (!key || !value) { - throw new Error('Key and value must be defined.'); - } - - var position = 0; - while (position < this.keys.length && this.comparator(key, this.keys[position]) > 0) { - position++; - } - - this.keys.splice(position, 0, key); - this.values.splice(position, 0, value); - } - - public remove(key: TKey): boolean { - if (!key) { - throw new Error('Key must be defined.'); - } - var indexOfKey = this.indexOfKey(key); - if (indexOfKey >= 0) { - this.values.splice(indexOfKey, 1); - this.keys.splice(indexOfKey, 1); - } - - return indexOfKey >= 0; - } - - public getIterator(): IIterator> { - return new SortedListIterator(this.keys, this.values); - } -} - -class SortedListIterator implements IIterator> { - private keys: TKey[]; - private values: TValue[]; - private index: number; - - constructor(keys: TKey[], values: TValue[]) { - this.keys = keys; - this.values = values; - this.index = -1; - } - - public get current(): KeyValue { - if (this.index < 0 || this.keys.length < this.index) { - return null; - } - - return { - key: this.keys[this.index], - value: this.values[this.index] - }; - } - - public moveNext(): boolean { - this.index++; - return this.index < this.keys.length; - } - - public hasNext(): boolean { - return this.index + 1 < this.keys.length; - } - - public reset(): void { - this.index = -1; - } - - public dispose(): void { - this.keys = null; - this.values = null; - } -} - -class ListIterator implements IIterator { - private values: TValue[]; - private index: number; - - constructor(values: TValue[]) { - this.values = values; - this.index = -1; - } - - public get current(): TValue { - if (this.index < 0 || this.values.length < this.index) { - return null; - } - - return this.values[this.index]; - } - - public moveNext(): boolean { - this.index++; - return this.index < this.values.length; - } - - public hasNext(): boolean { - return this.index + 1 < this.values.length; - } - - public reset(): void { - this.index = -1; - } - - public dispose(): void { - this.values = null; - } -} \ No newline at end of file diff --git a/src/vs/base/parts/ipc/node/ipc.cp.ts b/src/vs/base/parts/ipc/node/ipc.cp.ts index 70a7f4dbd81..49fbaeba84e 100644 --- a/src/vs/base/parts/ipc/node/ipc.cp.ts +++ b/src/vs/base/parts/ipc/node/ipc.cp.ts @@ -104,22 +104,20 @@ export class Client implements IClient, IDisposable { private get client(): IPCClient { if (!this._client) { const args = this.options && this.options.args ? this.options.args : []; - let forkOpts:any = undefined; + const forkOpts = Object.create(null); - if (this.options) { - forkOpts = Object.create(null); + forkOpts.env = assign(clone(process.env), { 'VSCODE_PARENT_PID': String(process.pid) }); - if (this.options.env) { - forkOpts.env = assign(clone(process.env), this.options.env); - } + if (this.options && this.options.env) { + forkOpts.env = assign(forkOpts.env, this.options.env); + } - if (typeof this.options.debug === 'number') { - forkOpts.execArgv = ['--nolazy', '--debug=' + this.options.debug]; - } + if (this.options && typeof this.options.debug === 'number') { + forkOpts.execArgv = ['--nolazy', '--debug=' + this.options.debug]; + } - if (typeof this.options.debugBrk === 'number') { - forkOpts.execArgv = ['--nolazy', '--debug-brk=' + this.options.debugBrk]; - } + if (this.options && typeof this.options.debugBrk === 'number') { + forkOpts.execArgv = ['--nolazy', '--debug-brk=' + this.options.debugBrk]; } this.child = fork(this.modulePath, args, forkOpts); diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index 8c27201f26e..f8d94989037 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -575,12 +575,19 @@ export class QuickOpenWidget implements IModelProvider { } } - // Finally check for auto focus of second entry + // Check for auto focus of second entry else if (autoFocus.autoFocusSecondEntry) { if (entries.length > 1) { this.tree.focusNth(1); } } + + // Finally check for auto focus of last entry + else if (autoFocus.autoFocusLastEntry) { + if (entries.length > 1) { + this.tree.focusLast(); + } + } } public refresh(input: IModel, autoFocus: IAutoFocus): void { @@ -719,8 +726,8 @@ export class QuickOpenWidget implements IModelProvider { } } - public isQuickNavigating(): boolean { - return !!this.quickNavigateConfiguration; + public getQuickNavigateConfiguration(): IQuickNavigateConfiguration { + return this.quickNavigateConfiguration; } public setPlaceHolder(placeHolder: string): void { diff --git a/src/vs/base/parts/quickopen/common/quickOpen.ts b/src/vs/base/parts/quickopen/common/quickOpen.ts index bc2002d3609..8bbe2285f39 100644 --- a/src/vs/base/parts/quickopen/common/quickOpen.ts +++ b/src/vs/base/parts/quickopen/common/quickOpen.ts @@ -27,6 +27,11 @@ export interface IAutoFocus { */ autoFocusSecondEntry?: boolean; + /** + * If set to true, will automatically select the last entry from the result list. + */ + autoFocusLastEntry?: boolean; + /** * If set to true, will automatically select any entry whose label starts with the search * value. Since some entries to the top might match the query but not on the prefix, this diff --git a/src/vs/base/parts/tree/browser/treeDefaults.ts b/src/vs/base/parts/tree/browser/treeDefaults.ts index a4222238f67..2fcaabc37aa 100644 --- a/src/vs/base/parts/tree/browser/treeDefaults.ts +++ b/src/vs/base/parts/tree/browser/treeDefaults.ts @@ -433,7 +433,7 @@ export class DefaultAccessibilityProvider implements _.IAccessibilityProvider { export class CollapseAllAction extends Action { constructor(private viewer: _.ITree, enabled: boolean) { - super('workbench.action.collapse', nls.localize('collapse', "Collapse All"), 'monaco-tree-action collapse-all', enabled); + super('vs.tree.collapse', nls.localize('collapse', "Collapse"), 'monaco-tree-action collapse-all', enabled); } public run(context?: any): TPromise { diff --git a/src/vs/base/test/common/sortedList.test.ts b/src/vs/base/test/common/sortedList.test.ts deleted file mode 100644 index d4e9a65234a..00000000000 --- a/src/vs/base/test/common/sortedList.test.ts +++ /dev/null @@ -1,111 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import * as assert from 'assert'; -import SortedList = require('vs/base/common/sortedList'); - -function getCuisineKeys(): string[] { - return ['german', 'swiss', 'french', 'italian', 'english','scotish', 'turksih', 'hungarian', 'serbian', 'swedish', 'russian', - 'portugesse', 'american', 'japenesse', 'chinesse', 'bosnian', 'makedonian', 'libanese', 'mexican', 'thailand']; -} - -function getCuisineValues(): string[] { - return ['beer', 'cheese', 'wine', 'pizza', 'chips', 'whiskey', 'kebab', 'gulash', 'pljeska', 'salmon', 'vodka', - 'shrimp', 'burger', 'susshi', 'sechuan', 'cevapcici', 'burek', 'falafel', 'burito', 'curryduck']; -} - -function shouldThrow(func: (key: any) => any, key: any): void { - try { - func(key); - assert(false); - } catch (e) { - assert(true); - } -} - -var keys = getCuisineKeys(); -var values = getCuisineValues(); - -function getCuisineList(withoutIterator:boolean = false): SortedList.ISortedList { - var result = new SortedList.SortedList(withoutIterator ? null : (first: string, second: string) => { - return first.localeCompare(second); - }); - for (var i = 0; i < keys.length; i++) { - result.add(keys[i], values[i]); - } - - return result; -} - -suite('SortedList', () => { - test('sorted list add', function() { - var sortedList = getCuisineList(); - assert.equal(sortedList.count, keys.length); - - for (var i = 0; i < keys.length; i++) { - assert.equal(sortedList.getValue(keys[i]), values[i]); - assert(sortedList.indexOfKey(keys[i]) >= 0); - assert.notEqual(sortedList.getValueByIndex(i), null); - } - }); - - test('sorted list add with default comparator', function() { - var sortedList = getCuisineList(true /* without comparator */); - assert.equal(sortedList.count, keys.length); - - for (var i = 0; i < keys.length; i++) { - assert.equal(sortedList.getValue(keys[i]), values[i]); - assert(sortedList.indexOfKey(keys[i]) >= 0); - assert.notEqual(sortedList.getValueByIndex(i), null); - } - }); - - test('sorted list remove', function() { - var sortedList = getCuisineList(); - for (var i = 0; i < keys.length; i++) { - assert(sortedList.remove(keys[i])); - } - assert.equal(sortedList.count, 0); - }); - - test('sorted list iterator', function() { - var sortedList = getCuisineList(); - // cast due to TS bug. - var iterator = sortedList.getIterator(); - var elementCount = 0; - while (iterator.moveNext()) { - elementCount++; - assert(keys.indexOf(iterator.current.key) >= 0); - assert(values.indexOf(iterator.current.value) >= 0); - } - assert.equal(elementCount, sortedList.count); - - iterator.reset(); - elementCount = 0; - assert(iterator.hasNext()); - while (iterator.moveNext()) { - elementCount++; - assert(keys.indexOf(iterator.current.key) >= 0); - assert(values.indexOf(iterator.current.value) >= 0); - } - assert(!iterator.hasNext()); - assert.equal(elementCount, sortedList.count); - }); - - test('sorted list bad op', function() { - var sortedList = getCuisineList(); - assert.equal(sortedList.getKey(127), null); - assert.equal(sortedList.getKey(-1), null); - assert.equal(sortedList.getValue('banana'), null); - assert.equal(sortedList.remove('unexistingKey'), false); - assert.equal(sortedList.getValueByIndex(-4), null); - assert.equal(sortedList.getValueByIndex(1114), null); - assert.equal(sortedList.indexOfKey('fakeKey'), -1); - shouldThrow(sortedList.indexOfKey, null); - shouldThrow(sortedList.getValue, null); - shouldThrow(sortedList.remove, null); - }); -}); \ No newline at end of file diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index d089e91152b..a4d3a75fcb4 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -31,6 +31,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ILogService, MainLogService } from 'vs/code/electron-main/log'; import { IStorageService, StorageService } from 'vs/code/electron-main/storage'; import * as cp from 'child_process'; +import * as ansiregex from 'ansi-regex'; function quit(accessor: ServicesAccessor, error?: Error); function quit(accessor: ServicesAccessor, message?: string); @@ -311,7 +312,7 @@ function getUnixUserEnvironment(): TPromise { const raw = Buffer.concat(buffers).toString('utf8'); try { - const env = JSON.parse(raw); + const env = JSON.parse(raw.replace(ansiregex(), '')); if (runAsNode) { env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = runAsNode; diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index aaa18e0c357..6a29abf74bb 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -592,12 +592,14 @@ export class VSCodeMenu { let nextEditor = this.createMenuItem(nls.localize({ key: 'miNextEditor', comment: ['&& denotes a mnemonic'] }, "&&Next Editor"), 'workbench.action.nextEditor'); let previousEditor = this.createMenuItem(nls.localize({ key: 'miPreviousEditor', comment: ['&& denotes a mnemonic'] }, "&&Previous Editor"), 'workbench.action.previousEditor'); - let previousEditorInGroup = this.createMenuItem(nls.localize({ key: 'miPreviousEditorInGroup', comment: ['&& denotes a mnemonic'] }, "Previous &&Editor in Group"), 'workbench.action.openPreviousEditorInGroup'); + let nextEditorInGroup = this.createMenuItem(nls.localize({ key: 'miNextEditorInGroup', comment: ['&& denotes a mnemonic'] }, "&&Next Used Editor in Group"), 'workbench.action.openNextRecentlyUsedEditorInGroup'); + let previousEditorInGroup = this.createMenuItem(nls.localize({ key: 'miPreviousEditorInGroup', comment: ['&& denotes a mnemonic'] }, "&&Previous Used Editor in Group"), 'workbench.action.openPreviousRecentlyUsedEditorInGroup'); [ nextEditor, previousEditor, __separator__(), + nextEditorInGroup, previousEditorInGroup ].forEach(item => switchEditorMenu.append(item)); diff --git a/src/vs/editor/browser/editor.all.ts b/src/vs/editor/browser/editor.all.ts index 9a3a4165faa..84d92706363 100644 --- a/src/vs/editor/browser/editor.all.ts +++ b/src/vs/editor/browser/editor.all.ts @@ -24,6 +24,7 @@ import 'vs/css!vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace'; import 'vs/editor/contrib/inPlaceReplace/common/inPlaceReplace'; import 'vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard'; import 'vs/editor/contrib/linesOperations/common/linesOperations'; +import 'vs/editor/contrib/carretOperations/common/carretOperations'; import 'vs/editor/contrib/links/browser/links'; import 'vs/editor/contrib/multicursor/common/multicursor'; import 'vs/editor/contrib/outlineMarker/browser/outlineMarker'; diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index abd50689f9e..12dd875b4e0 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -18,9 +18,9 @@ export class CodeEditorServiceImpl extends AbstractCodeEditorService { private _styleSheet: HTMLStyleElement; private _decorationOptionProviders: {[key:string]:IModelDecorationOptionsProvider}; - constructor() { + constructor(styleSheet = dom.createStyleSheet()) { super(); - this._styleSheet = dom.createStyleSheet(); + this._styleSheet = styleSheet; this._decorationOptionProviders = Object.create(null); } @@ -141,6 +141,8 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { public stickiness: TrackedRangeStickiness; constructor(styleSheet: HTMLStyleElement, key:string, options:IDecorationRenderOptions) { + this.refCount = 0; + var themedOpts = getThemedRenderOptions(options); this.className = DecorationRenderHelper.createCSSRules( @@ -262,6 +264,7 @@ class DecorationRenderHelper { letterSpacing: 'letter-spacing:{0};', gutterIconPath: 'background:url(\'{0}\') center center no-repeat;', + gutterIconSize: 'background-size:{0};', contentText: 'content:\'{0}\';', contentIconPath: 'content:url(\'{0}\')', @@ -321,7 +324,10 @@ class DecorationRenderHelper { let cssTextArr = []; if (typeof opts.gutterIconPath !== 'undefined') { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, URI.file(opts.gutterIconPath).toString())); + cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, URI.parse(opts.gutterIconPath).toString())); + if (typeof opts.gutterIconSize !== 'undefined') { + cssTextArr.push(strings.format(this._CSS_MAP.gutterIconSize, opts.gutterIconSize)); + } } return cssTextArr.join(''); diff --git a/src/vs/editor/browser/standalone/simpleServices.ts b/src/vs/editor/browser/standalone/simpleServices.ts index d673ee1348f..116ab5bd97d 100644 --- a/src/vs/editor/browser/standalone/simpleServices.ts +++ b/src/vs/editor/browser/standalone/simpleServices.ts @@ -25,6 +25,7 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import * as editorCommon from 'vs/editor/common/editorCommon'; import {ICodeEditor, IDiffEditor} from 'vs/editor/browser/editorBrowser'; import {Selection} from 'vs/editor/common/core/selection'; +import {IEventService} from 'vs/platform/event/common/event'; export class SimpleEditor implements IEditor { @@ -281,6 +282,11 @@ export class SimpleExtensionService extends AbstractExtensionService { return TPromise.as(resources.map((resource) => { return { diff --git a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts b/src/vs/editor/browser/standalone/standaloneCodeEditor.ts index 189031214bb..2ed5ebddaaf 100644 --- a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts +++ b/src/vs/editor/browser/standalone/standaloneCodeEditor.ts @@ -7,11 +7,9 @@ import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {IContextViewService} from 'vs/platform/contextview/browser/contextView'; -import {IEditorService} from 'vs/platform/editor/common/editor'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {AbstractKeybindingService} from 'vs/platform/keybinding/browser/keybindingServiceImpl'; import {ICommandHandler, IKeybindingContextKey, IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; -import {IMarkerService} from 'vs/platform/markers/common/markers'; import {RemoteTelemetryServiceHelper} from 'vs/platform/telemetry/common/remoteTelemetryService'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IActionDescriptor, ICodeEditorWidgetCreationOptions, IDiffEditorOptions, IModel, IModelChangedEvent, EventType} from 'vs/editor/common/editorCommon'; @@ -21,6 +19,7 @@ import {StandaloneKeybindingService} from 'vs/editor/browser/standalone/simpleSe import {IEditorContextViewService, IEditorOverrideServices, ensureStaticPlatformServices, getOrCreateStaticServices} from 'vs/editor/browser/standalone/standaloneServices'; import {CodeEditorWidget} from 'vs/editor/browser/widget/codeEditorWidget'; import {DiffEditorWidget} from 'vs/editor/browser/widget/diffEditorWidget'; +import {ICodeEditor, IDiffEditor} from 'vs/editor/browser/editorBrowser'; /** * The options to create an editor. @@ -44,12 +43,22 @@ export interface IEditorConstructionOptions extends ICodeEditorWidgetCreationOpt export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { } -export class StandaloneEditor extends CodeEditorWidget { +export interface IStandaloneCodeEditor extends ICodeEditor { + addCommand(keybinding:number, handler:ICommandHandler, context:string): string; + createContextKey(key: string, defaultValue: T): IKeybindingContextKey; + addAction(descriptor:IActionDescriptor): void; +} + +export interface IStandaloneDiffEditor extends IDiffEditor { + addCommand(keybinding:number, handler:ICommandHandler, context:string): string; + createContextKey(key: string, defaultValue: T): IKeybindingContextKey; + addAction(descriptor:IActionDescriptor): void; +} + +export class StandaloneEditor extends CodeEditorWidget implements IStandaloneCodeEditor { - private _editorService:IEditorService; private _standaloneKeybindingService: StandaloneKeybindingService; private _contextViewService:IEditorContextViewService; - private _markerService: IMarkerService; private _ownsModel:boolean; private _toDispose2: IDisposable[]; @@ -61,9 +70,7 @@ export class StandaloneEditor extends CodeEditorWidget { @ICodeEditorService codeEditorService: ICodeEditorService, @IKeybindingService keybindingService: IKeybindingService, @ITelemetryService telemetryService: ITelemetryService, - @IContextViewService contextViewService: IContextViewService, - @IEditorService editorService: IEditorService, - @IMarkerService markerService: IMarkerService + @IContextViewService contextViewService: IContextViewService ) { if (keybindingService instanceof AbstractKeybindingService) { (keybindingService).setInstantiationService(instantiationService); @@ -77,8 +84,6 @@ export class StandaloneEditor extends CodeEditorWidget { } this._contextViewService = contextViewService; - this._editorService = editorService; - this._markerService = markerService; this._toDispose2 = toDispose; let model: IModel = null; @@ -110,10 +115,6 @@ export class StandaloneEditor extends CodeEditorWidget { this.dispose(); } - public getMarkerService():IMarkerService { - return this._markerService; - } - public addCommand(keybinding:number, handler:ICommandHandler, context:string): string { if (!this._standaloneKeybindingService) { console.warn('Cannot add command because the editor is configured with an unrecognized KeybindingService'); @@ -146,14 +147,6 @@ export class StandaloneEditor extends CodeEditorWidget { } } - public getTelemetryService():ITelemetryService { - return this._telemetryService; - } - - public getEditorService():IEditorService { - return this._editorService; - } - _attachModel(model:IModel):void { super._attachModel(model); if (this._view) { @@ -170,13 +163,11 @@ export class StandaloneEditor extends CodeEditorWidget { } } -export class StandaloneDiffEditor extends DiffEditorWidget { +export class StandaloneDiffEditor extends DiffEditorWidget implements IStandaloneDiffEditor { private _contextViewService:IEditorContextViewService; private _standaloneKeybindingService: StandaloneKeybindingService; private _toDispose2: IDisposable[]; - private _markerService: IMarkerService; - private _telemetryService: ITelemetryService; constructor( domElement:HTMLElement, @@ -185,9 +176,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget { @IInstantiationService instantiationService: IInstantiationService, @IKeybindingService keybindingService: IKeybindingService, @IContextViewService contextViewService: IContextViewService, - @IEditorService editorService: IEditorService, - @IMarkerService markerService: IMarkerService, - @ITelemetryService telemetryService: ITelemetryService, @IEditorWorkerService editorWorkerService: IEditorWorkerService ) { if (keybindingService instanceof AbstractKeybindingService) { @@ -202,9 +190,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget { this._contextViewService = contextViewService; - this._markerService = markerService; - this._telemetryService = telemetryService; - this._toDispose2 = toDispose; this._contextViewService.setContainer(this._containerDomElement); @@ -219,10 +204,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget { this.dispose(); } - public getMarkerService():IMarkerService { - return this._markerService; - } - public addCommand(keybinding:number, handler:ICommandHandler, context:string): string { if (!this._standaloneKeybindingService) { console.warn('Cannot add command because the editor is configured with an unrecognized KeybindingService'); @@ -254,10 +235,6 @@ export class StandaloneDiffEditor extends DiffEditorWidget { }); } } - - public getTelemetryService():ITelemetryService { - return this._telemetryService; - } } export var startup = (function() { diff --git a/src/vs/editor/browser/standalone/standaloneEditor.ts b/src/vs/editor/browser/standalone/standaloneEditor.ts index defa97f2522..fddf853ee19 100644 --- a/src/vs/editor/browser/standalone/standaloneEditor.ts +++ b/src/vs/editor/browser/standalone/standaloneEditor.ts @@ -9,7 +9,7 @@ import 'vs/css!./media/standalone-tokens'; import * as editorCommon from 'vs/editor/common/editorCommon'; import {ContentWidgetPositionPreference, OverlayWidgetPositionPreference} from 'vs/editor/browser/editorBrowser'; import {ShallowCancelThenPromise} from 'vs/base/common/async'; -import {StandaloneEditor, StandaloneDiffEditor, startup, IEditorConstructionOptions, IDiffEditorConstructionOptions} from 'vs/editor/browser/standalone/standaloneCodeEditor'; +import {StandaloneEditor, IStandaloneCodeEditor, StandaloneDiffEditor, IStandaloneDiffEditor, startup, IEditorConstructionOptions, IDiffEditorConstructionOptions} from 'vs/editor/browser/standalone/standaloneCodeEditor'; import {ScrollbarVisibility} from 'vs/base/browser/ui/scrollbar/scrollableElementOptions'; import {IEditorOverrideServices, ensureDynamicPlatformServices, ensureStaticPlatformServices} from 'vs/editor/browser/standalone/standaloneServices'; import {IDisposable} from 'vs/base/common/lifecycle'; @@ -20,12 +20,12 @@ import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollect import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService'; import {IModel} from 'vs/editor/common/editorCommon'; import {IModelService} from 'vs/editor/common/services/modelService'; -import {ICodeEditor, IDiffEditor} from 'vs/editor/browser/editorBrowser'; import {Colorizer, IColorizerElementOptions, IColorizerOptions} from 'vs/editor/browser/standalone/colorizer'; import {SimpleEditorService} from 'vs/editor/browser/standalone/simpleServices'; import * as modes from 'vs/editor/common/modes'; import {EditorWorkerClient} from 'vs/editor/common/services/editorWorkerServiceImpl'; import {IMarkerData} from 'vs/platform/markers/common/markers'; +import {DiffNavigator} from 'vs/editor/contrib/diffNavigator/common/diffNavigator'; function shallowClone(obj:T): T { let r:T = {}; @@ -51,7 +51,7 @@ export function setupServices(services: IEditorOverrideServices): IEditorOverrid * `domElement` should be empty (not contain other dom nodes). * The editor will read the size of `domElement`. */ -export function create(domElement:HTMLElement, options:IEditorConstructionOptions, services:IEditorOverrideServices):ICodeEditor { +export function create(domElement:HTMLElement, options?:IEditorConstructionOptions, services?:IEditorOverrideServices):IStandaloneCodeEditor { startup.initStaticServicesIfNecessary(); services = shallowClone(services); @@ -76,7 +76,7 @@ export function create(domElement:HTMLElement, options:IEditorConstructionOption * `domElement` should be empty (not contain other dom nodes). * The editor will read the size of `domElement`. */ -export function createDiffEditor(domElement:HTMLElement, options:IDiffEditorConstructionOptions, services: IEditorOverrideServices):IDiffEditor { +export function createDiffEditor(domElement:HTMLElement, options?:IDiffEditorConstructionOptions, services?: IEditorOverrideServices):IStandaloneDiffEditor { startup.initStaticServicesIfNecessary(); services = shallowClone(services); @@ -96,6 +96,23 @@ export function createDiffEditor(domElement:HTMLElement, options:IDiffEditorCons return result; } +export interface IDiffNavigator { + canNavigate():boolean; + next():void; + previous():void; + dispose():void; +} + +export interface IDiffNavigatorOptions { + followsCaret?:boolean; + ignoreCharChanges?:boolean; + alwaysRevealFirst?:boolean; +} + +export function createDiffNavigator(diffEditor:IStandaloneDiffEditor, opts?:IDiffNavigatorOptions): IDiffNavigator { + return new DiffNavigator(diffEditor, opts); +} + function prepareServices(domElement: HTMLElement, services: IEditorOverrideServices): { ctx: IEditorOverrideServices; toDispose: IDisposable[]; } { services = ensureStaticPlatformServices(services); var toDispose = ensureDynamicPlatformServices(domElement, services); @@ -262,6 +279,7 @@ export interface MonacoWebWorker { export class MonacoWebWorkerImpl extends EditorWorkerClient implements MonacoWebWorker { private _foreignModuleId: string; + private _foreignModuleCreateData: any; private _foreignProxy: TPromise; /** @@ -270,13 +288,16 @@ export class MonacoWebWorkerImpl extends EditorWorkerClient implements Monaco constructor(modelService: IModelService, opts:IWebWorkerOptions) { super(modelService); this._foreignModuleId = opts.moduleId; + this._foreignModuleCreateData = opts.createData || null; this._foreignProxy = null; } private _getForeignProxy(): TPromise { if (!this._foreignProxy) { this._foreignProxy = new ShallowCancelThenPromise(this._getProxy().then((proxy) => { - return proxy.loadForeignModule(this._foreignModuleId).then((foreignMethods) => { + return proxy.loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData).then((foreignMethods) => { + this._foreignModuleId = null; + this._foreignModuleCreateData = null; let proxyMethodRequest = (method:string, args:any[]): TPromise => { return proxy.fmr(method, args); @@ -316,6 +337,10 @@ export interface IWebWorkerOptions { * It should export a function `create` that should return the exported proxy. */ moduleId: string; + /** + * The data to send over when calling create on the module. + */ + createData?: any; } /** @@ -363,6 +388,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor { // methods create: create, createDiffEditor: createDiffEditor, + createDiffNavigator: createDiffNavigator, createModel: createModel, setModelLanguage: setModelLanguage, diff --git a/src/vs/editor/browser/standalone/standaloneLanguages.ts b/src/vs/editor/browser/standalone/standaloneLanguages.ts index 2f833db0253..4ddedb0dc5b 100644 --- a/src/vs/editor/browser/standalone/standaloneLanguages.ts +++ b/src/vs/editor/browser/standalone/standaloneLanguages.ts @@ -396,7 +396,7 @@ class SuggestAdapter { let isSingleLine = (editRange.startLineNumber === editRange.endLineNumber); // invalid text edit - if (!isSingleLine || editRange.startColumn !== position.lineNumber) { + if (!isSingleLine || editRange.startLineNumber !== position.lineNumber) { console.warn('INVALID text edit, must be single line and on the same line'); continue; } diff --git a/src/vs/editor/browser/widget/media/tokens.css b/src/vs/editor/browser/widget/media/tokens.css index 5b41114bc3e..1daf7573d52 100644 --- a/src/vs/editor/browser/widget/media/tokens.css +++ b/src/vs/editor/browser/widget/media/tokens.css @@ -31,6 +31,13 @@ .monaco-editor.hc-black .token.error-token { color: #FF0000; } .monaco-editor.hc-black .token.debug-token { color: #b267e6; } + +/* ----- mimic text bundle support for themes ----- */ +.monaco-editor .markup.bold { font-weight: bold; } +.monaco-editor .markup.italic { font-style: italic; } +.monaco-editor .markup.underline { text-decoration: underline; } + + /* -------------------- Indent Guides -------------------- */ .monaco-editor .token.indent-guide { diff --git a/src/vs/editor/common/config/config.ts b/src/vs/editor/common/config/config.ts index 650fa4dfb6f..d4eee107698 100644 --- a/src/vs/editor/common/config/config.ts +++ b/src/vs/editor/common/config/config.ts @@ -231,10 +231,12 @@ registerCoreCommand(H.ScrollLineDown, { }); registerCoreCommand(H.ScrollPageUp, { - primary: KeyMod.CtrlCmd | KeyCode.PageUp + primary: KeyMod.CtrlCmd | KeyCode.PageUp, + win: { primary: KeyMod.Alt | KeyCode.PageUp } }); registerCoreCommand(H.ScrollPageDown, { - primary: KeyMod.CtrlCmd | KeyCode.PageDown + primary: KeyMod.CtrlCmd | KeyCode.PageDown, + win: { primary: KeyMod.Alt | KeyCode.PageDown } }); registerCoreCommand(H.CursorColumnSelectLeft, { diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 1f48f54d6dc..3bc6922b5a0 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -3711,6 +3711,7 @@ export interface IThemeDecorationRenderOptions { letterSpacing?: string; gutterIconPath?: string; + gutterIconSize?: string; overviewRulerColor?: string; diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 515911f0a27..f498798c0ff 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -216,12 +216,6 @@ export interface IMode { */ inplaceReplaceSupport?:IInplaceReplaceSupport; - /** - * Optional adapter to support output for a model (e.g. markdown -> html) - * @internal - */ - emitOutputSupport?:IEmitOutputSupport; - /** * Optional adapter to support configuring this mode. * @internal @@ -827,22 +821,6 @@ export interface IInplaceReplaceSupport { navigateValueSet(resource:URI, range:editorCommon.IRange, up:boolean):TPromise; } -/** - * Interface used to get output for a language that supports transformation (e.g. markdown -> html) - * @internal - */ -export interface IEmitOutputSupport { - getEmitOutput(resource:URI):TPromise; -} -/** - * @internal - */ -export interface IEmitOutput { - filename?:string; - content:string; -} - - /** * A link inside the editor. */ diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index cae1ddb7c52..eec9760163f 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -20,6 +20,15 @@ import {IRawModelData} from 'vs/editor/common/services/editorSimpleWorkerCommon' import {getWordAtText, ensureValidWordDefinition} from 'vs/editor/common/model/wordHelper'; import {createMonacoBaseAPI} from 'vs/editor/common/standalone/standaloneBase'; +export interface IMirrorModel { + uri: URI; + version: number; + getText(): string; +} + +/** + * @internal + */ export class MirrorModel extends MirrorModel2 { public get uri(): URI { @@ -134,6 +143,9 @@ export class MirrorModel extends MirrorModel2 { } } +/** + * @internal + */ export class EditorSimpleWorkerImpl implements IRequestHandler { _requestHandlerTrait: any; @@ -288,11 +300,11 @@ export class EditorSimpleWorkerImpl implements IRequestHandler { // ---- BEGIN foreign module support -------------------------------------------------------------------------- - public loadForeignModule(moduleId:string): TPromise { + public loadForeignModule(moduleId:string, createData:any): TPromise { return new TPromise((c, e) => { // Use the global require to be sure to get the global config (self).require([moduleId], (foreignModule) => { - this._foreignModule = foreignModule.create(); + this._foreignModule = foreignModule.create(createData); let methods: string[] = []; for (let prop in this._foreignModule) { @@ -325,8 +337,16 @@ export class EditorSimpleWorkerImpl implements IRequestHandler { const instance = new EditorSimpleWorkerImpl(); +/** + * Get all available mirror models in this worker. + */ +export function getMirrorModels(): IMirrorModel[] { + return instance.getModels(); +} + /** * Called on the worker side + * @internal */ export function create(): IRequestHandler { return instance; @@ -334,9 +354,7 @@ export function create(): IRequestHandler { function createMonacoWorkerAPI(): typeof monaco.worker { return { - get mirrorModels () { - return instance.getModels(); - } + getMirrorModels: getMirrorModels }; } diff --git a/src/vs/editor/contrib/carretOperations/common/carretOperations.ts b/src/vs/editor/contrib/carretOperations/common/carretOperations.ts new file mode 100644 index 00000000000..0dc6eca25d8 --- /dev/null +++ b/src/vs/editor/contrib/carretOperations/common/carretOperations.ts @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as nls from 'vs/nls'; +import {TPromise} from 'vs/base/common/winjs.base'; +import {EditorAction} from 'vs/editor/common/editorAction'; +import {ICommand, ICommonCodeEditor, IEditorActionDescriptorData} from 'vs/editor/common/editorCommon'; +import {CommonEditorRegistry, ContextKey, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions'; +import {MoveCarretCommand} from './moveCarretCommand'; + +class MoveCarretAction extends EditorAction { + + private left:boolean; + + constructor(descriptor:IEditorActionDescriptorData, editor:ICommonCodeEditor, left:boolean) { + super(descriptor, editor); + this.left = left; + } + + public run():TPromise { + + var commands:ICommand[] = []; + var selections = this.editor.getSelections(); + + for (var i = 0; i < selections.length; i++) { + commands.push(new MoveCarretCommand(selections[i], this.left)); + } + + this.editor.executeCommands(this.id, commands); + + return TPromise.as(true); + } +} + +class MoveCarretLeftAction extends MoveCarretAction { + static ID = 'editor.action.moveCarretLeftAction'; + + constructor(descriptor:IEditorActionDescriptorData, editor:ICommonCodeEditor) { + super(descriptor, editor, true); + } +} + +class MoveCarretRightAction extends MoveCarretAction { + static ID = 'editor.action.moveCarretRightAction'; + + constructor(descriptor:IEditorActionDescriptorData, editor:ICommonCodeEditor) { + super(descriptor, editor, false); + } +} + +CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(MoveCarretLeftAction, MoveCarretLeftAction.ID, nls.localize('carret.moveLeft', "Move Carret Left"), { + context: ContextKey.EditorTextFocus, + primary: 0 +}, 'Move Carret Left')); + +CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(MoveCarretRightAction, MoveCarretRightAction.ID, nls.localize('carret.moveRight', "Move Carret Right"), { + context: ContextKey.EditorTextFocus, + primary: 0 +}, 'Move Carret Right')); diff --git a/src/vs/editor/contrib/carretOperations/common/moveCarretCommand.ts b/src/vs/editor/contrib/carretOperations/common/moveCarretCommand.ts new file mode 100644 index 00000000000..05e5c5739e0 --- /dev/null +++ b/src/vs/editor/contrib/carretOperations/common/moveCarretCommand.ts @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import {Range} from 'vs/editor/common/core/range'; +import {Selection} from 'vs/editor/common/core/selection'; +import {ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel} from 'vs/editor/common/editorCommon'; + +export class MoveCarretCommand implements ICommand { + + private _selection: Selection; + private _isMovingLeft: boolean; + + private _cutStartIndex: number; + private _cutEndIndex: number; + private _moved: boolean; + + private _selectionId: string; + + constructor(selection: Selection, isMovingLeft: boolean) { + this._selection = selection; + this._isMovingLeft = isMovingLeft; + } + + public getEditOperations(model: ITokenizedModel, builder: IEditOperationBuilder): void { + var s = this._selection; + this._selectionId = builder.trackSelection(s); + if (s.startLineNumber !== s.endLineNumber) { + return; + } + if (this._isMovingLeft && s.startColumn === 0) { + return; + } else if (!this._isMovingLeft && s.endColumn === model.getLineMaxColumn(s.startLineNumber)) { + return; + } + + var lineNumber = s.selectionStartLineNumber; + var lineContent = model.getLineContent(lineNumber); + + var left; + var middle; + var right; + + if (this._isMovingLeft) { + left = lineContent.substring(0, s.startColumn - 2); + middle = lineContent.substring(s.startColumn - 1, s.endColumn - 1); + right = lineContent.substring(s.startColumn - 2, s.startColumn - 1) + lineContent.substring(s.endColumn - 1); + } else { + left = lineContent.substring(0, s.startColumn - 1) + lineContent.substring(s.endColumn - 1, s.endColumn); + middle = lineContent.substring(s.startColumn - 1, s.endColumn - 1); + right = lineContent.substring(s.endColumn); + } + + var newLineContent = left + middle + right; + + builder.addEditOperation(new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber)), null); + builder.addEditOperation(new Range(lineNumber, 1, lineNumber, 1), newLineContent); + + this._cutStartIndex = s.startColumn + (this._isMovingLeft ? -1 : 1); + this._cutEndIndex = this._cutStartIndex + s.endColumn - s.startColumn; + this._moved = true; + } + + public computeCursorState(model: ITokenizedModel, helper: ICursorStateComputerData): Selection { + var result = helper.getTrackedSelection(this._selectionId); + if (this._moved) { + result = result.setStartPosition(result.startLineNumber, this._cutStartIndex); + result = result.setEndPosition(result.startLineNumber, this._cutEndIndex); + } + return result; + } +} diff --git a/src/vs/editor/contrib/carretOperations/test/common/moveCarretCommand.test.ts b/src/vs/editor/contrib/carretOperations/test/common/moveCarretCommand.test.ts new file mode 100644 index 00000000000..999f3dc305e --- /dev/null +++ b/src/vs/editor/contrib/carretOperations/test/common/moveCarretCommand.test.ts @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import {Selection} from 'vs/editor/common/core/selection'; +import {MoveCarretCommand} from 'vs/editor/contrib/carretOperations/common/moveCarretCommand'; +import {testCommand} from 'vs/editor/test/common/commands/commandTestUtils'; + + +function testMoveCarretLeftCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + testCommand(lines, null, selection, (sel) => new MoveCarretCommand(sel, true), expectedLines, expectedSelection); +} + +function testMoveCarretRightCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + testCommand(lines, null, selection, (sel) => new MoveCarretCommand(sel, false), expectedLines, expectedSelection); +} + +suite('Editor Contrib - Move Carret Command', () => { + + test('move selection to left', function () { + testMoveCarretLeftCommand( + [ + '012345' + ], + new Selection(1, 3, 1, 5), + [ + '023145' + ], + new Selection(1, 2, 1, 4) + ); + }); + test('move selection to right', function () { + testMoveCarretRightCommand( + [ + '012345' + ], + new Selection(1, 3, 1, 5), + [ + '014235' + ], + new Selection(1, 4, 1, 6) + ); + }); + test('move selection to left - from first column - no change', function () { + testMoveCarretLeftCommand( + [ + '012345' + ], + new Selection(1, 1, 1, 1), + [ + '012345' + ], + new Selection(1, 1, 1, 1) + ); + }); + test('move selection to right - from last column - no change', function () { + testMoveCarretRightCommand( + [ + '012345' + ], + new Selection(1, 5, 1, 7), + [ + '012345' + ], + new Selection(1, 5, 1, 7) + ); + }); +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts index d43874e4507..012f011b6a0 100644 --- a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts @@ -8,7 +8,6 @@ import * as nls from 'vs/nls'; import {IAction} from 'vs/base/common/actions'; import {KeyCode, KeyMod, Keybinding} from 'vs/base/common/keyCodes'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; -import {SortedList} from 'vs/base/common/sortedList'; import {TPromise} from 'vs/base/common/winjs.base'; import * as dom from 'vs/base/browser/dom'; import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent'; @@ -124,47 +123,53 @@ class ContextMenuController implements IEditorContribution { } private _getMenuActions(): IAction[] { - var editorModel = this._editor.getModel(); + const editorModel = this._editor.getModel(); if (!editorModel) { return []; } - var allActions = this._editor.getActions(); - var contributedActions = allActions.filter((action)=>(typeof action.shouldShowInContextMenu === 'function') && action.shouldShowInContextMenu() && action.isSupported()); - - return this._prepareActions(contributedActions); - } - - private _prepareActions(actions:EditorAction[]):IAction[] { - var list = new SortedList>(); - - actions.forEach((action)=>{ - var groups = action.getGroupId().split('/'); - var actionsForGroup = list.getValue(groups[0]); - if (!actionsForGroup) { - actionsForGroup = new SortedList(); - list.add(groups[0], actionsForGroup); + const contributedActions = this._editor.getActions().filter(action => { + if (action instanceof EditorAction) { + return action.shouldShowInContextMenu() && action.isSupported(); } - - actionsForGroup.add(groups[1] || groups[0], action); }); - var sortedAndGroupedActions:IAction[] = []; - var groupIterator = list.getIterator(); - while(groupIterator.moveNext()) { - var group = groupIterator.current.value; - var actionsIterator = group.getIterator(); - while(actionsIterator.moveNext()) { - var action = actionsIterator.current.value; - sortedAndGroupedActions.push(action); - } + return ContextMenuController._prepareActions(contributedActions); + } - if (groupIterator.hasNext()) { - sortedAndGroupedActions.push(new Separator()); - } - } + private static _prepareActions(actions: EditorAction[]): IAction[] { - return sortedAndGroupedActions; + const data = actions.map(action => { + const groupId = action.getGroupId(); + const idx = groupId.indexOf('/'); + const group = idx > 0 + ? groupId.substr(0, idx) + : groupId; + + return { action, group }; + }); + + data.sort((a, b) => { + if (a.group < b.group) { + return -1; + } else if (a.group > b.group) { + return 1; + } else { + return 0; + } + }); + + const result: IAction[] = []; + let lastGroup: string; + data.forEach((value, idx) => { + if (lastGroup && lastGroup !== value.group) { + result.push(new Separator()); + } + result.push(value.action); + lastGroup = value.group; + }); + + return result; } private _doShowContextMenu(actions:IAction[], forcedPosition:IPosition = null): void { diff --git a/src/vs/editor/contrib/snippet/common/snippet.ts b/src/vs/editor/contrib/snippet/common/snippet.ts index b006e09fd06..a54a4465626 100644 --- a/src/vs/editor/contrib/snippet/common/snippet.ts +++ b/src/vs/editor/contrib/snippet/common/snippet.ts @@ -700,7 +700,7 @@ class InsertSnippetController { } export interface ISnippetController extends editorCommon.IEditorContribution { - run(snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number): void; + run(snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number, stripPrefix?:boolean): void; jumpToNextPlaceholder(): void; jumpToPrevPlaceholder(): void; acceptSnippet(): void; @@ -736,7 +736,7 @@ class SnippetController implements ISnippetController { return SnippetController.ID; } - public run(snippet:CodeSnippet, overwriteBefore:number, overwriteAfter:number): void { + public run(snippet:CodeSnippet, overwriteBefore:number, overwriteAfter:number, stripPrefix?:boolean): void { let prevController = this._currentController; this._currentController = null; @@ -744,7 +744,7 @@ class SnippetController implements ISnippetController { // No placeholders => execute for all editor selections this._runForAllSelections(snippet, overwriteBefore, overwriteAfter); } else { - this._runForPrimarySelection(snippet, overwriteBefore, overwriteAfter); + this._runForPrimarySelection(snippet, overwriteBefore, overwriteAfter, stripPrefix); } if (!this._currentController) { @@ -785,12 +785,12 @@ class SnippetController implements ISnippetController { } } - private _runForPrimarySelection(snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number): void { + private _runForPrimarySelection(snippet: CodeSnippet, overwriteBefore: number, overwriteAfter: number, stripPrefix?:boolean): void { let initialAlternativeVersionId = this._editor.getModel().getAlternativeVersionId(); let edits: editorCommon.IIdentifiedSingleEditOperation[] = []; - let prepared = SnippetController._prepareSnippet(this._editor, this._editor.getSelection(), snippet, overwriteBefore, overwriteAfter); + let prepared = SnippetController._prepareSnippet(this._editor, this._editor.getSelection(), snippet, overwriteBefore, overwriteAfter, stripPrefix); SnippetController._addCommandForSnippet(this._editor.getModel(), prepared.adaptedSnippet, prepared.typeRange, edits); if (edits.length > 0) { @@ -822,7 +822,7 @@ class SnippetController implements ISnippetController { } } - private static _prepareSnippet(editor:editorCommon.ICommonCodeEditor, selection:Selection, snippet:CodeSnippet, overwriteBefore:number, overwriteAfter:number): { typeRange: Range; adaptedSnippet: ICodeSnippet; } { + private static _prepareSnippet(editor:editorCommon.ICommonCodeEditor, selection:Selection, snippet:CodeSnippet, overwriteBefore:number, overwriteAfter:number, stripPrefix?:boolean): { typeRange: Range; adaptedSnippet: ICodeSnippet; } { var model = editor.getModel(); var typeRange = SnippetController._getTypeRangeForSelection(model, selection, overwriteBefore, overwriteAfter); @@ -831,7 +831,7 @@ class SnippetController implements ISnippetController { var nextInSnippet = snippet.lines[0].substr(overwriteBefore); var commonPrefix = strings.commonPrefixLength(nextTextOnLine, nextInSnippet); - if (commonPrefix > 0) { + if (commonPrefix > 0 && !stripPrefix === false) { typeRange = typeRange.setEndPosition(typeRange.endLineNumber, typeRange.endColumn + commonPrefix); } } diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 56481279c39..1ec4ae1e8b2 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -38,6 +38,8 @@ interface ISuggestionTemplateData { disposables: IDisposable[]; } +const colorRegExp = /^(#([\da-f]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))$/i; + class Renderer implements IRenderer { private triggerKeybindingLabel: string; @@ -99,12 +101,15 @@ class Renderer implements IRenderer { data.root.setAttribute('aria-label', nls.localize('suggestionAriaLabel', "{0}, suggestion", suggestion.label)); } - if (suggestion.type === 'customcolor') { - data.icon.className = 'icon customcolor'; - data.colorspan.style.backgroundColor = suggestion.label; - } else { - data.icon.className = 'icon ' + suggestion.type; - data.colorspan.style.backgroundColor = ''; + data.icon.className = 'icon ' + suggestion.type; + data.colorspan.style.backgroundColor = ''; + + if (suggestion.type === 'color') { + let color = suggestion.label.match(colorRegExp) && suggestion.label || suggestion.documentationLabel.match(colorRegExp) && suggestion.documentationLabel; + if (color) { + data.icon.className = 'icon customcolor'; + data.colorspan.style.backgroundColor = color; + } } data.highlightedLabel.set(suggestion.label, (element).highlights); diff --git a/src/vs/editor/editor.main.ts b/src/vs/editor/editor.main.ts index 4cbecc20aa5..dec570e5e22 100644 --- a/src/vs/editor/editor.main.ts +++ b/src/vs/editor/editor.main.ts @@ -12,6 +12,9 @@ import 'vs/editor/contrib/quickOpen/browser/quickCommand.contribution'; import 'vs/languages/languages.main'; import 'vs/languages/php/common/php.contribution'; import 'vs/languages/json/common/json.contribution'; +import 'vs/languages/less/common/less.contribution'; +import 'vs/languages/sass/common/sass.contribution'; +import 'vs/languages/css/common/css.contribution'; import {createMonacoBaseAPI} from 'vs/editor/common/standalone/standaloneBase'; import {createMonacoEditorAPI} from 'vs/editor/browser/standalone/standaloneEditor'; diff --git a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts new file mode 100644 index 00000000000..3d009c2647f --- /dev/null +++ b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as assert from 'assert'; +import * as dom from 'vs/base/browser/dom'; +import {CodeEditorServiceImpl} from 'vs/editor/browser/services/codeEditorServiceImpl'; +import {IDecorationRenderOptions} from 'vs/editor/common/editorCommon'; + +suite('Browser Services - EditorLayoutProvider', () => { + var options: IDecorationRenderOptions = { + gutterIconPath: 'https://github.com/Microsoft/vscode/blob/master/resources/linux/code.png', + gutterIconSize: 'contain', + backgroundColor: 'red', + borderColor: 'yellow' + }; + test('register and resolve decoration type', () => { + var s = new CodeEditorServiceImpl(); + s.registerDecorationType('example', options); + assert.notEqual(s.resolveDecorationOptions('example', false), undefined); + }); + test('remove decoration type', () => { + var s = new CodeEditorServiceImpl(); + s.registerDecorationType('example', options); + assert.notEqual(s.resolveDecorationOptions('example', false), undefined); + s.removeDecorationType('example'); + assert.throws(() => s.resolveDecorationOptions('example', false)); + }); + test('css properties', () => { + var styleSheet = dom.createStyleSheet(); + var s = new CodeEditorServiceImpl(styleSheet); + s.registerDecorationType('example', options); + var sheet = styleSheet.sheet.toString(); + assert(sheet.indexOf('background: url(\'https://github.com/Microsoft/vscode/blob/master/resources/linux/code.png\') center center no-repeat;') > 0); + assert(sheet.indexOf('background-size: contain;') > 0); + assert(sheet.indexOf('border-color: yellow;') > 0); + assert(sheet.indexOf('background-color: red;') > 0); + }); +}); diff --git a/src/vs/languages/buildfile.js b/src/vs/languages/buildfile.js index 50d3a57ac48..965a3b68c9f 100644 --- a/src/vs/languages/buildfile.js +++ b/src/vs/languages/buildfile.js @@ -65,11 +65,6 @@ exports.collectModules = function(args) { .combine(worker) .define('vs/languages/html/common/htmlWorker', ['vs/languages/lib/common/beautify-html']); - // ---- markdown ------------------------------- - common.define('vs/languages/markdown/common/markdown', ['vs/languages/html/common/html']) - .combine(worker) - .define('vs/languages/markdown/common/markdownWorker'); - // ---- php ----------------------------------- common.define('vs/languages/php/common/php'); diff --git a/src/vs/languages/html/common/htmlTags.ts b/src/vs/languages/html/common/htmlTags.ts index dad79617bdd..23f0b6e8c47 100644 --- a/src/vs/languages/html/common/htmlTags.ts +++ b/src/vs/languages/html/common/htmlTags.ts @@ -286,13 +286,13 @@ export const HTML_TAGS: ITagSet = { ['form', 'for']), input: new HTMLTagSpecification( nls.localize('tags.input', 'The input element represents a typed data field, usually with a form control to allow the user to edit the data.'), - ['accept', 'alt', 'autocomplete:o', 'autofocus:v', 'checked:v', 'dirname', 'disabled:v', 'form', 'formaction', 'formenctype:et', 'formmethod:fm', 'formnovalidate:v', 'formtarget', 'height', 'inputmode:im', 'list', 'max', 'maxlength', 'min', 'minlength', 'multiple:v', 'name', 'pattern', 'placeholder', 'readonly:v', 'required:v', 'size', 'src', 'step', 'type:t', 'value', 'width']), + ['accept', 'alt', 'autocomplete:inputautocomplete', 'autofocus:v', 'checked:v', 'dirname', 'disabled:v', 'form', 'formaction', 'formenctype:et', 'formmethod:fm', 'formnovalidate:v', 'formtarget', 'height', 'inputmode:im', 'list', 'max', 'maxlength', 'min', 'minlength', 'multiple:v', 'name', 'pattern', 'placeholder', 'readonly:v', 'required:v', 'size', 'src', 'step', 'type:t', 'value', 'width']), button: new HTMLTagSpecification( nls.localize('tags.button', 'The button element represents a button labeled by its contents.'), ['autofocus:v', 'disabled:v', 'form', 'formaction', 'formenctype:et', 'formmethod:fm', 'formnovalidate:v', 'formtarget', 'name', 'type:bt', 'value']), select: new HTMLTagSpecification( nls.localize('tags.select', 'The select element represents a control for selecting amongst a set of options.'), - ['autocomplete:o', 'autofocus:v', 'disabled:v', 'form', 'multiple:v', 'name', 'required:v', 'size']), + ['autocomplete:inputautocomplete', 'autofocus:v', 'disabled:v', 'form', 'multiple:v', 'name', 'required:v', 'size']), datalist: new HTMLTagSpecification( nls.localize('tags.datalist', 'The datalist element represents a set of option elements that represent predefined options for other controls. In the rendering, the datalist element represents nothing and it, along with its children, should be hidden.')), optgroup: new HTMLTagSpecification( @@ -303,7 +303,7 @@ export const HTML_TAGS: ITagSet = { ['disabled:v', 'label', 'selected:v', 'value']), textarea: new HTMLTagSpecification( nls.localize('tags.textarea', 'The textarea element represents a multiline plain text edit control for the element\'s raw value. The contents of the control represent the control\'s default value.'), - ['autocomplete:o', 'autofocus:v', 'cols', 'dirname', 'disabled:v', 'form', 'inputmode:im', 'maxlength', 'minlength', 'name', 'placeholder', 'readonly:v', 'required:v', 'rows', 'wrap:w']), + ['autocomplete:inputautocomplete', 'autofocus:v', 'cols', 'dirname', 'disabled:v', 'form', 'inputmode:im', 'maxlength', 'minlength', 'name', 'placeholder', 'readonly:v', 'required:v', 'rows', 'wrap:w']), output: new HTMLTagSpecification( nls.localize('tags.output', 'The output element represents the result of a calculation performed by the application, or the result of a user action.'), ['for', 'form', 'name']), @@ -452,6 +452,7 @@ export function getHTML5TagProvider(): IHTMLTagProvider { xo: ['anonymous', 'use-credentials'], sb: ['allow-forms', 'allow-modals', 'allow-pointer-lock', 'allow-popups', 'allow-popups-to-escape-sandbox', 'allow-same-origin', 'allow-scripts', 'allow-top-navigation'], tristate: ['true', 'false', 'mixed', 'undefined'], + inputautocomplete: ['additional-name', 'address-level1', 'address-level2', 'address-level3', 'address-level4', 'address-line1', 'address-line2', 'address-line3', 'bday', 'bday-year', 'bday-day', 'bday-month', 'billing', 'cc-additional-name', 'cc-csc', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-family-name', 'cc-given-name', 'cc-name', 'cc-number', 'cc-type', 'country', 'country-name', 'current-password', 'email', 'family-name', 'fax', 'given-name', 'home', 'honorific-prefix', 'honorific-suffix', 'impp', 'language', 'mobile', 'name', 'new-password', 'nickname', 'organization', 'organization-title', 'pager', 'photo', 'postal-code', 'sex', 'shipping', 'street-address', 'tel-area-code', 'tel', 'tel-country-code', 'tel-extension', 'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-national', 'transaction-amount', 'transaction-currency', 'url', 'username', 'work'], autocomplete: ['inline', 'list', 'both', 'none'], current: ['page', 'step', 'location', 'date', 'time', 'true', 'false'], dropeffect: ['copy', 'move', 'link', 'execute', 'popup', 'none'], diff --git a/src/vs/languages/languages.main.ts b/src/vs/languages/languages.main.ts index 11c18fe1adf..be15b628f86 100644 --- a/src/vs/languages/languages.main.ts +++ b/src/vs/languages/languages.main.ts @@ -8,8 +8,4 @@ import 'vs/languages/handlebars/common/handlebars.contribution'; import 'vs/languages/html/common/html.contribution'; -import 'vs/languages/markdown/common/markdown.contribution'; import 'vs/languages/razor/common/razor.contribution'; -//import 'vs/languages/less/common/less.contribution'; -//import 'vs/languages/sass/common/sass.contribution'; -//import 'vs/languages/css/common/css.contribution'; diff --git a/src/vs/languages/markdown/common/markdown.contribution.ts b/src/vs/languages/markdown/common/markdown.contribution.ts deleted file mode 100644 index f7b716c086a..00000000000 --- a/src/vs/languages/markdown/common/markdown.contribution.ts +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import nls = require('vs/nls'); -import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry'; -import ConfigurationRegistry = require('vs/platform/configuration/common/configurationRegistry'); -import Platform = require('vs/platform/platform'); - -ModesRegistry.registerCompatMode({ - id: 'markdown', - extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'], - aliases: ['Markdown', 'markdown'], - mimetypes: ['text/x-web-markdown'], - moduleId: 'vs/languages/markdown/common/markdown', - ctorName: 'MarkdownMode' -}); - -// Configuration -const configurationRegistry = Platform.Registry.as(ConfigurationRegistry.Extensions.Configuration); -configurationRegistry.registerConfiguration({ - 'id': 'markdown', - 'order': 20, - 'type': 'object', - 'title': nls.localize('markdownConfigurationTitle', "Markdown preview configuration"), - 'properties': { - 'markdown.styles': { - 'type': 'array', - 'description': nls.localize('styles', "A list of URLs or local paths to CSS style sheets to use from the markdown preview."), - 'items': { - 'type': 'string' - } - } - } -}); \ No newline at end of file diff --git a/src/vs/languages/markdown/common/markdown.ts b/src/vs/languages/markdown/common/markdown.ts deleted file mode 100644 index 08b22bbab2e..00000000000 --- a/src/vs/languages/markdown/common/markdown.ts +++ /dev/null @@ -1,268 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import WinJS = require('vs/base/common/winjs.base'); -import URI from 'vs/base/common/uri'; -import Types = require('vs/editor/common/modes/monarch/monarchTypes'); -import Compile = require('vs/editor/common/modes/monarch/monarchCompile'); -import Modes = require('vs/editor/common/modes'); -import MarkdownWorker = require('vs/languages/markdown/common/markdownWorker'); -import {OneWorkerAttr, AllWorkersAttr} from 'vs/platform/thread/common/threadService'; -import {htmlTokenTypes} from 'vs/languages/html/common/html'; -import markdownTokenTypes = require('vs/languages/markdown/common/markdownTokenTypes'); -import {IModeService} from 'vs/editor/common/services/modeService'; -import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; -import {IThreadService} from 'vs/platform/thread/common/thread'; -import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; -import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService'; -import {AbstractMode, ModeWorkerManager} from 'vs/editor/common/modes/abstractMode'; -import {createTokenizationSupport} from 'vs/editor/common/modes/monarch/monarchLexer'; -import {LanguageConfigurationRegistry, LanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry'; -import {wireCancellationToken} from 'vs/base/common/async'; - -export const language = - { - defaultToken: '', - tokenPostfix: '.md', - - // escape codes - control: /[\\`*_\[\]{}()#+\-\.!]/, - noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/, - escapes: /\\(?:@control)/, - - // escape codes for javascript/CSS strings - jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/, - - // non matched elements - empty: [ - 'area', 'base', 'basefont', 'br', 'col', 'frame', - 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param' - ], - - tokenizer: { - root: [ - - // headers (with #) - [/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ['white', markdownTokenTypes.TOKEN_HEADER_LEAD, markdownTokenTypes.TOKEN_HEADER, markdownTokenTypes.TOKEN_HEADER]], - - // headers (with =) - [/^\s*(=+|\-+)\s*$/, markdownTokenTypes.TOKEN_EXT_HEADER], - - // headers (with ***) - [/^\s*((\*[ ]?)+)\s*$/, markdownTokenTypes.TOKEN_SEPARATOR], - - // quote - [/^\s*>+/, markdownTokenTypes.TOKEN_QUOTE], - - // list (starting with * or number) - [/^\s*([\*\-+:]|\d+\.)\s/, markdownTokenTypes.TOKEN_LIST], - - // code block (4 spaces indent) - [/^(\t|[ ]{4})[^ ].*$/, markdownTokenTypes.TOKEN_BLOCK], - - // code block (3 tilde) - [/^\s*~{3}\s*((?:\w|[\/\-#])+)?\s*$/, { token: markdownTokenTypes.TOKEN_BLOCK, next: '@codeblock' }], - - // github style code blocks (with backticks and language) - [/^\s*```\s*((?:\w|[\/\-#])+)\s*$/, { token: markdownTokenTypes.TOKEN_BLOCK, next: '@codeblockgh', nextEmbedded: '$1' }], - - // github style code blocks (with backticks but no language) - [/^\s*`{3}\s*$/, { token: markdownTokenTypes.TOKEN_BLOCK, next: '@codeblock' }], - - // markup within lines - { include: '@linecontent' }, - ], - - codeblock: [ - [/^\s*~{3}\s*$/, { token: markdownTokenTypes.TOKEN_BLOCK, next: '@pop' }], - [/^\s*`{3}\s*$/, { token: markdownTokenTypes.TOKEN_BLOCK, next: '@pop' }], - [/.*$/, markdownTokenTypes.TOKEN_BLOCK_CODE], - ], - - // github style code blocks - codeblockgh: [ - [/```\s*$/, { token: '@rematch', switchTo: '@codeblockghend', nextEmbedded: '@pop' }], - [/[^`]*$/, markdownTokenTypes.TOKEN_BLOCK_CODE], - ], - - codeblockghend: [ - [/\s*```/, { token: markdownTokenTypes.TOKEN_BLOCK_CODE, next: '@pop' }], - [/./, '@rematch', '@pop'], - ], - - linecontent: [ - - // escapes - [/&\w+;/, 'string.escape'], - [/@escapes/, 'escape'], - - // various markup - [/\b__([^\\_]|@escapes|_(?!_))+__\b/, 'strong'], - [/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, 'strong'], - [/\b_[^_]+_\b/, 'emphasis'], - [/\*([^\\*]|@escapes)+\*/, 'emphasis'], - [/`([^\\`]|@escapes)+`/, 'variable'], - - // links - [/\{[^}]+\}/, 'string.target'], - [/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ['string.link', '', 'string.link']], - [/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, 'string.link'], - - // or html - { include: 'html' }, - ], - - // Note: it is tempting to rather switch to the real HTML mode instead of building our own here - // but currently there is a limitation in Monarch that prevents us from doing it: The opening - // '<' would start the HTML mode, however there is no way to jump 1 character back to let the - // HTML mode also tokenize the opening angle bracket. Thus, even though we could jump to HTML, - // we cannot correctly tokenize it in that mode yet. - html: [ - // html tags - [/<(\w+)\/>/, htmlTokenTypes.getTag('$1')], - [/<(\w+)/, { - cases: { - '@empty': { token: htmlTokenTypes.getTag('$1'), next: '@tag.$1' }, - '@default': { token: htmlTokenTypes.getTag('$1'), bracket: '@open', next: '@tag.$1' } - } - }], - [/<\/(\w+)\s*>/, { token: htmlTokenTypes.getTag('$1'), bracket: '@close' }], - - [//, 'comment', '@pop'], - [/',] - }, - brackets: [['{','}'], ['[',']'], ['(',')'], ['<','>']], - autoClosingPairs: [] - }; - - public emitOutputSupport: Modes.IEmitOutputSupport; - public configSupport:Modes.IConfigurationSupport; - public tokenizationSupport: Modes.ITokenizationSupport; - - private _modeWorkerManager: ModeWorkerManager; - private _threadService:IThreadService; - - constructor( - descriptor: Modes.IModeDescriptor, - @IInstantiationService instantiationService: IInstantiationService, - @IThreadService threadService: IThreadService, - @IModeService modeService: IModeService, - @IEditorWorkerService editorWorkerService: IEditorWorkerService, - @IConfigurationService configurationService: IConfigurationService - ) { - super(descriptor.id); - let lexer = Compile.compile(descriptor.id, language); - - this._modeWorkerManager = new ModeWorkerManager(descriptor, 'vs/languages/markdown/common/markdownWorker', 'MarkdownWorker', null, instantiationService); - this._threadService = threadService; - - this.emitOutputSupport = this; - this.configSupport = this; - - this.tokenizationSupport = createTokenizationSupport(modeService, this, lexer); - - LanguageConfigurationRegistry.register(this.getId(), MarkdownMode.LANG_CONFIG); - - Modes.SuggestRegistry.register(this.getId(), { - triggerCharacters: [], - shouldAutotriggerSuggest: false, - provideCompletionItems: (model, position, token) => { - return wireCancellationToken(token, editorWorkerService.textualSuggest(model.uri, position)); - } - }, true); - } - - private _worker(runner:(worker:MarkdownWorker.MarkdownWorker)=>WinJS.TPromise): WinJS.TPromise { - return this._modeWorkerManager.worker(runner); - } - - public configure(options:any): WinJS.TPromise { - if (this._threadService.isInMainThread) { - return this._configureWorkers(options); - } else { - return this._worker((w) => w._doConfigure(options)); - } - } - - static $_configureWorkers = AllWorkersAttr(MarkdownMode, MarkdownMode.prototype._configureWorkers); - private _configureWorkers(options:any): WinJS.TPromise { - return this._worker((w) => w._doConfigure(options)); - } - - static $getEmitOutput = OneWorkerAttr(MarkdownMode, MarkdownMode.prototype.getEmitOutput); - public getEmitOutput(resource: URI, absoluteWorkerResourcesPath?: string): WinJS.TPromise { // TODO@Ben technical debt: worker cannot resolve paths absolute - return this._worker((w) => w.getEmitOutput(resource, absoluteWorkerResourcesPath)); - } -} diff --git a/src/vs/languages/markdown/common/markdownTokenTypes.ts b/src/vs/languages/markdown/common/markdownTokenTypes.ts deleted file mode 100644 index 17d4882747f..00000000000 --- a/src/vs/languages/markdown/common/markdownTokenTypes.ts +++ /dev/null @@ -1,26 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -export const TOKEN_HEADER_LEAD = 'entity.name.tag'; -export const TOKEN_HEADER = 'entity.name.tag'; -export const TOKEN_EXT_HEADER = 'entity.other.attribute-name'; -export const TOKEN_SEPARATOR = 'meta.separator'; -export const TOKEN_QUOTE = 'comment'; -export const TOKEN_LIST = 'keyword'; -export const TOKEN_BLOCK = 'string'; -export const TOKEN_BLOCK_CODE = 'variable.source'; - -/* -// old settings -export const TOKEN_HEADER_LEAD = 'white'; -export const TOKEN_HEADER = 'keyword.1'; -export const TOKEN_EXT_HEADER = 'keyword.header'; -export const TOKEN_SEPARATOR = 'keyword.header'; -export const TOKEN_QUOTE = 'comment'; -export const TOKEN_LIST = 'string.list'; -export const TOKEN_BLOCK = 'variable'; -export const TOKEN_BLOCK_CODE = 'variable.code'; -*/ \ No newline at end of file diff --git a/src/vs/languages/markdown/common/markdownWorker.ts b/src/vs/languages/markdown/common/markdownWorker.ts deleted file mode 100644 index 4cea1b12af5..00000000000 --- a/src/vs/languages/markdown/common/markdownWorker.ts +++ /dev/null @@ -1,231 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import WinJS = require('vs/base/common/winjs.base'); -import URI from 'vs/base/common/uri'; -import Types = require('vs/base/common/types'); -import Modes = require('vs/editor/common/modes'); -import Paths = require('vs/base/common/paths'); -import Marked = require('vs/base/common/marked/marked'); -import {tokenizeToString} from 'vs/editor/common/modes/textToHtmlTokenizer'; -import {isMacintosh} from 'vs/base/common/platform'; -import {IModeService} from 'vs/editor/common/services/modeService'; -import {IResourceService} from 'vs/editor/common/services/resourceService'; -import {IMarkerService} from 'vs/platform/markers/common/markers'; - -enum Theme { - LIGHT, - DARK, - HC_BLACK -} - -export class MarkdownWorker { - - private static DEFAULT_MODE = 'text/plain'; - - private cssLinks: string[]; - private theme: Theme = Theme.DARK; - - // Custom Scrollbar CSS (inlined because of pseudo elements that cannot be made theme aware) - private static LIGHT_SCROLLBAR_CSS: string = [ - '' - ].join('\n'); - - private static DARK_SCROLLBAR_CSS: string = [ - '' - ].join('\n'); - - private static HC_BLACK_SCROLLBAR_CSS: string = [ - '' - ].join('\n'); - - private modeService: IModeService; - private resourceService:IResourceService; - private markerService: IMarkerService; - private _modeId: string; - - constructor( - modeId: string, - @IResourceService resourceService: IResourceService, - @IMarkerService markerService: IMarkerService, - @IModeService modeService: IModeService - ) { - this._modeId = modeId; - this.resourceService = resourceService; - this.markerService = markerService; - this.modeService = modeService; - } - - _doConfigure(options: any): WinJS.TPromise { - if (options && options.theme) { - this.theme = (options.theme === 'vs-dark') ? Theme.DARK : (options.theme === 'vs') ? Theme.LIGHT : Theme.HC_BLACK; - } - - if (options && Types.isArray(options.styles)) { - this.cssLinks = options.styles; - } - - return WinJS.TPromise.as(void 0); - } - - public getEmitOutput(resource: URI, absoluteWorkersResourcePath: string): WinJS.TPromise { // TODO@Ben technical debt: worker cannot resolve paths absolute - let model = this.resourceService.get(resource); - let cssLinks: string[] = this.cssLinks || []; - - // Custom Renderer to fix href in images - let renderer = new Marked.marked.Renderer(); - let $this = this; - renderer.image = function(href: string, title: string, text: string): string { - let out = '' + text + '' : '>'; - - return out; - }; - - // Custom Renderer to open links always in a new tab - let superRenderLink = renderer.link; - renderer.link = function(href: string, title: string, text: string): string { - let link = superRenderLink.call(this, href, title, text); - - // We cannot support local anchor tags because the iframe editor does not have a src set - if (href && href[0] === '#') { - link = link.replace('href=', 'localhref='); - } else { - link = link.replace(' void) { - - // Lookup the mode and use the tokenizer to get the HTML - let mimeForLang = modeService.getModeIdForLanguageName(lang) || lang || MarkdownWorker.DEFAULT_MODE; - modeService.getOrCreateMode(mimeForLang).then((mode) => { - callback(null, tokenizeToString(code, mode)); - }); - }; - - return new WinJS.Promise((c, e) => { - - // Render markdown file contents to HTML - Marked.marked(model.getValue(), { - gfm: true, // GitHub flavored markdown - renderer: renderer, - highlight: highlighter - }, (error: Error, htmlResult: string) => { - - // Compute head - let head = [ - '', - '', - '', - '', - (cssLinks.length === 0) ? '' : '', - (cssLinks.length === 0) ? '' : '', - (this.theme === Theme.LIGHT) ? MarkdownWorker.LIGHT_SCROLLBAR_CSS : (this.theme === Theme.DARK) ? MarkdownWorker.DARK_SCROLLBAR_CSS : MarkdownWorker.HC_BLACK_SCROLLBAR_CSS, - cssLinks.map((style) => { - return ''; - }).join('\n'), - '', - isMacintosh ? '' : '' - ].join('\n'); - - // Compute body - let body = [ - (this.theme === Theme.LIGHT) ? '
' : (this.theme === Theme.DARK) ? '
' : '
', - htmlResult, - '
', - ].join('\n'); - - // Tail - let tail = [ - '', - '' - ].join('\n'); - - c({ - head: head, - body: body, - tail: tail - }); - }); - }); - } - - private fixHref(resource: URI, href: string): string { - if (href) { - - // Return early if href is already a URL - if (URI.parse(href).scheme) { - return href; - } - - // Otherwise convert to a file URI by joining the href with the resource location - return URI.file(Paths.join(Paths.dirname(resource.fsPath), href)).toString(); - } - - return href; - } -} \ No newline at end of file diff --git a/src/vs/languages/markdown/common/tokens.css b/src/vs/languages/markdown/common/tokens.css deleted file mode 100644 index 8af0921fc9c..00000000000 --- a/src/vs/languages/markdown/common/tokens.css +++ /dev/null @@ -1,706 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/* -------------------------------- Begin vs tokens (copied from tokens.css) -------------------------------- */ - -.monaco-editor.vs .token { color: #000000; } -.monaco-editor.vs .token.whitespace { color: rgba(51, 51, 51, 0.2) !important; } -.monaco-editor.vs .token.terminal { color: #e00000; } -.monaco-editor.vs .token.terminal.code1 { font-weight: bold; } -.monaco-editor.vs .token.variable { color: #001188; } -.monaco-editor.vs .token.variable.predefined { color: #4864AA; } -.monaco-editor.vs .token.constant { color: #dd0000; } -.monaco-editor.vs .token.string { color: #A31515; } -.monaco-editor.vs .token.string.escape { color: #A31515; } -.monaco-editor.vs .token.comment { color: #008000; } -.monaco-editor.vs .token.comment.shebang { color: #929292; } -.monaco-editor.vs .token.literal { color: #000000; } -.monaco-editor.vs .token.literal.string { color: #A31515; } -.monaco-editor.vs .token.literal.hex { color: #e07000; } -.monaco-editor.vs .token.number { color: #09885A; } -.monaco-editor.vs .token.number.hex { color: #3030c0; } -.monaco-editor.vs .token.number.octal { color: #204070; } -.monaco-editor.vs .token.number.binary { color: #e07070; } -.monaco-editor.vs .token.regexp { color: #800000; } -.monaco-editor.vs .token.delimiter { color: #000000; } -.monaco-editor.vs .token.tag { color: #800000; } -.monaco-editor.vs .token.metatag { color: #e00000; } -.monaco-editor.vs .token.annotation { color: gray; } -.monaco-editor.vs .token.key { color: #863B00; } -.monaco-editor.vs .token.attribute.name { color: red; } -.monaco-editor.vs .token.attribute.value { color: #0451A5; } -.monaco-editor.vs .token.info-token { color: #316bcd; } -.monaco-editor.vs .token.warn-token { color: #cd9731; } -.monaco-editor.vs .token.error-token { color: #cd3131; } -.monaco-editor.vs .token.debug-token { color: purple; } -/* Keywords should come at the end in order to match cases like token.keyword.string */ -.monaco-editor.vs .token.keyword { color: #0000FF; } -.monaco-editor.vs .token.keyword.flow { color: #AF00DB; } - -/* PHP */ -.monaco-editor.vs .token.metatag.php { font-weight: bold; } - -/* Ruby */ -.monaco-editor.vs .token.predefined.ruby { color: #0000FF; } - -/* Markdown */ -.monaco-editor.vs .token.emphasis { font-style: italic;} -.monaco-editor.vs .token.strong { font-weight: bold; } -.monaco-editor.vs .token.header { color: navy ;} - -/* JSON */ -.monaco-editor.vs .token.string.key { color: #A31515; } -.monaco-editor.vs .token.string.value { color: #0451A5; } - -/* YAML */ -.monaco-editor.vs .token.string.yaml { color: #0451A5; } - -/* C# */ -.monaco-editor.vs .token.type { color: #008080; } -.monaco-editor.vs .token.identifier.method { color: #e07000; } - -/* SQL */ -.monaco-editor.vs .token.string.sql { color: #FF0000; } -.monaco-editor.vs .token.predefined.sql { color: #FF00FF; } -.monaco-editor.vs .token.operator.sql { color: #778899; } - -/* HTML */ -.monaco-editor.vs .token.delimiter.html { color: #383838; } -.monaco-editor.vs .token.metatag.content.html { color: red; } -.monaco-editor.vs .token.metatag.html { color: gray; } -.monaco-editor.vs .token.attribute.name.html { color: red; } -.monaco-editor.vs .token.attribute.value.html { color: blue; } - -.monaco-editor.vs .token.string.html { color: blue; } - -/* XML */ -.monaco-editor.vs .token.delimiter.xml { color: blue; } -.monaco-editor.vs .token.metatag.content.xml { color: red; } -.monaco-editor.vs .token.metatag.xml { color: gray; } -.monaco-editor.vs .token.attribute.name.xml { color: red; } -.monaco-editor.vs .token.attribute.value.xml { color: blue; } - -/* TypeScript */ -.monaco-editor.vs .token.entity.ts { color: black; } - -/* VSXML */ -.monaco-editor.vs .token.vs { color: #006400; } -.monaco-editor.vs .token.comment.vs { color: #aeb9ae; } -.monaco-editor.vs .token.tag.vs { color: #aeb9ae; } -.monaco-editor.vs .token.attribute.name.vs { color: #aeb9ae; } -.monaco-editor.vs .token.attribute.value.vs { color: #2c51cc; } -.monaco-editor.vs .token.delimiter.vs { color: #708870; } - -/* Jade */ -.monaco-editor.vs .token.tag.id.jade, -.monaco-editor.vs .token.tag.class.jade { color: #4F76AC; } -.monaco-editor.vs .token.interpolation.jade { color: magenta; } -.monaco-editor.vs .token.interpolation.delimiter.jade { color: magenta; } - - -/* -------------------------------- End vs tokens -------------------------------- */ - -/* -------------------------------- Begin vs-dark tokens -------------------------------- */ -.monaco-editor.vs-dark .token { color: #D4D4D4; } -.monaco-editor.vs-dark .token.whitespace { color: rgba(227, 228, 226, 0.16) !important; } -.monaco-editor.vs-dark .token.terminal { color: #BD5050; } -.monaco-editor.vs-dark .token.terminal.code1 { font-weight: bold; } -.monaco-editor.vs-dark .token.variable { color: #74B0DF; } -.monaco-editor.vs-dark .token.variable.predefined { color: #4864AA; } - -.monaco-editor.vs-dark .token.constant { color: #dd0000; } -.monaco-editor.vs-dark .token.string { color: #CE9178; } -.monaco-editor.vs-dark .token.string.escape { color: #CE9178; } -.monaco-editor.vs-dark .token.comment { color: #929292; } -.monaco-editor.vs-dark .token.comment.shebang { color: #929292; } -.monaco-editor.vs-dark .token.comment.doc { color: #608B4E; } -.monaco-editor.vs-dark .token.literal { color: #e00000; } -.monaco-editor.vs-dark .token.literal.hex { color: #e07000; } -.monaco-editor.vs-dark .token.number { color: #B5CEA8; } -.monaco-editor.vs-dark .token.number.hex { color: #5BB498; } -.monaco-editor.vs-dark .token.number.binary { color: #3030c0; } -.monaco-editor.vs-dark .token.number.octal { color: #204070; } -.monaco-editor.vs-dark .token.regexp { color: #B46695; } -.monaco-editor.vs-dark .token.delimiter { color: #DCDCDC; } -.monaco-editor.vs-dark .token.tag { color: #569CD6; } -.monaco-editor.vs-dark .token.metatag { color: #DD6A6F; } -.monaco-editor.vs-dark .token.annotation { color: #cc6666; } -.monaco-editor.vs-dark .token.key { color: #9CDCFE; } -.monaco-editor.vs-dark .token.attribute.name { color: #9CDCFE; } -.monaco-editor.vs-dark .token.attribute.value { color: #CE9178; } - -.monaco-editor.vs-dark .token.info-token { color: #6796e6; } -.monaco-editor.vs-dark .token.warn-token { color: #cd9731; } -.monaco-editor.vs-dark .token.error-token { color: #f44747; } -.monaco-editor.vs-dark .token.debug-token { color: #b267e6; } -/* Keywords should come at the end in order to match cases like token.keyword.string */ -.monaco-editor.vs-dark .token.keyword { color: #569CD6; } -.monaco-editor.vs-dark .token.keyword.flow { color: #C586C0; } -.monaco-editor.vs-dark .token.keyword.datatype { color: #569CD6; } - -/* PHP */ -.monaco-editor.vs-dark .token.metatag.php { font-weight: bold; } - -/* Ruby */ -.monaco-editor.vs-dark .token.predefined.ruby { color: #4E94CE; } - -/* Markdown */ -.monaco-editor.vs-dark .token.emphasis { font-style: italic;} -.monaco-editor.vs-dark .token.strong { font-weight: bold; } -.monaco-editor.vs-dark .token.header { color: navy ;} - - -/* JSON */ -.monaco-editor.vs-dark .token.string.key { color: #9CDCFE; } -.monaco-editor.vs-dark .token.string.value { color: #CE9178; } - -/* YAML */ -.monaco-editor.vs-dark .token.string.yaml { color: #CE9178; } - -/* C# */ -.monaco-editor.vs-dark .token.type { color: #3DC9B0; } -.monaco-editor.vs-dark .token.identifier.method { color: #e07000; } - -/* SQL */ -.monaco-editor.vs-dark .token.string.sql { color: #FF0000; } -.monaco-editor.vs-dark .token.predefined.sql { color: #FF00FF; } -.monaco-editor.vs-dark .token.operator.sql { color: #778899; } - - -/* HTML */ -.monaco-editor.vs-dark .token.delimiter.html { color: #808080; } -.monaco-editor.vs-dark .token.metatag.content.html { color: #9CDCFE; } -.monaco-editor.vs-dark .token.metatag.html { color: #569CD6; } - -.monaco-editor.vs-dark .token.string.html { color: #CE9178; } - -/* XML */ -.monaco-editor.vs-dark .token.delimiter.xml { color: #808080; } -.monaco-editor.vs-dark .token.metatag.content.xml { color: #9CDCFE; } -.monaco-editor.vs-dark .token.metatag.xml { color: #569CD6; } - -/* CSS */ -.monaco-editor.vs-dark .token.attribute.name.css { color: #9CDCFE; } -.monaco-editor.vs-dark .token.attribute.value.css { color: #C8C8C8; } -.monaco-editor.vs-dark .token.delimiter.css { color: #DCDCDC; } - -/* VSXML */ -.monaco-editor.vs-dark .token.vs { color: #608B4E; } -.monaco-editor.vs-dark .token.tag.vs { color: #949494; } -.monaco-editor.vs-dark .token.delimiter.vs { color: #585858; } -.monaco-editor.vs-dark .token.attribute.name.vs { color: #949494; } -.monaco-editor.vs-dark .token.attribute.value.vs { color: #C4C4C4; } - -/* Jade */ -.monaco-editor.vs-dark .token.tag.id.jade, -.monaco-editor.vs-dark .token.tag.class.jade { color: #4F76AC; } -.monaco-editor.vs-dark .token.interpolation.jade { color: magenta; } -.monaco-editor.vs-dark .token.interpolation.delimiter.jade { color: magenta; } - - -/* -------------------------------- End vs-dark tokens -------------------------------- */ - - -/* -------------------------------- Begin hc-black tokens -------------------------------- */ -.monaco-editor.hc-black .token { color: #FFFFFF; } -.monaco-editor.hc-black .token.whitespace { color: #FFFF00 !important; } -.monaco-editor.hc-black .token.terminal { color: #569CD6; } -.monaco-editor.hc-black .token.terminal.code1 { font-weight: bold; } - -.monaco-editor.hc-black .token.variable { color: #1AEBFF; } -.monaco-editor.hc-black .token.variable.predefined { color: #1AEBFF; } -.monaco-editor.hc-black .token.constant { color: #dd0000; } -.monaco-editor.hc-black .token.string { color: #CE9178; } -.monaco-editor.hc-black .token.string.escape { color: #CE9178; } -.monaco-editor.hc-black .token.comment { color: #008000; } -.monaco-editor.hc-black .token.comment.shebang { color: #929292; } -.monaco-editor.hc-black .token.comment.doc { color: #608B4E; } - -.monaco-editor.hc-black .token.literal { color: #FFFFFF; } -.monaco-editor.hc-black .token.literal.hex { color: #FFFFFF; } -.monaco-editor.hc-black .token.number { color: #FFFFFF; } -.monaco-editor.hc-black .token.number.hex { color: #FFFFFF; } -.monaco-editor.hc-black .token.number.octal { color: #FFFFFF; } -.monaco-editor.hc-black .token.number.binary { color: #FFFFFF; } -.monaco-editor.hc-black .token.regexp { color: #C0C0C0; } -.monaco-editor.hc-black .token.delimiter { color: #FFFF00; } -.monaco-editor.hc-black .token.tag { color: #569CD6; } -.monaco-editor.hc-black .token.metatag { color: #569CD6; } -.monaco-editor.hc-black .token.annotation { color: #569CD6; } -.monaco-editor.hc-black .token.key { color: #9CDCFE; } -.monaco-editor.hc-black .token.attribute.name { color: #569CD6; } -.monaco-editor.hc-black .token.attribute.value { color: #3FF23F; } -.monaco-editor.hc-black .token.info-token { color: #6796e6; } -.monaco-editor.hc-black .token.warn-token { color: #008000; } -.monaco-editor.hc-black .token.error-token { color: #FF0000; } -.monaco-editor.hc-black .token.debug-token { color: #b267e6; } - -/* Keywords should come at the end in order to match cases like token.keyword.string */ -.monaco-editor.hc-black .token.keyword { color: #1AEBFF; } -.monaco-editor.hc-black .token.keyword.flow { color: #C586C0; } -.monaco-editor.hc-black .token.keyword.datatype { color: #569CD6; } - -/* PHP */ -.monaco-editor.hc-black .token.metatag.php { font-weight: bold; } - -/* Ruby */ -.monaco-editor.hc-black .token.predefined.ruby { color: #4E94CE; } - -/* Markdown */ -.monaco-editor.hc-black .token.emphasis { font-style: italic;} -.monaco-editor.hc-black .token.strong { font-weight: bold; } -.monaco-editor.hc-black .token.header { color: navy ;} - - -/* JSON */ -.monaco-editor.hc-black .token.string.key { color: #9CDCFE; } -.monaco-editor.hc-black .token.string.value { color: #CE9178; } - -/* YAML */ -.monaco-editor.hc-black .token.string.yaml { color: #CE9178; } - -/* C# */ -.monaco-editor.hc-black .token.type { color: #3DC9B0; } -.monaco-editor.hc-black .token.identifier.method { color: #e07000; } - -/* SQL */ -.monaco-editor.hc-black .token.string.sql { color: #FF0000; } -.monaco-editor.hc-black .token.predefined.sql { color: #FF00FF; } -.monaco-editor.hc-black .token.operator.sql { color: #778899; } - - -/* HTML */ -.monaco-editor.hc-black .token.delimiter.html { color: #FFFF00; } -.monaco-editor.hc-black .token.metatag.content.html { color: #1AEBFF; } -.monaco-editor.hc-black .token.metatag.html { color: #569CD6; } - -.monaco-editor.hc-black .token.string.html { color: #CE9178; } - -/* XML */ -.monaco-editor.hc-black .token.delimiter.xml { color: #FFFF00; } -.monaco-editor.hc-black .token.metatag.content.xml { color: #1AEBFF; } -.monaco-editor.hc-black .token.metatag.xml { color: #569CD6; } - -/* CSS */ -.monaco-editor.hc-black .token.attribute.name.css { color: #569CD6; } -.monaco-editor.hc-black .token.attribute.value.css { color: #3FF23F; } -.monaco-editor.hc-black .token.delimiter.css { color: #FFFF00; } - -/* VSXML */ -.monaco-editor.hc-black .token.vs { color: #FFFFFF; } -.monaco-editor.hc-black .token.tag.vs { color: #949494; } -.monaco-editor.hc-black .token.delimiter.vs { color: #585858; } -.monaco-editor.hc-black .token.attribute.name.vs { color: #949494; } -.monaco-editor.hc-black .token.attribute.value.vs { color: #C4C4C4; } - -/* Jade */ -.monaco-editor.hc-black .token.tag.string.jade { color: #CE9178; } -.monaco-editor.hc-black .token.tag.id.jade, -.monaco-editor.hc-black .token.tag.class.jade { color: #4F76AC; } -.monaco-editor.hc-black .token.interpolation.jade { color: magenta; } -.monaco-editor.hc-black .token.interpolation.delimiter.jade { color: magenta; } - -/* -------------------------------- End hc-black tokens -------------------------------- */ - - -/*****************************************************************************************/ -/************************************ TextMate Scopes ************************************/ -/*****************************************************************************************/ - -/* Standard light theme tokens */ - -.monaco-editor.vs .token { color: #000000; } -.monaco-editor.vs .token.whitespace { color: rgba(51, 51, 51, 0.2) !important; } - -.monaco-editor.vs .token.builtin.function { color: #0000FF; } - -.monaco-editor.vs .token.comment, -.monaco-editor.vs .token.comment.block, -.monaco-editor.vs .token.comment.block.documentation, -.monaco-editor.vs .token.comment.line { color: #008000; } -/* -.monaco-editor.vs .token.comment.line.documentation -.monaco-editor.vs .token.comment.line.double-slash -.monaco-editor.vs .token.comment.line.double-dash -.monaco-editor.vs .token.comment.line.number-sign -.monaco-editor.vs .token.comment.line.percentage -.monaco-editor.vs .token.comment.line.character -*/ - -.monaco-editor.vs .token.constant { color: #dd0000; } -.monaco-editor.vs .token.constant.language { color: #0000FF; } -.monaco-editor.vs .token.constant.numeric { color: #09885A; } -.monaco-editor.vs .token.constant.numeric.hex { color: #3030c0; } -.monaco-editor.vs .token.constant.numeric.octal { color: #204070; } -.monaco-editor.vs .token.constant.numeric.binary { color: #e07070; } -.monaco-editor.vs .token.constant.regexp { color: #811f3f; } -.monaco-editor.vs .token.constant.rgb-value { color: #0451A5; } - -/*.monaco-editor.vs .token.constant.character -.monaco-editor.vs .token.constant.character.escape -.monaco-editor.vs .token.constant.language.boolean -.monaco-editor.vs .token.constant.language.null -.monaco-editor.vs .token.constant.other*/ - -/*.monaco-editor.vs .token.brace.paren -.monaco-editor.vs .token.brace.round -.monaco-editor.vs .token.brace.square -.monaco-editor.vs .token.brace.curly*/ - -.monaco-editor.vs .token.entity { color: #A31515; } -.monaco-editor.vs .token.entity.name { color: #800000; } -.monaco-editor.vs .token.entity.name.tag { color: #800000; } -.monaco-editor.vs .token.entity.name.function { color: #444444; } -.monaco-editor.vs .token.entity.name.class { color: #2B91AF; } -.monaco-editor.vs .token.entity.name.selector { color: #800000; } -.monaco-editor.vs .token.entity.other.selector { color: #800000; } -.monaco-editor.vs .token.entity.other.attribute-name { color: red; } -.monaco-editor.vs .token.entity.other.attribute-name.css { color: #800000; } - -/*.monaco-editor.vs .token.entity.name.type -.monaco-editor.vs .token.entity.name.tag -.monaco-editor.vs .token.entity.name.section -.monaco-editor.vs .token.entity.other -.monaco-editor.vs .token.entity.other.inherited-class -.monaco-editor.vs .token.entity.other.attribute-name*/ - -.monaco-editor.vs .token.annotation.storage.type, -.monaco-editor.vs .token.heritage.storage.type { color: #2B91AF; } -.monaco-editor.vs .token.invalid { color: #cd3131; } -/*.monaco-editor.vs .token.invalid.illegal -.monaco-editor.vs .token.invalid.deprecated*/ - -/*.monaco-editor.vs .token.markup*/ -.monaco-editor.vs .token.markup.underline { text-decoration: underline;} -/*.monaco-editor.vs .token.markup.underline.link*/ -.monaco-editor.vs .token.markup.bold { font-weight: bold; } -.monaco-editor.vs .token.markup.heading { color: navy ;} -.monaco-editor.vs .token.markup.italic { font-style: italic;} -/*.monaco-editor.vs .token.markup.list -.monaco-editor.vs .token.markup.list.numbered -.monaco-editor.vs .token.markup.list.unnumbered -.monaco-editor.vs .token.markup.quote -.monaco-editor.vs .token.markup.raw -.monaco-editor.vs .token.markup.other*/ - -.monaco-editor.vs .token.meta { color: #000000; } -.monaco-editor.vs .token.meta.selector { color: #800000; } -.monaco-editor.vs .token.meta.tag { color: #800000; } - -.monaco-editor.vs .token.storage { color: gray }; -.monaco-editor.vs .token.storage.content { color: red }; -.monaco-editor.vs .token.storage.type { color: #0000FF; } -.monaco-editor.vs .token.storage.modifier { color: #0000FF; } -.monaco-editor.vs .token.cast.storage.type, -.monaco-editor.vs .token.new.storage.type { color: #2B91AF; } -.monaco-editor.vs .token.var.storage.type { color: #0000FF; } -.monaco-editor.vs .token.var.annotation.storage.type { color: #2B91AF; } - -.monaco-editor.vs .token.string { color: #A31515; } -.monaco-editor.vs .token.string.tag { color: blue; } -/*.monaco-editor.vs .token.string.quoted -.monaco-editor.vs .token.string.quoted.single -.monaco-editor.vs .token.string.quoted.double -.monaco-editor.vs .token.string.quoted.triple -.monaco-editor.vs .token.string.quoted.other -.monaco-editor.vs .token.string.unquoted -.monaco-editor.vs .token.string.interpolated*/ -.monaco-editor.vs .token.string.quoted.variable { color: #001188; } -.monaco-editor.vs .token.string.regexp { color: #811f3f; } -/*.monaco-editor.vs .token.string.other*/ - -.monaco-editor.vs .token.support { color: #800000; } -.monaco-editor.vs .token.support.type { color: red; } -.monaco-editor.vs .token.support.type.json { color: #A31515; } -.monaco-editor.vs .token.support.property-value { color: #0451A5; } -/*.monaco-editor.vs .token.support.function -.monaco-editor.vs .token.support.class -.monaco-editor.vs .token.support.type -.monaco-editor.vs .token.support.constant -.monaco-editor.vs .token.support.variable -.monaco-editor.vs .token.support.other*/ - -.monaco-editor.vs .token.variable.parameter { color: #001188; } -/*.monaco-editor.vs .token.variable*/ -.monaco-editor.vs .token.variable.language { color: #4864AA; } -/*.monaco-editor.vs .token.variable.other*/ - -/* Keywords should come at the end in order to match cases like token.keyword.string */ -.monaco-editor.vs .token.keyword { color: #0000FF; } -.monaco-editor.vs .token.keyword.control { color: #0000FF; } -.monaco-editor.vs .token.keyword.operator { color: #666666; } -.monaco-editor.vs .token.keyword.operator.new { color: #0000FF; } -.monaco-editor.vs .token.keyword.other.unit { color: #09885A; } -/*.monaco-editor.vs .token.keyword.operator -.monaco-editor.vs .token.keyword.other*/ - -.monaco-editor.vs .token.punctuation { color: #000000; } -.monaco-editor.vs .token.punctuation.string { color: #A31515; } -.monaco-editor.vs .token.punctuation.string.quoted.variable { color: #001188; } -.monaco-editor.vs .token.punctuation.string.regexp { color: #811f3f; } -.monaco-editor.vs .token.punctuation.tag { color: #800000; } -.monaco-editor.vs .token.punctuation.string.tag { color: blue; } -/* -------------------------------- Begin vs-dark tokens -------------------------------- */ - -.monaco-editor.vs-dark .token { color: #D4D4D4; } -.monaco-editor.vs-dark .token.whitespace { color: rgba(227, 228, 226, 0.16) !important; } - -.monaco-editor.vs-dark .token.builtin.function { color: #569CD6; } - -.monaco-editor.vs-dark .token.comment, -.monaco-editor.vs-dark .token.comment.block, -.monaco-editor.vs-dark .token.comment.block.documentation, -.monaco-editor.vs-dark .token.comment.line { color: #608B4E; } -/*.monaco-editor.vs-dark .token.comment.line.double-slash -.monaco-editor.vs-dark .token.comment.line.double-dash -.monaco-editor.vs-dark .token.comment.line.number-sign -.monaco-editor.vs-dark .token.comment.line.percentage -.monaco-editor.vs-dark .token.comment.line.character*/ - -.monaco-editor.vs-dark .token.constant { color: #569CD6; } -.monaco-editor.vs-dark .token.constant.language { color: #569CD6; } -.monaco-editor.vs-dark .token.constant.numeric { color: #B5CEA8; } -.monaco-editor.vs-dark .token.constant.numeric.hex { color: #5BB498; } -.monaco-editor.vs-dark .token.constant.numeric.octal { color: #204070; } -.monaco-editor.vs-dark .token.constant.numeric.binary { color: #e07070; } -.monaco-editor.vs-dark .token.constant.regexp { color: #646695; } -.monaco-editor.vs-dark .token.constant.rgb-value { color: #D4D4D4; } -/*.monaco-editor.vs-dark .token.constant.character -.monaco-editor.vs-dark .token.constant.character.escape -.monaco-editor.vs-dark .token.constant.language.boolean -.monaco-editor.vs-dark .token.constant.language.null -.monaco-editor.vs-dark .token.constant.other*/ - -/*.monaco-editor.vs-dark .token.brace.paren -.monaco-editor.vs-dark .token.brace.round -.monaco-editor.vs-dark .token.brace.square -.monaco-editor.vs-dark .token.brace.curly*/ - -.monaco-editor.vs-dark .token.entity { color: #9CDCFE; } -.monaco-editor.vs-dark .token.entity.name { color: #569CD6; } -.monaco-editor.vs-dark .token.entity.name.tag { color: #569CD6; } -.monaco-editor.vs-dark .token.entity.name.function { color: #DCDCAA; } -.monaco-editor.vs-dark .token.entity.name.class { color: #4EC9B0; } -.monaco-editor.vs-dark .token.entity.name.selector { color: #569CD6; } - -.monaco-editor.vs-dark .token.entity.other.selector { color: #569CD6; } -.monaco-editor.vs-dark .token.entity.other.attribute-name { color: #9CDCFE; } -.monaco-editor.vs-dark .token.entity.other.attribute-name.css { color: #569CD6; } -/* -.monaco-editor.vs-dark .token.entity.name.type -.monaco-editor.vs-dark .token.entity.name.tag -.monaco-editor.vs-dark .token.entity.name.section -.monaco-editor.vs-dark .token.entity.other -.monaco-editor.vs-dark .token.entity.other.inherited-class -.monaco-editor.vs-dark .token.entity.other.attribute-name*/ - -.monaco-editor.vs-dark .token.invalid { color: #f44747; } -/*.monaco-editor.vs-dark .token.invalid.illegal -.monaco-editor.vs-dark .token.invalid.deprecated*/ - -/*.monaco-editor.vs-dark .token.markup*/ -.monaco-editor.vs-dark .token.markup.underline { text-decoration: underline;} -/*.monaco-editor.vs-dark .token.markup.underline.link*/ -.monaco-editor.vs-dark .token.markup.bold { font-weight: bold; } -.monaco-editor.vs-dark .token.markup.heading { color: #6796e6; } -.monaco-editor.vs-dark .token.markup.italic { font-style: italic;} -/*.monaco-editor.vs-dark .token.markup.list -.monaco-editor.vs-dark .token.markup.list.numbered -.monaco-editor.vs-dark .token.markup.list.unnumbered -.monaco-editor.vs-dark .token.markup.quote -.monaco-editor.vs-dark .token.markup.raw -.monaco-editor.vs-dark .token.markup.other*/ - -.monaco-editor.vs-dark .token.meta { color: #D4D4D4; } -.monaco-editor.vs-dark .token.meta.selector { color: #569CD6; } -.monaco-editor.vs-dark .token.meta.tag { color: #CE9178; } - -.monaco-editor.vs-dark .token.storage { color: #569CD6 }; -.monaco-editor.vs-dark .token.storage.content { color: #9CDCFE }; -.monaco-editor.vs-dark .token.storage.type { color: #569CD6; } -.monaco-editor.vs-dark .token.storage.modifier { color: #569CD6; } -.monaco-editor.vs-dark .token.annotation.storage.type, -.monaco-editor.vs-dark .token.heritage.storage.type, -.monaco-editor.vs-dark .token.cast.storage.type, -.monaco-editor.vs-dark .token.new.storage.type { color: #4EC9B0; } -.monaco-editor.vs-dark .token.var.storage.type { color: #569CD6; } -.monaco-editor.vs-dark .token.var.annotation.storage.type { color: #4EC9B0; } - -.monaco-editor.vs-dark .token.string { color: #CE9178; } -.monaco-editor.vs-dark .token.string.tag { color: #CE9178; } -/*.monaco-editor.vs-dark .token.string.quoted -.monaco-editor.vs-dark .token.string.quoted.single -.monaco-editor.vs-dark .token.string.quoted.double -.monaco-editor.vs-dark .token.string.quoted.triple -.monaco-editor.vs-dark .token.string.quoted.other -.monaco-editor.vs-dark .token.string.unquoted -.monaco-editor.vs-dark .token.string.interpolated*/ -.monaco-editor.vs-dark .token.string.quoted.variable { color: #74B0DF; } -.monaco-editor.vs-dark .token.string.regexp { color: #D16969; } -/*.monaco-editor.vs-dark .token.string.other*/ - -.monaco-editor.vs-dark .token.support { color: #A79873; } -.monaco-editor.vs-dark .token.support.type { color: #9CDCFE; } -.monaco-editor.vs-dark .token.support.property-value { color: #CE9178; } -/*.monaco-editor.vs-dark .token.support.function -.monaco-editor.vs-dark .token.support.class -.monaco-editor.vs-dark .token.support.constant -.monaco-editor.vs-dark .token.support.variable -.monaco-editor.vs-dark .token.support.other*/ - -.monaco-editor.vs-dark .token.variable.parameter { color: #9CDCFE; } -/*.monaco-editor.vs-dark .token.variable*/ -.monaco-editor.vs-dark .token.variable.language { color: #4864AA; } -/*.monaco-editor.vs-dark .token.variable.other*/ - -/* Keywords should come at the end in order to match cases like token.keyword.string */ -.monaco-editor.vs-dark .token.keyword { color: #569CD6; } -.monaco-editor.vs-dark .token.keyword.control { color: #569CD6; } -.monaco-editor.vs-dark .token.keyword.operator { color: #909090; } -.monaco-editor.vs-dark .token.keyword.operator.new { color: #569CD6; } -.monaco-editor.vs-dark .token.keyword.other.unit { color: #B5CEA8; } -/*.monaco-editor.vs-dark .token.keyword.operator -.monaco-editor.vs-dark .token.keyword.other*/ - -.monaco-editor.vs-dark .token.punctuation { color: #DCDCDC; } -.monaco-editor.vs-dark .token.punctuation.string { color: #CE9178; } -.monaco-editor.vs-dark .token.punctuation.string.quoted.variable { color: #74B0DF; } -.monaco-editor.vs-dark .token.punctuation.string.regexp { color: #D16969; } -.monaco-editor.vs-dark .token.punctuation.tag { color: #569CD6; } -.monaco-editor.vs-dark .token.punctuation.string.tag { color: #CE9178; } - -/* -------------------------------- End vs-dark tokens -------------------------------- */ - - -/* -------------------------------- Begin hc-black tokens ----------------------------- */ - -.monaco-editor.hc-black .token { color: #FFFFFF; } -.monaco-editor.hc-black .token.whitespace { color: rgba(227, 228, 226, 0.16) !important; } - -.monaco-editor.hc-black .token.builtin.function { color: #569CD6; } - -.monaco-editor.hc-black .token.comment, -.monaco-editor.hc-black .token.comment.block, -.monaco-editor.hc-black .token.comment.block.documentation, -.monaco-editor.hc-black .token.comment.line { color: #608B4E; } -/*.monaco-editor.hc-black .token.comment.line.double-slash -.monaco-editor.hc-black .token.comment.line.double-dash -.monaco-editor.hc-black .token.comment.line.number-sign -.monaco-editor.hc-black .token.comment.line.percentage -.monaco-editor.hc-black .token.comment.line.character*/ - -.monaco-editor.hc-black .token.constant { color: #569CD6; } -.monaco-editor.hc-black .token.constant.language { color: #569CD6; } -.monaco-editor.hc-black .token.constant.numeric { color: #B5CEA8; } -.monaco-editor.hc-black .token.constant.numeric.hex { color: #5BB498; } -.monaco-editor.hc-black .token.constant.numeric.octal { color: #204070; } -.monaco-editor.hc-black .token.constant.numeric.binary { color: #e07070; } -.monaco-editor.hc-black .token.constant.regexp { color: #B46695; } -.monaco-editor.hc-black .token.constant.rgb-value { color: #D4D4D4; } -/*.monaco-editor.hc-black .token.constant.character -.monaco-editor.hc-black .token.constant.character.escape -.monaco-editor.hc-black .token.constant.language.boolean -.monaco-editor.hc-black .token.constant.language.null -.monaco-editor.hc-black .token.constant.other*/ - -/*.monaco-editor.hc-black .token.brace.paren -.monaco-editor.hc-black .token.brace.round -.monaco-editor.hc-black .token.brace.square -.monaco-editor.hc-black .token.brace.curly*/ - -.monaco-editor.hc-black .token.entity { color: #9CDCFE; } -.monaco-editor.hc-black .token.entity.name { color: #569CD6; } -.monaco-editor.hc-black .token.entity.name.tag { color: #569CD6; } -.monaco-editor.hc-black .token.entity.name.function { color: #DCDCAA; } -.monaco-editor.hc-black .token.entity.name.class { color: #4EC9B0; } -.monaco-editor.hc-black .token.entity.name.selector { color: #569CD6; } -.monaco-editor.hc-black .token.entity.other.selector { color: #569CD6; } -.monaco-editor.hc-black .token.entity.other.attribute-name { color: #9CDCFE; } -.monaco-editor.hc-black .token.entity.other.attribute-name.css { color: #569CD6; } -/* -.monaco-editor.hc-black .token.entity.name.type -.monaco-editor.hc-black .token.entity.name.tag -.monaco-editor.hc-black .token.entity.name.section -.monaco-editor.hc-black .token.entity.other -.monaco-editor.hc-black .token.entity.other.inherited-class -.monaco-editor.hc-black .token.entity.other.attribute-name*/ - -.monaco-editor.hc-black .token.invalid { color: #f44747; } -/*.monaco-editor.hc-black .token.invalid.illegal -.monaco-editor.hc-black .token.invalid.deprecated*/ - -/*.monaco-editor.hc-black .token.markup*/ -.monaco-editor.hc-black .token.markup.underline { text-decoration: underline;} -/*.monaco-editor.hc-black .token.markup.underline.link*/ -.monaco-editor.hc-black .token.markup.bold { font-weight: bold; } -.monaco-editor.hc-black .token.markup.heading { color: #6796e6; } -.monaco-editor.hc-black .token.markup.italic { font-style: italic;} -/*.monaco-editor.hc-black .token.markup.list -.monaco-editor.hc-black .token.markup.list.numbered -.monaco-editor.hc-black .token.markup.list.unnumbered -.monaco-editor.hc-black .token.markup.quote -.monaco-editor.hc-black .token.markup.raw -.monaco-editor.hc-black .token.markup.other*/ - -.monaco-editor.hc-black .token.meta { color: #D4D4D4; } -.monaco-editor.hc-black .token.meta.selector { color: #569CD6; } -.monaco-editor.hc-black .token.meta.tag { color: #CE9178; } - -.monaco-editor.hc-black .token.storage { color: #569CD6 }; -.monaco-editor.hc-black .token.storage.content { color: #9CDCFE }; -.monaco-editor.hc-black .token.storage.type { color: #569CD6; } -.monaco-editor.hc-black .token.storage.modifier { color: #569CD6; } -.monaco-editor.hc-black .token.annotation.storage.type, -.monaco-editor.hc-black .token.heritage.storage.type, -.monaco-editor.hc-black .token.cast.storage.type, -.monaco-editor.hc-black .token.new.storage.type { color: #4EC9B0; } -.monaco-editor.hc-black .token.var.storage.type { color: #569CD6; } -.monaco-editor.hc-black .token.var.annotation.storage.type { color: #4EC9B0; } - -.monaco-editor.hc-black .token.string { color: #CE9178; } -.monaco-editor.hc-black .token.string.tag { color: #CE9178; } -/*.monaco-editor.hc-black .token.string.quoted -.monaco-editor.hc-black .token.string.quoted.single -.monaco-editor.hc-black .token.string.quoted.double -.monaco-editor.hc-black .token.string.quoted.triple -.monaco-editor.hc-black .token.string.quoted.other -.monaco-editor.hc-black .token.string.unquoted -.monaco-editor.hc-black .token.string.interpolated*/ -.monaco-editor.hc-black .token.string.quoted.variable { color: #74B0DF; } -.monaco-editor.hc-black .token.string.regexp { color: #D16969; } -/*.monaco-editor.hc-black .token.string.other*/ - -.monaco-editor.hc-black .token.support { color: #800000; } -.monaco-editor.hc-black .token.support.type { color: #9CDCFE; } -.monaco-editor.hc-black .token.support.property-value { color: #CE9178; } -/*.monaco-editor.hc-black .token.support.function -.monaco-editor.hc-black .token.support.class -.monaco-editor.hc-black .token.support.constant -.monaco-editor.hc-black .token.support.variable -.monaco-editor.hc-black .token.support.other*/ - -.monaco-editor.hc-black .token.variable.parameter { color: #9CDCFE; } -/*.monaco-editor.hc-black .token.variable*/ -.monaco-editor.hc-black .token.variable.language { color: #4864AA; } -/*.monaco-editor.hc-black .token.variable.other*/ - - -/* Keywords should come at the end in order to match cases like token.keyword.string */ -.monaco-editor.hc-black .token.keyword { color: #569CD6; } -.monaco-editor.hc-black .token.keyword.control { color: #569CD6; } -.monaco-editor.hc-black .token.keyword.operator { color: #909090; } -.monaco-editor.hc-black .token.keyword.operator.new { color: #569CD6; } -.monaco-editor.hc-black .token.keyword.other.unit { color: #B5CEA8; } -/*.monaco-editor.hc-black .token.keyword.operator -.monaco-editor.hc-black .token.keyword.other*/ - -.monaco-editor.hc-black .token.punctuation { color: #DCDCDC; } -.monaco-editor.hc-black .token.punctuation.string { color: #CE9178; } -.monaco-editor.hc-black .token.punctuation.string.quoted.variable { color: #74B0DF; } -.monaco-editor.hc-black .token.punctuation.string.regexp { color: #D16969; } -.monaco-editor.hc-black .token.punctuation.tag { color: #569CD6; } -.monaco-editor.hc-black .token.punctuation.string.tag { color: #CE9178; } - -/* -------------------------------- End hc-black tokens ----------------------------- */ \ No newline at end of file diff --git a/src/vs/languages/markdown/test/common/markdown.test.ts b/src/vs/languages/markdown/test/common/markdown.test.ts deleted file mode 100644 index e46e0d5b747..00000000000 --- a/src/vs/languages/markdown/test/common/markdown.test.ts +++ /dev/null @@ -1,116 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import modesUtil = require('vs/editor/test/common/modesUtil'); -import Modes = require('vs/editor/common/modes'); -import {htmlTokenTypes} from 'vs/languages/html/common/html'; -import {MockModeService} from 'vs/editor/test/common/mocks/mockModeService'; -import {NULL_THREAD_SERVICE} from 'vs/platform/test/common/nullThreadService'; -import {IThreadService} from 'vs/platform/thread/common/thread'; -import {IModeService} from 'vs/editor/common/services/modeService'; -import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; -import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService'; -import {MarkdownMode} from 'vs/languages/markdown/common/markdown'; -import {MockTokenizingMode} from 'vs/editor/test/common/mocks/mockMode'; - -class MarkdownMockModeService extends MockModeService { - isRegisteredMode(mimetypeOrModeId: string): boolean { - if (mimetypeOrModeId === 'javascript') { - return true; - } - if (mimetypeOrModeId === 'css') { - return true; - } - throw new Error('Not implemented'); - } - - getMode(commaSeparatedMimetypesOrCommaSeparatedIds: string): Modes.IMode { - if (commaSeparatedMimetypesOrCommaSeparatedIds === 'javascript') { - return new MockTokenizingMode('js', 'mock-js'); - } - if (commaSeparatedMimetypesOrCommaSeparatedIds === 'css') { - return new MockTokenizingMode('css', 'mock-css'); - } - throw new Error('Not implemented'); - } - - getModeIdForLanguageName(alias:string): string { - if (alias === 'text/javascript') { - return 'javascript'; - } - if (alias === 'text/css') { - return 'css'; - } - console.log(alias); - throw new Error('Not implemented'); - } -} - -suite('Markdown - tokenization', () => { - - var tokenizationSupport: Modes.ITokenizationSupport; - - (function() { - let threadService = NULL_THREAD_SERVICE; - let modeService = new MarkdownMockModeService(); - let services = new ServiceCollection(); - services.set(IThreadService, threadService); - services.set(IModeService, modeService); - let inst = new InstantiationService(services); - threadService.setInstantiationService(inst); - - let mode = new MarkdownMode( - { id: 'markdown' }, - inst, - threadService, - modeService, - null, - null - ); - - tokenizationSupport = mode.tokenizationSupport; - - })(); - - test('', () => { - modesUtil.executeTests(tokenizationSupport, [ - // HTML and embedded content - bug 16912 - [{ - line: 'foo*bar*', - tokens: [ - { startIndex:0, type: htmlTokenTypes.getTag('b.md') }, - { startIndex:3, type: '' }, - { startIndex:6, type: htmlTokenTypes.getTag('b.md') }, - { startIndex:10, type: 'emphasis.md' } - ]}], - - [{ - line: '*bar*', - tokens: [ - { startIndex:0, type: htmlTokenTypes.getTag('b.md') }, - { startIndex:4, type: 'emphasis.md' } - ]}], - - [{ - line: '*bar*', - tokens: [ - { startIndex:0, type: htmlTokenTypes.getTag('script.md') }, - { startIndex:8, type: 'mock-js' }, - { startIndex:20, type: htmlTokenTypes.getTag('script.md') }, - { startIndex:29, type: 'emphasis.md' } - ]}], - - [{ - line: '*bar*', - tokens: [ - { startIndex:0, type: htmlTokenTypes.getTag('style.md') }, - { startIndex:7, type: 'mock-css' }, - { startIndex:30, type: htmlTokenTypes.getTag('style.md') }, - { startIndex:38, type: 'emphasis.md' } - ]}] - ]); - }); -}); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index fcaec8601cd..7fa814ce385 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -752,14 +752,29 @@ declare module monaco.editor { * `domElement` should be empty (not contain other dom nodes). * The editor will read the size of `domElement`. */ - export function create(domElement: HTMLElement, options: IEditorConstructionOptions, services: IEditorOverrideServices): ICodeEditor; + export function create(domElement: HTMLElement, options?: IEditorConstructionOptions, services?: IEditorOverrideServices): IStandaloneCodeEditor; /** * Create a new diff editor under `domElement`. * `domElement` should be empty (not contain other dom nodes). * The editor will read the size of `domElement`. */ - export function createDiffEditor(domElement: HTMLElement, options: IDiffEditorConstructionOptions, services: IEditorOverrideServices): IDiffEditor; + export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorConstructionOptions, services?: IEditorOverrideServices): IStandaloneDiffEditor; + + export interface IDiffNavigator { + canNavigate(): boolean; + next(): void; + previous(): void; + dispose(): void; + } + + export interface IDiffNavigatorOptions { + followsCaret?: boolean; + ignoreCharChanges?: boolean; + alwaysRevealFirst?: boolean; + } + + export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator; /** * Create a new editor model. @@ -830,6 +845,10 @@ declare module monaco.editor { * It should export a function `create` that should return the exported proxy. */ moduleId: string; + /** + * The data to send over when calling create on the module. + */ + createData?: any; } /** @@ -875,6 +894,26 @@ declare module monaco.editor { export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { } + export interface IStandaloneCodeEditor extends ICodeEditor { + addCommand(keybinding: number, handler: ICommandHandler, context: string): string; + createContextKey(key: string, defaultValue: T): IKeybindingContextKey; + addAction(descriptor: IActionDescriptor): void; + } + + export interface IStandaloneDiffEditor extends IDiffEditor { + addCommand(keybinding: number, handler: ICommandHandler, context: string): string; + createContextKey(key: string, defaultValue: T): IKeybindingContextKey; + addAction(descriptor: IActionDescriptor): void; + } + export interface ICommandHandler { + (...args: any[]): void; + } + + export interface IKeybindingContextKey { + set(value: T): void; + reset(): void; + } + export interface IEditorOverrideServices { } @@ -4669,12 +4708,16 @@ declare module monaco.languages { declare module monaco.worker { + export interface IMirrorModel { uri: Uri; version: number; getText(): string; } - export var mirrorModels: IMirrorModel[]; + /** + * Get all available mirror models in this worker. + */ + export function getMirrorModels(): IMirrorModel[]; } \ No newline at end of file diff --git a/src/vs/platform/actions/common/actionsService.ts b/src/vs/platform/actions/common/actionsService.ts deleted file mode 100644 index 8ab9fea5567..00000000000 --- a/src/vs/platform/actions/common/actionsService.ts +++ /dev/null @@ -1,140 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import {localize} from 'vs/nls'; -import {Action, IAction} from 'vs/base/common/actions'; -import {IJSONSchema} from 'vs/base/common/jsonSchema'; -import {IExtensionService} from 'vs/platform/extensions/common/extensions'; -import {IExtensionMessageCollector, ExtensionsRegistry} from 'vs/platform/extensions/common/extensionsRegistry'; -import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; -import {IActionsService} from './actions'; - -interface Commands { - commands: Command | Command[]; -} - -interface Command { - command: string; - title: string; - category?: string; -} - -function isCommands(thing: Command | Command[]): thing is Command[] { - return Array.isArray(thing); -} - -function isValidCommand(candidate: Command, rejects: string[]): boolean { - if (!candidate) { - rejects.push(localize('nonempty', "expected non-empty value.")); - return false; - } - if (typeof candidate.command !== 'string') { - rejects.push(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'command')); - return false; - } - if (typeof candidate.title !== 'string') { - rejects.push(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'title')); - return false; - } - if (candidate.category && typeof candidate.category !== 'string') { - rejects.push(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'category')); - return false; - } - return true; -} - -let commandType: IJSONSchema = { - type: 'object', - properties: { - command: { - description: localize('vscode.extension.contributes.commandType.command', 'Identifier of the command to execute'), - type: 'string' - }, - title: { - description: localize('vscode.extension.contributes.commandType.title', 'Title by which the command is represented in the UI.'), - type: 'string' - }, - category: { - description: localize('vscode.extension.contributes.commandType.category', '(Optional) category string by the command is grouped in the UI'), - type: 'string' - } - } -}; -let commandsExtPoint = ExtensionsRegistry.registerExtensionPoint('commands', { - description: localize('vscode.extension.contributes.commands', "Contributes commands to the command palette."), - oneOf: [ - commandType, - { - type: 'array', - items: commandType - } - ] -}); - -export default class ActionsService implements IActionsService { - - private _extensionService: IExtensionService; - private _keybindingsService: IKeybindingService; - private _extensionsActions: IAction[] = []; - - serviceId: any; - - constructor( - @IExtensionService extensionService: IExtensionService, - @IKeybindingService keybindingsService: IKeybindingService - ) { - this._extensionService = extensionService; - this._keybindingsService = keybindingsService; - commandsExtPoint.setHandler((extensions) => { - for (let d of extensions) { - this._onDescription(d.value, d.collector); - } - }); - } - - private _onDescription(commands: Command | Command[], collector: IExtensionMessageCollector): void { - if (isCommands(commands)) { - for (let command of commands) { - this._handleCommand(command, collector); - } - } else { - this._handleCommand(commands, collector); - } - } - - private _handleCommand(command: Command, collector: IExtensionMessageCollector): void { - - let rejects: string[] = []; - - if (isValidCommand(command, rejects)) { - // make sure this extension is activated by this command - let activationEvent = `onCommand:${command.command}`; - - // action that (1) activates the extension and dispatches the command - let label = command.category ? localize('category.label', "{0}: {1}", command.category, command.title) : command.title; - let action = new Action(command.command, label, undefined, true, () => { - return this._extensionService.activateByEvent(activationEvent).then(() => { - return this._keybindingsService.executeCommand(command.command); - }); - }); - this._extensionsActions.push(action); - } - - if (rejects.length > 0) { - collector.error(localize( - 'error', - "Invalid `contributes.{0}`: {1}", - commandsExtPoint.name, - rejects.join('\n') - )); - } - - } - - getActions(): IAction[] { - return this._extensionsActions.slice(0); - } -} diff --git a/src/vs/platform/actions/common/commandsExtensionPoint.ts b/src/vs/platform/actions/common/commandsExtensionPoint.ts new file mode 100644 index 00000000000..b10db1143d0 --- /dev/null +++ b/src/vs/platform/actions/common/commandsExtensionPoint.ts @@ -0,0 +1,257 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import {localize} from 'vs/nls'; +import {Action} from 'vs/base/common/actions'; +import {join} from 'vs/base/common/paths'; +import {IJSONSchema} from 'vs/base/common/jsonSchema'; +import {IExtensionService} from 'vs/platform/extensions/common/extensions'; +import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; +import {IExtensionPointUser, ExtensionsRegistry} from 'vs/platform/extensions/common/extensionsRegistry'; + +export interface ResourceFilter { + language?: string; + scheme?: string; + pattern?: string; +} + +export type Locations = 'editor/primary' | 'editor/secondary' | 'explorer/context'; + +export interface ThemableIcon { + dark: string; + light: string; +} + +export interface Command { + command: string; + title: string; + category?: string; + where?: Locations | Locations[]; + when?: string | string[] | ResourceFilter | ResourceFilter[]; + icon?: string | ThemableIcon; +} + +export function isThemableIcon(thing: any): thing is ThemableIcon { + return typeof thing === 'object' && thing && typeof (thing).dark === 'string' && typeof (thing).light === 'string'; +} + + +namespace validation { + + function isValidWhere(where: Locations | Locations[], user: IExtensionPointUser): boolean { + if (Array.isArray(where)) { + return where.every(where => isValidWhere(where, user)); + } else if (['editor/primary', 'editor/secondary', 'explorer/context'].indexOf(where) < 0) { + user.collector.error(localize('optwhere', "property `where` can be omitted or must be a valid enum value")); + return false; + } + return true; + } + + function isValidWhen(when: string | string[] | ResourceFilter | ResourceFilter[], user: IExtensionPointUser): boolean { + if (Array.isArray(when)) { + for (let w of when) { + if (!isValidWhen(w, user)) { + return false; + } + } + } else if (typeof when === 'string' || typeof when === 'object') { + return true; + } + user.collector.error(localize('requirefilter', "property `when` is mandatory and must be a string or like `{language, scheme, pattern}`")); + return false; + } + + function isValidIcon(icon: string | ThemableIcon, user: IExtensionPointUser): boolean { + if (typeof icon === 'undefined') { + return true; + } + if (typeof icon === 'string') { + return true; + } + if (typeof icon === 'object' && typeof (icon).dark === 'string' && typeof (icon).light === 'string') { + return true; + } + user.collector.error(localize('opticon', "property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")); + return false; + } + + export function isValidCommand(candidate: Command, user: IExtensionPointUser): boolean { + if (!candidate) { + user.collector.error(localize('nonempty', "expected non-empty value.")); + return false; + } + if (typeof candidate.command !== 'string') { + user.collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'command')); + return false; + } + if (typeof candidate.title !== 'string') { + user.collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'title')); + return false; + } + if (candidate.category && typeof candidate.category !== 'string') { + user.collector.error(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'category')); + return false; + } + if (!isValidIcon(candidate.icon, user)) { + return false; + } + + // make icon paths absolute + let {icon} = candidate; + if (typeof icon === 'string') { + candidate.icon = join(user.description.extensionFolderPath, icon); + } else if(isThemableIcon(icon)) { + icon.dark = join(user.description.extensionFolderPath, icon.dark); + icon.light = join(user.description.extensionFolderPath, icon.light); + } + + return true; + } + +} + + +namespace schema { + + const filterType: IJSONSchema = { + type: 'object', + properties: { + language: { + description: localize('vscode.extension.contributes.filterType.language', ""), + type: 'string' + }, + scheme: { + description: localize('vscode.extension.contributes.filterType.scheme', ""), + type: 'string' + }, + pattern: { + description: localize('vscode.extension.contributes.filterType.pattern', ""), + type: 'string' + } + } + }; + + const contextType: IJSONSchema = { + type: 'object', + properties: { + where: { + description: localize('vscode.extension.contributes.commandType.context.where', "Menus and tool bars to which commands can be added, e.g. `editor title actions` or `explorer context menu`"), + enum: [ + 'editor/primary', + 'editor/secondary' + ] + }, + when: { + description: localize('vscode.extension.contributes.commandType.context.when', "Condition that must be met in order to show the command. Can be a language identifier, a glob-pattern, an uri scheme, or a combination of them."), + anyOf: [ + 'string', + filterType, + { type: 'array', items: 'string' }, + { type: 'array', items: filterType }, + ] + }, + icon: { + description: localize('vscode.extension.contributes.commandType.icon', '(Optional) Icon which is used to represent the command in the UI. Either a file path or a themable configuration'), + oneOf: [ + 'string', + { + type: 'object', + properties: { + light: { + description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'), + type: 'string' + }, + dark: { + description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'), + type: 'string' + } + } + } + ] + } + } + }; + + const commandType: IJSONSchema = { + type: 'object', + properties: { + command: { + description: localize('vscode.extension.contributes.commandType.command', 'Identifier of the command to execute'), + type: 'string' + }, + title: { + description: localize('vscode.extension.contributes.commandType.title', 'Title by which the command is represented in the UI'), + type: 'string' + }, + category: { + description: localize('vscode.extension.contributes.commandType.category', '(Optional) Category string by the command is grouped in the UI'), + type: 'string' + }, + context: { + description: localize('vscode.extension.contributes.commandType.context', '(Optional) Define places where the command should show in addition to the Command palette'), + oneOf: [ + contextType, + { type: 'array', items: contextType } + ] + } + } + }; + + export const commandContribution: IJSONSchema = { + description: localize('vscode.extension.contributes.commands', "Contributes commands to the command palette."), + oneOf: [ + commandType, + { + type: 'array', + items: commandType + } + ] + }; +} + +export const commands: Command[] = []; + +function handleCommand(command: Command, user: IExtensionPointUser): void { + if (validation.isValidCommand(command, user)) { + // store command globally + commands.push(command); + } +} + +ExtensionsRegistry.registerExtensionPoint('commands', schema.commandContribution).setHandler(extensions => { + for (let extension of extensions) { + const {value} = extension; + if (Array.isArray(value)) { + for (let command of value) { + handleCommand(command, extension); + } + } else { + handleCommand(value, extension); + } + } + + Object.freeze(commands); +}); + +export class CommandAction extends Action { + + constructor( + public command: Command, + @IExtensionService extensionService: IExtensionService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(command.command, command.title); + this.order = Number.MAX_VALUE; + + const activationEvent = `onCommand:${command.command}`; + this._actionCallback = (...args: any[]) => { + return extensionService.activateByEvent(activationEvent).then(() => { + return keybindingService.executeCommand(command.command, ...args); + }); + }; + } +} \ No newline at end of file diff --git a/src/vs/platform/actions/workbench/actionBarContributions.ts b/src/vs/platform/actions/workbench/actionBarContributions.ts new file mode 100644 index 00000000000..725c6a4aab8 --- /dev/null +++ b/src/vs/platform/actions/workbench/actionBarContributions.ts @@ -0,0 +1,215 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import {Registry} from 'vs/platform/platform'; +import URI from 'vs/base/common/uri'; +import {IAction, Action} from 'vs/base/common/actions'; +import {IDisposable} from 'vs/base/common/lifecycle'; +import {BaseActionItem, ActionItem} from 'vs/base/browser/ui/actionbar/actionbar'; +import {Scope, IActionBarRegistry, Extensions, ActionBarContributor} from 'vs/workbench/browser/actionBarRegistry'; +import {IModeService} from 'vs/editor/common/services/modeService'; +import {IExtensionService} from 'vs/platform/extensions/common/extensions'; +import {IThemeService} from 'vs/workbench/services/themes/common/themeService'; +import {isLightTheme} from 'vs/platform/theme/common/themes'; +import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; +import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; +import {commands, CommandAction, Command, Locations} from '../common/commandsExtensionPoint'; +import matches from 'vs/editor/common/modes/languageSelector'; +import {EditorInput} from 'vs/workbench/common/editor'; + +class ResolvedCommand { + + constructor( + private _command: Command, + @IInstantiationService private _instantiationService: IInstantiationService, + @IThemeService private _themeService: IThemeService, + @IModeService private _modeService: IModeService + ) { + + } + + matches(location: Locations, resource: URI): boolean { + const {where, when} = this._command; + if (!where || !when) { + return false; + } + // (1) check for location + if (Array.isArray(where)) { + if (where.every(where => where !== location)) { + return false; + } + } else if (where !== location) { + return false; + } + // (2) check for resource + if (!matches(when, resource, this._modeService.getModeIdByFilenameOrFirstLine(resource.fsPath))) { + return false; + } + + return true; + } + + createAction(resource: URI): ScopedCommandAction { + return this._instantiationService.createInstance(ScopedCommandAction, this._command, resource); + } +} + +class ScopedCommandAction extends CommandAction { + + private _themeListener: IDisposable; + + constructor( + command: Command, + private _resource: URI, + @IThemeService private _themeService: IThemeService, + @IExtensionService extensionService: IExtensionService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(command, extensionService, keybindingService); + } + + dispose() { + this._themeListener.dispose(); + super.dispose(); + } + + get icon(): string { + const {icon} = this.command; + if (!icon) { + return; + } + if (typeof icon === 'string') { + return icon; + } else { + return isLightTheme(this._themeService.getTheme()) + ? icon.light + : icon.dark; + } + } + + run() { + return super.run(this._resource); + } +} + +abstract class BaseActionBarContributor extends ActionBarContributor { + + private _isReady: boolean = false; + private _contributedActions: ResolvedCommand[]; + + constructor( + @IExtensionService private _extensionService: IExtensionService, + @IInstantiationService private _instantationService: IInstantiationService + ) { + super(); + this._extensionService.onReady().then(() => { + this._contributedActions = commands.map(command => _instantationService.createInstance(ResolvedCommand, command)); + this._isReady = true; + }); + } + + protected abstract _wheres(): { primary: Locations; secondary: Locations }; + + protected abstract _getResource(context: any): URI; + + public hasActions(context: any): boolean { + return this._isReady && this._wheres().primary && this.getActions(context).length > 0; + } + + public hasSecondaryActions(context: any): boolean { + return this._isReady && this._wheres().secondary && this.getSecondaryActions(context).length > 0; + } + + public getActions(context: any): IAction[] { + return this._getActions(context, this._wheres().primary); + } + + public getSecondaryActions(context: any): IAction[] { + return this._getActions(context, this._wheres().secondary); + } + + private _getActions(context: any, where: Locations): IAction[] { + const uri = this._getResource(context); + const result: IAction[] = []; + if (uri) { + for (let command of this._contributedActions) { + if (command.matches(where, uri)) { + result.push(command.createAction(uri)); + } + } + } + return result; + } + + public getActionItem(context: any, action: Action): BaseActionItem { + if (action instanceof ScopedCommandAction) { + return this._instantationService.createInstance(CommandActionItem, action); + } + } +} + +class EditorContributor extends BaseActionBarContributor { + + protected _wheres(): { primary: Locations; secondary: Locations } { + return { primary: 'editor/primary', secondary: 'editor/secondary' }; + } + protected _getResource(context: any): URI { + const {input} = context; + if (input instanceof EditorInput) { + if (typeof input.getResource === 'function') { + const candidate = input.getResource(); + if (candidate instanceof URI) { + return candidate; + } + } + } + } +} + +class ContextMenuContributor extends BaseActionBarContributor { + + protected _wheres(): { primary: Locations; secondary: Locations } { + return { secondary: 'explorer/context', primary: undefined }; + } + + protected _getResource(context: any): URI { + if (context.element) { + if (context.element.resource instanceof URI) { + return context.element.resource; + } + } + } +} + +class CommandActionItem extends ActionItem { + + constructor( + action: ScopedCommandAction, + @IThemeService private _themeService: IThemeService + ) { + super(undefined, action, { icon: Boolean(action.icon), label: !Boolean(action.icon) }); + + this._themeService.onDidThemeChange(this._updateClass, this, this.callOnDispose); + } + + _updateClass(): void { + super._updateClass(); + + const element = this.$e.getHTMLElement(); + const {icon} = this._action; + if (icon && element.classList.contains('icon')) { + element.style.backgroundImage = `url("${icon}")`; + } + } + + onClick(event: Event): void { + super.onClick(event); + } +} + +Registry.as(Extensions.Actionbar).registerActionBarContributor(Scope.EDITOR, EditorContributor); +Registry.as(Extensions.Actionbar).registerActionBarContributor(Scope.VIEWER, ContextMenuContributor); \ No newline at end of file diff --git a/src/vs/platform/actions/workbench/actionsService.ts b/src/vs/platform/actions/workbench/actionsService.ts new file mode 100644 index 00000000000..70bf8e563db --- /dev/null +++ b/src/vs/platform/actions/workbench/actionsService.ts @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import {localize} from 'vs/nls'; +import {IAction} from 'vs/base/common/actions'; +import {IExtensionService} from 'vs/platform/extensions/common/extensions'; +import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; +import {IActionsService} from '../common/actions'; +import {commands, CommandAction} from '../common/commandsExtensionPoint'; +import 'vs/platform/actions/workbench/actionBarContributions'; + +export default class ActionsService implements IActionsService { + + serviceId: any; + + private _extensionsActions: IAction[]; + + constructor( + @IExtensionService private _extensionService: IExtensionService, + @IKeybindingService private _keybindingsService: IKeybindingService + ) { + this._extensionService.onReady().then(() => this._extensionsActions = null); + } + + getActions(): IAction[] { + + if (!this._extensionsActions) { + this._extensionsActions = []; + for (let command of commands) { + + const action = new CommandAction(command, this._extensionService, this._keybindingsService); + action.order = Number.MAX_VALUE; + action.label = command.category + ? localize('category.label', "{0}: {1}", command.category, command.title) + : command.title; + + this._extensionsActions.push(action); + } + } + + return this._extensionsActions.slice(0); + } +} diff --git a/src/vs/platform/configuration/common/model.ts b/src/vs/platform/configuration/common/model.ts index 0d0d5d26ee1..df1cfbc8a8f 100644 --- a/src/vs/platform/configuration/common/model.ts +++ b/src/vs/platform/configuration/common/model.ts @@ -117,16 +117,17 @@ export function consolidate(configMap: { [key: string]: IConfigFile; }): { conte // defaults... -function processDefaultValues(withConfig: (config: configurationRegistry.IConfigurationNode, isTop?: boolean) => void): void { +function processDefaultValues(withConfig: (config: configurationRegistry.IConfigurationNode, isTop?: boolean) => boolean): void { let configurations = (platform.Registry.as(configurationRegistry.Extensions.Configuration)).getConfigurations(); - let visit = (config: configurationRegistry.IConfigurationNode, isFirst: boolean) => { - withConfig(config, isFirst); + let visit = (config: configurationRegistry.IConfigurationNode, level: number) => { + let handled = withConfig(config, level === 0); if (Array.isArray(config.allOf)) { config.allOf.forEach((c) => { - visit(c, false); + // if the config node only contains an `allOf` we treat the `allOf` children as if they were at the top level + visit(c, (!handled && level === 0) ? level : level + 1); }); } }; @@ -142,7 +143,7 @@ function processDefaultValues(withConfig: (config: configurationRegistry.IConfig return c1.order - c2.order; }).forEach((config) => { - visit(config, true); + visit(config, 0); }); } @@ -150,7 +151,7 @@ function processDefaultValues(withConfig: (config: configurationRegistry.IConfig export function getDefaultValues(): any { let ret: any = Object.create(null); - let handleConfig = (config: configurationRegistry.IConfigurationNode, isTop: boolean) => { + let handleConfig = (config: configurationRegistry.IConfigurationNode, isTop: boolean) : boolean => { if (config.properties) { Object.keys(config.properties).forEach((key) => { let prop = config.properties[key]; @@ -160,7 +161,9 @@ export function getDefaultValues(): any { } setNode(ret, key, value); }); + return true; } + return false; }; processDefaultValues(handleConfig); return ret; @@ -172,18 +175,21 @@ export function getDefaultValuesContent(indent: string): string { let result: string[] = []; result.push('{'); - let handleConfig = (config: configurationRegistry.IConfigurationNode, isTop: boolean) => { + let handleConfig = (config: configurationRegistry.IConfigurationNode, isTop: boolean) : boolean => { + let handled = false; if (config.title) { + handled = true; if (isTop) { result.push(''); - result.push(indent + '//-------- ' + config.title + ' --------'); + result.push('//-------- ' + config.title + ' --------'); } else { result.push(indent + '// ' + config.title); } result.push(''); } if (config.properties) { + handled = true; Object.keys(config.properties).forEach((key) => { let prop = config.properties[key]; @@ -209,6 +215,7 @@ export function getDefaultValuesContent(indent: string): string { result.push(''); }); } + return handled; }; processDefaultValues(handleConfig); diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index f6e1ea32559..c482f5eefa2 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -162,6 +162,12 @@ export interface IEditorOptionsBag { * The index in the document stack where to insert the editor into when opening. */ index?: number; + + /** + * An active editor that is opened will show its contents directly. Set to true to open an editor + * in the background. + */ + inactive?: boolean; } export interface ITextEditorOptions extends IEditorOptionsBag { diff --git a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts index 7dfb181595c..db12d424c91 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts @@ -46,7 +46,11 @@ export function getOutdatedExtensions(extensionsService: IExtensionManagementSer return extensionsService.getInstalled().then(installed => { const ids = installed.map(({ manifest }) => `${ manifest.publisher }.${ manifest.name }`); - return galleryService.query({ ids, pageSize: 1000 }).then(result => { + if (installed.length === 0) { + return TPromise.as([]); + } + + return galleryService.query({ ids, pageSize: ids.length }).then(result => { const available = result.firstPage; return available.map(extension => { diff --git a/src/vs/platform/theme/common/themes.ts b/src/vs/platform/theme/common/themes.ts index 0fedb5ecfd0..24bfada0768 100644 --- a/src/vs/platform/theme/common/themes.ts +++ b/src/vs/platform/theme/common/themes.ts @@ -8,6 +8,10 @@ export function isLightTheme(themeId: string) { return /vs($| )/.test(themeId); } +export function isDarkTheme(themeId: string) { + return /vs-dark($| )/.test(themeId); +} + export function getSyntaxThemeId(themeId: string) { return themeId.split(' ')[1]; } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 52ffa608086..93cf6db550b 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -738,6 +738,13 @@ declare namespace vscode { */ gutterIconPath?: string; + /** + * Specifies the size of the gutter icon. + * Available values are 'auto', 'contain', 'cover' and any percentage value. + * For further information: https://msdn.microsoft.com/en-us/library/jj127316(v=vs.85).aspx + */ + gutterIconSize?: string; + /** * The color of the decoration in the overview ruler. Use rgba() and define transparent colors to play well with other decorations. */ @@ -2623,7 +2630,7 @@ declare namespace vscode { /** * A diagnostics collection is a container that manages a set of * [diagnostics](#Diagnostic). Diagnostics are always scopes to a - * a diagnostics collection and a resource. + * diagnostics collection and a resource. * * To get an instance of a `DiagnosticCollection` use * [createDiagnosticCollection](#languages.createDiagnosticCollection). diff --git a/src/vs/workbench/browser/actionBarRegistry.ts b/src/vs/workbench/browser/actionBarRegistry.ts index 87d66ae4803..726cab7da75 100644 --- a/src/vs/workbench/browser/actionBarRegistry.ts +++ b/src/vs/workbench/browser/actionBarRegistry.ts @@ -198,8 +198,13 @@ export function prepareActions(actions: IAction[]): IAction[] { actions = actions.sort((first: Action, second: Action) => { let firstOrder = first.order; let secondOrder = second.order; - - return firstOrder < secondOrder ? -1 : 1; + if (firstOrder < secondOrder) { + return -1; + } else if (firstOrder > secondOrder) { + return 1; + } else { + return 0; + } }); // Clean up leading separators diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 459f647425c..2ac7fa5f107 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -6,12 +6,10 @@ import {Registry} from 'vs/platform/platform'; import nls = require('vs/nls'); -import {TPromise} from 'vs/base/common/winjs.base'; import {Action, IAction} from 'vs/base/common/actions'; -import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {IEditorQuickOpenEntry, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor} from 'vs/workbench/browser/quickopen'; import {StatusbarItemDescriptor, StatusbarAlignment, IStatusbarRegistry, Extensions as StatusExtensions} from 'vs/workbench/browser/parts/statusbar/statusbar'; -import {EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions, IEditorInputActionContext, IEditorInputAction, EditorInputActionContributor, EditorInputAction} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions} from 'vs/workbench/browser/parts/editor/baseEditor'; import {StringEditorInput} from 'vs/workbench/common/editor/stringEditorInput'; import {StringEditor} from 'vs/workbench/browser/parts/editor/stringEditor'; import {DiffEditorInput} from 'vs/workbench/common/editor/diffEditorInput'; @@ -24,8 +22,6 @@ import {TextDiffEditor} from 'vs/workbench/browser/parts/editor/textDiffEditor'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {BinaryResourceDiffEditor} from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; -import {IFrameEditor} from 'vs/workbench/browser/parts/editor/iframeEditor'; -import {IFrameEditorInput} from 'vs/workbench/common/editor/iframeEditorInput'; import {IConfigurationRegistry, Extensions as ConfigurationExtensions} from 'vs/platform/configuration/common/configurationRegistry'; import {ChangeEncodingAction, ChangeEOLAction, ChangeModeAction, EditorStatus} from 'vs/workbench/browser/parts/editor/editorStatus'; import {IWorkbenchActionRegistry, Extensions as ActionExtensions} from 'vs/workbench/common/actionRegistry'; @@ -34,11 +30,11 @@ import {SyncActionDescriptor} from 'vs/platform/actions/common/actions'; import {SyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; import {KeyMod, KeyCode} from 'vs/base/common/keyCodes'; import {EditorStacksModel} from 'vs/workbench/common/editor/editorStacksModel'; -import {CloseEditorsInGroupAction, CloseEditorsInOtherGroupsAction, CloseAllEditorsAction, MoveGroupLeftAction, MoveGroupRightAction, SplitEditorAction, PinEditorAction, CloseOtherEditorsInGroupAction, OpenToSideAction, +import {CloseEditorsInGroupAction, CloseEditorsInOtherGroupsAction, CloseAllEditorsAction, MoveGroupLeftAction, MoveGroupRightAction, SplitEditorAction, KeepEditorAction, CloseOtherEditorsInGroupAction, OpenToSideAction, NavigateBetweenGroupsAction, FocusFirstGroupAction, FocusSecondGroupAction, FocusThirdGroupAction, EvenGroupWidthsAction, MaximizeGroupAction, MinimizeOtherGroupsAction, FocusPreviousGroup, FocusNextGroup, ShowEditorsInLeftGroupAction, - toEditorQuickOpenEntry, CloseLeftEditorsInGroupAction, CloseRightEditorsInGroupAction, OpenNextEditor, OpenPreviousEditor, NavigateBackwardsAction, NavigateForwardAction, ReopenClosedEditorAction, OpenPreviousEditorInGroupAction, NAVIGATE_IN_LEFT_GROUP_PREFIX, + toEditorQuickOpenEntry, CloseLeftEditorsInGroupAction, CloseRightEditorsInGroupAction, OpenNextEditor, OpenPreviousEditor, NavigateBackwardsAction, NavigateForwardAction, ReopenClosedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, NAVIGATE_IN_LEFT_GROUP_PREFIX, GlobalQuickOpenAction, OpenPreviousEditorFromHistoryAction, QuickOpenNavigateNextAction, QuickOpenNavigatePreviousAction, ShowAllEditorsAction, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, ClearEditorHistoryAction, ShowEditorsInCenterGroupAction, - NAVIGATE_IN_CENTER_GROUP_PREFIX, ShowEditorsInRightGroupAction, NAVIGATE_IN_RIGHT_GROUP_PREFIX, RemoveFromEditorHistoryAction + NAVIGATE_IN_CENTER_GROUP_PREFIX, ShowEditorsInRightGroupAction, NAVIGATE_IN_RIGHT_GROUP_PREFIX, RemoveFromEditorHistoryAction, FocusLastEditorInStackAction, OpenNextRecentlyUsedEditorInGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; // Register String Editor @@ -82,19 +78,6 @@ import {CloseEditorsInGroupAction, CloseEditorsInOtherGroupsAction, CloseAllEdit ] ); -// Register IFrame Editor -(Registry.as(EditorExtensions.Editors)).registerEditor( - new EditorDescriptor( - IFrameEditor.ID, - nls.localize('iframeEditor', "IFrame Editor"), - 'vs/workbench/browser/parts/editor/iframeEditor', - 'IFrameEditor' - ), - [ - new SyncDescriptor(IFrameEditorInput) - ] -); - // Register Editor Status let statusBar = (Registry.as(StatusExtensions.Statusbar)); statusBar.registerStatusbarItem(new StatusbarItemDescriptor(EditorStatus, StatusbarAlignment.RIGHT, 100 /* High Priority */)); @@ -105,64 +88,6 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(ChangeModeAction, Chan registry.registerWorkbenchAction(new SyncActionDescriptor(ChangeEOLAction, ChangeEOLAction.ID, ChangeEOLAction.LABEL), 'Change End of Line Sequence'); registry.registerWorkbenchAction(new SyncActionDescriptor(ChangeEncodingAction, ChangeEncodingAction.ID, ChangeEncodingAction.LABEL), 'Change File Encoding'); -export class ViewSourceEditorInputAction extends EditorInputAction { - - constructor( - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IWorkspaceContextService private contextService: IWorkspaceContextService - ) { - super('workbench.files.action.viewSourceFromEditor', nls.localize('viewSource', "View Source"), 'iframe-editor-action view-source'); - } - - public run(event?: any): TPromise { - let iFrameEditorInput = this.input; - let sideBySide = !!(event && (event.ctrlKey || event.metaKey)); - - return this.editorService.openEditor({ - resource: iFrameEditorInput.getResource() - }, sideBySide); - } -} - -export class RefreshIFrameEditorInputAction extends EditorInputAction { - - constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService) { - super('workbench.files.action.refreshIFrameEditor', nls.localize('reload', "Reload"), 'iframe-editor-action refresh'); - } - - public run(event?: any): TPromise { - let editor = this.editorService.getActiveEditor(); - if (editor instanceof IFrameEditor) { - (editor).reload(true); - (editor).focus(); - } - - return TPromise.as(null); - } -} - -let actionBarRegistry = Registry.as(ActionBarExtensions.Actionbar); -class IFrameEditorActionContributor extends EditorInputActionContributor { - - constructor( @IInstantiationService private instantiationService: IInstantiationService) { - super(); - } - - public hasActionsForEditorInput(context: IEditorInputActionContext): boolean { - return context.input instanceof IFrameEditorInput; - } - - public getActionsForEditorInput(context: IEditorInputActionContext): IEditorInputAction[] { - return [ - this.instantiationService.createInstance(RefreshIFrameEditorInputAction), - this.instantiationService.createInstance(ViewSourceEditorInputAction) - ]; - } -} - -// Contribute to IFrame Editor Inputs -actionBarRegistry.registerActionBarContributor(Scope.EDITOR, IFrameEditorActionContributor); - // Register keybinding for "Next Change" & "Previous Change" in visible diff editor KeybindingsRegistry.registerCommandDesc({ id: 'workbench.action.compareEditor.nextChange', @@ -246,6 +171,7 @@ export class QuickOpenActionContributor extends ActionBarContributor { } } +const actionBarRegistry = Registry.as(ActionBarExtensions.Actionbar); actionBarRegistry.registerActionBarContributor(Scope.VIEWER, QuickOpenActionContributor); Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpenHandler( @@ -337,12 +263,18 @@ function navigateKeybinding(shift: boolean): IKeybindings { // Register Editor Actions const category = nls.localize('view', "View"); -registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousEditorInGroupAction, OpenPreviousEditorInGroupAction.ID, OpenPreviousEditorInGroupAction.LABEL, { +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextRecentlyUsedEditorInGroupAction, OpenNextRecentlyUsedEditorInGroupAction.ID, OpenNextRecentlyUsedEditorInGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyCode.Tab } -}), 'Open Previous in Editor Group'); +}), 'Open Next Recently Used Editor in Group'); +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousRecentlyUsedEditorInGroupAction, OpenPreviousRecentlyUsedEditorInGroupAction.ID, OpenPreviousRecentlyUsedEditorInGroupAction.LABEL, { + primary: KeyMod.CtrlCmd | KeyMod.Shift |  KeyCode.Tab, + mac: { + primary: KeyMod.WinCtrl | KeyMod.Shift |  KeyCode.Tab + } +}), 'Open Previous Recently Used Editor in Group'); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowAllEditorsAction, ShowAllEditorsAction.ID, ShowAllEditorsAction.LABEL, { primary: null, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Tab } }), 'View: Show All Editors', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowEditorsInLeftGroupAction, ShowEditorsInLeftGroupAction.ID, ShowEditorsInLeftGroupAction.LABEL), 'View: Show Editors in Left Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowEditorsInCenterGroupAction, ShowEditorsInCenterGroupAction.ID, ShowEditorsInCenterGroupAction.LABEL), 'View: Show Editors in Center Group', category); @@ -356,7 +288,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousEditor, Op mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow } }), 'View: Open Previous Editor', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ReopenClosedEditorAction, ReopenClosedEditorAction.ID, ReopenClosedEditorAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_T }), 'View: Reopen Closed Editor', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(PinEditorAction, PinEditorAction.ID, PinEditorAction.LABEL, { primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.Enter) }), 'View: Pin Editor', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(KeepEditorAction, KeepEditorAction.ID, KeepEditorAction.LABEL, { primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.Enter) }), 'View: Keep Editor', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseAllEditorsAction, CloseAllEditorsAction.ID, CloseAllEditorsAction.LABEL, { primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_W) }), 'View: Close All Editors', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseLeftEditorsInGroupAction, CloseLeftEditorsInGroupAction.ID, CloseLeftEditorsInGroupAction.LABEL), 'View: Close Editors to the Left', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseRightEditorsInGroupAction, CloseRightEditorsInGroupAction.ID, CloseRightEditorsInGroupAction.LABEL), 'View: Close Editors to the Right', category); @@ -368,6 +300,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(NavigateBetweenGroupsA registry.registerWorkbenchAction(new SyncActionDescriptor(FocusFirstGroupAction, FocusFirstGroupAction.ID, FocusFirstGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_1 }), 'View: Focus Left Editor Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(FocusSecondGroupAction, FocusSecondGroupAction.ID, FocusSecondGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_2 }), 'View: Focus Center Editor Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(FocusThirdGroupAction, FocusThirdGroupAction.ID, FocusThirdGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_3 }), 'View: Focus Right Editor Group', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(FocusLastEditorInStackAction, FocusLastEditorInStackAction.ID, FocusLastEditorInStackAction.LABEL, { primary: KeyMod.WinCtrl | KeyCode.KEY_0 }), 'View: Focus Last Editor in Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(EvenGroupWidthsAction, EvenGroupWidthsAction.ID, EvenGroupWidthsAction.LABEL), 'View: Even Editor Group Widths', category); registry.registerWorkbenchAction(new SyncActionDescriptor(MaximizeGroupAction, MaximizeGroupAction.ID, MaximizeGroupAction.LABEL), 'View: Maximize Editor Group and Hide Sidebar', category); registry.registerWorkbenchAction(new SyncActionDescriptor(MinimizeOtherGroupsAction, MinimizeOtherGroupsAction.ID, MinimizeOtherGroupsAction.LABEL), 'View: Minimize Other Editor Groups', category); @@ -396,6 +329,48 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(RemoveFromEditorHistor registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenNavigateNextAction, QuickOpenNavigateNextAction.ID, QuickOpenNavigateNextAction.LABEL, navigateKeybinding(false), KbExpr.has('inQuickOpen')), 'Navigate Next in Quick Open'); registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenNavigatePreviousAction, QuickOpenNavigatePreviousAction.ID, QuickOpenNavigatePreviousAction.LABEL, navigateKeybinding(true), KbExpr.has('inQuickOpen'), KeybindingsRegistry.WEIGHT.workbenchContrib(50)), 'Navigate Previous in Quick Open'); +// Keybindings to focus a specific index in the tab folder if tabs are enabled +for (let i = 0; i < 9; i++) { + const editorIndex = i; + const visibleIndex = i + 1; + + KeybindingsRegistry.registerCommandDesc({ + id: 'workbench.action.openEditorAtIndex' + visibleIndex, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), + when: void 0, + primary: KeyMod.WinCtrl | toKeyCode(visibleIndex), + handler: accessor => { + const editorService = accessor.get(IWorkbenchEditorService); + const editorGroupService = accessor.get(IEditorGroupService); + + const active = editorService.getActiveEditor(); + if (active) { + const group = editorGroupService.getStacksModel().groupAt(active.position); + const editor = group.getEditor(editorIndex); + + if (editor) { + return editorService.openEditor(editor); + } + } + } + }); +} + +function toKeyCode(index: number): KeyCode { + switch (index) { + case 0: return KeyCode.KEY_0; + case 1: return KeyCode.KEY_1; + case 2: return KeyCode.KEY_2; + case 3: return KeyCode.KEY_3; + case 4: return KeyCode.KEY_4; + case 5: return KeyCode.KEY_5; + case 6: return KeyCode.KEY_6; + case 7: return KeyCode.KEY_7; + case 8: return KeyCode.KEY_8; + case 9: return KeyCode.KEY_9; + } +} + // Configuration let configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); configurationRegistry.registerConfiguration({ @@ -404,26 +379,26 @@ configurationRegistry.registerConfiguration({ 'title': nls.localize('workbenchConfigurationTitle', "Workbench configuration"), 'type': 'object', 'properties': { - 'workbench.showEditorTabs': { + 'workbench.editor.showTabs': { 'type': 'boolean', 'description': nls.localize('showEditorTabs', "Controls if opened editors should show in tabs or not."), 'default': false }, - 'workbench.previewEditors': { + 'workbench.editor.enablePreview': { 'type': 'boolean', - 'description': nls.localize('previewEditors', "Controls if opened editors show as preview until getting pinned. Set to false to always open editors pinned."), + 'description': nls.localize('enablePreview', "Controls if opened editors show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."), 'default': true }, - 'workbench.quickOpenPreviews': { + 'workbench.editor.enablePreviewFromQuickOpen': { 'type': 'boolean', - 'description': nls.localize('quickOpenPreviews', "Controls if editors opened from quick open show as preview. Set to false to always open editors from quick open pinned."), + 'description': nls.localize('enablePreviewFromQuickOpen', "Controls if opened editors from quick open show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."), 'default': true }, - 'workbench.editorOpenPositioning': { + 'workbench.editor.openPositioning': { 'type': 'string', - 'enum': ['left', 'right', 'beginning', 'end'], + 'enum': ['left', 'right', 'first', 'last'], 'default': 'right', - 'description': nls.localize('editorOpenPositioning', "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the current active one. Select 'beginning' or 'end' to open editors independently from the currently active one.") + 'description': nls.localize('editorOpenPositioning', "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the current active one. Select 'first' or 'last' to open editors independently from the currently active one.") } } }); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index cbc55e9a15c..1a588852832 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -750,10 +750,10 @@ export class MaximizeGroupAction extends Action { } } -export class PinEditorAction extends Action { +export class KeepEditorAction extends Action { - public static ID = 'workbench.action.pinEditor'; - public static LABEL = nls.localize('pinEditor', "Pin Editor"); + public static ID = 'workbench.action.keepEditor'; + public static LABEL = nls.localize('keepEditor', "Keep Editor"); constructor( id: string, @@ -970,6 +970,38 @@ export class ShowEditorsInRightGroupAction extends QuickOpenAction { } } +export class ShowEditorsInGroupAction extends Action { + + public static ID = 'workbench.action.showEditorsInGroup'; + public static LABEL = nls.localize('showEditorsInGroup', "Show Editors in Group"); + + constructor( + id: string, + label: string, + @IQuickOpenService private quickOpenService: IQuickOpenService, + @IEditorGroupService private editorGroupService: IEditorGroupService + ) { + super(id, label); + } + + public run(context?: IEditorContext): TPromise { + const stacks = this.editorGroupService.getStacksModel(); + const groupCount = stacks.groups.length; + if (groupCount <= 1 || !context) { + return this.quickOpenService.show(NAVIGATE_ALL_EDITORS_GROUP_PREFIX); + } + + switch (stacks.positionOfGroup(context.group)) { + case Position.CENTER: + return this.quickOpenService.show((groupCount === 2) ? NAVIGATE_IN_RIGHT_GROUP_PREFIX : NAVIGATE_IN_CENTER_GROUP_PREFIX); + case Position.RIGHT: + return this.quickOpenService.show(NAVIGATE_IN_RIGHT_GROUP_PREFIX); + } + + return this.quickOpenService.show(NAVIGATE_IN_LEFT_GROUP_PREFIX); + } +} + export const NAVIGATE_ALL_EDITORS_GROUP_PREFIX = 'edt '; export class ShowAllEditorsAction extends QuickOpenAction { @@ -982,10 +1014,7 @@ export class ShowAllEditorsAction extends QuickOpenAction { } } -export class OpenPreviousEditorInGroupAction extends Action { - - public static ID = 'workbench.action.openPreviousEditorInGroup'; - public static LABEL = nls.localize('openPreviousEditorInGroup', "Open Previous in Editor Group"); +export class BaseQuickOpenEditorInGroupAction extends Action { constructor( id: string, @@ -1020,6 +1049,40 @@ export class OpenPreviousEditorInGroupAction extends Action { } } +export class OpenPreviousRecentlyUsedEditorInGroupAction extends BaseQuickOpenEditorInGroupAction { + + public static ID = 'workbench.action.openPreviousRecentlyUsedEditorInGroup'; + public static LABEL = nls.localize('openPreviousEditorInGroup', "Open Previous Recently Used Editor in Group"); + + constructor( + id: string, + label: string, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService, + @IEditorGroupService editorGroupService: IEditorGroupService, + @IWorkbenchEditorService editorService: IWorkbenchEditorService + ) { + super(id, label, quickOpenService, keybindingService, editorGroupService, editorService); + } +} + +export class OpenNextRecentlyUsedEditorInGroupAction extends BaseQuickOpenEditorInGroupAction { + + public static ID = 'workbench.action.openNextRecentlyUsedEditorInGroup'; + public static LABEL = nls.localize('openNextEditorInGroup', "Open Next Recently Used Editor in Group"); + + constructor( + id: string, + label: string, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService, + @IEditorGroupService editorGroupService: IEditorGroupService, + @IWorkbenchEditorService editorService: IWorkbenchEditorService + ) { + super(id, label, quickOpenService, keybindingService, editorGroupService, editorService); + } +} + export class GlobalQuickOpenAction extends Action { public static ID = 'workbench.action.quickOpen'; @@ -1178,4 +1241,33 @@ export class QuickOpenNavigatePreviousAction extends BaseQuickOpenNavigateAction interface IEditorPickOpenEntry extends IPickOpenEntry { identifier: IEditorIdentifier; +} + +export class FocusLastEditorInStackAction extends Action { + + public static ID = 'workbench.action.openLastEditorInGroup'; + public static LABEL = nls.localize('focusLastEditorInStack', "Open Last Editor in Group"); + + constructor( + id: string, + label: string, + @IEditorGroupService private editorGroupService: IEditorGroupService, + @IWorkbenchEditorService private editorService: IWorkbenchEditorService + ) { + super(id, label); + } + + public run(): TPromise { + const active = this.editorService.getActiveEditor(); + if (active) { + const group = this.editorGroupService.getStacksModel().groupAt(active.position); + const editor = group.getEditor(group.count - 1); + + if (editor) { + return this.editorService.openEditor(editor); + } + } + + return TPromise.as(true); + } } \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 07b4c516e38..737653efed8 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -128,7 +128,10 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService this.stacks = this.instantiationService.createInstance(EditorStacksModel); - this.previewEditors = configurationService.getConfiguration().workbench.previewEditors; + const editorConfig = configurationService.getConfiguration().workbench.editor; + this.previewEditors = editorConfig.enablePreview; + + this.telemetryService.publicLog('workbenchEditorConfiguration', editorConfig); this.registerListeners(); } @@ -140,7 +143,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService } private onConfigurationUpdated(configuration: IWorkbenchEditorConfiguration): void { - const newPreviewEditors = configuration.workbench.previewEditors; + const newPreviewEditors = configuration.workbench.editor.enablePreview; // Pin all preview editors of the user chose to disable preview if (this.previewEditors !== newPreviewEditors && !newPreviewEditors) { @@ -235,7 +238,13 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // stacks model gets updated if any of the UI updating fails with an error. const group = this.ensureGroup(position, !options || !options.preserveFocus); const pinned = !this.previewEditors || (options && (options.pinned || typeof options.index === 'number')) || input.isDirty(); - group.openEditor(input, { active: true, pinned, index: options && options.index }); + const active = (group.count === 0) || !options || !options.inactive; + group.openEditor(input, { active, pinned, index: options && options.index }); + + // Return early if the editor is to be open inactive and there are other editors in this group to show + if (!active) { + return TPromise.as(null); + } // Progress Monitor & Ref Counting this.editorOpenToken[position]++; @@ -313,6 +322,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // Build Container off-DOM editorContainer = $().div({ 'class': 'editor-container', + 'role': 'tabpanel', id: descriptor.getId() }, (div) => { newlyCreatedEditorContainerBuilder = div; @@ -923,7 +933,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // Validate width ratios const positions = rightEditors.length ? 3 : centerEditors.length ? 2 : 1; if (!widthRatios || widthRatios.length !== positions) { - widthRatios = (positions === 3) ? [0.33, 0.33, 0.34] : (positions === 2) ? [0.5, 0.5] : [1]; + if (!this.getVisibleEditors().length) { + widthRatios = (positions === 3) ? [0.33, 0.33, 0.34] : (positions === 2) ? [0.5, 0.5] : [1]; + } else { + widthRatios = void 0; + } } // Open each input respecting the options. Since there can only be one active editor in each diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index a504261df5f..5a7a49892e6 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -11,7 +11,7 @@ import labels = require('vs/base/common/labels'); import URI from 'vs/base/common/uri'; import errors = require('vs/base/common/errors'); import strings = require('vs/base/common/strings'); -import {IAutoFocus, Mode, IEntryRunContext} from 'vs/base/parts/quickopen/common/quickOpen'; +import {IAutoFocus, Mode, IEntryRunContext, IQuickNavigateConfiguration} from 'vs/base/parts/quickopen/common/quickOpen'; import {QuickOpenModel, QuickOpenEntry, QuickOpenEntryGroup} from 'vs/base/parts/quickopen/browser/quickOpenModel'; import scorer = require('vs/base/common/scorer'); import {QuickOpenHandler} from 'vs/workbench/browser/quickopen'; @@ -178,8 +178,8 @@ export abstract class EditorGroupPicker extends BaseEditorPicker { return nls.localize('noOpenedEditors', "List of opened editors is currently empty"); } - public getAutoFocus(searchValue: string, isQuickNavigating?: boolean): IAutoFocus { - if (searchValue || !isQuickNavigating) { + public getAutoFocus(searchValue: string, quickNavigateConfiguration: IQuickNavigateConfiguration): IAutoFocus { + if (searchValue || !quickNavigateConfiguration) { return { autoFocusFirstEntry: true }; @@ -191,6 +191,13 @@ export abstract class EditorGroupPicker extends BaseEditorPicker { return super.getAutoFocus(searchValue); } + const isShiftNavigate = (quickNavigateConfiguration && quickNavigateConfiguration.keybindings.some(k => k.hasShift())); + if (isShiftNavigate) { + return { + autoFocusLastEntry: true + }; + } + return { autoFocusFirstEntry: group.count === 1, autoFocusSecondEntry: group.count > 1 diff --git a/src/vs/workbench/browser/parts/editor/iframeEditor.ts b/src/vs/workbench/browser/parts/editor/iframeEditor.ts deleted file mode 100644 index de06bf54d82..00000000000 --- a/src/vs/workbench/browser/parts/editor/iframeEditor.ts +++ /dev/null @@ -1,287 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -import 'vs/css!./media/iframeeditor'; -import nls = require('vs/nls'); -import {TPromise} from 'vs/base/common/winjs.base'; -import URI from 'vs/base/common/uri'; -import DOM = require('vs/base/browser/dom'); -import {Dimension, Builder, $} from 'vs/base/browser/builder'; -import errors = require('vs/base/common/errors'); -import {EditorOptions, EditorInput} from 'vs/workbench/common/editor'; -import {BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor'; -import {IFrameEditorInput} from 'vs/workbench/common/editor/iframeEditorInput'; -import {IFrameEditorModel} from 'vs/workbench/common/editor/iframeEditorModel'; -import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; -import {IStorageService} from 'vs/platform/storage/common/storage'; -import {Position} from 'vs/platform/editor/common/editor'; -import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; -import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; - -/** - * An implementation of editor for showing HTML content in an IFrame by leveraging the IFrameEditorInput. - */ -export class IFrameEditor extends BaseEditor { - - public static ID = 'workbench.editors.iFrameEditor'; - - private static RESOURCE_PROPERTY = 'resource'; - - private iframeContainer: Builder; - private iframeBuilder: Builder; - private focusTracker: DOM.IFocusTracker; - - constructor( - @ITelemetryService telemetryService: ITelemetryService, - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IEditorGroupService private editorGroupService: IEditorGroupService, - @IStorageService private storageService: IStorageService - ) { - super(IFrameEditor.ID, telemetryService); - } - - public getTitle(): string { - return this.getInput() ? this.getInput().getName() : nls.localize('iframeEditor', "IFrame Viewer"); - } - - public createEditor(parent: Builder): void { - - // Container for IFrame - let iframeContainerElement = document.createElement('div'); - iframeContainerElement.className = 'iframe-container'; - this.iframeContainer = $(iframeContainerElement); - this.iframeContainer.tabindex(0); // enable focus support from the editor part (do not remove) - - // IFrame - this.iframeBuilder = $(this.iframeContainer).element('iframe').addClass('iframe'); - this.iframeBuilder.attr({ 'frameborder': '0' }); - this.iframeBuilder.removeProperty(IFrameEditor.RESOURCE_PROPERTY); - - parent.getHTMLElement().appendChild(iframeContainerElement); - } - - public setInput(input: EditorInput, options: EditorOptions): TPromise { - let oldInput = this.getInput(); - super.setInput(input, options); - - // Detect options - let forceOpen = options && options.forceOpen; - - // Same Input - if (!forceOpen && input.matches(oldInput)) { - return TPromise.as(null); - } - - // Assert Input - if (!(input instanceof IFrameEditorInput)) { - return TPromise.wrapError('Invalid editor input. IFrame editor requires an input instance of IFrameEditorInput.'); - } - - // Different Input (Reload) - return this.doSetInput(input, true /* isNewInput */); - } - - private doSetInput(input: EditorInput, isNewInput?: boolean): TPromise { - return this.editorService.resolveEditorModel(input, true /* Reload */).then((resolvedModel) => { - - // Assert Model interface - if (!(resolvedModel instanceof IFrameEditorModel)) { - return TPromise.wrapError('Invalid editor input. IFrame editor requires a model instance of IFrameEditorModel.'); - } - - // Assert that the current input is still the one we expect. This prevents a race condition when loading takes long and another input was set meanwhile - if (!this.getInput() || this.getInput() !== input) { - return null; - } - - // Set IFrame contents - let iframeModel = resolvedModel; - let isUpdate = !isNewInput && !!this.iframeBuilder.getProperty(IFrameEditor.RESOURCE_PROPERTY); - let contents = iframeModel.getContents(); - - // Crazy hack to get keybindings to bubble out of the iframe to us - contents.body = contents.body + this.enableKeybindings(); - - // Set Contents - try { - this.setFrameContents(iframeModel.resource, isUpdate ? contents.body : [contents.head, contents.body, contents.tail].join('\n'), isUpdate /* body only */); - } catch (error) { - setTimeout(() => this.reload(true /* clear */), 1000); // retry in case of an error which indicates the iframe (only) might be on a different URL - } - - // When content is fully replaced, we also need to recreate the focus tracker - if (!isUpdate) { - this.clearFocusTracker(); - } - - // Track focus on contents and make the editor active when focus is received - if (!this.focusTracker) { - this.focusTracker = DOM.trackFocus((this.iframeBuilder.getHTMLElement()).contentWindow); - this.focusTracker.addFocusListener(() => { - this.editorGroupService.activateGroup(this.position); - }); - } - }); - } - - private setFrameContents(resource: URI, contents: string, isUpdate: boolean): void { - let iframeWindow = (this.iframeBuilder.getHTMLElement()).contentWindow; - - // Update body only if this is an update of the same resource (preserves scroll position and does not flicker) - if (isUpdate) { - iframeWindow.document.body.innerHTML = contents; - } - - // Write directly to iframe document replacing any previous content - else { - iframeWindow.document.open('text/html', 'replace'); - iframeWindow.document.write(contents); - iframeWindow.document.close(); - - // Reset scroll - iframeWindow.scrollTo(0, 0); - - // Associate resource with iframe - this.iframeBuilder.setProperty(IFrameEditor.RESOURCE_PROPERTY, resource.toString()); - } - } - - private enableKeybindings(): string { - return [ - '' - ].join('\n'); - } - - public clearInput(): void { - - // Reset IFrame - this.clearIFrame(); - - super.clearInput(); - } - - private clearIFrame(): void { - this.iframeBuilder.src('about:blank'); - this.iframeBuilder.removeProperty(IFrameEditor.RESOURCE_PROPERTY); - - // Focus Listener - this.clearFocusTracker(); - } - - private clearFocusTracker(): void { - if (this.focusTracker) { - this.focusTracker.dispose(); - this.focusTracker = null; - } - } - - public layout(dimension: Dimension): void { - - // Pass on to IFrame Container and IFrame - this.iframeContainer.size(dimension.width, dimension.height); - this.iframeBuilder.size(dimension.width, dimension.height); - } - - public focus(): void { - this.iframeContainer.domFocus(); - } - - public changePosition(position: Position): void { - super.changePosition(position); - - // reparenting an IFRAME into another DOM element yields weird results when the contents are made - // of a string and not a URL. to be on the safe side we reload the iframe when the position changes - // and we do it using a timeout of 0 to reload only after the position has been changed in the DOM - setTimeout(() => this.reload(true)); - } - - /** - * Reloads the contents of the iframe in this editor by reapplying the input. - */ - public reload(clearIFrame?: boolean): void { - if (this.input) { - if (clearIFrame) { - this.clearIFrame(); - } - - this.doSetInput(this.input).done(null, errors.onUnexpectedError); - } - } - - public dispose(): void { - - // Destroy Container - this.iframeContainer.destroy(); - - // Focus Listener - this.clearFocusTracker(); - - super.dispose(); - } -} \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/media/notabstitle.css b/src/vs/workbench/browser/parts/editor/media/notabstitle.css index dbc0d75c794..91b4b6cff34 100644 --- a/src/vs/workbench/browser/parts/editor/media/notabstitle.css +++ b/src/vs/workbench/browser/parts/editor/media/notabstitle.css @@ -7,6 +7,7 @@ .monaco-workbench > .part.editor > .content > .one-editor-container > .title .title-decoration { width: 18px; + padding-left: 2px; } .monaco-workbench > .part.editor > .content > .one-editor-container > .title .title-decoration.dirty { diff --git a/src/vs/workbench/browser/parts/editor/media/sidebyside.css b/src/vs/workbench/browser/parts/editor/media/sidebyside.css index 5a018fd4084..6856774592e 100644 --- a/src/vs/workbench/browser/parts/editor/media/sidebyside.css +++ b/src/vs/workbench/browser/parts/editor/media/sidebyside.css @@ -11,6 +11,35 @@ background-color: #252526; } +#monaco-workbench-editor-move-overlay, +#monaco-workbench-editor-drop-overlay { + position: absolute; + left: 0; + width: 100%; + z-index: 3000000; +} + +#monaco-workbench-editor-drop-overlay { + opacity: 0; /* initially not visible until moving around */ +} + +.vs #monaco-workbench-editor-drop-overlay, +.vs .monaco-workbench .editor.empty > .content.dropfeedback { + background-color: rgba(51,153,255, 0.18); +} + +.vs-dark #monaco-workbench-editor-drop-overlay, +.vs-dark .monaco-workbench .editor.empty > .content.dropfeedback { + background-color: rgba(83, 89, 93, 0.5); +} + +.hc-black #monaco-workbench-editor-drop-overlay, +.hc-black .monaco-workbench .editor.empty > .content.dropfeedback { + background: none !important; + outline: 2px dashed #f38518; + outline-offset: -2px; +} + .vs .monaco-workbench .editor > .content.dragged { border-left: 1px solid #E7E7E7; border-right: 1px solid #E7E7E7; diff --git a/src/vs/workbench/browser/parts/editor/media/tabstitle.css b/src/vs/workbench/browser/parts/editor/media/tabstitle.css index 5c26d7a4ede..4ec13f088bf 100644 --- a/src/vs/workbench/browser/parts/editor/media/tabstitle.css +++ b/src/vs/workbench/browser/parts/editor/media/tabstitle.css @@ -11,8 +11,12 @@ .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container { display: flex; - overflow: scroll; background-color: rgba(128, 128, 128, 0.2); + height: 35px; +} + +.monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container.scroll { + overflow: scroll !important; } .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container::-webkit-scrollbar { @@ -35,12 +39,8 @@ padding-left: 10px; } -.monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab:focus { - outline-offset: -2px; -} - .hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title.active .tabs-container > .tab.active { - border: 1px solid #6FC3DF; + border: 1px solid #f38518; } .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab:first-child { @@ -48,28 +48,29 @@ } .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab.active { - border-bottom: 0; + border-bottom-color: transparent; opacity: 1 !important; } -.vs .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container.dropfeedback, +.vs .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container.dropfeedback { + background-color: rgba(51,153,255, 0.18); +} + .vs .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab.dropfeedback { - background-color: #DDECFF; + background-color: rgba(187, 230, 255, 0.5); + opacity: 1 !important; } .vs-dark .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container.dropfeedback, .vs-dark .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab.dropfeedback { - background-color: #383B3D; + background-color: rgba(83, 89, 93, 0.5); } .hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container.dropfeedback, .hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab.dropfeedback { background: none !important; - border: 1px dashed #f38518; -} - -.monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab.dragged { - opacity: 0.7 !important; + outline: 2px dashed #f38518; + outline-offset: -2px; } /* Tab Close */ @@ -133,6 +134,7 @@ content: url('close-dirty-inverse.svg'); } +.hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab .close-editor-action, .hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title .tabs-container > .tab.dirty .close-editor-action:hover { content: url('close-inverse.svg'); } diff --git a/src/vs/workbench/browser/parts/editor/media/titlecontrol.css b/src/vs/workbench/browser/parts/editor/media/titlecontrol.css index 2555f319b0b..d0380420643 100644 --- a/src/vs/workbench/browser/parts/editor/media/titlecontrol.css +++ b/src/vs/workbench/browser/parts/editor/media/titlecontrol.css @@ -51,12 +51,18 @@ .monaco-workbench > .part.editor > .content > .one-editor-container > .title .group-actions .action-label { display: block; height: 35px; - width: 28px; + line-height: 35px; + min-width: 28px; background-size: 16px; background-position: center center; background-repeat: no-repeat; } +.hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title .title-actions .action-label, +.hc-black .monaco-workbench > .part.editor > .content > .one-editor-container > .title .group-actions .action-label { + line-height: initial; +} + .monaco-workbench > .part.editor > .content > .one-editor-container > .title .group-actions .action-label .label, .monaco-workbench > .part.editor > .content > .one-editor-container > .title .title-actions .action-label .label { display: none; @@ -78,21 +84,6 @@ cursor: -webkit-grabbing; } -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container .title, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container .title .title-label a, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container .title .title-label span { - cursor: url(data:;base64,AAACAAEAICACAAcABQAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), auto; -} - -#monaco-workbench-editor-move-overlay-custom-drag-cursor, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container.dragged, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container.dragged .title, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container.dragged .title .title-label a, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container.dragged .title .title-label span, -.monaco-workbench > .part.editor > .content.multiple-editors.custom-drag-cursor .one-editor-container.dragged .monaco-editor .view-lines { - cursor: url(data:;base64,AAACAAEAICACAAcABQAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAAH/AAAB/wAAA/0AAANsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//+AB///wAf//4AH//+AD///yT/////////////////////////////8=), auto; -} - /* Actions */ .monaco-workbench .close-editor-action { @@ -136,8 +127,13 @@ width: 16px; } -.hc-black .monaco-workbench .close-editor-action { +.hc-black .monaco-workbench .close-editor-action:before { content: url('close-inverse.svg'); + position: absolute; + top: 12px; + left: 8px; + height: 16px; + width: 16px; } .hc-black .monaco-workbench .split-editor-action:before { diff --git a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts index c5ec12ea615..499a30b1c88 100644 --- a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts @@ -9,13 +9,13 @@ import 'vs/css!./media/notabstitle'; import {prepareActions} from 'vs/workbench/browser/actionBarRegistry'; import errors = require('vs/base/common/errors'); import arrays = require('vs/base/common/arrays'); -import {Builder, $} from 'vs/base/browser/builder'; import {IEditorGroup, EditorInput} from 'vs/workbench/common/editor'; import DOM = require('vs/base/browser/dom'); import {ToolBar} from 'vs/base/browser/ui/toolbar/toolbar'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IContextMenuService} from 'vs/platform/contextview/browser/contextView'; import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; +import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IMessageService} from 'vs/platform/message/common/message'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; @@ -23,10 +23,10 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingServic import {TitleControl} from 'vs/workbench/browser/parts/editor/titleControl'; export class NoTabsTitleControl extends TitleControl { - private titleContainer: Builder; - private titleLabel: Builder; - private titleDecoration: Builder; - private titleDescription: Builder; + private titleContainer: HTMLElement; + private titleLabel: HTMLElement; + private titleDecoration: HTMLElement; + private titleDescription: HTMLElement; private editorActionsToolbar: ToolBar; @@ -36,13 +36,14 @@ export class NoTabsTitleControl extends TitleControl { constructor( @IContextMenuService contextMenuService: IContextMenuService, @IInstantiationService instantiationService: IInstantiationService, + @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IEditorGroupService editorGroupService: IEditorGroupService, @IKeybindingService keybindingService: IKeybindingService, @ITelemetryService telemetryService: ITelemetryService, @IMessageService messageService: IMessageService ) { - super(contextMenuService, instantiationService, editorService, editorGroupService, keybindingService, telemetryService, messageService); + super(contextMenuService, instantiationService, configurationService, editorService, editorGroupService, keybindingService, telemetryService, messageService); this.currentPrimaryEditorActionIds = []; this.currentSecondaryEditorActionIds = []; @@ -54,50 +55,51 @@ export class NoTabsTitleControl extends TitleControl { this.editorActionsToolbar.context = { group }; } - public create(parent: Builder): void { - this.titleContainer = $(parent); + public create(parent: HTMLElement): void { + this.titleContainer = parent; // Pin on double click - parent.on(DOM.EventType.DBLCLICK, (e: MouseEvent) => { + this.toDispose.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.DBLCLICK, (e: MouseEvent) => { DOM.EventHelper.stop(e); this.onTitleDoubleClick(); - }); + })); + // Detect mouse click - parent.on(DOM.EventType.MOUSE_UP, (e: MouseEvent) => { + this.toDispose.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.MOUSE_UP, (e: MouseEvent) => { DOM.EventHelper.stop(e, false); this.onTitleClick(e); - }); + })); // Left Title Decoration - parent.div({ - 'class': 'title-decoration' - }, (div) => { - this.titleDecoration = div; - }); + this.titleDecoration = document.createElement('div'); + DOM.addClass(this.titleDecoration, 'title-decoration'); + this.titleContainer.appendChild(this.titleDecoration); // Left Title Label & Description - parent.div({ - 'class': 'title-label' - }, (div) => { + const labelContainer = document.createElement('div'); + DOM.addClass(labelContainer, 'title-label'); - // Label - this.titleLabel = $(div).a(); + this.titleLabel = document.createElement('a'); + labelContainer.appendChild(this.titleLabel); - // Description - this.titleDescription = $(div).span(); - }); + this.titleDescription = document.createElement('span'); + labelContainer.appendChild(this.titleDescription); + + this.titleContainer.appendChild(labelContainer); // Right Actions Container - parent.div({ - 'class': 'title-actions' - }, (div) => { + const actionsContainer = document.createElement('div'); + DOM.addClass(actionsContainer, 'title-actions'); - // Editor actions - this.editorActionsToolbar = this.doCreateToolbar(div); - }); + this.editorActionsToolbar = this.doCreateToolbar(actionsContainer); + + this.titleContainer.appendChild(actionsContainer); + + // Context Menu + this.toDispose.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.CONTEXT_MENU, (e: Event) => this.onContextMenu({ group: this.context, editor: this.context.activeEditor }, e, this.titleContainer))); } private onTitleDoubleClick(): void { @@ -131,13 +133,12 @@ export class NoTabsTitleControl extends TitleControl { } protected doRefresh(): void { - if (!this.context) { - return; - } - const group = this.context; - const editor = group.activeEditor; + const editor = group && group.activeEditor; if (!editor) { + this.titleLabel.innerText = ''; + this.titleDescription.innerText = ''; + this.editorActionsToolbar.setActions([], [])(); this.currentPrimaryEditorActionIds = []; @@ -151,16 +152,16 @@ export class NoTabsTitleControl extends TitleControl { // Pinned state if (isPinned) { - this.titleContainer.addClass('pinned'); + DOM.addClass(this.titleContainer, 'pinned'); } else { - this.titleContainer.removeClass('pinned'); + DOM.removeClass(this.titleContainer, 'pinned'); } // Activity state if (isActive) { - this.titleContainer.addClass('active'); + DOM.addClass(this.titleContainer, 'active'); } else { - this.titleContainer.removeClass('active'); + DOM.removeClass(this.titleContainer, 'active'); } // Editor Title @@ -171,21 +172,21 @@ export class NoTabsTitleControl extends TitleControl { verboseDescription = ''; // dont repeat what is already shown } - this.titleLabel.safeInnerHtml(name); - this.titleLabel.title(verboseDescription); + this.titleLabel.innerText = name; + this.titleLabel.title = verboseDescription; - this.titleDescription.safeInnerHtml(description); - this.titleDescription.title(verboseDescription); + this.titleDescription.innerText = description; + this.titleDescription.title = verboseDescription; // Editor Decoration if (editor.isDirty()) { - this.titleDecoration.addClass('dirty'); + DOM.addClass(this.titleDecoration, 'dirty'); } else { - this.titleDecoration.removeClass('dirty'); + DOM.removeClass(this.titleDecoration, 'dirty'); } // Update Editor Actions Toolbar - const editorActions = this.getEditorActions(group); + const editorActions = this.getEditorActions({group, editor }); const primaryEditorActions = prepareActions(editorActions.primary); if (isActive && editor instanceof EditorInput && editor.supportsSplitEditor()) { primaryEditorActions.push(this.splitEditorAction); diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts index eb7b7d0d3c5..be6d811fc4d 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts @@ -9,13 +9,14 @@ import 'vs/css!./media/sidebyside'; import arrays = require('vs/base/common/arrays'); import Event, {Emitter} from 'vs/base/common/event'; import {StandardMouseEvent} from 'vs/base/browser/mouseEvent'; -import {isWindows} from 'vs/base/common/platform'; import types = require('vs/base/common/types'); import {Dimension, Builder, $} from 'vs/base/browser/builder'; import {Sash, ISashEvent, IVerticalSashLayoutProvider} from 'vs/base/browser/ui/sash/sash'; import {ProgressBar} from 'vs/base/browser/ui/progressbar/progressbar'; import {BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor'; import DOM = require('vs/base/browser/dom'); +import errors = require('vs/base/common/errors'); +import {isMacintosh} from 'vs/base/common/platform'; import {IWorkbenchEditorService, GroupArrangement} from 'vs/workbench/services/editor/common/editorService'; import {IContextMenuService} from 'vs/platform/contextview/browser/contextView'; import {Position, POSITIONS} from 'vs/platform/editor/common/editor'; @@ -26,11 +27,14 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; +import {IExtensionService} from 'vs/platform/extensions/common/extensions'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {TabsTitleControl} from 'vs/workbench/browser/parts/editor/tabsTitleControl'; +import {TitleControl} from 'vs/workbench/browser/parts/editor/titleControl'; import {NoTabsTitleControl} from 'vs/workbench/browser/parts/editor/noTabsTitleControl'; -import {IEditorStacksModel, IStacksModelChangeEvent, IWorkbenchEditorConfiguration} from 'vs/workbench/common/editor'; +import {IEditorStacksModel, IStacksModelChangeEvent, IWorkbenchEditorConfiguration, EditorOptions} from 'vs/workbench/common/editor'; import {ITitleAreaControl} from 'vs/workbench/browser/parts/editor/titleControl'; +import {extractResources} from 'vs/base/browser/dnd'; export enum Rochade { NONE, @@ -124,6 +128,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti @IEventService private eventService: IEventService, @IConfigurationService private configurationService: IConfigurationService, @IKeybindingService private keybindingService: IKeybindingService, + @IExtensionService private extensionService: IExtensionService, @IInstantiationService private instantiationService: IInstantiationService ) { this.stacks = editorGroupService.getStacksModel(); @@ -154,6 +159,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti private registerListeners(): void { this.toDispose.push(this.stacks.onModelChanged(e => this.onStacksChanged(e))); this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.extensionService.onReady().then(() => POSITIONS.forEach(position => this.titleAreaControl[position].refresh())); } private onConfigurationUpdated(configuration: IWorkbenchEditorConfiguration): void { @@ -161,7 +167,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti const titleControl = this.titleAreaControl[position]; if (titleControl) { const usingTabs = (titleControl instanceof TabsTitleControl); - const useTabs = configuration.workbench.showEditorTabs; + const useTabs = configuration.workbench.editor.showTabs; if (usingTabs !== useTabs) { // Dispose old @@ -704,6 +710,9 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti private create(parent: Builder): void { + // Allow to drop into container to open + this.enableDropTarget(parent.getHTMLElement()); + // Left Container this.containers[Position.LEFT] = $(parent).div({ class: 'one-editor-container editor-left monaco-editor-background' }); @@ -743,18 +752,238 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti this.progressBar[position] = new ProgressBar($(this.containers[position])); this.progressBar[position].getContainer().hide(); }); + } - // Drag cursor - if (isWindows) { - parent.addClass('custom-drag-cursor'); + private enableDropTarget(node: HTMLElement): void { + const $this = this; + const overlayId = 'monaco-workbench-editor-drop-overlay'; + const splitToPropertyKey = 'splitToPosition'; + const stacks = this.editorGroupService.getStacksModel(); + let overlay: Builder; + + function onDrop(e: DragEvent, position: Position, splitTo?: Position): void { + DOM.removeClass(node, 'dropfeedback'); + destroyOverlay(); + + const editorService = $this.editorService; + const groupService = $this.editorGroupService; + + const splitEditor = (typeof splitTo === 'number'); // TODO@Ben ugly split code should benefit from empty group support once available! + const freeGroup = (stacks.groups.length === 1) ? Position.CENTER : Position.RIGHT; + const pinned = EditorOptions.create({ pinned: true }); + + // Check for transfer from title control + const draggedEditor = TitleControl.getDraggedEditor(); + if (draggedEditor) { + const isCopy = (e.ctrlKey && !isMacintosh) || (e.altKey && isMacintosh); + + // Copy editor to new location + if (isCopy) { + if (splitEditor) { + editorService.openEditor(draggedEditor.editor, pinned, freeGroup).then(() => { + if (splitTo !== freeGroup) { + groupService.moveGroup(freeGroup, splitTo); + } + }).done(null, errors.onUnexpectedError); + } else { + editorService.openEditor(draggedEditor.editor, pinned, position).done(null, errors.onUnexpectedError); + } + } + + // Move editor to new location + else { + const sourcePosition = stacks.positionOfGroup(draggedEditor.group); + if (splitEditor) { + if (draggedEditor.group.count === 1) { + groupService.moveGroup(sourcePosition, splitTo); + } else { + editorService.openEditor(draggedEditor.editor, pinned, freeGroup).then(() => { + if (splitTo !== freeGroup) { + groupService.moveGroup(freeGroup, splitTo); + } + groupService.moveEditor(draggedEditor.editor, stacks.positionOfGroup(draggedEditor.group), splitTo); + }).done(null, errors.onUnexpectedError); + } + + } else { + groupService.moveEditor(draggedEditor.editor, sourcePosition, position); + } + } + } + + // Check for URI transfer + else { + const droppedResources = extractResources(e).filter(r => r.scheme === 'file' || r.scheme === 'untitled'); + if (droppedResources.length) { + window.focus(); // make sure this window has focus so that the open call reaches the right window! + + // Open all + editorService.openEditors(droppedResources.map(resource => { return { input: { resource, options: { pinned: true } }, position: splitEditor ? freeGroup : position }; })) + .then(() => { + if (splitEditor && splitTo !== freeGroup) { + groupService.moveGroup(freeGroup, splitTo); + } + + groupService.focusGroup(splitEditor ? splitTo : position); + }) + .done(null, errors.onUnexpectedError); + } + } } + + function destroyOverlay(): void { + if (overlay) { + overlay.destroy(); + overlay = void 0; + } + } + + function positionOverlay(e: DragEvent, groups: number, position: Position): void { + const target = e.target; + const posXOnOverlay = e.offsetX; + const overlayIsSplit = typeof overlay.getProperty(splitToPropertyKey) === 'number'; + const overlayWidth = target.clientWidth; + const splitThreshold = overlayIsSplit ? overlayWidth / 5 : overlayWidth / 10; + const isCopy = (e.ctrlKey && !isMacintosh) || (e.altKey && isMacintosh); + const draggedEditor = TitleControl.getDraggedEditor(); + + const isOverSplitLeft = posXOnOverlay < splitThreshold; + const isOverSplitRight = posXOnOverlay + splitThreshold > overlayWidth; + + let splitTarget: Position; + + // No splitting if we reached maximum group count + if (groups === POSITIONS.length) { + splitTarget = null; + } + + // Special splitting if we drag an editor of a group with only one editor + else if (!isCopy && draggedEditor && draggedEditor.group.count === 1) { + const positionOfDraggedEditor = stacks.positionOfGroup(draggedEditor.group); + switch (positionOfDraggedEditor) { + case Position.LEFT: + if (position === Position.CENTER && isOverSplitRight) { + splitTarget = Position.CENTER; // allow to move single editor from LEFT to CENTER + } + break; + case Position.CENTER: + if (position === Position.LEFT && isOverSplitLeft) { + splitTarget = Position.LEFT; // allow to move single editor from CENTER to LEFT + } + break; + default: + splitTarget = null; // splitting not allowed + } + } + + // Any other case, check for mouse position + else { + if (isOverSplitRight) { + splitTarget = (position === Position.LEFT) ? Position.CENTER : Position.RIGHT; + } else if (isOverSplitLeft) { + splitTarget = (position === Position.LEFT) ? Position.LEFT : Position.CENTER; + } + } + + // Apply split target + const canSplit = (typeof splitTarget === 'number'); + if (canSplit) { + overlay.setProperty(splitToPropertyKey, splitTarget); + } else { + overlay.removeProperty(splitToPropertyKey); + } + + // Update overlay styles + if (canSplit && isOverSplitRight) { + overlay.style({ + left: '50%', + width: '50%', + }); + } else if (canSplit && isOverSplitLeft) { + overlay.style({ + width: '50%' + }); + } else { + overlay.style({ + left: '0', + width: '100%' + }); + } + + // Make sure the overlay is visible + overlay.style({ opacity: 1 }); + } + + function createOverlay(target: HTMLElement): void { + if (!overlay) { + const containers = $this.visibleEditorContainers.filter(c => !!c); + containers.forEach((container, index) => { + if (container && DOM.isAncestor(target, container.getHTMLElement())) { + const useTabs = !!$this.configurationService.getConfiguration().workbench.editor.showTabs; + + overlay = $('div').style({ + top: useTabs ? SideBySideEditorControl.EDITOR_TITLE_HEIGHT + 'px' : 0, + height: useTabs ? `calc(100% - ${SideBySideEditorControl.EDITOR_TITLE_HEIGHT}px` : '100%' + }).id(overlayId); + + overlay.appendTo(container); + + overlay.on(DOM.EventType.DROP, (e: DragEvent) => { + DOM.EventHelper.stop(e, true); + onDrop(e, index, overlay.getProperty(splitToPropertyKey)); + }); + + overlay.on(DOM.EventType.DRAG_OVER, (e: DragEvent) => { + positionOverlay(e, containers.length, index); + }); + + overlay.on([DOM.EventType.DRAG_LEAVE, DOM.EventType.DRAG_END], () => { + destroyOverlay(); + }); + } + }); + } + } + + // Let a dropped file open inside Code (only if dropped over editor area) + this.toDispose.push(DOM.addDisposableListener(node, DOM.EventType.DROP, (e: DragEvent) => { + DOM.EventHelper.stop(e, true); + onDrop(e, Position.LEFT); + })); + + // Drag over + this.toDispose.push(DOM.addDisposableListener(node, DOM.EventType.DRAG_OVER, (e: DragEvent) => { + DOM.addClass(node, 'dropfeedback'); + + const target = e.target; + if (target) { + if (overlay && target.id !== overlayId) { + destroyOverlay(); // somehow we managed to move the mouse quickly out of the current overlay, so destroy it + } + + createOverlay(target); + } + })); + + // Drag leave + this.toDispose.push(DOM.addDisposableListener(node, DOM.EventType.DRAG_LEAVE, (e: DragEvent) => { + DOM.removeClass(node, 'dropfeedback'); + })); + + // Drag end (also install globally to be safe) + [node, window].forEach(container => { + this.toDispose.push(DOM.addDisposableListener(container, DOM.EventType.DRAG_END, (e: DragEvent) => { + DOM.removeClass(node, 'dropfeedback'); + destroyOverlay(); + })); + }); } private createTitleControl(position: Position): void { - const useTabs = !!this.configurationService.getConfiguration().workbench.showEditorTabs; + const useTabs = !!this.configurationService.getConfiguration().workbench.editor.showTabs; this.titleAreaControl[position] = useTabs ? this.instantiationService.createInstance(TabsTitleControl) : this.instantiationService.createInstance(NoTabsTitleControl); - this.titleAreaControl[position].create($(this.titleContainer[position])); + this.titleAreaControl[position].create(this.titleContainer[position].getHTMLElement()); this.titleAreaControl[position].setContext(this.stacks.groupAt(position)); this.titleAreaControl[position].refresh(); } @@ -783,15 +1012,11 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti DOM.EventHelper.stop(e); - // Overlay the editor area with a div to be able to capture all mouse events (helps when iframes are used in any editor) + // Overlay the editor area with a div to be able to capture all mouse events let overlayDiv = $('div').style({ - position: 'absolute', top: SideBySideEditorControl.EDITOR_TITLE_HEIGHT + 'px', - left: 0, - width: '100%', - height: '100%', - zIndex: 3000000 - }).id(isWindows ? 'monaco-workbench-editor-move-overlay-custom-drag-cursor' : 'monaco-workbench-editor-move-overlay'); + height: '100%' + }).id('monaco-workbench-editor-move-overlay'); overlayDiv.appendTo(this.parent); // Update flag @@ -936,8 +1161,12 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti // Move to valid position if any if (moveTo !== null) { this.editorGroupService.moveGroup(position, moveTo); - this.titleAreaControl[position].refresh(true); - this.titleAreaControl[moveTo].refresh(true); + + // To reduce flickering during this operation we trigger a refresh of all + // title controls right after. + POSITIONS.forEach(p => { + this.titleAreaControl[p].refresh(true); + }); } // Otherwise layout to restore proper positioning diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 9f73c4b6e99..8dded89ab7b 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -6,24 +6,20 @@ 'use strict'; import 'vs/css!./media/tabstitle'; -import {TPromise} from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); import {IAction} from 'vs/base/common/actions'; import {prepareActions} from 'vs/workbench/browser/actionBarRegistry'; import arrays = require('vs/base/common/arrays'); import errors = require('vs/base/common/errors'); -import URI from 'vs/base/common/uri'; import DOM = require('vs/base/browser/dom'); import {isMacintosh} from 'vs/base/common/platform'; -import {Builder, $} from 'vs/base/browser/builder'; import {MIME_BINARY} from 'vs/base/common/mime'; import {Position} from 'vs/platform/editor/common/editor'; -import {IEditorGroup, IEditorIdentifier, asFileEditorInput, EditorOptions, IWorkbenchEditorConfiguration} from 'vs/workbench/common/editor'; +import {IEditorGroup, IEditorIdentifier, asFileEditorInput, EditorOptions} from 'vs/workbench/common/editor'; import {ToolBar} from 'vs/base/browser/ui/toolbar/toolbar'; import {StandardKeyboardEvent} from 'vs/base/browser/keyboardEvent'; import {CommonKeybindings as Kb} from 'vs/base/common/keyCodes'; import {ActionBar, Separator} from 'vs/base/browser/ui/actionbar/actionbar'; -import {StandardMouseEvent} from 'vs/base/browser/mouseEvent'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IContextMenuService} from 'vs/platform/contextview/browser/contextView'; @@ -36,11 +32,9 @@ import {TitleControl} from 'vs/workbench/browser/parts/editor/titleControl'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {ScrollableElement} from 'vs/base/browser/ui/scrollbar/scrollableElement'; import {ScrollbarVisibility} from 'vs/base/browser/ui/scrollbar/scrollableElementOptions'; +import {extractResources} from 'vs/base/browser/dnd'; export class TabsTitleControl extends TitleControl { - - private static draggedEditor: IEditorIdentifier; - private titleContainer: HTMLElement; private tabsContainer: HTMLElement; private activeTab: HTMLElement; @@ -52,36 +46,22 @@ export class TabsTitleControl extends TitleControl { private currentPrimaryGroupActionIds: string[]; private currentSecondaryGroupActionIds: string[]; - private previewEditors: boolean; - constructor( @IContextMenuService contextMenuService: IContextMenuService, @IInstantiationService instantiationService: IInstantiationService, - @IConfigurationService private configurationService: IConfigurationService, + @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IEditorGroupService editorGroupService: IEditorGroupService, @IKeybindingService keybindingService: IKeybindingService, @ITelemetryService telemetryService: ITelemetryService, @IMessageService messageService: IMessageService ) { - super(contextMenuService, instantiationService, editorService, editorGroupService, keybindingService, telemetryService, messageService); + super(contextMenuService, instantiationService, configurationService, editorService, editorGroupService, keybindingService, telemetryService, messageService); this.currentPrimaryGroupActionIds = []; this.currentSecondaryGroupActionIds = []; this.tabDisposeables = []; - - this.onConfigurationUpdated(configurationService.getConfiguration()); - - this.registerListeners(); - } - - private registerListeners(): void { - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); - } - - private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { - this.previewEditors = config.workbench.previewEditors; } public setContext(group: IEditorGroup): void { @@ -90,13 +70,22 @@ export class TabsTitleControl extends TitleControl { this.groupActionsToolbar.context = { group }; } - public create(parent: Builder): void { - this.titleContainer = parent.getHTMLElement(); + public create(parent: HTMLElement): void { + this.titleContainer = parent; // Tabs Container this.tabsContainer = document.createElement('div'); + this.tabsContainer.setAttribute('role', 'tablist'); DOM.addClass(this.tabsContainer, 'tabs-container'); + this.toDispose.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.SCROLL, e => { + if (DOM.hasClass(this.tabsContainer, 'scroll')) { + this.scrollbar.updateState({ + scrollLeft: this.tabsContainer.scrollLeft // during DND the container gets scrolled so we need to update the custom scrollbar + }); + } + })); + // Custom Scrollbar this.scrollbar = new ScrollableElement(this.tabsContainer, { horizontal: ScrollbarVisibility.Auto, @@ -106,7 +95,6 @@ export class TabsTitleControl extends TitleControl { canUseTranslate3d: true, horizontalScrollbarSize: 3 }); - this.tabsContainer.style.overflow = 'scroll'; // custom scrollbar is eager on removing this style but we want it for DND scroll feedback this.scrollbar.onScroll(e => { this.tabsContainer.scrollLeft = e.scrollLeft; @@ -116,6 +104,8 @@ export class TabsTitleControl extends TitleControl { // Drag over this.toDispose.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.DRAG_OVER, (e: DragEvent) => { + DOM.addClass(this.tabsContainer, 'scroll'); // enable support to scroll while dragging + const target = e.target; if (target instanceof HTMLElement && target.className.indexOf('tabs-container') === 0) { DOM.addClass(this.tabsContainer, 'dropfeedback'); @@ -125,16 +115,19 @@ export class TabsTitleControl extends TitleControl { // Drag leave this.toDispose.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.DRAG_LEAVE, (e: DragEvent) => { DOM.removeClass(this.tabsContainer, 'dropfeedback'); + DOM.removeClass(this.tabsContainer, 'scroll'); })); // Drag end this.toDispose.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.DRAG_END, (e: DragEvent) => { DOM.removeClass(this.tabsContainer, 'dropfeedback'); + DOM.removeClass(this.tabsContainer, 'scroll'); })); // Drop onto tabs container this.toDispose.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.DROP, (e: DragEvent) => { DOM.removeClass(this.tabsContainer, 'dropfeedback'); + DOM.removeClass(this.tabsContainer, 'scroll'); const target = e.target; if (target instanceof HTMLElement && target.className.indexOf('tabs-container') === 0) { @@ -144,20 +137,23 @@ export class TabsTitleControl extends TitleControl { const targetIndex = group.count; // Local DND - if (TabsTitleControl.draggedEditor) { - e.preventDefault(); + const draggedEditor = TitleControl.getDraggedEditor(); + if (draggedEditor) { + DOM.EventHelper.stop(e, true); - const sourcePosition = this.stacks.positionOfGroup(TabsTitleControl.draggedEditor.group); + const sourcePosition = this.stacks.positionOfGroup(draggedEditor.group); // Move editor to target position and index - if (this.isMoveOperation(e, TabsTitleControl.draggedEditor.group, group)) { - this.editorGroupService.moveEditor(TabsTitleControl.draggedEditor.editor, sourcePosition, targetPosition, targetIndex); + if (this.isMoveOperation(e, draggedEditor.group, group)) { + this.editorGroupService.moveEditor(draggedEditor.editor, sourcePosition, targetPosition, targetIndex); } // Copy: just open editor at target index else { - this.editorService.openEditor(TabsTitleControl.draggedEditor.editor, EditorOptions.create({ pinned: true, index: targetIndex }), targetPosition).done(null, errors.onUnexpectedError); + this.editorService.openEditor(draggedEditor.editor, EditorOptions.create({ pinned: true, index: targetIndex }), targetPosition).done(null, errors.onUnexpectedError); } + + this.onEditorDragEnd(); } // External DND @@ -172,7 +168,7 @@ export class TabsTitleControl extends TitleControl { const groupActionsContainer = document.createElement('div'); DOM.addClass(groupActionsContainer, 'group-actions'); this.titleContainer.appendChild(groupActionsContainer); - this.groupActionsToolbar = this.doCreateToolbar($(groupActionsContainer)); + this.groupActionsToolbar = this.doCreateToolbar(groupActionsContainer); } public allowDragging(element: HTMLElement): boolean { @@ -212,9 +208,11 @@ export class TabsTitleControl extends TitleControl { // Active state if (isActive) { DOM.addClass(tabContainer, 'active'); + tabContainer.setAttribute('aria-selected', 'true'); this.activeTab = tabContainer; } else { DOM.removeClass(tabContainer, 'active'); + tabContainer.setAttribute('aria-selected', 'false'); } // Dirty State @@ -231,13 +229,11 @@ export class TabsTitleControl extends TitleControl { } protected doRefresh(): void { - if (!this.context) { - return; - } - const group = this.context; - const editor = group.activeEditor; + const editor = group && group.activeEditor; if (!editor) { + this.clearTabs(); + this.groupActionsToolbar.setActions([], [])(); this.currentPrimaryGroupActionIds = []; @@ -266,12 +262,16 @@ export class TabsTitleControl extends TitleControl { this.doUpdate(); } - private refreshTabs(group: IEditorGroup): void { - - // Empty container first + private clearTabs(): void { DOM.clearNode(this.tabsContainer); dispose(this.tabDisposeables); this.tabDisposeables = []; + } + + private refreshTabs(group: IEditorGroup): void { + + // Empty container first + this.clearTabs(); const tabContainers: HTMLElement[] = []; @@ -280,6 +280,8 @@ export class TabsTitleControl extends TitleControl { const tabContainer = document.createElement('div'); tabContainer.draggable = true; tabContainer.tabIndex = 0; + tabContainer.setAttribute('role', 'tab'); + tabContainer.setAttribute('aria-label', editor.getName()); DOM.addClass(tabContainer, 'tab monaco-editor-background'); tabContainers.push(tabContainer); @@ -330,9 +332,11 @@ export class TabsTitleControl extends TitleControl { const containerScrollPosX = this.tabsContainer.scrollLeft; const activeTabPosX = this.activeTab.offsetLeft; const activeTabWidth = this.activeTab.offsetWidth; + const activeTabFits = activeTabWidth <= visibleContainerWidth; // Tab is overflowing to the right: Scroll minimally until the element is fully visible to the right - if (containerScrollPosX + visibleContainerWidth < activeTabPosX + activeTabWidth) { + // Note: only try to do this if we actually have enough width to give to show the tab fully! + if (activeTabFits && containerScrollPosX + visibleContainerWidth < activeTabPosX + activeTabWidth) { this.scrollbar.updateState({ scrollLeft: containerScrollPosX + ((activeTabPosX + activeTabWidth) /* right corner of tab */ - (containerScrollPosX + visibleContainerWidth) /* right corner of view port */) }); @@ -347,9 +351,7 @@ export class TabsTitleControl extends TitleControl { // Update enablement of certain actions that depend on overflow const isOverflowing = (totalContainerWidth > visibleContainerWidth); - this.showEditorsOfLeftGroup.enabled = isOverflowing; - this.showEditorsOfCenterGroup.enabled = isOverflowing; - this.showEditorsOfRightGroup.enabled = isOverflowing; + this.showEditorsInGroupAction.enabled = isOverflowing; } private hookTabListeners(tab: HTMLElement, identifier: IEditorIdentifier): void { @@ -358,6 +360,8 @@ export class TabsTitleControl extends TitleControl { // Open on Click this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => { + tab.blur(); + if (e.button === 0 /* Left Button */ && !DOM.findParentWithClass(e.target || e.srcElement, 'monaco-action-bar', 'tab')) { setTimeout(() => this.editorService.openEditor(editor, null, position).done(null, errors.onUnexpectedError)); // timeout to keep focus in editor after mouse up } @@ -366,6 +370,7 @@ export class TabsTitleControl extends TitleControl { // Close on mouse middle click this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.MOUSE_UP, (e: MouseEvent) => { DOM.EventHelper.stop(e); + tab.blur(); if (e.button === 1 /* Middle Button */) { this.editorService.closeEditor(position, editor).done(null, errors.onUnexpectedError); @@ -420,34 +425,11 @@ export class TabsTitleControl extends TitleControl { })); // Context menu - this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.CONTEXT_MENU, (e: Event) => { - DOM.EventHelper.stop(e); - - let anchor: HTMLElement | { x: number, y: number } = tab; - if (e instanceof MouseEvent) { - const event = new StandardMouseEvent(e); - anchor = { x: event.posx, y: event.posy }; - } - - this.contextMenuService.showContextMenu({ - getAnchor: () => anchor, - getActions: () => TPromise.as(this.getTabActions(identifier)), - getActionsContext: () => identifier, - getKeyBinding: (action) => { - var opts = this.keybindingService.lookupKeybindings(action.id); - if (opts.length > 0) { - return opts[0]; // only take the first one - } - - return null; - } - }); - })); + this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.CONTEXT_MENU, (e: Event) => this.onContextMenu(identifier, e, tab))); // Drag start this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_START, (e: DragEvent) => { - DOM.addClass(tab, 'dragged'); - TabsTitleControl.draggedEditor = { editor, group }; + this.onEditorDragStart({ editor, group }); e.dataTransfer.effectAllowed = 'copyMove'; // Enable support to drag a file to desktop @@ -469,31 +451,36 @@ export class TabsTitleControl extends TitleControl { // Drag end this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_END, (e: DragEvent) => { - DOM.removeClass(tab, 'dragged'); DOM.removeClass(tab, 'dropfeedback'); - TabsTitleControl.draggedEditor = void 0; + + this.onEditorDragEnd(); })); // Drop this.tabDisposeables.push(DOM.addDisposableListener(tab, DOM.EventType.DROP, (e: DragEvent) => { + DOM.removeClass(tab, 'dropfeedback'); + const targetPosition = this.stacks.positionOfGroup(group); const targetIndex = group.indexOf(editor); // Local DND - if (TabsTitleControl.draggedEditor) { - e.preventDefault(); + const draggedEditor = TabsTitleControl.getDraggedEditor(); + if (draggedEditor) { + DOM.EventHelper.stop(e, true); - const sourcePosition = this.stacks.positionOfGroup(TabsTitleControl.draggedEditor.group); + const sourcePosition = this.stacks.positionOfGroup(draggedEditor.group); // Move editor to target position and index - if (this.isMoveOperation(e, TabsTitleControl.draggedEditor.group, group)) { - this.editorGroupService.moveEditor(TabsTitleControl.draggedEditor.editor, sourcePosition, targetPosition, targetIndex); + if (this.isMoveOperation(e, draggedEditor.group, group)) { + this.editorGroupService.moveEditor(draggedEditor.editor, sourcePosition, targetPosition, targetIndex); } // Copy: just open editor at target index else { - this.editorService.openEditor(TabsTitleControl.draggedEditor.editor, EditorOptions.create({ pinned: true, index: targetIndex }), targetPosition).done(null, errors.onUnexpectedError); + this.editorService.openEditor(draggedEditor.editor, EditorOptions.create({ pinned: true, index: targetIndex }), targetPosition).done(null, errors.onUnexpectedError); } + + this.onEditorDragEnd(); } // External DND @@ -504,31 +491,7 @@ export class TabsTitleControl extends TitleControl { } private handleExternalDrop(e: DragEvent, targetPosition: Position, targetIndex: number): void { - let resources: URI[] = []; - - if (e.dataTransfer.types.length > 0) { - - // Check for in-app DND - const rawData = e.dataTransfer.getData(e.dataTransfer.types[0]); - if (rawData) { - const resource = URI.parse(rawData); - if (resource.scheme === 'file' || resource.scheme === 'untitled') { - resources.push(resource); - } - } - - // Check for external app DND - else if (e.dataTransfer && e.dataTransfer.files) { - let thepaths: string[] = []; - for (let i = 0; i < e.dataTransfer.files.length; i++) { - if (e.dataTransfer.files[i] && (e.dataTransfer.files[i]).path) { - thepaths.push(e.dataTransfer.files[i].path); - } - } - - resources = thepaths.map(p => URI.file(p)); - } - } + const resources = extractResources(e).filter(r => r.scheme === 'file' || r.scheme === 'untitled'); // Open resources if found if (resources.length) { @@ -552,28 +515,13 @@ export class TabsTitleControl extends TitleControl { return !isCopy || source.id === target.id; } - private getTabActions(identifier: IEditorIdentifier): IAction[] { + protected getContextMenuActions(identifier: IEditorIdentifier): IAction[] { + const actions = super.getContextMenuActions(identifier); const {editor, group} = identifier; - // Enablement - this.closeOtherEditorsAction.enabled = group.count > 1; - this.pinEditorAction.enabled = !group.isPinned(editor); - this.closeRightEditorsAction.enabled = group.indexOf(editor) !== group.count - 1; - - // Actions: For all editors - const actions: IAction[] = [ - this.closeEditorAction, - this.closeOtherEditorsAction, - this.closeRightEditorsAction - ]; - - if (this.previewEditors) { - actions.push(new Separator(), this.pinEditorAction); - } - // Actions: For active editor if (group.isActive(editor)) { - const editorActions = this.getEditorActions(group); + const editorActions = this.getEditorActions(identifier); if (editorActions.primary.length) { actions.push(new Separator(), ...prepareActions(editorActions.primary)); } diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index ac093418efe..68be8227519 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -11,26 +11,25 @@ import {Registry} from 'vs/platform/platform'; import {Scope, IActionBarRegistry, Extensions} from 'vs/workbench/browser/actionBarRegistry'; import {IAction, Action} from 'vs/base/common/actions'; import errors = require('vs/base/common/errors'); -import {Builder} from 'vs/base/browser/builder'; import DOM = require('vs/base/browser/dom'); +import {TPromise} from 'vs/base/common/winjs.base'; import {BaseEditor, IEditorInputActionContext} from 'vs/workbench/browser/parts/editor/baseEditor'; import {RunOnceScheduler} from 'vs/base/common/async'; -import {IEditorStacksModel, IEditorGroup, EditorInput} from 'vs/workbench/common/editor'; +import {IEditorStacksModel, IEditorGroup, IEditorIdentifier, EditorInput, IWorkbenchEditorConfiguration, IStacksModelChangeEvent} from 'vs/workbench/common/editor'; import {EventType as BaseEventType} from 'vs/base/common/events'; import {IActionItem, ActionsOrientation, Separator} from 'vs/base/browser/ui/actionbar/actionbar'; import {ToolBar} from 'vs/base/browser/ui/toolbar/toolbar'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IContextMenuService} from 'vs/platform/contextview/browser/contextView'; import {Position} from 'vs/platform/editor/common/editor'; +import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; import {IMessageService, Severity} from 'vs/platform/message/common/message'; -import {QuickOpenAction} from 'vs/workbench/browser/quickopen'; +import {StandardMouseEvent} from 'vs/base/browser/mouseEvent'; import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; -import {ShowEditorsInLeftGroupAction, ShowAllEditorsAction, ShowEditorsInCenterGroupAction, ShowEditorsInRightGroupAction, CloseEditorsInGroupAction, MoveGroupLeftAction, - MoveGroupRightAction, SplitEditorAction, CloseEditorAction, PinEditorAction, CloseOtherEditorsInGroupAction, CloseRightEditorsInGroupAction} -from 'vs/workbench/browser/parts/editor/editorActions'; +import {CloseEditorsInGroupAction, MoveGroupLeftAction, MoveGroupRightAction, SplitEditorAction, CloseEditorAction, KeepEditorAction, CloseOtherEditorsInGroupAction, CloseRightEditorsInGroupAction, ShowEditorsInGroupAction} from 'vs/workbench/browser/parts/editor/editorActions'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; export interface IToolbarActions { @@ -41,7 +40,7 @@ export interface IToolbarActions { export interface ITitleAreaControl { setContext(group: IEditorGroup): void; allowDragging(element: HTMLElement): boolean; - create(parent: Builder): void; + create(parent: HTMLElement): void; refresh(instant?: boolean): void; update(instant?: boolean): void; layout(): void; @@ -49,22 +48,25 @@ export interface ITitleAreaControl { } export abstract class TitleControl { + + private static draggedEditor: IEditorIdentifier; + protected stacks: IEditorStacksModel; protected context: IEditorGroup; protected toDispose: IDisposable[]; protected closeEditorAction: CloseEditorAction; - protected pinEditorAction: PinEditorAction; + protected pinEditorAction: KeepEditorAction; protected closeOtherEditorsAction: CloseOtherEditorsInGroupAction; protected closeRightEditorsAction: CloseRightEditorsInGroupAction; - protected showEditorsOfLeftGroup: QuickOpenAction; - protected showEditorsOfCenterGroup: QuickOpenAction; - protected showEditorsOfRightGroup: QuickOpenAction; protected moveGroupLeftAction: MoveGroupLeftAction; protected moveGroupRightAction: MoveGroupRightAction; protected closeEditorsInGroupAction: CloseEditorsInGroupAction; protected splitEditorAction: SplitEditorAction; - protected showAllEditorsAction: ShowAllEditorsAction; + protected showEditorsInGroupAction: ShowEditorsInGroupAction; + + private previewEditors: boolean; + private showTabs: boolean; private mapActionsToEditors: { [editorId: string]: IToolbarActions; }; private scheduler: RunOnceScheduler; @@ -73,6 +75,7 @@ export abstract class TitleControl { constructor( @IContextMenuService protected contextMenuService: IContextMenuService, @IInstantiationService protected instantiationService: IInstantiationService, + @IConfigurationService protected configurationService: IConfigurationService, @IWorkbenchEditorService protected editorService: IWorkbenchEditorService, @IEditorGroupService protected editorGroupService: IEditorGroupService, @IKeybindingService protected keybindingService: IKeybindingService, @@ -83,43 +86,55 @@ export abstract class TitleControl { this.stacks = editorGroupService.getStacksModel(); this.mapActionsToEditors = Object.create(null); + this.onConfigurationUpdated(configurationService.getConfiguration()); + this.scheduler = new RunOnceScheduler(() => this.onSchedule(), 0); this.toDispose.push(this.scheduler); this.initActions(); + this.registerListeners(); } - private updateActionEnablement(): void { + public static getDraggedEditor(): IEditorIdentifier { + return TitleControl.draggedEditor; + } + + protected onEditorDragStart(editor: IEditorIdentifier): void { + TitleControl.draggedEditor = editor; + } + + protected onEditorDragEnd(): void { + TitleControl.draggedEditor = void 0; + } + + private registerListeners(): void { + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toDispose.push(this.stacks.onModelChanged(e => this.onStacksChanged(e))); + } + + private onStacksChanged(e: IStacksModelChangeEvent): void { + if (e.structural) { + this.updateSplitActionEnablement(); + } + } + + private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { + this.previewEditors = config.workbench.editor.enablePreview; + this.showTabs = config.workbench.editor.showTabs; + } + + private updateSplitActionEnablement(): void { if (!this.context) { return; } - const group = this.context; const groupCount = this.stacks.groups.length; - // Move group - switch (this.stacks.positionOfGroup(group)) { - case Position.LEFT: - this.moveGroupLeftAction.enabled = false; - this.moveGroupRightAction.enabled = this.stacks.groups.length > 1; - break; - - case Position.CENTER: - this.moveGroupRightAction.enabled = this.stacks.groups.length > 2; - break; - - case Position.RIGHT: - this.moveGroupRightAction.enabled = false; - break; - } - // Split editor this.splitEditorAction.enabled = groupCount < 3; } private onSchedule(): void { - this.updateActionEnablement(); - if (this.refreshScheduled) { this.doRefresh(); } else { @@ -172,20 +187,17 @@ export abstract class TitleControl { this.closeOtherEditorsAction = this.instantiationService.createInstance(CloseOtherEditorsInGroupAction, CloseOtherEditorsInGroupAction.ID, nls.localize('closeOthers', "Close Others")); this.closeRightEditorsAction = this.instantiationService.createInstance(CloseRightEditorsInGroupAction, CloseRightEditorsInGroupAction.ID, nls.localize('closeRight', "Close to the Right")); this.closeEditorsInGroupAction = this.instantiationService.createInstance(CloseEditorsInGroupAction, CloseEditorsInGroupAction.ID, nls.localize('closeAll', "Close All")); - this.pinEditorAction = this.instantiationService.createInstance(PinEditorAction, PinEditorAction.ID, nls.localize('pin', "Pin Editor")); - this.showAllEditorsAction = this.instantiationService.createInstance(ShowAllEditorsAction, ShowAllEditorsAction.ID, nls.localize('showEditors', "Show Editors")); + this.pinEditorAction = this.instantiationService.createInstance(KeepEditorAction, KeepEditorAction.ID, nls.localize('keepEditor', "Keep Editor")); + this.showEditorsInGroupAction = this.instantiationService.createInstance(ShowEditorsInGroupAction, ShowEditorsInGroupAction.ID, ShowEditorsInGroupAction.LABEL); this.splitEditorAction = this.instantiationService.createInstance(SplitEditorAction, SplitEditorAction.ID, SplitEditorAction.LABEL); this.moveGroupLeftAction = this.instantiationService.createInstance(MoveGroupLeftAction, MoveGroupLeftAction.ID, nls.localize('moveLeft', "Move Left")); this.moveGroupRightAction = this.instantiationService.createInstance(MoveGroupRightAction, MoveGroupRightAction.ID, nls.localize('moveRight', "Move Right")); - this.showEditorsOfLeftGroup = this.instantiationService.createInstance(ShowEditorsInLeftGroupAction, ShowEditorsInLeftGroupAction.ID, nls.localize('showEditors', "Show Editors")); - this.showEditorsOfCenterGroup = this.instantiationService.createInstance(ShowEditorsInCenterGroupAction, ShowEditorsInCenterGroupAction.ID, nls.localize('showEditors', "Show Editors")); - this.showEditorsOfRightGroup = this.instantiationService.createInstance(ShowEditorsInRightGroupAction, ShowEditorsInRightGroupAction.ID, nls.localize('showEditors', "Show Editors")); - [this.showEditorsOfLeftGroup, this.showEditorsOfCenterGroup, this.showEditorsOfRightGroup, this.showAllEditorsAction].forEach(a => a.class = 'show-group-editors-action'); + this.showEditorsInGroupAction.class = 'show-group-editors-action'; } - protected doCreateToolbar(container: Builder): ToolBar { - const toolbar = new ToolBar(container.getHTMLElement(), this.contextMenuService, { + protected doCreateToolbar(container: HTMLElement): ToolBar { + const toolbar = new ToolBar(container, this.contextMenuService, { actionItemProvider: (action: Action) => this.actionItemProvider(action), orientation: ActionsOrientation.HORIZONTAL, ariaLabel: nls.localize('araLabelEditorActions', "Editor actions"), @@ -234,33 +246,35 @@ export abstract class TitleControl { // Check Registry if (!actionItem) { - let actionBarRegistry = Registry.as(Extensions.Actionbar); + const actionBarRegistry = Registry.as(Extensions.Actionbar); actionItem = actionBarRegistry.getActionItemForContext(Scope.EDITOR, { input: editor && editor.input, editor, position }, action); } return actionItem; } - protected getEditorActions(group: IEditorGroup): IToolbarActions { - const position = this.stacks.positionOfGroup(group); - const isActive = this.stacks.isActive(group); + protected getEditorActions(identifier: IEditorIdentifier): IToolbarActions { const primary: IAction[] = []; const secondary: IAction[] = []; - const editor = this.editorService.getVisibleEditors()[position]; - if (isActive && editor instanceof BaseEditor) { - let editorActions = this.mapActionsToEditors[editor.getId()]; + const {group} = identifier; + const position = this.stacks.positionOfGroup(group); + + // Editor actions require the editor control to be there, so we retrieve it via service + const control = this.editorService.getVisibleEditors()[position]; + if (this.stacks.isActive(group) && control instanceof BaseEditor && control.input && typeof control.position === 'number') { + + // Editor Control Actions + let editorActions = this.mapActionsToEditors[control.getId()]; if (!editorActions) { - editorActions = this.getEditorActionsForContext(editor); - this.mapActionsToEditors[editor.getId()] = editorActions; + editorActions = this.getEditorActionsForContext(control); + this.mapActionsToEditors[control.getId()] = editorActions; } - primary.push(...editorActions.primary); secondary.push(...editorActions.secondary); - // Handle Editor Input Actions - let editorInputActions = this.getEditorActionsForContext({ input: editor.input, editor, position: editor.position }); - + // Editor Input Actions + const editorInputActions = this.getEditorActionsForContext({ input: control.input, editor: control, position: control.position }); primary.push(...editorInputActions.primary); secondary.push(...editorInputActions.secondary); } @@ -271,8 +285,8 @@ export abstract class TitleControl { private getEditorActionsForContext(context: BaseEditor): IToolbarActions; private getEditorActionsForContext(context: IEditorInputActionContext): IToolbarActions; private getEditorActionsForContext(context: any): IToolbarActions { - let primaryActions: IAction[] = []; - let secondaryActions: IAction[] = []; + const primaryActions: IAction[] = []; + const secondaryActions: IAction[] = []; // From Editor if (context instanceof BaseEditor) { @@ -281,9 +295,11 @@ export abstract class TitleControl { } // From Contributions - let actionBarRegistry = Registry.as(Extensions.Actionbar); - primaryActions.push(...actionBarRegistry.getActionBarActionsForContext(Scope.EDITOR, context)); - secondaryActions.push(...actionBarRegistry.getSecondaryActionBarActionsForContext(Scope.EDITOR, context)); + else { + const actionBarRegistry = Registry.as(Extensions.Actionbar); + primaryActions.push(...actionBarRegistry.getActionBarActionsForContext(Scope.EDITOR, context)); + secondaryActions.push(...actionBarRegistry.getSecondaryActionBarActionsForContext(Scope.EDITOR, context)); + } return { primary: primaryActions, @@ -295,35 +311,30 @@ export abstract class TitleControl { const editor = group.activeEditor; const primary: IAction[] = []; - const groupCount = this.stacks.groups.length; - // Overflow - let overflowAction: Action; - if (groupCount === 1) { - overflowAction = this.showAllEditorsAction; - } else { - switch (this.stacks.positionOfGroup(group)) { - case Position.LEFT: - overflowAction = this.showEditorsOfLeftGroup; - break; - - case Position.CENTER: - overflowAction = (groupCount === 2) ? this.showEditorsOfRightGroup : this.showEditorsOfCenterGroup; - break; - - case Position.RIGHT: - overflowAction = this.showEditorsOfRightGroup; - break; - } - } - - primary.push(overflowAction); + primary.push(this.showEditorsInGroupAction); // Splitting if (editor instanceof EditorInput && editor.supportsSplitEditor()) { primary.push(this.splitEditorAction); } + // Enablement + switch (this.stacks.positionOfGroup(group)) { + case Position.LEFT: + this.moveGroupLeftAction.enabled = false; + this.moveGroupRightAction.enabled = this.stacks.groups.length > 1; + break; + + case Position.CENTER: + this.moveGroupRightAction.enabled = this.stacks.groups.length > 2; + break; + + case Position.RIGHT: + this.moveGroupRightAction.enabled = false; + break; + } + // Return actions const secondary = [ this.moveGroupLeftAction, @@ -335,16 +346,62 @@ export abstract class TitleControl { return { primary, secondary }; } + protected onContextMenu(identifier: IEditorIdentifier, e: Event, node: HTMLElement): void { + let anchor: HTMLElement | { x: number, y: number } = node; + if (e instanceof MouseEvent) { + const event = new StandardMouseEvent(e); + anchor = { x: event.posx, y: event.posy }; + } + + this.contextMenuService.showContextMenu({ + getAnchor: () => anchor, + getActions: () => TPromise.as(this.getContextMenuActions(identifier)), + getActionsContext: () => identifier, + getKeyBinding: (action) => { + var opts = this.keybindingService.lookupKeybindings(action.id); + if (opts.length > 0) { + return opts[0]; // only take the first one + } + + return null; + } + }); + } + + protected getContextMenuActions(identifier: IEditorIdentifier): IAction[] { + const {editor, group} = identifier; + + // Enablement + this.closeOtherEditorsAction.enabled = group.count > 1; + this.pinEditorAction.enabled = !group.isPinned(editor); + this.closeRightEditorsAction.enabled = group.indexOf(editor) !== group.count - 1; + + // Actions: For all editors + const actions: IAction[] = [ + this.closeEditorAction, + this.closeOtherEditorsAction + ]; + + if (this.showTabs) { + actions.push(this.closeRightEditorsAction); + } + + actions.push(this.closeEditorsInGroupAction); + + if (this.previewEditors) { + actions.push(new Separator(), this.pinEditorAction); + } + + return actions; + } + public dispose(): void { dispose(this.toDispose); // Actions [ this.splitEditorAction, - this.showAllEditorsAction, - this.showEditorsOfLeftGroup, - this.showEditorsOfCenterGroup, - this.showEditorsOfRightGroup, + this.showEditorsInGroupAction, this.closeEditorAction, this.closeRightEditorsAction, this.closeOtherEditorsAction, diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index fafbc01b194..83fb90f2528 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -771,7 +771,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe let placeHolderLabel = (typeof canRun === 'string') ? canRun : nls.localize('canNotRunPlaceholder', "This quick open handler can not be used in the current context"); const model = new QuickOpenModel([new PlaceholderQuickOpenEntry(placeHolderLabel)], this.actionProvider); - this.showModel(model, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.isQuickNavigating()), resolvedHandler.getAriaLabel()); + this.showModel(model, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.getQuickNavigateConfiguration()), resolvedHandler.getAriaLabel()); return TPromise.as(null); } @@ -792,9 +792,9 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe if (this.currentResultToken === currentResultToken) { if (!result || !result.entries.length) { const model = new QuickOpenModel([new PlaceholderQuickOpenEntry(resolvedHandler.getEmptyLabel(value))]); - this.showModel(model, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.isQuickNavigating()), resolvedHandler.getAriaLabel()); + this.showModel(model, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.getQuickNavigateConfiguration()), resolvedHandler.getAriaLabel()); } else { - this.showModel(result, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.isQuickNavigating()), resolvedHandler.getAriaLabel()); + this.showModel(result, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.getQuickNavigateConfiguration()), resolvedHandler.getAriaLabel()); } } }); @@ -1023,7 +1023,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry { public run(mode: Mode, context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { const sideBySide = !context.quickNavigateConfiguration && context.keymods.indexOf(KeyMod.CtrlCmd) >= 0; - const pinned = !this.configurationService.getConfiguration().workbench.quickOpenPreviews; + const pinned = !this.configurationService.getConfiguration().workbench.editor.enablePreviewFromQuickOpen; this.editorService.openEditor(this.input, EditorOptions.create({ pinned }), sideBySide).done(null, errors.onUnexpectedError); diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index 12092bce3ab..e83e4341c1d 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -14,7 +14,7 @@ import errors = require('vs/base/common/errors'); import {Registry} from 'vs/platform/platform'; import {Action} from 'vs/base/common/actions'; import {KeyMod} from 'vs/base/common/keyCodes'; -import {Mode, IEntryRunContext, IAutoFocus, IModel} from 'vs/base/parts/quickopen/common/quickOpen'; +import {Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration} from 'vs/base/parts/quickopen/common/quickOpen'; import {QuickOpenEntry, IHighlight, QuickOpenEntryGroup, QuickOpenModel} from 'vs/base/parts/quickopen/browser/quickOpenModel'; import {EditorOptions, EditorInput} from 'vs/workbench/common/editor'; import {IResourceInput, IEditorInput} from 'vs/platform/editor/common/editor'; @@ -63,7 +63,7 @@ export class QuickOpenHandler { * Indicates if the handler wishes the quick open widget to automatically select the first result entry or an entry * based on a specific prefix match. */ - public getAutoFocus(searchValue: string, isQuickNavigating?: boolean): IAutoFocus { + public getAutoFocus(searchValue: string, quickNavigateConfiguration?: IQuickNavigateConfiguration): IAutoFocus { return {}; } diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index fd4259566f4..07d83498e13 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -48,9 +48,7 @@ import {WorkbenchKeybindingService} from 'vs/workbench/services/keybinding/elect import {IWorkspace, IConfiguration} from 'vs/platform/workspace/common/workspace'; import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; import {IActivityService} from 'vs/workbench/services/activity/common/activityService'; -import {IExtensionService} from 'vs/platform/extensions/common/extensions'; import {IViewletService} from 'vs/workbench/services/viewlet/common/viewletService'; -import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IPanelService} from 'vs/workbench/services/panel/common/panelService'; import {WorkbenchMessageService} from 'vs/workbench/services/message/browser/messageService'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; @@ -62,12 +60,11 @@ import {IInstantiationService} from 'vs/platform/instantiation/common/instantiat import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle'; import {IMessageService} from 'vs/platform/message/common/message'; -import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IThreadService} from 'vs/platform/thread/common/thread'; import {MainThreadService} from 'vs/platform/thread/common/mainThreadService'; import {IStatusbarService} from 'vs/platform/statusbar/common/statusbar'; import {IActionsService} from 'vs/platform/actions/common/actions'; -import ActionsService from 'vs/platform/actions/common/actionsService'; +import ActionsService from 'vs/platform/actions/workbench/actionsService'; import {IContextMenuService} from 'vs/platform/contextview/browser/contextView'; interface WorkbenchParams { @@ -129,15 +126,12 @@ export class Workbench implements IPartService { serviceCollection: ServiceCollection, @IInstantiationService private instantiationService: IInstantiationService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, - @IConfigurationService private configurationService: IConfigurationService, @IEventService private eventService: IEventService, @IWorkbenchWorkspaceContextService private contextService: IWorkbenchWorkspaceContextService, @IStorageService private storageService: IStorageService, - @ITelemetryService private telemetryService: ITelemetryService, @ILifecycleService private lifecycleService: ILifecycleService, @IMessageService private messageService: IMessageService, - @IThreadService private threadService: IThreadService, - @IExtensionService private extensionService: IExtensionService + @IThreadService private threadService: IThreadService ) { // Validate params @@ -247,7 +241,7 @@ export class Workbench implements IPartService { return { input: inputWithOptions.input, options: inputWithOptions.options, - position: Math.min(index, Position.RIGHT) // put any resource > RIGHT to right position + position: Position.LEFT }; }); @@ -676,10 +670,11 @@ export class Workbench implements IPartService { // We update the editorpart class to indicate if an editor is opened or not // through a delay to accomodate for fast editor switching + const editorContainer = this.editorPart.getContainer(); if (visibleEditors === 0) { - this.editorBackgroundDelayer.trigger(() => this.editorPart.getContainer().addClass('empty')); + this.editorBackgroundDelayer.trigger(() => editorContainer.addClass('empty')); } else { - this.editorBackgroundDelayer.trigger(() => this.editorPart.getContainer().removeClass('empty')); + this.editorBackgroundDelayer.trigger(() => editorContainer.removeClass('empty')); } } diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 3beced9bfe8..e187c46a96f 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -336,13 +336,15 @@ export class EditorOptions implements IEditorOptions { preserveFocus?: boolean; forceOpen?: boolean; pinned?: boolean, - index?: number + index?: number, + inactive?: boolean }): EditorOptions { let options = new EditorOptions(); options.preserveFocus = settings.preserveFocus; options.forceOpen = settings.forceOpen; options.pinned = settings.pinned; options.index = settings.index; + options.inactive = settings.inactive; return options; } @@ -380,6 +382,12 @@ export class EditorOptions implements IEditorOptions { * The index in the document stack where to insert the editor into when opening. */ public index: number; + + /** + * An active editor that is opened will show its contents directly. Set to true to open an editor + * in the background. + */ + public inactive: boolean; } /** @@ -395,7 +403,7 @@ export class TextEditorOptions extends EditorOptions { public static from(input: IResourceInput): TextEditorOptions { let options: TextEditorOptions = null; if (input && input.options) { - if (input.options.selection || input.options.forceOpen || input.options.preserveFocus || input.options.pinned || typeof input.options.index === 'number') { + if (input.options.selection || input.options.forceOpen || input.options.preserveFocus || input.options.pinned || input.options.inactive || typeof input.options.index === 'number') { options = new TextEditorOptions(); } @@ -416,6 +424,10 @@ export class TextEditorOptions extends EditorOptions { options.pinned = true; } + if (input.options.inactive) { + options.inactive = true; + } + if (typeof input.options.index === 'number') { options.index = input.options.index; } @@ -669,15 +681,17 @@ export type GroupIdentifier = number; export const EditorOpenPositioning = { LEFT: 'left', RIGHT: 'right', - BEGINNING: 'beginning', - END: 'end' + FIRST: 'first', + LAST: 'last' }; export interface IWorkbenchEditorConfiguration { workbench: { - showEditorTabs: boolean; - previewEditors: boolean; - quickOpenPreviews: boolean; - editorOpenPositioning: string; + editor: { + showTabs: boolean; + enablePreview: boolean; + enablePreviewFromQuickOpen: boolean; + openPositioning: string; + } }; } \ No newline at end of file diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index db2e993087d..287e76b2a18 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -117,7 +117,7 @@ export class EditorGroup implements IEditorGroup { } private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { - this.editorOpenPositioning = config.workbench.editorOpenPositioning; + this.editorOpenPositioning = config.workbench.editor.openPositioning; } public get id(): GroupIdentifier { @@ -217,12 +217,12 @@ export class EditorGroup implements IEditorGroup { } // Insert to the BEGINNING - else if (this.editorOpenPositioning === EditorOpenPositioning.BEGINNING) { + else if (this.editorOpenPositioning === EditorOpenPositioning.FIRST) { targetIndex = 0; } // Insert to the END - else if (this.editorOpenPositioning === EditorOpenPositioning.END) { + else if (this.editorOpenPositioning === EditorOpenPositioning.LAST) { targetIndex = this.editors.length; } @@ -603,13 +603,18 @@ export class EditorGroup implements IEditorGroup { this._label = data.label; this.editors = data.editors.map(e => { - const editor = registry.getEditorInputFactory(e.id).deserialize(this.instantiationService, e.value); + const factory = registry.getEditorInputFactory(e.id); + if (factory) { + const editor = factory.deserialize(this.instantiationService, e.value); - this.hookEditorListeners(editor); - this.updateResourceMap(editor, false /* add */); + this.hookEditorListeners(editor); + this.updateResourceMap(editor, false /* add */); - return editor; - }); + return editor; + } + + return null; + }).filter(e => !!e); this.mru = data.mru.map(i => this.editors[i]); this.active = this.mru[0]; this.preview = this.editors[data.preview]; @@ -817,8 +822,11 @@ export class EditorStacksModel implements IEditorStacksModel { this._groups.splice(index, 1); this.groupToIdentifier[group.id] = void 0; - // Event + // Events this.fireEvent(this._onGroupClosed, group, true); + for (let i = index; i < this._groups.length; i++) { + this.fireEvent(this._onGroupMoved, this._groups[i], true); // send move event for groups to the right that moved to the left into the closed group position + } } public closeGroups(except?: EditorGroup): void { @@ -862,7 +870,9 @@ export class EditorStacksModel implements IEditorStacksModel { this._groups.splice(toIndex, 0, group); // Event - this.fireEvent(this._onGroupMoved, group, true); + for (let i = Math.min(index, toIndex); i <= Math.max(index, toIndex) && i < this._groups.length; i++) { + this.fireEvent(this._onGroupMoved, this._groups[i], true); // send move event for groups to the right that moved to the left into the closed group position + } } private indexOf(group: EditorGroup): number { @@ -1008,7 +1018,14 @@ export class EditorStacksModel implements IEditorStacksModel { const editorsRaw: { inputId: string; inputValue: string }[] = state.editors; const registry = Registry.as(Extensions.Editors); - const editors = editorsRaw.map(editorRaw => registry.getEditorInputFactory(editorRaw.inputId).deserialize(this.instantiationService, editorRaw.inputValue)); + const editors = editorsRaw.map(editorRaw => { + const factory = registry.getEditorInputFactory(editorRaw.inputId); + if (factory) { + return factory.deserialize(this.instantiationService, editorRaw.inputValue); + } + + return null; + }).filter(editor => !!editor); if (editors.length > 0) { const leftGroup = this.openGroup('', true); diff --git a/src/vs/workbench/common/editor/iframeEditorInput.ts b/src/vs/workbench/common/editor/iframeEditorInput.ts deleted file mode 100644 index fc9bf180112..00000000000 --- a/src/vs/workbench/common/editor/iframeEditorInput.ts +++ /dev/null @@ -1,106 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import {TPromise} from 'vs/base/common/winjs.base'; -import {EditorModel, EditorInput} from 'vs/workbench/common/editor'; -import URI from 'vs/base/common/uri'; - -/** - * An editor input to use with the IFrameEditor. - */ -export abstract class IFrameEditorInput extends EditorInput { - - public static ID: string = 'workbench.editors.iFrameEditorInput'; - - private resource: URI; - private name: string; - private description: string; - private cachedModel: EditorModel; - - constructor(resource: URI, name: string, description: string) { - super(); - - this.resource = resource; - this.name = name; - this.description = description; - } - - public getTypeId(): string { - return IFrameEditorInput.ID; - } - - public getResource(): URI { - return this.resource; - } - - public getName(): string { - return this.name; - } - - public getDescription(): string { - return this.description; - } - - public resolve(refresh?: boolean): TPromise { - let modelPromise: TPromise; - - // Use Cached Model - if (this.cachedModel && !refresh) { - modelPromise = TPromise.as(this.cachedModel); - } - - // Refresh Cached Model - else if (this.cachedModel && refresh) { - modelPromise = this.cachedModel.load(); - } - - // Create Model and Load - else { - let model = this.createModel(); - modelPromise = model.load(); - } - - return modelPromise.then((resolvedModel: EditorModel) => { - this.cachedModel = resolvedModel; - - return this.cachedModel; - }); - } - - /** - * Subclasses override this method to provide their own implementation. - */ - protected abstract createModel(): EditorModel; - - /** - * Subclasses override this method to create a new input from a given resource. - */ - public abstract createNew(resource: URI): IFrameEditorInput; - - public matches(otherInput: any): boolean { - if (super.matches(otherInput) === true) { - return true; - } - - if (otherInput instanceof IFrameEditorInput) { - let otherIFrameEditorInput = otherInput; - - // Otherwise compare by properties - return otherIFrameEditorInput.resource.toString() === this.resource.toString(); - } - - return false; - } - - public dispose(): void { - if (this.cachedModel) { - this.cachedModel.dispose(); - this.cachedModel = null; - } - - super.dispose(); - } -} \ No newline at end of file diff --git a/src/vs/workbench/common/editor/iframeEditorModel.ts b/src/vs/workbench/common/editor/iframeEditorModel.ts deleted file mode 100644 index 95ae8957d7b..00000000000 --- a/src/vs/workbench/common/editor/iframeEditorModel.ts +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import URI from 'vs/base/common/uri'; -import {EditorModel} from 'vs/workbench/common/editor'; - -export interface IFrameContents { - head: string; - body: string; - tail: string; -} - -/** - * An editor model that represents the resolved state for an iframe editor input. After the model has been - * resolved it knows which content to pass to the iframe editor. The contents will be set directly into the - * iframe. The contents have to ensure that e.g. a base URL is set so that relative links or images can be - * resolved. - */ -export class IFrameEditorModel extends EditorModel { - private _resource: URI; - - private head: string; - private body: string; - private tail: string; - - constructor(resource:URI) { - super(); - - this._resource = resource; - } - - public get resource(): URI { - return this._resource; - } - - public setContents(head: string, body: string, tail: string): void { - this.head = head; - this.body = body; - this.tail = tail; - } - - public getContents(): IFrameContents { - return { - head: this.head, - body: this.body, - tail: this.tail - }; - } -} \ No newline at end of file diff --git a/src/vs/workbench/common/editor/stringEditorInput.ts b/src/vs/workbench/common/editor/stringEditorInput.ts index f9b9b3298ea..08e817bfe3b 100644 --- a/src/vs/workbench/common/editor/stringEditorInput.ts +++ b/src/vs/workbench/common/editor/stringEditorInput.ts @@ -44,8 +44,7 @@ export class StringEditorInput extends EditorInput { } protected getResource(): URI { - // Subclasses can implement to associate a resource with the input - return null; + return null; // Subclasses can implement to associate a resource with the input } public getTypeId(): string { @@ -145,6 +144,13 @@ export class StringEditorInput extends EditorInput { return true; } + // If we have resource URIs, use those to compare + const resource = this.getResource(); + const otherResource = otherStringEditorInput.getResource(); + if (resource && otherResource) { + return resource.toString() === otherResource.toString(); + } + // Otherwise compare by properties return otherStringEditorInput.value === this.value && otherStringEditorInput.mime === this.mime && diff --git a/src/vs/workbench/common/editor/textEditorModel.ts b/src/vs/workbench/common/editor/textEditorModel.ts index 6b717be5bd2..2172ac930ff 100644 --- a/src/vs/workbench/common/editor/textEditorModel.ts +++ b/src/vs/workbench/common/editor/textEditorModel.ts @@ -60,8 +60,15 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd // To avoid flickering, give the mode at most 50ms to load. If the mode doesn't load in 50ms, proceed creating the model with a mode promise return TPromise.any([TPromise.timeout(50), this.getOrCreateMode(this.modeService, mime, firstLineText)]).then(() => { - let model = this.modelService.createModel(value, this.getOrCreateMode(this.modeService, mime, firstLineText), resource); - this.createdEditorModel = true; + let model = resource && this.modelService.getModel(resource); + let mode = this.getOrCreateMode(this.modeService, mime, firstLineText); + if (!model) { + model = this.modelService.createModel(value, mode, resource); + this.createdEditorModel = true; + } else { + model.setValue(value); + model.setMode(mode); + } this.textEditorModelHandle = model.uri; diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 63b169ce2d9..a5e88527de7 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -99,6 +99,8 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput { public revert(): TPromise { this.cachedModel.revert(); + this.dispose(); // a reverted untitled editor is no longer valid, so we dispose it + return TPromise.as(true); } diff --git a/src/vs/workbench/electron-browser/index.html b/src/vs/workbench/electron-browser/index.html index 0863286ed10..015cf62f40c 100644 --- a/src/vs/workbench/electron-browser/index.html +++ b/src/vs/workbench/electron-browser/index.html @@ -208,7 +208,7 @@ - +