From f3782ffc240b2d23deb75c0fda33ea3f1060b39f Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 24 Feb 2021 18:22:35 +0000 Subject: [PATCH 1/2] Fix a typo preventing pinfo from working on ids with letter 's' --- .../src/transclusions/ipython/overrides.spec.ts | 7 +++++++ .../jupyterlab-lsp/src/transclusions/ipython/overrides.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.spec.ts b/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.spec.ts index eaca1c22c..250c1d075 100644 --- a/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.spec.ts +++ b/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.spec.ts @@ -205,6 +205,13 @@ describe('Default IPython overrides', () => { reverse = line_magics_map.reverse.override_for(override); expect(reverse).to.equal('int??'); + + override = line_magics_map.override_for('some_func??'); + expect(override).to.equal( + "get_ipython().run_line_magic('pinfo2', 'some_func')" + ); + reverse = line_magics_map.reverse.override_for(override); + expect(reverse).to.equal('some_func??'); }); it('does not override standalone question marks', () => { diff --git a/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.ts b/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.ts index 1e3d9b484..7bc6830b3 100644 --- a/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.ts +++ b/packages/jupyterlab-lsp/src/transclusions/ipython/overrides.ts @@ -42,7 +42,7 @@ function empty_or_escaped(x: string) { */ export const LINE_MAGIC_PREFIX = '^(\\s*|\\s*\\S+\\s*=\\s*)'; -export const PYTHON_IDENTIFIER = '([^?s\'"\\(\\)-\\+\\/#]+)'; +export const PYTHON_IDENTIFIER = '([^?\\s\'"\\(\\)-\\+\\/#]+)'; export let overrides: IScopedCodeOverride[] = [ /** From 802e6a9026b1962a49ed8c03653ee9be003c1741 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 24 Feb 2021 20:23:15 +0000 Subject: [PATCH 2/2] Update changelog (also for #544) --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 600a9c18a..916f5dfdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ ## CHANGELOG +### `@krassowski/jupyterlab-lsp 3.4.2` (unreleased) + +- bug fixes: + + - prevents throwing a highlights error when adding new cell with Shift + Enter ([#544]) + - fixes IPython `pinfo` and `pinfo2` (`?` and `??`) for identifiers containing `s` ([#547]) + +[#544]: https://github.com/krassowski/jupyterlab-lsp/pull/544 +[#547]: https://github.com/krassowski/jupyterlab-lsp/pull/547 + ### `jupyter-lsp 1.1.4` (2020-02-21) - bug fixes: