Skip to content

Commit a2211b8

Browse files
authored
Add basic support for entering text into the interactive window (microsoft#3972)
This is the first step in getting an input into the interactive window. Still to do: - Make it auto height - Make it not go away when the user submits (it should just stay around and change to readonly so the screen doesn't flash) - Functional tests. - History (up/down arrows)
1 parent 20e4d32 commit a2211b8

27 files changed

+625
-340
lines changed

news/1 Enhancements/3101.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ability to enter python code directly into the Python Interactive window

package-lock.json

Lines changed: 85 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.datascience-ui.dependencies.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
"character-entities-legacy",
2727
"character-reference-invalid",
2828
"classnames",
29+
"codemirror",
2930
"collapse-white-space",
3031
"core-js",
3132
"create-emotion",
33+
"create-react-class",
3234
"css-loader",
3335
"d3-array",
3436
"d3-bboxCollide",
@@ -78,9 +80,11 @@
7880
"leaflet",
7981
"lodash.clonedeep",
8082
"lodash.curry",
83+
"lodash.debounce",
8184
"lodash.flatten",
8285
"lodash.flow",
8386
"lodash.get",
87+
"lodash.isequal",
8488
"lodash.set",
8589
"lodash.uniq",
8690
"lodash",
@@ -95,12 +99,12 @@
9599
"parse-entities",
96100
"path-browserify",
97101
"polygon-offset",
98-
"prismjs",
99102
"process",
100103
"prop-types",
101104
"pure-color",
102105
"react-annotation",
103106
"react-base16-styling",
107+
"react-codemirror",
104108
"react-color",
105109
"react-dom",
106110
"react-hot-loader",

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,11 @@
989989
"description": "Amount of time (in ms) to wait for an interrupt before asking to restart the Jupyter kernel.",
990990
"scope": "resource"
991991
},
992+
"python.dataScience.allowInput": {
993+
"type": "boolean",
994+
"default": false,
995+
"description": "Allow the inputting of python code directly into the Python Interactive window (currently under development)"
996+
},
992997
"python.dataScience.showCellInputCode": {
993998
"type": "boolean",
994999
"default": true,
@@ -1841,6 +1846,7 @@
18411846
},
18421847
"dependencies": {
18431848
"@jupyterlab/services": "^3.1.4",
1849+
"@types/strip-json-comments": "0.0.30",
18441850
"arch": "^2.1.0",
18451851
"azure-storage": "^2.10.1",
18461852
"diff-match-patch": "^1.0.0",
@@ -1866,6 +1872,7 @@
18661872
"rxjs": "^5.5.9",
18671873
"semver": "^5.5.0",
18681874
"stack-trace": "0.0.10",
1875+
"strip-json-comments": "^2.0.1",
18691876
"sudo-prompt": "^8.2.0",
18701877
"tmp": "^0.0.29",
18711878
"tree-kill": "^1.2.0",
@@ -1913,9 +1920,9 @@
19131920
"@types/md5": "^2.1.32",
19141921
"@types/mocha": "^2.2.48",
19151922
"@types/node": "9.4.7",
1916-
"@types/prismjs": "^1.9.0",
19171923
"@types/promisify-node": "^0.4.0",
19181924
"@types/react": "^16.4.14",
1925+
"@types/react-codemirror": "^1.0.2",
19191926
"@types/react-dom": "^16.0.8",
19201927
"@types/react-json-tree": "^0.6.8",
19211928
"@types/request": "^2.47.0",
@@ -1934,7 +1941,6 @@
19341941
"awesome-typescript-loader": "^5.2.1",
19351942
"babel-loader": "^8.0.3",
19361943
"babel-plugin-inline-json-import": "^0.3.1",
1937-
"babel-plugin-prismjs": "^1.0.2",
19381944
"babel-plugin-transform-runtime": "^6.23.0",
19391945
"babel-polyfill": "^6.26.0",
19401946
"chai": "^4.1.2",
@@ -1972,9 +1978,9 @@
19721978
"mocha-junit-reporter": "^1.17.0",
19731979
"node-has-native-dependencies": "^1.0.2",
19741980
"nyc": "^13.1.0",
1975-
"prismjs": "^1.15.0",
19761981
"raw-loader": "^0.5.1",
19771982
"react": "^16.5.2",
1983+
"react-codemirror": "^1.0.0",
19781984
"react-dev-utils": "^5.0.2",
19791985
"react-dom": "^16.5.2",
19801986
"react-json-tree": "^0.11.0",

src/client/common/application/webPanel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as path from 'path';
88
import { Uri, ViewColumn, WebviewPanel, window } from 'vscode';
99

1010
import * as localize from '../../common/utils/localize';
11+
import { Identifiers } from '../../datascience/constants';
1112
import { IServiceContainer } from '../../ioc/types';
1213
import { IConfigurationService, IDisposableRegistry } from '../types';
1314
import { IWebPanel, IWebPanelMessageListener, WebPanelMessage } from './types';
@@ -101,6 +102,7 @@ export class WebPanel implements IWebPanel {
101102
<meta charset="utf-8">
102103
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
103104
<meta name="theme-color" content="#000000">
105+
<meta name="theme" content="${Identifiers.GeneratedThemeName}"/>
104106
<title>React App</title>
105107
<base href="${uriBase}"/>
106108
<style type="text/css">

0 commit comments

Comments
 (0)