Skip to content
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

In process #65

Merged
merged 11 commits into from
Sep 12, 2022
Merged

In process #65

merged 11 commits into from
Sep 12, 2022

Conversation

aslakhellesoy
Copy link
Contributor

@aslakhellesoy aslakhellesoy commented Aug 29, 2022

🤔 What's changed?

Expose a newWasmServer function that returns two streams for LSP.

⚡️ What's your motivation?

To be able to start the server in-process in the VSCode extension. This allows us to control more of the server behaviour:

First, it lays a foundation for cucumber/vscode#81 and cucumber/blockly#23 because it makes it possible to start a 2nd language server for the Blockly editor, which will use an LSP client to retrieve all the steps.

However, as I am writing this, I realize that the Blockly editor isn't going to get the suggestions via auto-complete, because that only returns matching results for a string. It's going to need them all. It might be better to do something similar to GherkinLanguageServer.reindex. Ot better, access the already indexed data from the server instance:

const server = new CucumberLanguageServer(...)
// later...
const suggestions = server.suggestions

In any case, this refactoring will make this possible.

Another benefit of this refactoring is preparing for cucumber/vscode#1
We could abstract file system access behind a simple FileSystem API and pass in one that is backed by either https://code.visualstudio.com/api/references/vscode-api#FileSystem (which we would use in VSCode), or a Node.js file system implementation (for standalone mode - vim etc).

This API would have operations for globbing. For VSCode we can use vscode.workspace.findFiles.

Solving this might be a milestone towards making the VSCode extension ready for GitHub Codespaces / github.dev

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, documentation etc. without changing behaviour)
  • 🐛 Bug fix (non-breaking change which fixes a defect)
  • ⚡ New feature (non-breaking change which adds new behaviour)
  • 💥 Breaking change (incompatible changes to the API)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@aslakhellesoy aslakhellesoy merged commit 6fb65e6 into main Sep 12, 2022
@aslakhellesoy aslakhellesoy deleted the in-process branch September 12, 2022 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant