Skip to content

Commit

Permalink
Merge pull request #547 from krassowski/fix-ipython-pinfo
Browse files Browse the repository at this point in the history
Fix a typo preventing pinfo from working on ids with letter 's'
  • Loading branch information
krassowski authored Feb 24, 2021
2 parents 4590114 + 802e6a9 commit 75823e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## CHANGELOG

### `@krassowski/jupyterlab-lsp 3.4.2` (unreleased)

- bug fixes:

- prevents throwing a highlights error when adding new cell with <kbd>Shift</kbd> + <kbd>Enter</kbd> ([#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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
/**
Expand Down

0 comments on commit 75823e8

Please sign in to comment.