-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language service #396
Comments
Draft PR wiring up basic implementation of P1 features in VS Code and the playground: #364 |
This adds a wrapper over `LanguageService` in the `wasm` crate to expose it as a JavaScript class. See: #396 The existing WASM methods `check_code()` and `get_completions()` are made redundant now that we have the language service, so I'm removing them and adding a shim where they're used in the npm package. Exactly how we're going to expose the language service in the npm package is still being discussed, so I thought I'd get the more straightforward WASM changes checked in first.
- Add a `QSharpLanguageService` class in the npm package that wraps the WASM language service. - Refactor all the web worker proxy logic from `ICompiler` to make it a generic utility that can turn any object into a web worker proxy. This is implemented in [`worker-proxy.ts`](https://github.com/microsoft/qsharp/pull/426/files#diff-d6a9e927974cf2eec1b1ea6996ddc0c25a0209b8c2d741a14fdc2764641d295e). - Expose `getLanguageService()` and `getLanguageServiceWorker()` which use the above. You can reference #364 to see how this will eventually come together in VS Code and the playground. Tracking issue: #396
@minestarks -- is #1038 going to unblock LSP support, or are there other changes required? Also, perhaps we could file some separate issues for some of these features and use this issue to track them? |
@sezna well, we'd have to implement an LSP server... but if you're asking if anything in the core language service crate needs to change, I don't think so. I had a prototype for this a few months ago using the https://github.com/python-lsp/python-lsp-jsonrpc package which was working in JupyterLab. I think it's just a matter of wiring pieces together.
Yes this issue is quite big, I don't mind breaking off a few items. I didn't want to create issues for things that aren't even on our radar, but for near-term stuff (e.g. formatting) and for stuff we want a dedicated discussion thread for, it makes sense. |
Closing as completed. The unchecked items in the original description are currently out of scope. |
This issue tracks the implementation of the language service and editor features for Q#. Editor features are things like autocomplete, go-to-definition and hover. The language service is the component that uses the compiler internals to keep track of the current state of the program, update the program in response to document updates, and answer questions about it in response to requests from the editor.
Components involved
run()
method etc)pip install
the extension instead of having to separately install Node.js) for a JupyterLab user.Implementation plan
This list shows the proposed order of implementation, based on complexity (simpler features like hover are prioritized above more complicated ones like completions) and feature priority (VS Code extension being the highest priority deliverable).
The links are to LSP documentation. Even if we don't implement a true LSP server, we'll follow the LSP spec while designing the interface as it closely resembles the extensibility model used by many editors (VS Code, Monaco, JupyterLab, etc).
}
)The text was updated successfully, but these errors were encountered: