mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-16 21:58:25 +00:00
fix extension types
This commit is contained in:
parent
52fb080193
commit
0f2923a385
1 changed files with 7 additions and 1 deletions
|
@ -90,7 +90,13 @@ function fmtDocument(document: vscode.TextDocument) {
|
|||
if (!editor) return; // Need an editor to apply text edits.
|
||||
|
||||
const contents = editor.document.getText();
|
||||
const formatted = dioxus.format_file(contents, !editor.options.insertSpaces, editor.options.tabSize);
|
||||
let tabSize: number;
|
||||
if (typeof editor.options.tabSize === 'number') {
|
||||
tabSize = editor.options.tabSize;
|
||||
} else {
|
||||
tabSize = 4;
|
||||
}
|
||||
const formatted = dioxus.format_file(contents, !editor.options.insertSpaces, tabSize);
|
||||
|
||||
// Replace the entire text document
|
||||
// Yes, this is a bit heavy handed, but the dioxus side doesn't know the line/col scheme that vscode is using
|
||||
|
|
Loading…
Add table
Reference in a new issue