Skip to content

Commit 07a66b2

Browse files
authored
Merge pull request #340 from krassowski/fix/code-overrides
Fix code overrides & add an acceptance test
2 parents d631b35 + 84dbbc2 commit 07a66b2

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## CHANGELOG
22

3+
### `@krassowski/jupyterlab-lsp 2.0.2` (2020-09-07)
4+
5+
- bug fixes
6+
7+
- fix code overrides not being registered properly ([#340])
8+
9+
[#340]: https://github.com/krassowski/jupyterlab-lsp/issues/340
10+
311
### `@krassowski/jupyterlab-lsp 2.0.1` (2020-09-07)
412

513
- bug fixes

atest/03_Notebook.robot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ Foreign Extractors
2929
END
3030
Capture Page Screenshot 11-extracted.png
3131
[Teardown] Clean Up After Working with File and Settings ${file}
32+
33+
Code Overrides
34+
${file} = Set Variable Code overrides.ipynb
35+
Setup Notebook Python ${file}
36+
${virtual_path} = Set Variable ${OUTPUT DIR}${/}home${/}.virtual_documents/Code\ overrides.ipynb
37+
Wait Until Created ${virtual_path}
38+
${document} = Get File ${virtual_path}
39+
Should Be Equal ${document} get_ipython().run_line_magic("ls", "")\n\n\nget_ipython().run_line_magic("pip", " freeze")\n

atest/examples/Code overrides.ipynb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%ls"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"%pip freeze"
19+
]
20+
}
21+
],
22+
"metadata": {
23+
"kernelspec": {
24+
"display_name": "Python 3",
25+
"language": "python",
26+
"name": "python3"
27+
},
28+
"language_info": {
29+
"codemirror_mode": {
30+
"name": "ipython",
31+
"version": 3
32+
},
33+
"file_extension": ".py",
34+
"mimetype": "text/x-python",
35+
"name": "python",
36+
"nbconvert_exporter": "python",
37+
"pygments_lexer": "ipython3",
38+
"version": "3.7.5"
39+
}
40+
},
41+
"nbformat": 4,
42+
"nbformat_minor": 4
43+
}

packages/jupyterlab-lsp/src/overrides/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CodeOverridesManager implements ILSPCodeOverridesManager {
1717
}
1818

1919
register(override: IScopedCodeOverride, language: string) {
20-
if (!(language in override)) {
20+
if (!(language in this._overrides)) {
2121
this._overrides[language] = { cell: [], line: [] };
2222
}
2323
let overrides = this._overrides[language];

0 commit comments

Comments
 (0)