lapce / lapce/lapce-plugin-rust

Hide pieces of the API

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31
Forks
12
PR merge metrics
No merged PRs in 30d

Description

There's various pieces of the API that should probably be hidden or made non-constructable.
Hiding functions would allow us to later replace or alter the code behind them without breaking 'good' plugins because they shouldn't be using them directly. Making some structures non-constructable would let us add fields in the future easily.

  • handle_rpc is an internal function, it should be #[doc(hidden)].
  • Ideally users should never have to use object_from_stdin/object_from_stdout. These should probably be internal, and we just pass the requests/notifications to the plugin.
  • parse_stdin should be hidden
  • Http should be made non-constructable (add a hidden empty marker field), just in case.
  • VoltEnvironment should be made non-constructable.
    • Really I think VoltEnvironment should have to be created if you want to use it.
    • Would let us cache values in the future.
  • PluginError should perhaps be #[non_exhaustive] in case we want to add other error kinds with types in the future.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the public definitions and exports for handle_rpc, object_from_stdin, object_from_stdout, parse_stdin, Http, VoltEnvironment, and PluginError. Review how plugins currently use these APIs and determine the intended visibility, construction, and future-compatibility changes; done means the listed APIs enforce those constraints without breaking supported plugin usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.