mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-13 07:47:05 +08:00
* 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>
17 lines
627 B
TypeScript
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;
|
|
}
|