提交 e3598e04 编写于 作者: D Daniel Imms

Merge remote-tracking branch 'origin/master' into tyriar/terminal_tabs

......@@ -38,5 +38,6 @@ script:
- gulp hygiene
- gulp electron
- gulp compile
- gulp optimize-vscode
- ./scripts/test.sh
- ./scripts/test-integration.sh
......@@ -75,6 +75,7 @@ var copyrightFilter = [
'!**/*.sh',
'!**/*.txt',
'!**/*.xpm',
'!extensions/markdown/media/tomorrow.css'
];
var tslintFilter = [
......
......@@ -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
......@@ -84,7 +80,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 +169,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 +196,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 })
......
......@@ -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
{
"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",
......
......@@ -11,6 +11,7 @@ const extensions = [
'vscode-colorize-tests',
'json',
'configuration-editing',
'markdown',
'typescript',
'php',
'javascript',
......
......@@ -17,6 +17,6 @@
"watch": "gulp watch-extension:configuration-editing"
},
"dependencies": {
"jsonc-parser": "^0.2.1"
"jsonc-parser": "^0.2.2"
}
}
......@@ -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),
......
......@@ -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;
}
......
......@@ -42,6 +42,7 @@ export class CSSValidation {
let range = Range.create(document.positionAt(marker.getOffset()), document.positionAt(marker.getOffset() + marker.getLength()));
return <Diagnostic>{
code: marker.getRule().id,
source: document.languageId,
message: marker.getMessage(),
severity: marker.getLevel() === nodes.Level.Warning ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error,
range: range
......
......@@ -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';
......
......@@ -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"
......
......@@ -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",
......
......@@ -193,7 +193,7 @@
<key>control-statement</key>
<dict>
<key>match</key>
<string>(?&lt;!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default)\b</string>
<string>(?&lt;!\.)\b(break|catch|continue|debugger|declare|do|else|finally|for|if|return|switch|throw|try|while|with|super|case|default|yield)\b</string>
<key>name</key>
<string>keyword.control.js</string>
</dict>
......@@ -1815,6 +1815,110 @@
</dict>
</array>
</dict>
<key>ternary-expression</key>
<dict>
<key>begin</key>
<string>(?=\?)</string>
<key>end</key>
<string>(?=$|[;,])</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#ternary-operator</string>
</dict>
<dict>
<key>include</key>
<string>#ternary-expression-type</string>
</dict>
</array>
</dict>
<key>ternary-expression-type</key>
<dict>
<key>name</key>
<string>meta.expression.js</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string</string>
</dict>
<dict>
<key>include</key>
<string>#regex</string>
</dict>
<dict>
<key>include</key>
<string>#template</string>
</dict>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
<dict>
<key>include</key>
<string>#literal</string>
</dict>
<dict>
<key>include</key>
<string>#paren-expression</string>
</dict>
<dict>
<key>include</key>
<string>#ternary-expression</string>
</dict>
<dict>
<key>include</key>
<string>#import-operator</string>
</dict>
<dict>
<key>include</key>
<string>#expression-operator</string>
</dict>
<dict>
<key>include</key>
<string>#imply-operator</string>
</dict>
<dict>
<key>include</key>
<string>#relational-operator</string>
</dict>
<dict>
<key>include</key>
<string>#arithmetic-operator</string>
</dict>
<dict>
<key>include</key>
<string>#logic-operator</string>
</dict>
<dict>
<key>include</key>
<string>#assignment-operator</string>
</dict>
<dict>
<key>include</key>
<string>#type-primitive</string>
</dict>
<dict>
<key>include</key>
<string>#function-call</string>
</dict>
</array>
</dict>
<key>ternary-operator</key>
<dict>
<key>begin</key>
<string>(\?)</string>
<key>end</key>
<string>(:)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#ternary-expression-type</string>
</dict>
</array>
</dict>
<key>this-literal</key>
<dict>
<key>match</key>
......@@ -2206,6 +2310,10 @@
<string>meta.var-single-variable.expr.js</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#ternary-expression</string>
</dict>
<dict>
<key>include</key>
<string>#type-annotation</string>
......
......@@ -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"
},
......
......@@ -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<CompletionItem> {
......@@ -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);
}
};
......
......@@ -14,7 +14,7 @@ export class JSONDocumentSymbols {
constructor() {
}
public compute(document: TextDocument, doc: Parser.JSONDocument): Promise<SymbolInformation[]> {
public findDocumentSymbols(document: TextDocument, doc: Parser.JSONDocument): Promise<SymbolInformation[]> {
let root = doc.root;
if (!root) {
......
/*---------------------------------------------------------------------------------------------
* 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<Diagnostic[]>;
parseJSONDocument(document: TextDocument): JSONDocument;
resetSchema(uri: string): boolean;
doResolve(item: CompletionItem): Thenable<CompletionItem>;
doComplete(document: TextDocument, position: Position, doc: JSONDocument): Thenable<CompletionList>;
findDocumentSymbols(document: TextDocument, doc: JSONDocument): Promise<SymbolInformation[]>;
doHover(document: TextDocument, position: Position, doc: JSONDocument): Thenable<Hover>;
format(document: TextDocument, range: Range, options: FormattingOptions): Thenable<TextEdit[]>;
}
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<XHRResponse>;
}
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))
};
}
......@@ -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<ResolvedSchema> {
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<XHRResponse>;
}
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<ResolvedSchema> {
public resolveSchemaContent(schemaToResolve: UnresolvedSchema, schemaURL: string): Thenable<ResolvedSchema> {
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<any> => {
let resolveExternalLink = (node: any, uri: string, linkPath: string, parentSchemaURL: string): Thenable<any> => {
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<any> => {
let resolveRefs = (node: IJSONSchema, parentSchema: IJSONSchema, parentSchemaURL: string): Thenable<any> => {
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<ResolvedSchema> {
......
......@@ -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' ? (<ObjectASTNode>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
......
/*---------------------------------------------------------------------------------------------
* 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' ? (<ObjectASTNode>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
......@@ -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<NugetServices>;
public constructor(requestService: IRequestService) {
public constructor(requestService: RequestService) {
this.requestService = requestService;
}
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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<XHRResponse>({ 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#",
......
......@@ -8,6 +8,7 @@
<string>makefile</string>
<string>GNUmakefile</string>
<string>OCamlMakefile</string>
<string>mk</string>
</array>
<key>name</key>
<string>Makefile</string>
......@@ -718,4 +719,4 @@
<key>uuid</key>
<string>FF1825E8-6B1C-11D9-B883-000D93589AF6</string>
</dict>
</plist>
\ No newline at end of file
</plist>
// 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 <http://unlicense.org/>"
]
},
{
"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\"."
]
}
]
{
"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
......@@ -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
/* 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
{
"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"
}]
},
"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
{
"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
/*---------------------------------------------------------------------------------------------
* 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 `<pre class="hljs"><code><div>${hljs.highlight(lang, str, true).value}</div></code></pre>`;
} catch (error) { }
}
return `<pre class="hljs"><code><div>${md.utils.escapeHtml(str)}</div></code></pre>`;
}
}).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<Uri>();
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 `<link rel="stylesheet" href="${this.fixHref(uri, style)}" type="text/css" media="screen">`;
});
}
return [];
}
public provideTextDocumentContent(uri: Uri): Thenable<string> {
return vscode.workspace.openTextDocument(Uri.parse(uri.query)).then(document => {
const head = [].concat(
'<!DOCTYPE html>',
'<html>',
'<head>',
'<meta http-equiv="Content-type" content="text/html;charset=UTF-8">',
`<link rel="stylesheet" type="text/css" href="${this.getMediaPath('markdown.css')}" >`,
`<link rel="stylesheet" type="text/css" href="${this.getMediaPath('tomorrow.css')}" >`,
this.computeCustomStyleSheetIncludes(uri),
'</head>',
'<body>'
).join('\n');
const body = md.render(document.getText());
const tail = [
'</body>',
'</html>'
].join('\n');
return head + body + tail;
});
}
get onDidChange(): Event<Uri> {
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
......@@ -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
/// <reference path='../../../declares.d.ts'/>
/// <reference path='../../../lib.core.d.ts'/>
/// <reference path='../../../node.d.ts'/>
此差异已折叠。
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"outDir": "out",
"noLib": true,
"sourceMap": true,
"rootDir": "."
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
......@@ -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"
}
]
}
......
impl Foo<A,B>
where A: B
{ }
impl Foo<A,B> for C
where A: B
{ }
impl Foo<A,B> for C
{
fn foo<A,B> -> C
where A: B
{ }
}
fn foo<A,B> -> C
where A: B
{ }
struct Foo<A,B>
where A: B
{ }
trait Foo<A,B> : C
where A: B
{ }
\ No newline at end of file
此差异已折叠。
......@@ -7,6 +7,8 @@
<string>sql</string>
<string>ddl</string>
<string>dml</string>
<string>dsql</string>
<string>psql</string>
</array>
<key>keyEquivalent</key>
<string>^~S</string>
......@@ -762,4 +764,4 @@
<key>uuid</key>
<string>C49120AC-6ECC-11D9-ACC8-000D93589AF6</string>
</dict>
</plist>
\ No newline at end of file
</plist>
......@@ -282,6 +282,54 @@
<string>#F8F8F0</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Quote</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#22aa44</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Styling</string>
<key>scope</key>
<string>markup.bold, markup.italic</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#22aa44</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Inline</string>
<key>scope</key>
<string>markup.inline.raw</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#9966b8</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Setext Header</string>
<key>scope</key>
<string>markup.heading.setext</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#ddbb88</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>96A92F4B-E068-4DC6-9635-F55E7D920420</string>
......
......@@ -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",
......
......@@ -48,6 +48,12 @@
"settings": {
"foreground": "#001080"
}
},
{
"scope": ["markup.quote", "markup.list"],
"settings": {
"foreground": "#0451a5"
}
}
]
}
\ No newline at end of file
......@@ -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": {
......
......@@ -300,7 +300,7 @@
<key>name</key>
<string>Headings</string>
<key>scope</key>
<string>markup.heading punctuation.definition.heading, entity.name.section</string>
<string>markup.heading, markup.heading.setext, punctuation.definition.heading, entity.name.section</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
......
......@@ -56,7 +56,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9AA83A</string>
</dict>
......@@ -70,7 +70,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D08442</string>
</dict>
......@@ -84,7 +84,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -98,7 +98,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#408080</string>
</dict>
......@@ -112,7 +112,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#8080FF</string>
<key>background</key>
......@@ -128,7 +128,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -142,7 +142,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#C7444A</string>
</dict>
......@@ -156,7 +156,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -170,7 +170,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9B0000</string>
<key>background</key>
......@@ -186,7 +186,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#C7444A</string>
</dict>
......@@ -200,7 +200,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#CE6700</string>
</dict>
......@@ -214,7 +214,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -228,7 +228,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -242,7 +242,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -256,7 +256,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -270,7 +270,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#676867</string>
</dict>
......@@ -284,7 +284,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -298,7 +298,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#FF0080</string>
</dict>
......@@ -312,7 +312,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#008200</string>
</dict>
......@@ -326,7 +326,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#FF0B00</string>
</dict>
......@@ -340,7 +340,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -354,7 +354,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#0080FF</string>
</dict>
......@@ -368,7 +368,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -382,7 +382,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -396,7 +396,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -410,7 +410,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
......@@ -424,7 +424,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -438,7 +438,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9AA83A</string>
</dict>
......@@ -452,7 +452,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9AA83A</string>
</dict>
......@@ -466,7 +466,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -480,7 +480,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
......@@ -494,7 +494,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -508,7 +508,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
......@@ -533,7 +533,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9AA83A</string>
</dict>
......@@ -547,7 +547,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#6089B4</string>
</dict>
......@@ -561,7 +561,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9872A2</string>
</dict>
......@@ -575,7 +575,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#676867</string>
</dict>
......@@ -589,7 +589,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#C7444A</string>
</dict>
......@@ -614,7 +614,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
......@@ -650,7 +650,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D08442</string>
</dict>
......@@ -664,7 +664,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#9AA83A</string>
</dict>
......@@ -678,7 +678,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
......@@ -692,7 +692,7 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D9B700</string>
</dict>
......@@ -717,11 +717,83 @@
<dict>
<key>fontStyle</key>
<string>
</string>
</string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Quote</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#9872A2</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Lists</string>
<key>scope</key>
<string>markup.list</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#9AA83A</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Styling</string>
<key>scope</key>
<string>markup.bold, markup.italic</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#6089B4</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Inline</string>
<key>scope</key>
<string>markup.inline.raw</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF0080</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Headings</string>
<key>scope</key>
<string>markup.heading</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#D0B344</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Setext Header</string>
<key>scope</key>
<string>markup.heading.setext</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#D0B344</string>
</dict>
</dict>
</array>
</dict>
</plist>
......@@ -380,6 +380,78 @@
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Quote</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#F92672</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Lists</string>
<key>scope</key>
<string>markup.list</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E6DB74</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Styling</string>
<key>scope</key>
<string>markup.bold, markup.italic</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#66D9EF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Inline</string>
<key>scope</key>
<string>markup.inline.raw</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FD971F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Headings</string>
<key>scope</key>
<string>markup.heading</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup Setext Header</string>
<key>scope</key>
<string>markup.heading.setext</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
......
此差异已折叠。
......@@ -75,7 +75,7 @@
</dict>
</dict>
<key>match</key>
<string> (?:([-_a-zA-Z0-9]+)((:)))?([a-zA-Z-]+)</string>
<string> (?:([-_\p{L}\d]+)((:)))?([\p{L}-]+)</string>
</dict>
<dict>
<key>include</key>
......
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<WorkFine>
<NoColorWithNonLatinCharacters_АБВ NextTagnotWork="something" Поле="tagnotwork">
<WorkFine/>
<Error_АБВГД/>
</NoColorWithNonLatinCharacters_АБВ>
</WorkFine>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册