mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
18
extensions/python/.vscode/launch.json
vendored
Normal file
18
extensions/python/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outDir": "${workspaceRoot}/out",
|
||||
"preLaunchTask": "npm"
|
||||
}
|
||||
]
|
||||
}
|
||||
30
extensions/python/.vscode/tasks.json
vendored
Normal file
30
extensions/python/.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// Available variables which can be used inside of strings.
|
||||
// ${workspaceRoot}: the root folder of the team
|
||||
// ${file}: the current opened file
|
||||
// ${fileBasename}: the current opened file's basename
|
||||
// ${fileDirname}: the current opened file's dirname
|
||||
// ${fileExtname}: the current opened file's extension
|
||||
// ${cwd}: the current working directory of the spawned process
|
||||
|
||||
// A task runner that calls a custom npm script that compiles the extension.
|
||||
{
|
||||
"version": "0.1.0",
|
||||
|
||||
// we want to run npm
|
||||
"command": "npm",
|
||||
|
||||
// the command is a shell script
|
||||
"isShellCommand": true,
|
||||
|
||||
// show the output window only if unrecognized errors occur.
|
||||
"showOutput": "silent",
|
||||
|
||||
// we run the custom script "compile" as defined in package.json
|
||||
"args": ["run", "compile"],
|
||||
|
||||
// The tsc compiler is started in watching mode
|
||||
"isWatching": true,
|
||||
|
||||
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
|
||||
"problemMatcher": "$tsc-watch"
|
||||
}
|
||||
3
extensions/python/.vscodeignore
Normal file
3
extensions/python/.vscodeignore
Normal file
@@ -0,0 +1,3 @@
|
||||
test/**
|
||||
src/**
|
||||
tsconfig.json
|
||||
9
extensions/python/OSSREADME.json
Normal file
9
extensions/python/OSSREADME.json
Normal file
@@ -0,0 +1,9 @@
|
||||
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
|
||||
[
|
||||
{
|
||||
"name": "MagicStack/MagicPython",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"repositoryURL": "https://github.com/MagicStack/MagicPython"
|
||||
}
|
||||
]
|
||||
26
extensions/python/language-configuration.json
Normal file
26
extensions/python/language-configuration.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "#",
|
||||
"blockComment": [ "'''", "'''" ]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
{ "open": "{", "close": "}" },
|
||||
{ "open": "[", "close": "]" },
|
||||
{ "open": "(", "close": ")" },
|
||||
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
||||
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
]
|
||||
// enhancedBrackets: [ { open: /.*:\s*$/, closeComplete: 'else:' } ],
|
||||
}
|
||||
30
extensions/python/package.json
Normal file
30
extensions/python/package.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "python",
|
||||
"version": "0.1.0",
|
||||
"publisher": "vscode",
|
||||
"engines": { "vscode": "*" },
|
||||
"activationEvents": ["onLanguage:python"],
|
||||
"main": "./out/pythonMain",
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "python",
|
||||
"extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi" ],
|
||||
"aliases": [ "Python", "py" ],
|
||||
"firstLine": "^#!/.*\\bpython[0-9.-]*\\b",
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "python",
|
||||
"scopeName": "source.python",
|
||||
"path": "./syntaxes/MagicPython.tmLanguage.json"
|
||||
},{
|
||||
"scopeName": "source.regexp.python",
|
||||
"path": "./syntaxes/MagicRegExp.tmLanguage.json"
|
||||
}]
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "gulp compile-extension:python",
|
||||
"watch": "gulp watch-extension:python",
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js MagicStack/MagicPython grammars/MagicPython.tmLanguage ./syntaxes/MagicPython.tmLanguage.json grammars/MagicRegExp.tmLanguage ./syntaxes/MagicRegExp.tmLanguage.json"
|
||||
}
|
||||
}
|
||||
17
extensions/python/src/pythonMain.ts
Normal file
17
extensions/python/src/pythonMain.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import { ExtensionContext, languages, IndentAction } from 'vscode';
|
||||
|
||||
export function activate(context: ExtensionContext): any {
|
||||
languages.setLanguageConfiguration('python', {
|
||||
onEnterRules: [
|
||||
{
|
||||
beforeText: /^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,
|
||||
action: { indentAction: IndentAction.Indent }
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
6
extensions/python/src/typings/ref.d.ts
vendored
Normal file
6
extensions/python/src/typings/ref.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
5253
extensions/python/syntaxes/MagicPython.tmLanguage.json
Normal file
5253
extensions/python/syntaxes/MagicPython.tmLanguage.json
Normal file
File diff suppressed because it is too large
Load Diff
501
extensions/python/syntaxes/MagicRegExp.tmLanguage.json
Normal file
501
extensions/python/syntaxes/MagicRegExp.tmLanguage.json
Normal file
@@ -0,0 +1,501 @@
|
||||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicRegExp.tmLanguage",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/MagicStack/MagicPython/commit/361a4964a559481330764a447e7bab88d4f1b01b",
|
||||
"name": "MagicRegExp",
|
||||
"scopeName": "source.regexp.python",
|
||||
"fileTypes": [
|
||||
"re"
|
||||
],
|
||||
"uuid": "39e15186-71e6-11e5-b82c-7c6d62900c7c",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"regexp-base-expression": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-quantifier"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-base-common"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fregexp-base-expression": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#fregexp-quantifier"
|
||||
},
|
||||
{
|
||||
"include": "#fstring-formatting-braces"
|
||||
},
|
||||
{
|
||||
"match": "\\{.*?\\}"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-base-common"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fstring-formatting-braces": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "empty braces are illegal",
|
||||
"match": "({)(\\s*?)(})",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "constant.character.format.placeholder.other.python"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.brace.python"
|
||||
},
|
||||
"3": {
|
||||
"name": "constant.character.format.placeholder.other.python"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "constant.character.escape.python",
|
||||
"match": "({{|}})"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-base-common": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.other.match.any.regexp",
|
||||
"match": "\\."
|
||||
},
|
||||
{
|
||||
"name": "support.other.match.begin.regexp",
|
||||
"match": "\\^"
|
||||
},
|
||||
{
|
||||
"name": "support.other.match.end.regexp",
|
||||
"match": "\\$"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.quantifier.regexp",
|
||||
"match": "[+*?]\\??"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.disjunction.regexp",
|
||||
"match": "\\|"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-sequence"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-quantifier": {
|
||||
"name": "keyword.operator.quantifier.regexp",
|
||||
"match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
|
||||
},
|
||||
"fregexp-quantifier": {
|
||||
"name": "keyword.operator.quantifier.regexp",
|
||||
"match": "(?x)\n \\{\\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\\}\n"
|
||||
},
|
||||
"regexp-backreference-number": {
|
||||
"name": "meta.backreference.regexp",
|
||||
"match": "(\\\\[1-9]\\d?)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.tag.backreference.regexp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"regexp-backreference": {
|
||||
"name": "meta.backreference.named.regexp",
|
||||
"match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.named.backreference.regexp"
|
||||
},
|
||||
"3": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"regexp-flags": {
|
||||
"name": "storage.modifier.flag.regexp",
|
||||
"match": "\\(\\?[aiLmsux]+\\)"
|
||||
},
|
||||
"regexp-escape-special": {
|
||||
"name": "support.other.escape.special.regexp",
|
||||
"match": "\\\\([AbBdDsSwWZ])"
|
||||
},
|
||||
"regexp-escape-character": {
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
|
||||
},
|
||||
"regexp-escape-unicode": {
|
||||
"name": "constant.character.unicode.regexp",
|
||||
"match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
|
||||
},
|
||||
"regexp-escape-catchall": {
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "\\\\(.|\\n)"
|
||||
},
|
||||
"regexp-escape-sequence": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-escape-special"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-character"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-unicode"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-backreference-number"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-catchall"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-charecter-set-escapes": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "\\\\[abfnrtv\\\\]"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-special"
|
||||
},
|
||||
{
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "\\\\([0-7]{1,3})"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-character"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-unicode"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-catchall"
|
||||
}
|
||||
]
|
||||
},
|
||||
"codetags": {
|
||||
"match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.codetag.notation.python"
|
||||
}
|
||||
}
|
||||
},
|
||||
"regexp-expression": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-base-expression"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-character-set"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-comments"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-flags"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-named-group"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-backreference"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookahead"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookahead-negative"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookbehind"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookbehind-negative"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-conditional"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-parentheses-non-capturing"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-parentheses"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-character-set": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
|
||||
},
|
||||
{
|
||||
"name": "meta.character.set.regexp",
|
||||
"begin": "(\\[)(\\^)?(\\])?",
|
||||
"end": "(\\])",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.operator.negation.regexp"
|
||||
},
|
||||
"3": {
|
||||
"name": "constant.character.set.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.character.set.end.regexp constant.other.set.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-charecter-set-escapes"
|
||||
},
|
||||
{
|
||||
"name": "constant.character.set.regexp",
|
||||
"match": "[^\\n]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-named-group": {
|
||||
"name": "meta.named.regexp",
|
||||
"begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.named.group.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-comments": {
|
||||
"name": "comment.regexp",
|
||||
"begin": "\\(\\?#",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.comment.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.comment.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#codetags"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookahead": {
|
||||
"begin": "(\\()\\?=",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookahead.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookahead.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookahead-negative": {
|
||||
"begin": "(\\()\\?!",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookahead.negative.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookahead.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookbehind": {
|
||||
"begin": "(\\()\\?<=",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookbehind.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookbehind.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookbehind-negative": {
|
||||
"begin": "(\\()\\?<!",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookbehind.negative.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookbehind.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-conditional": {
|
||||
"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.conditional.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.conditional.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-parentheses-non-capturing": {
|
||||
"begin": "\\(\\?:",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-parentheses": {
|
||||
"begin": "\\(",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
97
extensions/python/test/colorize-fixtures/test.py
Normal file
97
extensions/python/test/colorize-fixtures/test.py
Normal file
@@ -0,0 +1,97 @@
|
||||
from banana import *
|
||||
|
||||
class Monkey:
|
||||
# Bananas the monkey can eat.
|
||||
capacity = 10
|
||||
def eat(self, N):
|
||||
'''Make the monkey eat N bananas!'''
|
||||
capacity = capacity - N*banana.size
|
||||
|
||||
def feeding_frenzy(self):
|
||||
eat(9.25)
|
||||
return "Yum yum"
|
||||
|
||||
def some_func(a:
|
||||
lambda x=None:
|
||||
{key: val
|
||||
for key, val in
|
||||
(x if x is not None else [])
|
||||
}=42):
|
||||
pass
|
||||
|
||||
if 1900 < year < 2100 and 1 <= month <= 12 \
|
||||
and 1 <= day <= 31 and 0 <= hour < 24 \
|
||||
and 0 <= minute < 60 and 0 <= second < 60: # Looks like a valid date
|
||||
return 1
|
||||
|
||||
def firstn(g, n):
|
||||
for i in range(n):
|
||||
yield g.next()
|
||||
|
||||
reduce(lambda x,y: x+y, [47,11,42,13])
|
||||
woerter = {"house" : "Haus", "cat":"Katze", "black":"schwarz"}
|
||||
|
||||
mydictionary = {
|
||||
'foo': 23, #comment
|
||||
'bar': "hello" #sqadsad
|
||||
}
|
||||
|
||||
def steuern(einkommen):
|
||||
"""Berechnung der zu zahlenden Steuern fuer ein zu versteuerndes Einkommen von x"""
|
||||
if einkommen <= 8004:
|
||||
steuer = 0
|
||||
elif einkommen <= 13469:
|
||||
y = (einkommen -8004.0)/10000.0
|
||||
steuer = (912.17 * y + 1400)*y
|
||||
else:
|
||||
steuer = einkommen * 0.44 - 15694
|
||||
return steuer
|
||||
|
||||
def beliebig(x, y, *mehr):
|
||||
print "x=", x, ", x=", y
|
||||
print "mehr: ", mehr
|
||||
|
||||
class Memoize:
|
||||
def __init__(self, fn):
|
||||
self.fn = fn
|
||||
self.memo = {}
|
||||
def __call__(self, *args):
|
||||
if args not in self.memo:
|
||||
self.memo[args] = self.fn(*args)
|
||||
return self.memo[args]
|
||||
|
||||
res = re.search(r"([0-9-]*)\s*([A-Za-z]+),\s+(.*)", i)
|
||||
|
||||
while True:
|
||||
try:
|
||||
n = raw_input("Number: ")
|
||||
n = int(n)
|
||||
break
|
||||
except ValueError:
|
||||
print("Not a number")
|
||||
|
||||
async with EXPR as VAR:
|
||||
BLOCK
|
||||
|
||||
# Comments in dictionary items should be colorized accordingly
|
||||
my_dictionary = {
|
||||
'foo':23, # this should be colorized as comment
|
||||
'bar':"foobar" #this should be colorized as comment
|
||||
}
|
||||
|
||||
# test raw strings
|
||||
text = r"""
|
||||
interval ``[1,2)`` leads to
|
||||
"""
|
||||
highlight_error = True
|
||||
|
||||
# highlight doctests
|
||||
r'''Module docstring
|
||||
|
||||
Some text followed by code sample:
|
||||
>>> for a in foo(2, b=1,
|
||||
... c=3):
|
||||
... print(a)
|
||||
0
|
||||
1
|
||||
'''
|
||||
6778
extensions/python/test/colorize-results/test_py.json
Normal file
6778
extensions/python/test/colorize-results/test_py.json
Normal file
File diff suppressed because it is too large
Load Diff
13
extensions/python/tsconfig.json
Normal file
13
extensions/python/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es2015"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"outDir": "./out"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user