jupyterlab-lsp
jupyterlab-lsp copied to clipboard
[wip] add settings-based code extractors
trafficstars
References
- fixes #1079
Code changes
- [x] adds
cellTypestoRegExpForeignCodeExtractor.IOptions - [x] adds
schema/transclusions.jsonto define a simplified extractor - [x] adds
ILSPCustomTransclusionsManagertoken
User-facing changes
- users will be able to add new extractors from the Settings Editor
Backwards-incompatible changes
- n/a
Chores
- [x] linted
- [ ] tested
- [ ] documented
- [ ] changelog entry
:point_left: Launch a binder notebook on branch bollwyvl/jupyterlab-lsp/gh-1079-settings-code-extractors
As of opening this PR, things kinda work, e.g. this naive extractor finding <script> tags inside .md files and markdown cells:
{
"enabled": true,
"codeExtractors": {
"md-js-script": {
"hostLanguage": "ipythongfm",
"foreignLanguage": "javascript"
"pattern": "<script>((.|\n)*?(?=</script>))</script>",
"foreignCaptureGroups": [1],
"fileExtension": "js",
"cellTypes": ["code", "markdown"],
"isStandalone": false,
}
}
}
Kinda, in that while diagnostics work, completion, go to definition, and others do not appear to work, but i haven't debugged further.
The internal state of the upstream manager (and the extractor itself) is kind of hard to reason about, and generally requires a full page reload after making any changes.