Skip to content

Commit

Permalink
♻️ Change format language
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovizuete committed Feb 6, 2023
1 parent 24ac480 commit 92a0b52
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/hooks/useMonacoConfigSupplier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useUrlState } from "./useUrlState";
import { initialState } from "../hooks/useQueryForm";
import { usePasswordContext } from "../contexts/usePassword";
import { getTablesSuggestionProvider } from "../lib/editor-suggestions/tables.suggestion";
import { format } from 'sql-formatter';
import { format } from "sql-formatter";

type Params = {
jsonParams: string;
Expand All @@ -27,8 +27,8 @@ export const useMonacoConfigSupplier = ({ jsonParams }: Params) => {
subs.push(
monaco.languages.registerCompletionItemProvider(
paremeterSnippetSuggetionProvider.language,
paremeterSnippetSuggetionProvider.provider,
),
paremeterSnippetSuggetionProvider.provider
)
);
subs.push(
monaco.languages.registerCompletionItemProvider(
Expand All @@ -37,10 +37,9 @@ export const useMonacoConfigSupplier = ({ jsonParams }: Params) => {
)
);
subs.push(
monaco.languages.registerDocumentFormattingEditProvider('sql', {
monaco.languages.registerDocumentFormattingEditProvider("sql", {
async provideDocumentFormattingEdits(model) {

const text = format(model.getValue(), { language: 'sql' , });
const text = format(model.getValue(), { language: "n1ql" });
return [
{
range: model.getFullModelRange(),
Expand All @@ -49,8 +48,7 @@ export const useMonacoConfigSupplier = ({ jsonParams }: Params) => {
];
},
})

)
);
}
return () => {
subs.forEach((sub) => sub.dispose());
Expand Down

0 comments on commit 92a0b52

Please sign in to comment.