Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be62784

Browse files
committed
updated extension to use latest ts and vscode
1 parent 1ec2ab4 commit be62784

22 files changed

+76
-332
lines changed

.vscodeignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ typings/**
33
out/test/**
44
test/**
55
src/**
6+
scripts/**
67
**/*.map
78
.gitignore
9+
.gitmodules
810
images/**/*.gif
911
images/**/*.png
1012
tsconfig.json
13+
typings.json
1114
pythonFiles/**/*.pyc
15+
requirements.txt
1216
vsc-extension-quickstart.md
1317
.travis.yml
14-
requirements.txt
15-
webpack.config.js
18+
webpack.config.js

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"theme": "dark"
2424
},
2525
"engines": {
26-
"vscode": "^1.5.0"
26+
"vscode": "^1.6.0"
2727
},
2828
"categories": [
2929
"Languages",
@@ -749,16 +749,12 @@
749749
}
750750
},
751751
"scripts": {
752-
"vscode:prepublish": "node ./node_modules/vscode/bin/compile && webpack",
753-
"compile": "webpack && node ./node_modules/vscode/bin/compile -watch -p ./ && installServerIntoExtension ./out ./src/server/package.json ./src/server/tsconfig.json",
752+
"vscode:prepublish": "tsc -p ./ && webpack",
753+
"compile": "webpack && tsc -watch -p ./",
754754
"postinstall": "node ./node_modules/vscode/bin/install",
755755
"test": "node ./node_modules/vscode/bin/test"
756756
},
757757
"dependencies": {
758-
"@types/jquery": "^1.10.31",
759-
"@types/socket.io": "^1.4.27",
760-
"@types/socket.io-client": "^1.4.27",
761-
"@types/uuid": "^3.3.27",
762758
"anser": "^1.1.0",
763759
"copy-paste": "^1.3.0",
764760
"diff-match-patch": "^1.0.0",
@@ -785,14 +781,21 @@
785781
"xml2js": "^0.4.17"
786782
},
787783
"devDependencies": {
784+
"@types/node": "^6.0.40",
785+
"@types/mocha": "^2.2.32",
786+
"@types/jquery": "^1.10.31",
787+
"@types/socket.io": "^1.4.27",
788+
"@types/socket.io-client": "^1.4.27",
789+
"@types/uuid": "^3.3.27",
788790
"babel-core": "^6.14.0",
789791
"babel-loader": "^6.2.5",
790792
"babel-preset-es2015": "^6.14.0",
791793
"ignore-loader": "^0.1.1",
792794
"retyped-diff-match-patch-tsd-ambient": "^1.0.0-0",
793795
"ts-loader": "^0.8.2",
794-
"typescript": "^1.8.5",
795-
"vscode": "^0.11.0",
796-
"webpack": "^1.13.2"
796+
"webpack": "^1.13.2",
797+
"typescript": "^2.0.3",
798+
"vscode": "^1.0.0",
799+
"mocha": "^2.3.3"
797800
}
798801
}

pythonVSCode

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/client/.vscode/launch.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/client/.vscode/settings.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/client/.vscode/tasks.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/client/common/utils.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// <reference path="../../../node_modules/@types/node/index.d.ts" />
2+
/// <reference path="../../../node_modules/vscode/vscode.d.ts" />
3+
14
'use strict';
25
// TODO: Cleanup this place
36
// Add options for execPythonFile
@@ -6,8 +9,8 @@ import * as os from 'os';
69
import * as fs from 'fs';
710
import * as child_process from 'child_process';
811
import * as settings from './configSettings';
9-
import {CancellationToken} from 'vscode';
10-
import {isNotInstalledError} from './helpers';
12+
import { CancellationToken } from 'vscode';
13+
import { isNotInstalledError } from './helpers';
1114

1215
export const IS_WINDOWS = /^win/.test(process.platform);
1316
const PATH_VARIABLE_NAME = IS_WINDOWS ? 'Path' : 'PATH';
@@ -161,14 +164,14 @@ function spawnFileInternal(file: string, args: string[], options: child_process.
161164
});
162165
proc.stdout.setEncoding('utf8');
163166
proc.stderr.setEncoding('utf8');
164-
proc.stdout.on('data', function (data) {
167+
proc.stdout.on('data', function (data: string) {
165168
if (token && token.isCancellationRequested) {
166169
return;
167170
}
168171
stdOut(data);
169172
});
170173

171-
proc.stderr.on('data', function (data) {
174+
proc.stderr.on('data', function (data: string) {
172175
if (token && token.isCancellationRequested) {
173176
return;
174177
}

src/client/debugger/DebugClients/NonDebugClient.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import {BaseDebugServer} from "../DebugServers/BaseDebugServer";
2-
import {NonDebugServer} from "../DebugServers/NonDebugServer";
3-
import {IPythonProcess, IPythonThread, IDebugServer} from "../Common/Contracts";
4-
import {DebugSession, OutputEvent} from "vscode-debugadapter";
5-
import {DebugProtocol} from "vscode-debugprotocol";
1+
import { BaseDebugServer } from "../DebugServers/BaseDebugServer";
2+
import { NonDebugServer } from "../DebugServers/NonDebugServer";
3+
import { IPythonProcess, IPythonThread, IDebugServer } from "../Common/Contracts";
4+
import { DebugSession, OutputEvent } from "vscode-debugadapter";
5+
import { DebugProtocol } from "vscode-debugprotocol";
66
import * as path from "path";
77
import * as child_process from "child_process";
8-
import {LaunchRequestArguments} from "../Common/Contracts";
9-
import {DebugClient, DebugType} from "./DebugClient";
8+
import { LaunchRequestArguments } from "../Common/Contracts";
9+
import { DebugClient, DebugType } from "./DebugClient";
1010
import * as fs from "fs";
11-
import {open} from "../../common/open";
11+
import { open } from "../../common/open";
1212
let fsExtra = require("fs-extra");
1313
let tmp = require("tmp");
1414
let prependFile = require("prepend-file");
@@ -122,10 +122,10 @@ export class NonDebugClient extends DebugClient {
122122
});
123123
this.pyProc.stderr.setEncoding("utf8");
124124
this.pyProc.stdout.setEncoding("utf8");
125-
this.pyProc.stderr.on("data", error => {
125+
this.pyProc.stderr.on("data", (error: string) => {
126126
this.debugSession.sendEvent(new OutputEvent(error, "stderr"));
127127
});
128-
this.pyProc.stdout.on("data", d => {
128+
this.pyProc.stdout.on("data", (d: string) => {
129129
this.debugSession.sendEvent(new OutputEvent(d, "stdout"));
130130
});
131131
this.pyProc.on('exit', () => {

src/client/debugger/DebugServers/LocalDebugServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class LocalDebugServer extends BaseDebugServer {
5353
this.debugSocketServer.on("error", ex => {
5454
let exMessage = JSON.stringify(ex);
5555
let msg = "";
56-
if (ex.code === "EADDRINUSE") {
56+
if ((ex as any).code === "EADDRINUSE") {
5757
msg = `The port used for debugging is in use, please try again or try restarting Visual Studio Code, Error = ${exMessage}`;
5858
}
5959
else {

src/client/package.json

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)