Open bollwyvl opened 5 years ago
remember when i said i would be better about doing more manageable chunks of work? well...
I started taking a look at what it would take to add a hierarchical symbol viewer, and it got a little more... involved than I thought... basically a good chunk of [2] and [3]:
https://github.com/krassowski/jupyterlab-lsp/compare/master...bollwyvl:add-hierarchial-symbol-viewer
here's the yak shave, each one of which should probably be a pr:
lsp
for the new package to requirelsp-ws
to start hacking on itws
because net
ws
while using optional chaining from ts 3.7<details>
, but probably pick up some react nonsenseSo anyhooo... I'll keep going on it, but it would already be unreasonably large to review, breaks tests, etc. so i'll probably have to actually make all those prs above.
however, in trying to get a new end-to-end feature actually working, i'm starting to see the pattern of some relatively radical things we could do to make it fit in the lab architecture:
ws
methods accept a vscode-uri
events
with phosphor (ne lumino) messages or signalsvscode-jsonrpc
The features refactor brought as closer to step 3. Useful notes are in the comment https://github.com/krassowski/jupyterlab-lsp/issues/316#issuecomment-673527034.
The plan in top level comment is slightly outdated, but I will work to make it happen; the next steps after #738 are:
-feature
suffix so that would be @jupyter-lsp/diagnostics-feature
, and it would allow us to have @jupyter-lsp/diagnostics
in case if we wanted to make some low-level shared code available to third-parties (as @jupyterlab
does with -extension
)
-capability
, but that would actually go to the non-suffixed one...jupyterlab-lsp
into packages as needed to avoid circular import in step 3; we should not call it "language-server" as it is client; currently I'm thinking:
@jupyter-lsp/jupyterlab-lsp
- umbrella package for compatibility@jupyter-lsp/ui-components
- today's components/
@jupyter-lsp/virtual
- virtual document, editor and friends@jupyter-lsp/protocol
- today's lsp.ts
; this needs to be available to features and provides what upstream package does not (e.g. fixes to upstream bugs like this one) and enums available at runtime@jupyter-lsp/editor-integration
@jupyter-lsp/codemirror4-integration
@jupyter-lsp/adapter
@jupyter-lsp/notebook-adapter
@jupyter-lsp/file-adapter
@jupyter-lsp/core
- not sure of name for this one, but basically should provide IFeature
, FeatureSettings
, positions, and all other things which are needed for features and not worth splitting into individual packagesProbably not this year though...
Update thoughts:
Edit: The split-up is also useful since starting with Notebook v7 it will possibly serve not only JupyterLab but also Notebook as demonstrated on RetroLab example. For now we could have
@jupyterlab/lsp
- provides core services starting with Notebook v7 and Lab v4@jupyter-lsp/core
- core services required by features (for now including functionality moved to @jupyterlab/lsp
)@jupyter-lsp/signature-capability
, @jupyter-lsp/hover-capability
, etc@jupyter-lsp/ui-components
@jupyter-lsp/ipython-extractors
@jupyter-lsp/rpy2-extractors
@jupyter-lsp/jupyterlab-lsp
- bundle of capabilities for Lab and later @jupyter-lsp/notebook-lsp
- bundle of capabilities for Notebook (some capabilities may not be as useful in the notebook interface and could be excluded, and some widget positioning code could be specific to Notebook app)
To easing proposing the client-facing parts of this codebase to @jupyterlab/jupyterlab, the repository could be re-organized as a monorepo with smaller, independently testable, extensible, and replaceable components with well-defined inter-package interfaces.
This would not block any feature development, but should help keep PRs more focused and less likely to create conflicts.
step 0️⃣#77src
compiling withcomposite: true
require
sstep 1️⃣ #79src
intopackages/jupyterlap-lsp
tsconfigbase.json
to be used by sub-packagetsconfig.json
spackage.json
lint
andbuild
tsc
will be invokedbuild
to use the metapackagestep 2️⃣
jupyterlab-lsp
intolanguage-server
andlanguage-server-extension
name
s at this pointlanguage-server
tokens.ts
and anILanguageServerManager
CommandIds
vendor-main
withawait import
extension
will end up being inmain
, and just about everything from themanager
will likely be lazy-loadable, e.g. the first time a notebook/document is loaded. on subsequent loads, it will already be cached.step 3️⃣
Manager
registration APIslanguage-server-ipython
,language-server-notebook
jump-to-definition
and the parts oflsp-codemirror