|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | 3 | import * as vscode from 'vscode'; |
4 | | -import {PythonCompletionItemProvider} from './providers/completionProvider'; |
5 | | -import {PythonHoverProvider} from './providers/hoverProvider'; |
6 | | -import {PythonDefinitionProvider} from './providers/definitionProvider'; |
7 | | -import {PythonReferenceProvider} from './providers/referenceProvider'; |
8 | | -import {PythonRenameProvider} from './providers/renameProvider'; |
9 | | -import {PythonFormattingEditProvider} from './providers/formatProvider'; |
| 4 | +import { PythonCompletionItemProvider } from './providers/completionProvider'; |
| 5 | +import { PythonHoverProvider } from './providers/hoverProvider'; |
| 6 | +import { PythonDefinitionProvider } from './providers/definitionProvider'; |
| 7 | +import { PythonReferenceProvider } from './providers/referenceProvider'; |
| 8 | +import { PythonRenameProvider } from './providers/renameProvider'; |
| 9 | +import { PythonFormattingEditProvider } from './providers/formatProvider'; |
10 | 10 | import * as sortImports from './sortImports'; |
11 | | -import {LintProvider} from './providers/lintProvider'; |
12 | | -import {PythonSymbolProvider} from './providers/symbolProvider'; |
13 | | -import {PythonSignatureProvider} from './providers/signatureProvider'; |
14 | | -import {activateFormatOnSaveProvider} from './providers/formatOnSaveProvider'; |
| 11 | +import { LintProvider } from './providers/lintProvider'; |
| 12 | +import { PythonSymbolProvider } from './providers/symbolProvider'; |
| 13 | +import { PythonSignatureProvider } from './providers/signatureProvider'; |
15 | 14 | import * as settings from './common/configSettings'; |
16 | 15 | import * as telemetryHelper from './common/telemetry'; |
17 | 16 | import * as telemetryContracts from './common/telemetryContracts'; |
18 | | -import {PythonCodeActionsProvider} from './providers/codeActionProvider'; |
19 | | -import {activateSimplePythonRefactorProvider} from './providers/simpleRefactorProvider'; |
20 | | -import {activateSetInterpreterProvider} from './providers/setInterpreterProvider'; |
21 | | -import {activateExecInTerminalProvider} from './providers/execInTerminalProvider'; |
| 17 | +import { PythonCodeActionsProvider } from './providers/codeActionProvider'; |
| 18 | +import { activateSimplePythonRefactorProvider } from './providers/simpleRefactorProvider'; |
| 19 | +import { activateSetInterpreterProvider } from './providers/setInterpreterProvider'; |
| 20 | +import { activateExecInTerminalProvider } from './providers/execInTerminalProvider'; |
22 | 21 | import * as tests from './unittests/main'; |
23 | 22 | import * as jup from './jupyter/main'; |
24 | | -import {HelpProvider} from './helpProvider'; |
| 23 | +import { HelpProvider } from './helpProvider'; |
| 24 | +import { Documentation } from './common/constants'; |
25 | 25 |
|
26 | 26 | const PYTHON: vscode.DocumentFilter = { language: 'python', scheme: 'file' }; |
27 | 27 | let unitTestOutChannel: vscode.OutputChannel; |
@@ -50,7 +50,6 @@ export function activate(context: vscode.ExtensionContext) { |
50 | 50 | context.subscriptions.push(activateSetInterpreterProvider()); |
51 | 51 | context.subscriptions.push(...activateExecInTerminalProvider()); |
52 | 52 | activateSimplePythonRefactorProvider(context, formatOutChannel); |
53 | | - context.subscriptions.push(activateFormatOnSaveProvider(PYTHON, pythonSettings, formatOutChannel, vscode.workspace.rootPath)); |
54 | 53 |
|
55 | 54 | // Enable indentAction |
56 | 55 | vscode.languages.setLanguageConfiguration(PYTHON.language, { |
@@ -93,6 +92,16 @@ export function activate(context: vscode.ExtensionContext) { |
93 | 92 |
|
94 | 93 | const hepProvider = new HelpProvider(); |
95 | 94 | context.subscriptions.push(hepProvider); |
| 95 | + |
| 96 | + // Check for old outdated settings |
| 97 | + const pySettings = vscode.workspace.getConfiguration('python'); |
| 98 | + if (pySettings.get('formatting.formatOnSave') === true) { |
| 99 | + vscode.window.showInformationMessage(`'python.formatting.formatOnSave' has been deprecated. Please use 'editor.formatOnSave' instead`, 'Help').then(item => { |
| 100 | + if (item === 'Help') { |
| 101 | + vscode.commands.executeCommand('python.displayHelp', Documentation.Formatting.FormatOnSave); |
| 102 | + } |
| 103 | + }); |
| 104 | + } |
96 | 105 | } |
97 | 106 |
|
98 | 107 | function disableOtherDocumentSymbolsProvider() { |
|
0 commit comments