Skip to content

Commit 22c0b20

Browse files
authored
Merge branch 'master' into add-i18n
2 parents 27f20c7 + 06f1e32 commit 22c0b20

File tree

123 files changed

+1929
-791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1929
-791
lines changed

.github/pull_request_template.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ https://github.com/jupyterlab/jupyterlab/blob/master/CONTRIBUTING.md
77

88
## References
99

10-
<!-- Note issue numbers this pull request addresses (should be at least one, see contributing guidelines above). -->
10+
<!-- Note issue numbers this pull request addresses (should be at least one, see contributing guidelines above).
11+
Use "fixes" and "closes" linking phrases as appropriate. -->
1112

1213
<!-- Note any other pull requests that address this issue and how this pull request is different. -->
1314

@@ -27,7 +28,7 @@ https://github.com/jupyterlab/jupyterlab/blob/master/CONTRIBUTING.md
2728

2829
## Chores
2930

30-
- [ ] linted
31-
- [ ] tested
32-
- [ ] documented
33-
- [ ] changelog entry
31+
- [ ] linted <!-- Required: Run "jlpm lint" and "python scripts/lint.py" from the root of the repository, then check this box like this: [x] -->
32+
- [ ] tested <!-- Recommended: Let us know if you already added a test case (if relevant). -->
33+
- [ ] documented <!-- Optional: Would it be good to improve the documentation? If yes, please consider doing this and checking this box. -->
34+
- [ ] changelog entry <!-- Recommended: Add a note in the CHANGELOG.md file under the most recent >unreleased< version; if one does not exist, feel free to create one by increasing the version number (no worries if you are not certain of the details - we can improve it later; let's just have something to work with) -->

.github/workflows/job.test.yml

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ defaults:
1616
shell: bash -l {0}
1717

1818
env:
19-
# Increase this value to reset all caches
20-
CACHE_EPOCH: 0
21-
22-
JLPM_CMD: jlpm --ignore-optional --prefer-offline --frozen-lockfile
23-
19+
JULIA_NUM_THREADS: 2
20+
MAMBA_NO_BANNER: 1
21+
PIP_DISABLE_PIP_VERSION_CHECK: 1
2422
PYTHONUNBUFFERED: 1
23+
2524
ATEST_RETRIES: 3
26-
PIP_DISABLE_PIP_VERSION_CHECK: 1
25+
JLPM_CMD: jlpm --ignore-optional --prefer-offline --frozen-lockfile
2726

28-
# TODO: replace once mambaforge "just works" with setup-miniconda
29-
MAMBAFORGE_URL: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge
27+
# Increase this value to reset all caches
28+
CACHE_EPOCH: 2
29+
JULIA_LANGSERVER: 3.2.0
3030

3131
jobs:
3232
lint:
@@ -50,7 +50,7 @@ jobs:
5050
nodejs: '${{ matrix.nodejs }}'
5151

5252
- name: Cache conda
53-
uses: actions/cache@v1
53+
uses: actions/cache@v2
5454
with:
5555
path: ~/conda_pkgs_dir
5656
key: |
@@ -61,11 +61,9 @@ jobs:
6161
- name: Set up Python and mamba
6262
uses: conda-incubator/setup-miniconda@v2
6363
with:
64-
installer-url: ${{ env.MAMBAFORGE_URL }}-Linux-x86_64.sh
65-
condarc-file: .github/.condarc
66-
67-
- name: Install base conda dependencies
68-
run: mamba env update -n test --file requirements/github-actions.yml
64+
environment-file: requirements/github-actions.yml
65+
miniforge-variant: Mambaforge
66+
use-mamba: true
6967

7068
- name: Install linting dependencies
7169
run: mamba env update -n test --file requirements/lint.yml
@@ -78,15 +76,17 @@ jobs:
7876
uses: actions/cache@v2
7977
with:
8078
path: '**/node_modules'
81-
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-lint-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
79+
key: |
80+
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-lint-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
8281
8382
- name: Cache yarn packages
8483
id: cache-yarn-packages
8584
if: steps.cache-node-modules.outputs.cache-hit != 'true'
86-
uses: actions/cache@v1
85+
uses: actions/cache@v2
8786
with:
8887
path: .yarn-packages
89-
key: ${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
88+
key: |
89+
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
9090
restore-keys: |
9191
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
9292
${{ env.CACHE_EPOCH }}-yarn-
@@ -107,6 +107,9 @@ jobs:
107107
- name: Lint frontend
108108
run: jlpm lint:check
109109

110+
- name: Check distributions
111+
run: python scripts/distcheck.py
112+
110113
build:
111114
name: build
112115
runs-on: ${{ matrix.os }}
@@ -128,7 +131,7 @@ jobs:
128131
nodejs: '${{ matrix.nodejs }}'
129132

130133
- name: Cache conda
131-
uses: actions/cache@v1
134+
uses: actions/cache@v2
132135
with:
133136
path: ~/conda_pkgs_dir
134137
key: |
@@ -139,8 +142,7 @@ jobs:
139142
- name: Set up Python and mamba
140143
uses: conda-incubator/setup-miniconda@v2
141144
with:
142-
installer-url: ${{ env.MAMBAFORGE_URL }}-Linux-x86_64.sh
143-
condarc-file: .github/.condarc
145+
miniforge-variant: Mambaforge
144146

145147
- name: Install minimal build deps
146148
shell: bash -l {0}
@@ -151,15 +153,17 @@ jobs:
151153
uses: actions/cache@v2
152154
with:
153155
path: '**/node_modules'
154-
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-build-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
156+
key: |
157+
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-build-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
155158
156159
- name: Cache yarn packages
157160
id: cache-yarn-packages
158161
if: steps.cache-node-modules.outputs.cache-hit != 'true'
159-
uses: actions/cache@v1
162+
uses: actions/cache@v2
160163
with:
161164
path: .yarn-packages
162-
key: ${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
165+
key: |
166+
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
163167
restore-keys: |
164168
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
165169
${{ env.CACHE_EPOCH }}-yarn-
@@ -230,11 +234,6 @@ jobs:
230234
steps:
231235
- uses: actions/checkout@v2
232236

233-
- uses: julia-actions/setup-julia@v1
234-
235-
- name: Install Julia language server
236-
run: julia -e 'using Pkg; Pkg.add("LanguageServer")'
237-
238237
- name: Set JupyterLab and Node versions
239238
uses: cschleiden/replace-tokens@v1
240239
with:
@@ -246,7 +245,7 @@ jobs:
246245
nodejs: '${{ matrix.nodejs }}'
247246

248247
- name: Cache conda
249-
uses: actions/cache@v1
248+
uses: actions/cache@v2
250249
with:
251250
path: ~/conda_pkgs_dir
252251
key: |
@@ -257,24 +256,9 @@ jobs:
257256
- name: Set up Python and mamba
258257
uses: conda-incubator/setup-miniconda@v2
259258
with:
260-
installer-url: ${{ env.MAMBAFORGE_URL }}-${{ matrix.mambaforge }}
261-
python-version: ${{ matrix.python }}
262-
condarc-file: .github/.condarc
263-
264-
- name: Describe conda
265-
run: |
266-
conda info
267-
conda config --show-sources
268-
conda config --show
269-
270-
- name: Install conda dependencies (unix)
271-
if: ${{ matrix.os != 'windows' }}
272-
run: mamba env update -n test --file requirements/github-actions.yml
273-
274-
- name: Install conda dependencies (windows)
275-
if: ${{ matrix.os == 'windows' }}
276-
shell: cmd /C call {0}
277-
run: mamba env update -n test --file requirements/github-actions.yml
259+
environment-file: requirements/github-actions.yml
260+
miniforge-variant: Mambaforge
261+
use-mamba: true
278262

279263
- name: List all packages
280264
run: conda list
@@ -284,22 +268,26 @@ jobs:
284268
uses: actions/cache@v2
285269
with:
286270
path: '**/node_modules'
287-
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-test-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
271+
key: |
272+
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-atest-${{ hashFiles('yarn.lock') }}
288273
289274
- name: Cache yarn packages
290275
id: cache-yarn-packages
291276
if: steps.cache-node-modules.outputs.cache-hit != 'true'
292-
uses: actions/cache@v1
277+
uses: actions/cache@v2
293278
with:
294279
path: .yarn-packages
295-
key: ${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
280+
key: |
281+
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
296282
restore-keys: |
297283
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
298284
${{ env.CACHE_EPOCH }}-yarn-
299285
300-
- name: install npm dependencies
301-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
302-
run: ${{ env.JLPM_CMD }}
286+
- uses: actions/cache@v2
287+
with:
288+
path: ~/.julia/artifacts
289+
key: |
290+
${{ env.CACHE_EPOCH }}-julia-test-${{ runner.os }}-${{ env.JULIA_LANGSERVER }}
303291
304292
- uses: actions/download-artifact@v2
305293
with:
@@ -325,6 +313,16 @@ jobs:
325313
- name: List frontend extensions
326314
run: jupyter labextension list
327315

316+
- name: install node-based language servers
317+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
318+
run: ${{ env.JLPM_CMD }}
319+
320+
- name: Install Julia
321+
uses: julia-actions/setup-julia@v1
322+
323+
- name: Install Julia language server
324+
run: julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(;name="LanguageServer", version="${{ env.JULIA_LANGSERVER }}"))'
325+
328326
- name: Run python tests
329327
run: python scripts/utest.py
330328

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
## CHANGELOG
22

3-
### `@krassowski/jupyterlab-lsp 3.4.2` (unreleased)
3+
### `@krassowski/jupyterlab-lsp 3.5.1` (unreleased)
4+
5+
- bug fixes:
6+
7+
- fixes name of jupyterlab-lsp package displayed in JupyterLab UI ([#570])
8+
- remove vendored CodeMirror from distribution ([#576])
9+
10+
[#570]: https://github.com/krassowski/jupyterlab-lsp/pull/570
11+
[#576]: https://github.com/krassowski/jupyterlab-lsp/pull/576
12+
13+
### `@krassowski/jupyterlab-lsp 3.5.0` (2020-03-22)
14+
15+
- features:
16+
17+
- adds `%%bigquery` IPython cell magic support for BigQuery ([#553], thanks @julioyildo)
18+
- completions filtering can be set to case-insensitive in settings ([#549])
19+
- completions filtering can hide exact matches ([#549])
20+
- the extra information displayed next to the completion label now can include 'detail' (usually module/package of origin), and can be customized in settings ([#549])
421

522
- bug fixes:
623

724
- prevents throwing a highlights error when adding new cell with <kbd>Shift</kbd> + <kbd>Enter</kbd> ([#544])
825
- fixes IPython `pinfo` and `pinfo2` (`?` and `??`) for identifiers containing `s` ([#547])
26+
- fixes incorrect behaviour of LSP features in some IPython magics with single line of content ([#560])
27+
- fixes name of jupyterlab-lsp package in JupyterLab
28+
29+
- for extension authors:
30+
31+
- minimal functional extractor and code overrides APIs are now exported; these APIs cab be subject to change in future releases ([#562])
932

1033
[#544]: https://github.com/krassowski/jupyterlab-lsp/pull/544
1134
[#547]: https://github.com/krassowski/jupyterlab-lsp/pull/547
35+
[#549]: https://github.com/krassowski/jupyterlab-lsp/pull/549
36+
[#553]: https://github.com/krassowski/jupyterlab-lsp/pull/553
37+
[#560]: https://github.com/krassowski/jupyterlab-lsp/pull/560
38+
[#562]: https://github.com/krassowski/jupyterlab-lsp/pull/562
1239

1340
### `jupyter-lsp 1.1.4` (2020-02-21)
1441

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ To run tests matching specific phrase, forward `-t` argument over yarn and lerna
126126
jlpm test -- -- -t match_phrase
127127
```
128128

129+
To verify the webpack build wouldn't include problematic vendored dependencies:
130+
131+
```bash
132+
python scripts/distcheck.py
133+
```
134+
129135
### Server Development
130136

131137
#### Testing `jupyter-lsp`

atest/05_Features/Completion.robot

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,28 @@ Shows Documentation With CompletionItem Resolve
296296
Completer Should Include Documentation the default method of the
297297
[Teardown] Clean Up After Working With File completion.R
298298

299+
Shows Only Relevant Suggestions In Known Magics
300+
# https://github.com/krassowski/jupyterlab-lsp/issues/559
301+
# h<tab>
302+
Enter Cell Editor 20 line=2
303+
Trigger Completer
304+
Completer Should Suggest help
305+
Completer Should Not Suggest from
306+
Completer Should Suggest hash
307+
308+
Completes In R Magics
309+
# Proper completion in R magics needs to be tested as:
310+
# - R magic extractor uses a tailor-made replacer function, not tested elsewhere
311+
# - R lanugage server is very sensitive to off-by-one errors (see https://github.com/REditorSupport/languageserver/issues/395)
312+
# '%%R\n librar<tab>'
313+
Enter Cell Editor 22 line=2
314+
Trigger Completer
315+
Completer Should Suggest library
316+
# '%R lib<tab>'
317+
Enter Cell Editor 24 line=1
318+
Trigger Completer
319+
Completer Should Suggest library
320+
299321
*** Keywords ***
300322
Setup Completion Test
301323
Setup Notebook Python Completion.ipynb

atest/examples/Completion.ipynb

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,56 @@
150150
"source": [
151151
"t"
152152
]
153+
},
154+
{
155+
"cell_type": "markdown",
156+
"metadata": {},
157+
"source": [
158+
"Cell magics show only relevant suggestions (triggering after `h` should return `hash`, `help`, etc, but not `from`):"
159+
]
160+
},
161+
{
162+
"cell_type": "code",
163+
"execution_count": null,
164+
"metadata": {},
165+
"outputs": [],
166+
"source": [
167+
"%%python\n",
168+
"h"
169+
]
170+
},
171+
{
172+
"cell_type": "markdown",
173+
"metadata": {},
174+
"source": [
175+
"Test that the leading space does not cause issues in R cell magic:"
176+
]
177+
},
178+
{
179+
"cell_type": "code",
180+
"execution_count": null,
181+
"metadata": {},
182+
"outputs": [],
183+
"source": [
184+
"%%R\n",
185+
" librar"
186+
]
187+
},
188+
{
189+
"cell_type": "markdown",
190+
"metadata": {},
191+
"source": [
192+
"And that R line magic works too:"
193+
]
194+
},
195+
{
196+
"cell_type": "code",
197+
"execution_count": null,
198+
"metadata": {},
199+
"outputs": [],
200+
"source": [
201+
"%R li"
202+
]
153203
}
154204
],
155205
"metadata": {

docs/Installation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
"##### pip\n",
251251
"\n",
252252
"```bash\n",
253-
"pip install jupyterlab-lsp={JUPYTERLAB_LSP_VERSION}\n",
253+
"pip install jupyterlab-lsp=={JUPYTERLAB_LSP_VERSION}\n",
254254
"```"
255255
]
256256
},

0 commit comments

Comments
 (0)