Skip to content

extension_api: Add language server schema methods#48334

Merged
MrSubidubi merged 8 commits intozed-industries:mainfrom
aviatesk:lsp-schema-extension-api
Mar 7, 2026
Merged

extension_api: Add language server schema methods#48334
MrSubidubi merged 8 commits intozed-industries:mainfrom
aviatesk:lsp-schema-extension-api

Conversation

@aviatesk
Copy link
Contributor

@aviatesk aviatesk commented Feb 4, 2026

(This should be merged after #48332)

This PR exposes the LSP settings schema functionality to extensions, allowing them to provide JSON schema for initialization_options and settings fields to enable autocomplete in settings files.

New extension API methods (v0.8.0+):

  • language_server_initialization_options_schema
  • language_server_settings_schema

Both methods return an optional JSON string conforming to JSON schema.
Older extension versions gracefully return None.

Release Notes:

  • Added support for settings schemas for the next version of the extension API so that settings autocompletion can be provided for language server settings.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 4, 2026
@maxdeviant maxdeviant changed the title extension_api: Add LSP schema methods to extension API (v0.8.0) extension_api: Add LSP schema methods Feb 4, 2026
@aviatesk aviatesk force-pushed the lsp-schema-extension-api branch 3 times, most recently from 8e1a843 to 193af58 Compare February 9, 2026 13:15
This exposes the LSP settings schema functionality to extensions, allowing
them to provide JSON Schema for `initialization_options` and `settings`
fields to enable autocomplete in settings files.

New extension API methods (v0.8.0+):
- `language_server_initialization_options_schema`
- `language_server_settings_schema`

Both methods return an optional JSON string conforming to JSON Schema.
Older extension versions gracefully return None.

Release Notes:

- Added extension API methods for providing JSON Schema for LSP `initialization_options` and `settings` fields (v0.8.0+)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aviatesk aviatesk force-pushed the lsp-schema-extension-api branch from 193af58 to d6a58aa Compare February 12, 2026 14:20
@aviatesk
Copy link
Contributor Author

Friendly ping.
This feature will enable LSP schema auto completion for external language extensions, so I'd really like to incorporate this change (and hopefully get the new extension crate version published soonish).

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another topic to discuss: I have been thinking about supporting an additional way to provide a schema, which would be via an URI. Strictly speaking, this might already be possible with the API at hand, but I am wondering as to whether we would want to make the option more explicit, as not many people might know about this.

@aviatesk
Copy link
Contributor Author

Another topic to discuss: I have been thinking about supporting an additional way to provide a schema, which would be via an URI. Strictly speaking, this might already be possible with the API at hand, but I am wondering as to whether we would want to make the option more explicit, as not many people might know about this.

I think the current API already reasonably covers this — since the return type is a JSON Schema value, extension authors are free to fetch a schema from any source (including a remote URL) and return it. So I don't see a need to provide a separate explicit option for this. If there turns out to be real user demand, we can always revisit later?

aviatesk and others added 2 commits February 13, 2026 00:09
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aviatesk
Copy link
Contributor Author

Friendly ping.

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some changes and fixes on top of this myself. Thanks for the PR and getting the ball rolling on this!

@MrSubidubi MrSubidubi changed the title extension_api: Add LSP schema methods extension_api: Add language server schema methods Mar 7, 2026
@MrSubidubi MrSubidubi merged commit 9663d05 into zed-industries:main Mar 7, 2026
30 checks passed
@aviatesk
Copy link
Contributor Author

aviatesk commented Mar 7, 2026

Thanks for finishing up this PR. Could you tell me when you will publish a new extension API version?

@aviatesk aviatesk deleted the lsp-schema-extension-api branch March 7, 2026 10:05
@MrSubidubi
Copy link
Member

Sadly, we currently have no set date nor a specific timeframe for publishing the new version. Initially, the version was slated for the release of agent provider extensions, but we had to postpone this due to some other changes. This might be unblocked soon, and we'll probably have to wait for that to land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants