Skip to content

Commit 75823e8

Browse files
authored
Merge pull request #547 from krassowski/fix-ipython-pinfo
Fix a typo preventing pinfo from working on ids with letter 's'
2 parents 4590114 + 802e6a9 commit 75823e8

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

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

3+
### `@krassowski/jupyterlab-lsp 3.4.2` (unreleased)
4+
5+
- bug fixes:
6+
7+
- prevents throwing a highlights error when adding new cell with <kbd>Shift</kbd> + <kbd>Enter</kbd> ([#544])
8+
- fixes IPython `pinfo` and `pinfo2` (`?` and `??`) for identifiers containing `s` ([#547])
9+
10+
[#544]: https://github.com/krassowski/jupyterlab-lsp/pull/544
11+
[#547]: https://github.com/krassowski/jupyterlab-lsp/pull/547
12+
313
### `jupyter-lsp 1.1.4` (2020-02-21)
414

515
- bug fixes:

packages/jupyterlab-lsp/src/transclusions/ipython/overrides.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ describe('Default IPython overrides', () => {
205205

206206
reverse = line_magics_map.reverse.override_for(override);
207207
expect(reverse).to.equal('int??');
208+
209+
override = line_magics_map.override_for('some_func??');
210+
expect(override).to.equal(
211+
"get_ipython().run_line_magic('pinfo2', 'some_func')"
212+
);
213+
reverse = line_magics_map.reverse.override_for(override);
214+
expect(reverse).to.equal('some_func??');
208215
});
209216

210217
it('does not override standalone question marks', () => {

packages/jupyterlab-lsp/src/transclusions/ipython/overrides.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function empty_or_escaped(x: string) {
4242
*/
4343
export const LINE_MAGIC_PREFIX = '^(\\s*|\\s*\\S+\\s*=\\s*)';
4444

45-
export const PYTHON_IDENTIFIER = '([^?s\'"\\(\\)-\\+\\/#]+)';
45+
export const PYTHON_IDENTIFIER = '([^?\\s\'"\\(\\)-\\+\\/#]+)';
4646

4747
export let overrides: IScopedCodeOverride[] = [
4848
/**

0 commit comments

Comments
 (0)