mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
fix: statically register formatting and semantic tokens capabilities (#814)
* fix: statically register formatting and semantic tokens capabilities * fix: inline variables and remove comment * dev: inline variables * fix: not working on vscode * test: update snapshot --------- Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
This commit is contained in:
parent
434f222855
commit
d618430f6e
2 changed files with 6 additions and 20 deletions
|
@ -147,25 +147,11 @@ impl Initializer for SuperInit {
|
|||
return (service, Err(err));
|
||||
}
|
||||
|
||||
// Respond to the host (LSP client)
|
||||
// Register these capabilities statically if the client does not support dynamic
|
||||
// registration
|
||||
let semantic_tokens_provider = match service.config.semantic_tokens {
|
||||
SemanticTokensMode::Enable if !const_config.tokens_dynamic_registration => {
|
||||
Some(SemanticTokensServerCapabilities::SemanticTokensOptions(
|
||||
get_semantic_tokens_options(),
|
||||
))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let document_formatting_provider = match service.config.formatter_mode {
|
||||
FormatterMode::Typstyle | FormatterMode::Typstfmt
|
||||
if !const_config.doc_fmt_dynamic_registration =>
|
||||
{
|
||||
Some(OneOf::Left(true))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let semantic_tokens_provider = (!const_config.tokens_dynamic_registration).then(|| {
|
||||
SemanticTokensServerCapabilities::SemanticTokensOptions(get_semantic_tokens_options())
|
||||
});
|
||||
let document_formatting_provider =
|
||||
(!const_config.doc_fmt_dynamic_registration).then_some(OneOf::Left(true));
|
||||
|
||||
let file_operations = const_config.notify_will_rename_files.then(|| {
|
||||
WorkspaceFileOperationsServerCapabilities {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue