Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Define printWidth at 100
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Sep 18, 2020
1 parent 078ee54 commit bce6fe8
Show file tree
Hide file tree
Showing 81 changed files with 290 additions and 1,156 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"singleQuote": true,
"trailingComma": "none",
"semi": true,
"useTabs": true
"useTabs": true,
"printWidth": 100
}
15 changes: 3 additions & 12 deletions scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ const BUNDLED_FILE_HEADER = [
].join('\n');

bundleOne('monaco.contribution');
glob('out/amd/*/*.contribution.js', { cwd: path.dirname(__dirname) }, function (
err,
files
) {
glob('out/amd/*/*.contribution.js', { cwd: path.dirname(__dirname) }, function (err, files) {
if (err) {
console.log(err);
return;
Expand All @@ -52,14 +49,8 @@ function bundleOne(moduleId, exclude) {
optimize: 'none'
},
async function (buildResponse) {
const devFilePath = path.join(
REPO_ROOT,
'release/dev/' + moduleId + '.js'
);
const minFilePath = path.join(
REPO_ROOT,
'release/min/' + moduleId + '.js'
);
const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js');
const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js');
const fileContents = fs.readFileSync(devFilePath).toString();
console.log();
console.log(`Minifying ${devFilePath}...`);
Expand Down
4 changes: 1 addition & 3 deletions src/_.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const lazyLanguageLoaders: { [languageId: string]: LazyLanguageLoader } = {};
class LazyLanguageLoader {
public static getOrCreate(languageId: string): LazyLanguageLoader {
if (!lazyLanguageLoaders[languageId]) {
lazyLanguageLoaders[languageId] = new LazyLanguageLoader(
languageId
);
lazyLanguageLoaders[languageId] = new LazyLanguageLoader(languageId);
}
return lazyLanguageLoaders[languageId];
}
Expand Down
10 changes: 2 additions & 8 deletions src/abap/abap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,17 +499,11 @@ export const language = <languages.IMonarchLanguage>{
[/[:,.]/, 'delimiter'],

[/[{}()\[\]]/, '@brackets'],
[
/@symbols/,
{ cases: { '@operators': 'operator', '@default': '' } }
],
[/@symbols/, { cases: { '@operators': 'operator', '@default': '' } }],

[/'/, { token: 'string', bracket: '@open', next: '@stringquote' }],
[/`/, { token: 'string', bracket: '@open', next: '@stringping' }],
[
/\|/,
{ token: 'string', bracket: '@open', next: '@stringtemplate' }
],
[/\|/, { token: 'string', bracket: '@open', next: '@stringtemplate' }],

[/\d+/, 'number']
],
Expand Down
6 changes: 2 additions & 4 deletions src/apex/apex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ testTokenization('apex', [
// Keywords
[
{
line:
'package test; class Program { static void main(String[] args) {} } }',
line: 'package test; class Program { static void main(String[] args) {} } }',
tokens: [
{ startIndex: 0, type: 'keyword.package.apex' },
{ startIndex: 7, type: '' },
Expand Down Expand Up @@ -271,8 +270,7 @@ testTokenization('apex', [
// Keywords with case variations
[
{
line:
'Package test; CLASS Program { Static void main(String[] args) {} } }',
line: 'Package test; CLASS Program { Static void main(String[] args) {} } }',
tokens: [
{ startIndex: 0, type: 'keyword.Package.apex' },
{ startIndex: 7, type: '' },
Expand Down
13 changes: 3 additions & 10 deletions src/apex/apex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ export const conf: languages.LanguageConfiguration = {
],
folding: {
markers: {
start: new RegExp(
'^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))'
),
end: new RegExp(
'^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))'
)
start: new RegExp('^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))'),
end: new RegExp('^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))')
}
}
};
Expand Down Expand Up @@ -300,10 +296,7 @@ export const language = <languages.IMonarchLanguage>{

// numbers
[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'],
[
/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,
'number.float'
],
[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'],
[/(@digits)[fFdD]/, 'number.float'],
[/(@digits)[lL]?/, 'number'],

Expand Down
13 changes: 3 additions & 10 deletions src/azcli/azcli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import {
testTokenization as actualTestTokenization,
ITestItem
} from '../test/testRunner';
import { testTokenization as actualTestTokenization, ITestItem } from '../test/testRunner';

function testTokenization(
_language: string | string[],
tests: ITestItem[][]
): void {
function testTokenization(_language: string | string[], tests: ITestItem[][]): void {
tests = tests.map((t) => {
return t.map((t) => {
return {
Expand Down Expand Up @@ -93,8 +87,7 @@ testTokenization('azcli', [
],
[
{
line:
'az ad sp create-for-rb --name ServicePrincipalName --password PASSWORD',
line: 'az ad sp create-for-rb --name ServicePrincipalName --password PASSWORD',
tokens: [
{ startIndex: 0, type: 'keyword.azcli' },
{ startIndex: 23, type: 'key.identifier.azcli' },
Expand Down
5 changes: 1 addition & 4 deletions src/bat/bat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ export const language = <languages.IMonarchLanguage>{
root: [
[/^(\s*)(rem(?:\s.*|))$/, ['', 'comment']],

[
/(\@?)(@keywords)(?!\w)/,
[{ token: 'keyword' }, { token: 'keyword.$2' }]
],
[/(\@?)(@keywords)(?!\w)/, [{ token: 'keyword' }, { token: 'keyword.$2' }]],

// whitespace
[/[ \t\r\n]+/, ''],
Expand Down
5 changes: 1 addition & 4 deletions src/clojure/clojure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,10 +864,7 @@ testTokenization('clojure', [
],

// comments
createTestCases(
['; this is an in-line comment.', ';; this is a line comment.'],
'comment'
),
createTestCases(['; this is an in-line comment.', ';; this is a line comment.'], 'comment'),

// `comment`
[
Expand Down
3 changes: 1 addition & 2 deletions src/coffee/coffee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1694,8 +1694,7 @@ testTokenization('coffeescript', [
tokens: [{ startIndex: 0, type: '' }]
},
{
line:
'# Everything is an Expression (at least, as much as possible)',
line: '# Everything is an Expression (at least, as much as possible)',
tokens: [{ startIndex: 0, type: 'comment.coffee' }]
},
{
Expand Down
17 changes: 3 additions & 14 deletions src/cpp/cpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,7 @@ export const language = <languages.IMonarchLanguage>{
tokenizer: {
root: [
// C++ 11 Raw String
[
/@encoding?R\"(?:([^ ()\\\t]*))\(/,
{ token: 'string.raw.begin', next: '@raw.$1' }
],
[/@encoding?R\"(?:([^ ()\\\t]*))\(/, { token: 'string.raw.begin', next: '@raw.$1' }],

// identifiers and keywords
[
Expand All @@ -303,10 +300,7 @@ export const language = <languages.IMonarchLanguage>{
// [[ attributes ]].
[/\[\[.*\]\]/, 'annotation'],

[
/^\s*#include/,
{ token: 'keyword.directive.include', next: '@include' }
],
[/^\s*#include/, { token: 'keyword.directive.include', next: '@include' }],

// Preprocessor directive
[/^\s*#\s*\w+/, 'keyword'],
Expand Down Expand Up @@ -383,12 +377,7 @@ export const language = <languages.IMonarchLanguage>{
'string.raw.end',
{ token: 'string.raw.end', next: '@pop' }
],
'@default': [
'string.raw',
'string.raw',
'string.raw',
'string.raw'
]
'@default': ['string.raw', 'string.raw', 'string.raw', 'string.raw']
}
}
],
Expand Down
6 changes: 2 additions & 4 deletions src/csharp/csharp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ testTokenization('csharp', [
tokens: [{ startIndex: 0, type: '' }]
},
{
line:
' string someString = $"hello{outside+variable}the string again {{ escaped";',
line: ' string someString = $"hello{outside+variable}the string again {{ escaped";',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'keyword.string.cs' },
Expand Down Expand Up @@ -425,8 +424,7 @@ testTokenization('csharp', [
// Keywords
[
{
line:
'namespace VS { class Program { static void Main(string[] args) {} } }',
line: 'namespace VS { class Program { static void Main(string[] args) {} } }',
tokens: [
{ startIndex: 0, type: 'keyword.namespace.cs' },
{ startIndex: 9, type: '' },
Expand Down
11 changes: 1 addition & 10 deletions src/csharp/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,7 @@ export const language = <languages.IMonarchLanguage>{

namespaceFollows: ['namespace', 'using'],

parenFollows: [
'if',
'for',
'while',
'switch',
'foreach',
'using',
'catch',
'when'
],
parenFollows: ['if', 'for', 'while', 'switch', 'foreach', 'using', 'catch', 'when'],

operators: [
'=',
Expand Down
44 changes: 9 additions & 35 deletions src/css/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,14 @@ export const language = <languages.IMonarchLanguage>{
{ token: 'keyword', next: '@keyframedeclaration' }
],
['[@](page|content|font-face|-moz-document)', { token: 'keyword' }],
[
'[@](charset|namespace)',
{ token: 'keyword', next: '@declarationbody' }
],
['[@](charset|namespace)', { token: 'keyword', next: '@declarationbody' }],
[
'(url-prefix)(\\()',
[
'attribute.value',
{ token: 'delimiter.parenthesis', next: '@urldeclaration' }
]
['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]
],
[
'(url)(\\()',
[
'attribute.value',
{ token: 'delimiter.parenthesis', next: '@urldeclaration' }
]
['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]
],
{ include: '@selectorname' },
['[\\*]', 'tag'], // selector symbols
Expand All @@ -96,11 +87,7 @@ export const language = <languages.IMonarchLanguage>{

selectorbody: [
{ include: '@comments' },
[
'[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))',
'attribute.name',
'@rulevalue'
], // rule definition: to distinguish from a nested selector check for whitespace, number or a semicolon
['[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))', 'attribute.name', '@rulevalue'], // rule definition: to distinguish from a nested selector check for whitespace, number or a semicolon
['}', { token: 'delimiter.bracket', next: '@pop' }]
],

Expand All @@ -117,17 +104,11 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@comments' },
[
'(url-prefix)(\\()',
[
'attribute.value',
{ token: 'delimiter.parenthesis', next: '@urldeclaration' }
]
['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]
],
[
'(url)(\\()',
[
'attribute.value',
{ token: 'delimiter.parenthesis', next: '@urldeclaration' }
]
['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]
],
{ include: '@functioninvocation' },
{ include: '@numbers' },
Expand All @@ -145,13 +126,9 @@ export const language = <languages.IMonarchLanguage>{
['(?=})', { token: '', next: '@pop' }] // missing semicolon
],

warndebug: [
['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }]
],
warndebug: [['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }]],

import: [
['[@](import)', { token: 'keyword', next: '@declarationbody' }]
],
import: [['[@](import)', { token: 'keyword', next: '@declarationbody' }]],

urldeclaration: [
{ include: '@strings' },
Expand Down Expand Up @@ -211,10 +188,7 @@ export const language = <languages.IMonarchLanguage>{
],

functioninvocation: [
[
'@identifier\\(',
{ token: 'attribute.value', next: '@functionarguments' }
]
['@identifier\\(', { token: 'attribute.value', next: '@functionarguments' }]
],

functionarguments: [
Expand Down
21 changes: 4 additions & 17 deletions src/dart/dart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,34 +255,21 @@ export const language = <languages.IMonarchLanguage>{
regexp: [
[
/(\{)(\d+(?:,\d*)?)(\})/,
[
'regexp.escape.control',
'regexp.escape.control',
'regexp.escape.control'
]
['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control']
],
[
/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,
[
'regexp.escape.control',
{ token: 'regexp.escape.control', next: '@regexrange' }
]
],
[
/(\()(\?:|\?=|\?!)/,
['regexp.escape.control', 'regexp.escape.control']
['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }]
],
[/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']],
[/[()]/, 'regexp.escape.control'],
[/@regexpctl/, 'regexp.escape.control'],
[/[^\\\/]/, 'regexp'],
[/@regexpesc/, 'regexp.escape'],
[/\\\./, 'regexp.invalid'],
[
/(\/)([gimsuy]*)/,
[
{ token: 'regexp', bracket: '@close', next: '@pop' },
'keyword.other'
]
[{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other']
]
],

Expand Down
3 changes: 1 addition & 2 deletions src/dockerfile/dockerfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ testTokenization('dockerfile', [
]
},
{
line:
' && sh autogen.sh && ./configure && make && make install \\',
line: ' && sh autogen.sh && ./configure && make && make install \\',
tokens: [{ startIndex: 0, type: '' }]
},
{
Expand Down
Loading

0 comments on commit bce6fe8

Please sign in to comment.