tact-lang / tact-vscode

Tact VS Code plugin
Apache License 2.0
22 stars 9 forks source link

fix: formatter throws error Unhandled method textDocument/formatting #4

Closed defi-pickle closed 1 year ago

defi-pickle commented 1 year ago

Related to the issue https://github.com/tact-lang/tact-vscode/issues/3

There is probably something wrong with this bit:

    context.subscriptions.push(
        languages.registerDocumentFormattingEditProvider('tact', {
            provideDocumentFormattingEdits(document: TextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]> {
                return Promise.resolve(formatDocument(document, context));
            },
    }));

Something is not right with formatDocument. If you want i can try to fix that later but this might be enough to get you started.

source: https://code.visualstudio.com/api/language-extensions/programmatic-language-features#format-source-code-in-an-editor

logvik commented 1 year ago

Will be included at the next release, thank you for your contribution!