/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
import * as standaloneEnums from '../../common/standalone/standaloneEnums.js';
import { setSnippetSuggestSupport, getSnippetSuggestSupport, CompletionItem as SuggestCompletionItem } from '../../contrib/suggest/suggest.js';
import { parseSnippet, Snippet, snippetScopeSelect } from '../../../workbench/contrib/snippets/browser/snippetsFile.js';
import { SimpleKeybinding, ChordKeybinding, ResolvedKeybinding, ResolvedKeybindingPart } from '../../../base/common/keybindings.js';
import { KeyCodeUtils } from '../../../base/common/keyCodes.js';
import { SnippetCompletion, SnippetCompletionProvider } from '../../../workbench/contrib/snippets/browser/snippetCompletionProvider.js';
import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js';
import { handleConfig as handleLanguageConfiguration } from '../../../workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js';
import { VS_DARK_THEME, VS_HC_THEME, VS_LIGHT_THEME } from '../../../workbench/services/themes/common/workbenchThemeService.js';
import { TMGrammarFactory } from '../../../workbench/services/textMate/common/TMGrammarFactory.js';
import { Extensions as TokenClassificationExtensions, getTokenClassificationRegistry, TokenStyle } from '../../../platform/theme/common/tokenClassificationRegistry.js';
import { Extensions as JsonContributionExtensions } from '../../../platform/jsonschemas/common/jsonContributionRegistry.js';
import { ColorThemeData } from '../../../workbench/services/themes/common/colorThemeData.js';
import { parseTextMateGrammar, TMTokenization, TMTokenizationSupport } from '../../../workbench/services/textMate/browser/abstractTextMateService.js';
import { ContextKeyExpr, ContextKeyFalseExpr, ContextKeyTrueExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyInExpr, ContextKeyNotInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyGreaterExpr, ContextKeyGreaterEqualsExpr, ContextKeySmallerExpr, ContextKeySmallerEqualsExpr, ContextKeyRegexExpr, ContextKeyNotRegexExpr, ContextKeyAndExpr, ContextKeyOrExpr, RawContextKey } from '../../../platform/contextkey/common/contextkey.js';
import { KeybindingIO, OutputBuilder } from '../../../workbench/services/keybinding/common/keybindingIO.js';
import { KeybindingParser } from '../../../base/common/keybindingParser.js';
import { ScanCodeBinding } from '../../../base/common/keybindings.js';
import { ResolvedKeybindingItem } from '../../../platform/keybinding/common/resolvedKeybindingItem.js';
import { Registry } from '../../../platform/registry/common/platform.js';
import { DefaultConfigurationModel, ConfigurationModel } from '../../../platform/configuration/common/configurationModels.js';
import { addToValueTree } from '../../../platform/configuration/common/configuration.js';
import { MacLinuxFallbackKeyboardMapper } from '../../../workbench/services/keybinding/common/macLinuxFallbackKeyboardMapper.js';
import { Extensions as KeybindingExtensions, KeybindingsRegistry } from '../../../platform/keybinding/common/keybindingsRegistry.js';
import { KeybindingResolver } from '../../../platform/keybinding/common/keybindingResolver.js';
import { CommandsRegistry } from '../../../platform/commands/common/commands.js';
import { allSettings, Extensions as ConfigurationExtensions } from '../../../platform/configuration/common/configurationRegistry.js';
import { resolveUserKeybindingItems } from '../../../workbench/services/keybinding/browser/keybindingService.js';
import { OS } from '../../../base/common/platform.js';
import { AbstractKeybindingService } from '../../../platform/keybinding/common/abstractKeybindingService.js';
import { SimpleConfigurationService, SimpleEditorModelResolverService, StandaloneKeybindingService } from './simpleServices.js';
import { FoldingModel, setCollapseStateForMatchingLines } from '../../contrib/folding/foldingModel.js';
import { AbstractCodeEditorService } from '../../browser/services/abstractCodeEditorService.js';
import { StandaloneCodeEditorServiceImpl } from './standaloneCodeServiceImpl.js';
import { FoldingRegion, FoldingRegions } from '../../contrib/folding/foldingRanges.js';
import { FoldingController } from '../../contrib/folding/folding.js';
import { CodeEditorServiceImpl, GlobalStyleSheet } from '../../browser/services/codeEditorServiceImpl.js';
import { AsyncReferenceCollection, ReferenceCollection, toDisposable } from '../../../base/common/lifecycle.js';
import { once } from '../../../base/common/functional.js';
/**
 * @internal
 */
export function createMonacoExtraAPI() {
    return {
        setSnippetSuggestSupport: setSnippetSuggestSupport,
        getSnippetSuggestSupport: getSnippetSuggestSupport,
        parseTextMateGrammar: parseTextMateGrammar,
        handleLanguageConfiguration: handleLanguageConfiguration,
        resolveUserKeybindingItems: resolveUserKeybindingItems,
        parseSnippet: parseSnippet,
        snippetScopeSelect: snippetScopeSelect,
        addToValueTree,
        setCollapseStateForMatchingLines: setCollapseStateForMatchingLines,
        getTokenClassificationRegistry,
        toDisposable,
        // enums
        ExtensionType: standaloneEnums.ExtensionType,
        SnippetSortOrder: standaloneEnums.SnippetSortOrder,
        SnippetSource: standaloneEnums.SnippetSource,
        ContextKeyExprType: standaloneEnums.ContextKeyExprType,
        OperatingSystem: standaloneEnums.OperatingSystem,
        ScanCode: standaloneEnums.ScanCode,
        EditPresentationTypes: standaloneEnums.EditPresentationTypes,
        ConfigurationScope: standaloneEnums.ConfigurationScope,
        ProgressLocation: standaloneEnums.ProgressLocation,
        ConfigurationTarget: standaloneEnums.ConfigurationTarget,
        KeybindingWeight: standaloneEnums.KeybindingWeight,
        KeybindingSource: standaloneEnums.KeybindingSource,
        TextEditorSelectionRevealType: standaloneEnums.TextEditorSelectionRevealType,
        once,
        // classes
        Snippet: Snippet,
        SnippetCompletion: SnippetCompletion,
        SnippetCompletionProvider: SnippetCompletionProvider,
        ExtensionIdentifier: ExtensionIdentifier,
        SuggestCompletionItem: SuggestCompletionItem,
        TMGrammarFactory: TMGrammarFactory,
        ColorThemeData: ColorThemeData,
        TokenStyle,
        KeybindingIO: KeybindingIO,
        OutputBuilder: OutputBuilder,
        KeybindingParser: KeybindingParser,
        ResolvedKeybindingItem: ResolvedKeybindingItem,
        SimpleKeybinding: SimpleKeybinding,
        ChordKeybinding: ChordKeybinding,
        ResolvedKeybinding: ResolvedKeybinding,
        ResolvedKeybindingPart: ResolvedKeybindingPart,
        ScanCodeBinding: ScanCodeBinding,
        DefaultConfigurationModel: DefaultConfigurationModel,
        ConfigurationModel: ConfigurationModel,
        ContextKeyExpr: ContextKeyExpr,
        ContextKeyFalseExpr: ContextKeyFalseExpr,
        ContextKeyTrueExpr: ContextKeyTrueExpr,
        ContextKeyDefinedExpr: ContextKeyDefinedExpr,
        ContextKeyEqualsExpr: ContextKeyEqualsExpr,
        ContextKeyInExpr: ContextKeyInExpr,
        ContextKeyNotInExpr: ContextKeyNotInExpr,
        ContextKeyNotEqualsExpr: ContextKeyNotEqualsExpr,
        ContextKeyNotExpr: ContextKeyNotExpr,
        ContextKeyGreaterExpr: ContextKeyGreaterExpr,
        ContextKeyGreaterEqualsExpr: ContextKeyGreaterEqualsExpr,
        ContextKeySmallerExpr: ContextKeySmallerExpr,
        ContextKeySmallerEqualsExpr: ContextKeySmallerEqualsExpr,
        ContextKeyRegexExpr: ContextKeyRegexExpr,
        ContextKeyNotRegexExpr: ContextKeyNotRegexExpr,
        ContextKeyAndExpr: ContextKeyAndExpr,
        ContextKeyOrExpr: ContextKeyOrExpr,
        RawContextKey: RawContextKey,
        MacLinuxFallbackKeyboardMapper: MacLinuxFallbackKeyboardMapper,
        KeyCodeUtils: KeyCodeUtils,
        KeybindingResolver: KeybindingResolver,
        AbstractKeybindingService: AbstractKeybindingService,
        StandaloneKeybindingService: StandaloneKeybindingService,
        AbstractCodeEditorService: AbstractCodeEditorService,
        SimpleEditorModelResolverService: SimpleEditorModelResolverService,
        StandaloneCodeEditorServiceImpl: StandaloneCodeEditorServiceImpl,
        CodeEditorServiceImpl: CodeEditorServiceImpl,
        GlobalStyleSheet,
        FoldingController: FoldingController,
        FoldingRegion,
        FoldingRegions,
        FoldingModel: FoldingModel,
        SimpleConfigurationService: SimpleConfigurationService,
        TMTokenizationSupport: TMTokenizationSupport,
        TMTokenization: TMTokenization,
        ReferenceCollection: ReferenceCollection,
        AsyncReferenceCollection: AsyncReferenceCollection,
        // Constants
        Registry: Registry,
        KeybindingExtensions: KeybindingExtensions,
        KeybindingsRegistry: KeybindingsRegistry,
        ConfigurationExtensions: ConfigurationExtensions,
        CommandsRegistry: CommandsRegistry,
        allSettings: allSettings,
        OS: OS,
        VS_LIGHT_THEME,
        VS_DARK_THEME,
        VS_HC_THEME,
        TokenClassificationExtensions,
        JsonContributionExtensions
    };
}
