Files
cloudbeaver/webapp/packages/plugin-codemirror6/src/useCodemirrorExtensions.ts
T
Alexeyanddariamarutkina 78c19187de Feat CB-3030 conflict resolving (#1814)
* CB-3030 feat: conflict resolving

* CB-3030 fix: display os specific key instead of mod

* CB-3030 fix: sql editor status

* CB-3030 fix: styles and data validation

* CB-3030 fix: sql editor styles

---------

Co-authored-by: dariamarutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-07-17 22:10:15 +03:00

17 lines
627 B
TypeScript

/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2023 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { Compartment, Extension } from '@codemirror/state';
import { useState } from 'react';
export function useCodemirrorExtensions(extensions?: Map<Compartment, Extension>, staticExtensions?: Extension): Map<Compartment, Extension> {
const [compartment] = useState(() => new Compartment());
const map = new Map(extensions?.entries());
map.set(compartment, staticExtensions || []);
return map;
}