Merge pull request #114628 from microsoft/alex/python-language-configuration
Move `onEnterRules` to `language-configuration.json`pull/114944/head^2
commit
5a3fedf0c4
|
@ -57,7 +57,6 @@ const compilations = [
|
|||
'microsoft-authentication/tsconfig.json',
|
||||
'npm/tsconfig.json',
|
||||
'php-language-features/tsconfig.json',
|
||||
'python/tsconfig.json',
|
||||
'search-result/tsconfig.json',
|
||||
'simple-browser/tsconfig.json',
|
||||
'testing-editor-contributions/tsconfig.json',
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
test/**
|
||||
src/**
|
||||
out/**
|
||||
tsconfig.json
|
||||
extension.webpack.config.js
|
||||
extension-browser.webpack.config.js
|
||||
cgmanifest.json
|
||||
.vscode
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const withBrowserDefaults = require('../shared.webpack.config').browser;
|
||||
|
||||
module.exports = withBrowserDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
extension: './src/pythonMain.ts'
|
||||
},
|
||||
output: {
|
||||
filename: 'pythonMain.js'
|
||||
}
|
||||
});
|
|
@ -1,17 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
pythonMain: './src/pythonMain.ts'
|
||||
}
|
||||
});
|
|
@ -46,5 +46,11 @@
|
|||
"start": "^\\s*#\\s*region\\b",
|
||||
"end": "^\\s*#\\s*endregion\\b"
|
||||
}
|
||||
}
|
||||
},
|
||||
"onEnterRules": [
|
||||
{
|
||||
"beforeText": "^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$",
|
||||
"action": { "indent": "indent" }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
"publisher": "vscode",
|
||||
"license": "MIT",
|
||||
"engines": { "vscode": "*" },
|
||||
"activationEvents": ["onLanguage:python"],
|
||||
"main": "./out/pythonMain",
|
||||
"browser": "./dist/browser/pythonMain",
|
||||
"extensionKind": [ "ui", "workspace", "web" ],
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
|
@ -29,8 +26,6 @@
|
|||
}]
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
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 }
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"extends": "../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue