diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a4947205170..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "docs"] - path = docs - url = https://github.com/DonJayamanne/pythonVSCodeDocs.git - branch = help diff --git a/docs b/docs deleted file mode 160000 index f37284e16b7..00000000000 --- a/docs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f37284e16b707ef9c43b126decde21929248a7dd diff --git a/gulpfile.js b/gulpfile.js index 052c3aa979f..f284ad9edc9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -43,7 +43,6 @@ const eolFilter = [ '!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,txt,md,json,yml}', '!out/**/*', '!images/**/*', - '!docs/**/*', '!.vscode/**/*', '!pythonFiles/**/*', '!resources/**/*', @@ -64,7 +63,6 @@ const tslintFilter = [ '!**/node_modules/**', '!out/**/*', '!images/**/*', - '!docs/**/*', '!.vscode/**/*', '!pythonFiles/**/*', '!resources/**/*', diff --git a/package.json b/package.json index 63f80480c85..1fcb1af34d2 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "onCommand:jupyter.runSelectionLine", "onCommand:jupyter.execCurrentCell", "onCommand:jupyter.execCurrentCellAndAdvance", - "onCommand:python.displayHelp", "onCommand:python.buildWorkspaceSymbols", "onCommand:python.updateSparkLibrary", "onCommand:python.startREPL", @@ -202,11 +201,6 @@ "title": "Go to Next Cell", "category": "Jupyter" }, - { - "command": "python.displayHelp", - "title": "Help", - "category": "Python" - }, { "command": "python.goToPythonObject", "title": "Go to Python Object", @@ -1600,8 +1594,6 @@ "lint": "tslint src/**/*.ts -t verbose" }, "dependencies": { - "anser": "^1.1.0", - "copy-paste": "^1.3.0", "diff-match-patch": "^1.0.0", "fs-extra": "^4.0.2", "fuzzy": "^0.1.3", @@ -1609,14 +1601,10 @@ "lodash": "^4.17.4", "minimatch": "^3.0.3", "named-js-regexp": "^1.3.1", - "node-static": "^0.7.9", - "prepend-file": "^1.3.0", "rx": "^4.1.0", "semver": "^5.4.1", "socket.io": "^1.4.8", "tmp": "0.0.29", - "transformime": "^3.1.2", - "transformime-marked": "0.0.1", "tree-kill": "^1.1.0", "uint64be": "^1.0.1", "untildify": "^3.0.2", @@ -1626,8 +1614,7 @@ "vscode-languageclient": "^3.1.0", "vscode-languageserver": "^3.1.0", "winreg": "^1.2.4", - "xml2js": "^0.4.17", - "vscode": "^1.1.5" + "xml2js": "^0.4.17" }, "devDependencies": { "@types/chai": "^4.0.4", @@ -1660,12 +1647,15 @@ "relative": "^3.0.2", "retyped-diff-match-patch-tsd-ambient": "^1.0.0-0", "sinon": "^2.3.6", + "transformime": "^3.1.2", + "transformime-marked": "0.0.1", "ts-loader": "^2.3.4", "tslint": "^5.7.0", "tslint-eslint-rules": "^4.1.1", "tslint-microsoft-contrib": "^5.0.1", "typescript": "^2.5.2", "typescript-formatter": "^6.0.0", - "webpack": "^1.13.2" + "webpack": "^1.13.2", + "vscode": "^1.1.5" } } diff --git a/src/client/common/constants.ts b/src/client/common/constants.ts index 5ab6c470e79..c332257d117 100644 --- a/src/client/common/constants.ts +++ b/src/client/common/constants.ts @@ -80,20 +80,3 @@ export namespace LinterErrors { export const InvalidSyntax = 'E999'; } } - -export namespace Documentation { - export const Home = '/docs/python-path/'; - export namespace Jupyter { - export const GettingStarted = '/docs/jupyter_getting-started/'; - export const Examples = '/docs/jupyter_examples/'; - export const Setup = '/docs/jupyter_prerequisites/'; - export const VersionIncompatiblity = '/docs/troubleshooting_jupyter/#Incompatible-dependencies'; - } - export namespace Formatting { - export const FormatOnSave = '/docs/formatting/'; - } - export namespace Workspace { - export const Home = '/docs/workspaceSymbols/'; - export const InstallOnWindows = '/docs/workspaceSymbols/#Install-Windows'; - } -} diff --git a/src/client/extension.ts b/src/client/extension.ts index bb5cf525204..827c95324eb 100644 --- a/src/client/extension.ts +++ b/src/client/extension.ts @@ -1,8 +1,6 @@ 'use strict'; -import * as fs from 'fs'; import * as os from 'os'; -import { workspace } from 'vscode'; import * as vscode from 'vscode'; import * as settings from './common/configSettings'; import { Commands } from './common/constants'; @@ -10,7 +8,6 @@ import { createDeferred } from './common/helpers'; import * as telemetryHelper from './common/telemetry'; import * as telemetryContracts from './common/telemetryContracts'; import { SimpleConfigurationProvider } from './debugger'; -import { HelpProvider } from './helpProvider'; import { InterpreterManager } from './interpreter'; import { SetInterpreterProvider } from './interpreter/configuration/setInterpreterProvider'; import { ShebangCodeLensProvider } from './interpreter/display/shebangCodeLensProvider'; @@ -142,9 +139,6 @@ export async function activate(context: vscode.ExtensionContext) { const triggerCharacters: string[] = os.EOL.split(''); triggerCharacters.shift(); - const hepProvider = new HelpProvider(); - context.subscriptions.push(hepProvider); - context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('python', new SimpleConfigurationProvider())); activationDeferred.resolve(); } diff --git a/src/client/helpProvider.ts b/src/client/helpProvider.ts deleted file mode 100644 index 74a524cccff..00000000000 --- a/src/client/helpProvider.ts +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -import * as vscode from 'vscode'; -import {Disposable} from 'vscode'; -import * as path from 'path'; -import * as http from 'http'; -import {createDeferred} from './common/helpers'; -import {Documentation} from './common/constants'; -const nodeStatic = require('node-static'); - -let serverAddress = "http://localhost:8080"; -let helpPageToDisplay = Documentation.Home; -export class TextDocumentContentProvider extends Disposable implements vscode.TextDocumentContentProvider { - private _onDidChange = new vscode.EventEmitter(); - private lastUri: vscode.Uri; - constructor() { - super(() => { }); - } - public provideTextDocumentContent(uri: vscode.Uri, token: vscode.CancellationToken): Thenable { - this.lastUri = uri; - return this.generateResultsView(); - } - - get onDidChange(): vscode.Event { - return this._onDidChange.event; - } - - public update() { - this._onDidChange.fire(this.lastUri); - } - - private generateResultsView(): Promise { - const addresss = serverAddress + helpPageToDisplay; - const htmlContent = ` - - - - - - - - `; - return Promise.resolve(htmlContent); - } -} -const helpSchema = 'help-viewer'; -const previewUri = vscode.Uri.parse(helpSchema + '://authority/python'); - -export class HelpProvider { - private disposables: Disposable[] = []; - constructor() { - const textProvider = new TextDocumentContentProvider(); - this.disposables.push(vscode.workspace.registerTextDocumentContentProvider(helpSchema, textProvider)); - this.disposables.push(vscode.commands.registerCommand('python.displayHelp', (page: string) => { - this.startServer().then(port => { - let viewColumn = vscode.ViewColumn.Two; - if (!page || typeof page !== 'string' || page.length === 0) { - helpPageToDisplay = Documentation.Home; - viewColumn = vscode.ViewColumn.One; - } - else { - helpPageToDisplay = page; - } - vscode.commands.executeCommand('vscode.previewHtml', previewUri, viewColumn, 'Help'); - }); - })); - } - dispose() { - this.disposables.forEach(d => d.dispose()); - this.stop(); - } - private httpServer: http.Server; - private port: number; - private startServer(): Promise { - if (this.port) { - return Promise.resolve(this.port); - } - - let def = createDeferred(); - var file = new nodeStatic.Server(path.join(__dirname, '..', '..', 'docs')); - this.httpServer = http.createServer((request, response) => { - request.addListener('end', function () { - // - // Serve files! - // - file.serve(request, response); - }).resume(); - }); - - this.httpServer.listen(0, () => { - this.port = this.httpServer.address().port; - serverAddress = 'http://localhost:' + this.port.toString(); - def.resolve(this.port); - def = null; - }); - this.httpServer.on('error', error => { - if (def) { - def.reject(error); - def = null; - } - }); - - return def.promise; - } - - private stop() { - if (!this.httpServer) { - return; - } - this.httpServer.close(); - this.httpServer = null; - } -} \ No newline at end of file diff --git a/src/client/jupyter/main.ts b/src/client/jupyter/main.ts index 8cb402b4aa0..c7f01370aba 100644 --- a/src/client/jupyter/main.ts +++ b/src/client/jupyter/main.ts @@ -7,7 +7,6 @@ import { Commands, PythonLanguage } from '../common/constants'; import { JupyterCodeLensProvider } from './editorIntegration/codeLensProvider'; import { JupyterSymbolProvider } from './editorIntegration/symbolProvider'; import { formatErrorForLogging } from '../common/utils'; -import { Documentation } from '../common/constants'; // import * as telemetryHelper from '../common/telemetry'; // import * as telemetryContracts from '../common/telemetryContracts'; import * as main from './jupyter_client/main'; @@ -147,10 +146,7 @@ export class Jupyter extends vscode.Disposable { }).catch(reason => { const message = typeof reason === 'string' ? reason : reason.message; this.outputChannel.appendLine(formatErrorForLogging(reason)); - vscode.window.showErrorMessage(message, 'Help', 'View Errors').then(item => { - if (item === 'Help') { - vscode.commands.executeCommand('python.displayHelp', Documentation.Jupyter.Setup); - } + vscode.window.showErrorMessage(message, 'View Errors').then(item => { if (item === 'View Errors') { this.outputChannel.show(); } @@ -230,4 +226,4 @@ export class Jupyter extends vscode.Disposable { this.onKernelChanged(); })); } -}; \ No newline at end of file +}; diff --git a/src/client/providers/codeActionProvider.ts b/src/client/providers/codeActionProvider.ts deleted file mode 100644 index 14e03c9a4b9..00000000000 --- a/src/client/providers/codeActionProvider.ts +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -import * as vscode from 'vscode'; -import {TextDocument, Range, CodeActionContext, CancellationToken, Command} from 'vscode'; - -export class PythonCodeActionsProvider implements vscode.CodeActionProvider { - public constructor(context: vscode.ExtensionContext) { - } - provideCodeActions(document: TextDocument, range: Range, context: CodeActionContext, token: CancellationToken): Thenable { - return new Promise((resolve, reject) => { - let commands: Command[] = [ - { - command: 'python.sortImports', - title: 'Sort Imports' - } - ]; - - if (vscode.window.activeTextEditor.document === document && !vscode.window.activeTextEditor.selection.isEmpty) { - let wordRange = document.getWordRangeAtPosition(range.start); - // If no word has been selected by the user, then don't display rename - // If something has been selected, then ensure we have selected a word (i.e. end and start matches the word range) - if (wordRange && !wordRange.isEmpty && wordRange.isEqual(vscode.window.activeTextEditor.selection)) { - let word = document.getText(wordRange).trim(); - if (word.length > 0) { - commands.push({ command: 'editor.action.rename', title: 'Rename Symbol' }); - } - } - } - - if (!range.isEmpty) { - let word = document.getText(range).trim(); - if (word.trim().length > 0) { - commands.push({ command: 'python.refactorExtractVariable', title: 'Extract Variable', arguments: [range] }); - commands.push({ command: 'python.refactorExtractMethod', title: 'Extract Method', arguments: [range] }); - } - } - resolve(commands); - }); - } -} diff --git a/tsconfig.json b/tsconfig.json index 0b10f6fac53..aacfa96ef3d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,6 @@ "src/server/node_modules", "src/client/node_modules", "src/server/src/typings", - "src/client/src/typings", - "docs" + "src/client/src/typings" ] }