Skip to content

Commit fda5598

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-texlab-spec
2 parents 5c74e42 + 419ec72 commit fda5598

File tree

9 files changed

+65
-14
lines changed

9 files changed

+65
-14
lines changed

CHANGELOG.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## CHANGELOG
22

3-
### `@krassowski/jupyterlab-lsp 1.0.1` (unreleased)
3+
### `@krassowski/jupyterlab-lsp 1.1.0` (2020-07-20)
4+
5+
- features
6+
7+
- language servers can now be configured from the Advanced Settings Editor ([#245][])
48

59
- features
610

@@ -13,6 +17,8 @@
1317
(and vice versa) ([#195][])
1418
- restores sorting order-indicating caret icons in diagnostics panel table ([#261][])
1519
- handles document open and change operation ordering more predictably ([#284][])
20+
- fixes some pyflakes issues caused by line magics substitution ([#293][])
21+
- updated the link to the documentation of language servers ([#294][])
1622

1723
### `lsp-ws-connection 0.4.1` (unreleased)
1824

@@ -24,6 +30,30 @@
2430
[#195]: https://github.com/krassowski/jupyterlab-lsp/issues/195
2531
[#245]: https://github.com/krassowski/jupyterlab-lsp/pull/245
2632
[#261]: https://github.com/krassowski/jupyterlab-lsp/issues/261
33+
[#293]: https://github.com/krassowski/jupyterlab-lsp/pull/293
34+
[#294]: https://github.com/krassowski/jupyterlab-lsp/pull/294
35+
36+
### `jupyter-lsp 0.9.0` (2020-07-20)
37+
38+
- features
39+
40+
- language servers can now be configured from the Advanced Settings Editor ([#245][])
41+
42+
- bug fixes
43+
44+
- handles document open and change operation ordering more predictably ([#284][])
45+
46+
### `lsp-ws-connection 0.5.0` (2020-07-20)
47+
48+
- features
49+
50+
- language servers can now be configured from the Advanced Settings Editor ([#245][])
51+
52+
- bug fixes
53+
54+
- handles document open and change operation ordering more predictably ([#284][])
55+
56+
[#245]: https://github.com/krassowski/jupyterlab-lsp/pull/245
2757
[#284]: https://github.com/krassowski/jupyterlab-lsp/pull/284
2858
[#288]: https://github.com/krassowski/jupyterlab-lsp/pull/288
2959

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ variables:
1313
ATEST_RETRIES: 3
1414
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
1515

16-
PY_JLSP_VERSION: 0.8.0
17-
JS_JLLSP_VERSION: 1.0.0
16+
PY_JLSP_VERSION: 0.9.0
17+
JS_JLLSP_VERSION: 1.1.0
1818
JS_JLG2D_VERSION: 1.0.0
1919

2020
FIRST_PARTY_LABEXTENSIONS: >-

packages/jupyterlab-lsp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@krassowski/jupyterlab-lsp",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Language Server Protocol integration for JupyterLab",
55
"keywords": [
66
"jupyter",
@@ -38,7 +38,7 @@
3838
"dependencies": {
3939
"@krassowski/jupyterlab_go_to_definition": "~1.0.0",
4040
"lodash.mergewith": "^4.6.1",
41-
"lsp-ws-connection": "~0.4.0"
41+
"lsp-ws-connection": "~0.5.0"
4242
},
4343
"devDependencies": {
4444
"@babel/preset-env": "^7.4.3",

packages/jupyterlab-lsp/src/adapters/jupyterlab/components/statusbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class LSPPopup extends VDomRenderer<LSPStatus.Model> {
213213
Documentation:{' '}
214214
<a
215215
href={
216-
'https://github.com/krassowski/jupyterlab-lsp/blob/master/docs/LANGUAGESERVERS.md'
216+
'https://jupyterlab-lsp.readthedocs.io/en/latest/Language%20Servers.html'
217217
}
218218
target="_blank"
219219
rel="noreferrer"

packages/jupyterlab-lsp/src/magics/defaults.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ describe('Default IPython overrides', () => {
104104
expect(reverse).to.equal(LINE_MAGIC_WITH_SPACE);
105105
});
106106

107+
it('overrides x =%ls', () => {
108+
// this is a corner-case as described in
109+
// https://github.com/krassowski/jupyterlab-lsp/issues/281#issuecomment-645286076
110+
let override = line_magics_map.override_for('x =%ls');
111+
expect(override).to.equal('x =get_ipython().run_line_magic("ls", "")');
112+
});
113+
114+
it('does not override line-magic-like constructs', () => {
115+
let override = line_magics_map.override_for('list("%")');
116+
expect(override).to.equal(null);
117+
});
118+
107119
it('escapes arguments', () => {
108120
const line_magic_with_args = '%MAGIC "arg"';
109121
let override = line_magics_map.override_for(line_magic_with_args);
@@ -122,5 +134,10 @@ describe('Default IPython overrides', () => {
122134
let reverse = line_magics_map.reverse.override_for(override);
123135
expect(reverse).to.equal('!ls -o');
124136
});
137+
138+
it('does not override shell-like constructs', () => {
139+
let override = line_magics_map.override_for('"!ls"');
140+
expect(override).to.equal(null);
141+
});
125142
});
126143
});

packages/jupyterlab-lsp/src/magics/defaults.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ export const language_specific_overrides: IOverridesRegistry = {
3838
// keep the content, keep magic/command name and new line at the end
3939

4040
// note magics do not have to start with the new line, for example x = !ls or x = %ls are both valid.
41+
// x =%ls is also valid. However, percent may also appear in strings, e.g. ls('%').
42+
// Hence: (^|\\s|=) for shell commands (!) and line magics (%); see issue #281.
43+
// This does not solve all issues, for example `list(" %ls")` still leads to:
44+
// `list(" get_ipython().run_line_magic("ls")", "")`.
4145
{
42-
pattern: '!(\\S+)(.*)(\n)?',
43-
replacement: 'get_ipython().getoutput("$1$2")$3',
46+
pattern: '(^|\\s|=)!(\\S+)(.*)(\n)?',
47+
replacement: '$1get_ipython().getoutput("$2$3")$4',
4448
reverse: {
4549
pattern: 'get_ipython\\(\\).getoutput\\("(.*?)"\\)(\n)?',
4650
replacement: '!$1$2'
@@ -62,11 +66,11 @@ export const language_specific_overrides: IOverridesRegistry = {
6266
}
6367
},
6468
{
65-
pattern: '%(\\S+)(.*)(\n)?',
66-
replacement: (match, name, args, line_break) => {
69+
pattern: '(^|\\s|=)%(\\S+)(.*)(\n)?',
70+
replacement: (match, prefix, name, args, line_break) => {
6771
args = empty_or_escaped(args);
6872
line_break = line_break || '';
69-
return `get_ipython().run_line_magic("${name}", "${args}")${line_break}`;
73+
return `${prefix}get_ipython().run_line_magic("${name}", "${args}")${line_break}`;
7074
},
7175
reverse: {
7276
pattern:

packages/lsp-ws-connection/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lsp-ws-connection",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "Utility for adapting editors to language server protocol",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

packages/metapackage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@krassowski/jupyterlab-lsp-metapackage",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "JupyterLab LSP - Meta Package. All of the packages used by JupyterLab LSP",
55
"homepage": "https://github.com/krassowski/jupyterlab-lsp",
66
"bugs": {

py_src/jupyter_lsp/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
""" single source of truth for jupyter_lsp version
22
"""
3-
__version__ = "0.8.0"
3+
__version__ = "0.9.0"

0 commit comments

Comments
 (0)