gluon-lang / lsp-types

Types for communicating with a language server
MIT License
328 stars 86 forks source link

Unable to cast TextDocumentSyncKind to i32 #285

Closed fda-odoo closed 5 months ago

fda-odoo commented 5 months ago

Hello,

I'm trying to create a TextDocumentChangeRegistrationOptions with the code

let textDocumentChangeRegistrationOptions = TextDocumentChangeRegistrationOptions {
    document_selector: None,
    sync_kind: 1,
};

However, I would want to use TextDocumentSyncKind::FULL instead of '1' for the sync_kind parameter, but no method exists to cast it to an i32, and the inner variable of struct TextDocumentSyncKind is private. Do I miss something, or the enum TextDocumentSyncKind can't work with this registration option?