@codingame/monaco-vscode-api
Advanced tools
Comparing version 1.69.7 to 1.69.8
@@ -1,5 +0,6 @@ | ||
import { E as Emitter, u as unsupported$1 } from './missing-services.js'; | ||
import { B as Breakpoint$1, C as CallHierarchyIncomingCall$1, a as CallHierarchyItem$1, b as CallHierarchyOutgoingCall$1, c as CodeAction$1, d as CodeActionKind$1, e as CodeActionTriggerKind$1, f as CodeLens$1, g as Color$1, h as ColorInformation$1, i as ColorPresentation$1, j as CommentMode$1, k as CommentThreadCollapsibleState$1, l as CompletionItem$1, m as CompletionItemKind$1, n as CompletionItemTag$1, o as CompletionList$1, p as CompletionTriggerKind$1, q as ConfigurationTarget$1, r as CustomExecution$1, D as DebugAdapterExecutable$1, s as DebugAdapterInlineImplementation$1, t as DebugAdapterNamedPipeServer$1, u as DebugAdapterServer$1, v as DebugConsoleMode$1, w as DecorationRangeBehavior$1, x as Diagnostic$1, y as DiagnosticRelatedInformation$1, z as DiagnosticSeverity$1, A as DiagnosticTag$1, E as Disposable$1, F as DocumentHighlight$1, G as DocumentHighlightKind$1, H as DocumentLink$1, I as DocumentSymbol$1, J as EndOfLine$1, K as EnvironmentVariableMutatorType$1, L as EvaluatableExpression$1, M as InlineValueText$1, N as InlineValueVariableLookup$1, O as InlineValueEvaluatableExpression$1, P as ExtensionKind$1, Q as ExtensionMode$1, R as FileChangeType$1, S as FileDecoration$1, T as FileSystemError$1, U as FoldingRange$1, V as FoldingRangeKind$1, W as FunctionBreakpoint$1, X as Hover$1, Y as Location$1, Z as MarkdownString$1, _ as ParameterInformation$1, $ as Position$1, a0 as ProcessExecution$1, a1 as ProgressLocation$1, a2 as QuickInputButtons$1, a3 as Range$1, a4 as RelativePattern$1, a5 as Selection$2, a6 as SelectionRange$1, a7 as SemanticTokens$1, a8 as SemanticTokensBuilder$1, a9 as SemanticTokensEdit$1, aa as SemanticTokensEdits$1, ab as SemanticTokensLegend$1, ac as ShellExecution$1, ad as ShellQuoting$1, ae as SignatureHelp$1, af as SignatureHelpTriggerKind$1, ag as SignatureInformation$1, ah as SnippetString$1, ai as SourceBreakpoint$1, aj as StatusBarAlignment$1, ak as SymbolInformation$1, al as SymbolKind$1, am as SymbolTag$1, an as Task$1, ao as TaskGroup$1, ap as TaskPanelKind$1, aq as TaskRevealKind$1, ar as TaskScope$1, as as TerminalLink$1, at as TerminalLocation$1, au as TerminalProfile$1, av as TextDocumentSaveReason$1, aw as TextEdit$1, ax as TextEditorLineNumbersStyle$1, ay as TextEditorRevealType$1, az as TextEditorSelectionChangeKind$1, aA as TextDocumentChangeReason$1, aB as ThemeColor$1, aC as ThemeIcon$1, aD as TreeItem$1, aE as TreeItemCollapsibleState$1, aF as TypeHierarchyItem$1, aG as UIKind$1, aH as ViewColumn$1, aI as WorkspaceEdit$1, aJ as InlayHint$1, aK as InlayHintLabelPart$1, aL as InlayHintKind$1, aM as NotebookRange$1, aN as NotebookCellKind$1, aO as NotebookCellData$1, aP as NotebookData$1, aQ as NotebookCellStatusBarAlignment$1, aR as NotebookCellOutput$1, aS as NotebookCellOutputItem$1, aT as NotebookCellStatusBarItem$1, aU as NotebookControllerAffinity$1, aV as LinkedEditingRanges$1, aW as TestRunRequest$1, aX as TestMessage$1, aY as TestTag$1, aZ as TestRunProfileKind$1, a_ as LanguageStatusSeverity$1, a$ as QuickPickItemKind$1, b0 as TextDiffTabInput, b1 as CustomEditorTabInput, b2 as NotebookEditorTabInput, b3 as NotebookDiffEditorTabInput, b4 as WebviewEditorTabInput, b5 as TerminalEditorTabInput, b6 as InputBoxValidationSeverity$1, b7 as InlineSuggestionList, b8 as InlineCompletionTriggerKind$1, b9 as InlineSuggestion, ba as DocumentDropEdit$1, bb as NotebookEditorRevealType$1, bc as getExtHostServices, bd as DEFAULT_EXTENSION, be as LanguageSelector } from './extHost.js'; | ||
import { C as CancellationTokenSource$1, F as FileType$1, a as FilePermission$1, S as Services } from './services2.js'; | ||
import { E as Emitter } from './polyfill.js'; | ||
import { g as getExtHostServices, D as DEFAULT_EXTENSION, L as LanguageSelector, P as ProgressLocation$1, V as ViewColumn$1, U as UIKind$1, B as Breakpoint$1, C as CallHierarchyIncomingCall$1, a as CallHierarchyItem$1, b as CallHierarchyOutgoingCall$1, c as CodeAction$1, d as CodeActionKind$1, e as CodeActionTriggerKind$1, f as CodeLens$1, h as Color$1, i as ColorInformation$1, j as ColorPresentation$1, k as CommentMode$1, l as CommentThreadCollapsibleState$1, m as CompletionItem$1, n as CompletionItemKind$1, o as CompletionItemTag$1, p as CompletionList$1, q as CompletionTriggerKind$1, r as ConfigurationTarget$1, s as CustomExecution$1, t as DebugAdapterExecutable$1, u as DebugAdapterInlineImplementation$1, v as DebugAdapterNamedPipeServer$1, w as DebugAdapterServer$1, x as DebugConsoleMode$1, y as DecorationRangeBehavior$1, z as Diagnostic$1, A as DiagnosticRelatedInformation$1, E as DiagnosticSeverity$1, F as DiagnosticTag$1, G as Disposable$1, H as DocumentHighlight$1, I as DocumentHighlightKind$1, J as DocumentLink$1, K as DocumentSymbol$1, M as EndOfLine$1, N as EnvironmentVariableMutatorType$1, O as EvaluatableExpression$1, Q as InlineValueText$1, R as InlineValueVariableLookup$1, S as InlineValueEvaluatableExpression$1, T as ExtensionKind$1, W as ExtensionMode$1, X as FileChangeType$1, Y as FileDecoration$1, Z as FileSystemError$1, _ as FoldingRange$1, $ as FoldingRangeKind$1, a0 as FunctionBreakpoint$1, a1 as Hover$1, a2 as Location$1, a3 as MarkdownString$1, a4 as ParameterInformation$1, a5 as Position$1, a6 as ProcessExecution$1, a7 as QuickInputButtons$1, a8 as Range$1, a9 as RelativePattern$1, aa as Selection$1, ab as SelectionRange$1, ac as SemanticTokens$1, ad as SemanticTokensBuilder$1, ae as SemanticTokensEdit$1, af as SemanticTokensEdits$1, ag as SemanticTokensLegend$1, ah as ShellExecution$1, ai as ShellQuoting$1, aj as SignatureHelp$1, ak as SignatureHelpTriggerKind$1, al as SignatureInformation$1, am as SnippetString$1, an as SourceBreakpoint$1, ao as StatusBarAlignment$1, ap as SymbolInformation$1, aq as SymbolKind$1, ar as SymbolTag$1, as as Task$1, at as TaskGroup$1, au as TaskPanelKind$1, av as TaskRevealKind$1, aw as TaskScope$1, ax as TerminalLink$1, ay as TerminalLocation$1, az as TerminalProfile$1, aA as TextDocumentSaveReason$1, aB as TextEdit$1, aC as TextEditorLineNumbersStyle$1, aD as TextEditorRevealType$1, aE as TextEditorSelectionChangeKind$1, aF as TextDocumentChangeReason$1, aG as ThemeColor$1, aH as ThemeIcon$1, aI as TreeItem$1, aJ as TreeItemCollapsibleState$1, aK as TypeHierarchyItem$1, aL as WorkspaceEdit$1, aM as InlayHint$1, aN as InlayHintLabelPart$1, aO as InlayHintKind$1, aP as NotebookRange$1, aQ as NotebookCellKind$1, aR as NotebookCellData$1, aS as NotebookData$1, aT as NotebookCellStatusBarAlignment$1, aU as NotebookCellOutput$1, aV as NotebookCellOutputItem$1, aW as NotebookCellStatusBarItem$1, aX as NotebookControllerAffinity$1, aY as LinkedEditingRanges$1, aZ as TestRunRequest$1, a_ as TestMessage$1, a$ as TestTag$1, b0 as TestRunProfileKind$1, b1 as LanguageStatusSeverity$1, b2 as QuickPickItemKind$1, b3 as TextDiffTabInput, b4 as CustomEditorTabInput, b5 as NotebookEditorTabInput, b6 as NotebookDiffEditorTabInput, b7 as WebviewEditorTabInput, b8 as TerminalEditorTabInput, b9 as InputBoxValidationSeverity$1, ba as InlineSuggestionList, bb as InlineCompletionTriggerKind$1, bc as InlineSuggestion, bd as DocumentDropEdit$1, be as NotebookEditorRevealType$1 } from './extHost.js'; | ||
import { S as Services, C as CancellationTokenSource$1, F as FileType$1, a as FilePermission$1 } from './services2.js'; | ||
import { score } from 'monaco-editor/esm/vs/editor/common/languageSelector.js'; | ||
import { u as unsupported$1 } from './missing-services.js'; | ||
import { Event } from 'monaco-editor/esm/vs/base/common/event.js'; | ||
@@ -18,3 +19,3 @@ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js'; | ||
var DebugConfigurationProviderTriggerKind$1; | ||
( ((function(DebugConfigurationProviderTriggerKind) { | ||
( (function(DebugConfigurationProviderTriggerKind) { | ||
DebugConfigurationProviderTriggerKind[DebugConfigurationProviderTriggerKind["Initial"] = 1] = "Initial"; | ||
@@ -24,3 +25,3 @@ DebugConfigurationProviderTriggerKind[DebugConfigurationProviderTriggerKind["Dynamic"] = 2] = "Dynamic"; | ||
DebugConfigurationProviderTriggerKind$1 || (DebugConfigurationProviderTriggerKind$1 = {}) | ||
))); | ||
)); | ||
function checkSelector(selector) { | ||
@@ -338,3 +339,3 @@ return selector; | ||
index: 0, | ||
name: ( uri.toString()) | ||
name: uri.toString() | ||
}]; | ||
@@ -759,3 +760,3 @@ }, | ||
RelativePattern: RelativePattern$1, | ||
Selection: Selection$2, | ||
Selection: Selection$1, | ||
SelectionRange: SelectionRange$1, | ||
@@ -762,0 +763,0 @@ SemanticTokens: SemanticTokens$1, |
@@ -1,9 +0,10 @@ | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { h as IPolicyService, j as IUserDataProfilesService, E as Emitter, k as NullPolicyService, U as UserSettings } from './missing-services.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { E as Emitter, U as UserSettings } from './polyfill.js'; | ||
import { e as IPolicyService, N as NullPolicyService, f as IUserDataProfilesService } from './missing-services.js'; | ||
import { b as isEmptyObject } from './types.js'; | ||
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js'; | ||
import { Extensions, machineOverridableSettings, windowSettings, resourceSettings, allSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, applicationSettings, machineSettings, OVERRIDE_PROPERTY_REGEX, overrideIdentifiersFromKey } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js'; | ||
import { Extensions, OVERRIDE_PROPERTY_REGEX, overrideIdentifiersFromKey, machineOverridableSettings, windowSettings, resourceSettings, allSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, applicationSettings, machineSettings } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js'; | ||
import { ConfigurationModel, Configuration, ConfigurationChangeEvent } from 'monaco-editor/esm/vs/platform/configuration/common/configurationModels.js'; | ||
import { IConfigurationService, addToValueTree, toValuesTree } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js'; | ||
import { addToValueTree, toValuesTree, IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js'; | ||
import { Event } from 'monaco-editor/esm/vs/base/common/event.js'; | ||
@@ -14,10 +15,13 @@ import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js'; | ||
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js'; | ||
import { isArray } from 'monaco-editor/esm/vs/base/common/types.js'; | ||
import { isArray, isUndefined } from 'monaco-editor/esm/vs/base/common/types.js'; | ||
import { extUriBiasedIgnorePathCase } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js'; | ||
import { bf as Position$2, bg as configurationDefaultsSchemaId } from './extHost.js'; | ||
export { bh as ConfigurationScope } from './extHost.js'; | ||
import { bf as Position, bg as getTelemetryLevel, bh as configurationDefaultsSchemaId } from './extHost.js'; | ||
export { bi as ConfigurationScope } from './extHost.js'; | ||
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js'; | ||
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js'; | ||
import { g as IWorkbenchEnvironmentService, I as IFileService } from './services2.js'; | ||
import { e as IWorkbenchEnvironmentService, d as IFileService } from './services2.js'; | ||
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js'; | ||
import { language } from 'monaco-editor/esm/vs/base/common/platform.js'; | ||
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js'; | ||
import { localize } from 'monaco-editor/esm/vs/nls.js'; | ||
@@ -50,3 +54,3 @@ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js'; | ||
super(...arguments); | ||
this._onDidChangeConfiguration = this._register(( (new Emitter()))); | ||
this._onDidChangeConfiguration = this._register(( new Emitter())); | ||
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; | ||
@@ -56,3 +60,3 @@ } | ||
if (!this._configurationModel) { | ||
this._configurationModel = ( (new DefaultConfigurationModel(this.getConfigurationDefaultOverrides()))); | ||
this._configurationModel = ( new DefaultConfigurationModel(this.getConfigurationDefaultOverrides())); | ||
} | ||
@@ -63,3 +67,3 @@ return this._configurationModel; | ||
this._configurationModel = undefined; | ||
this._register(( (Registry.as(Extensions.Configuration))).onDidUpdateConfiguration(({ properties, defaultsOverrides }) => this.onDidUpdateConfiguration(properties, defaultsOverrides))); | ||
this._register(( Registry.as(Extensions.Configuration)).onDidUpdateConfiguration(({ properties, defaultsOverrides }) => this.onDidUpdateConfiguration(properties, defaultsOverrides))); | ||
return this.configurationModel; | ||
@@ -81,4 +85,4 @@ } | ||
constructor(configurationDefaultsOverrides = {}) { | ||
const properties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties(); | ||
const keys = ( (Object.keys(properties))); | ||
const properties = ( Registry.as(Extensions.Configuration)).getConfigurationProperties(); | ||
const keys = ( Object.keys(properties)); | ||
const contents = Object.create(null); | ||
@@ -91,7 +95,7 @@ const overrides = []; | ||
} | ||
for (const key of ( (Object.keys(contents)))) { | ||
for (const key of ( Object.keys(contents))) { | ||
if (OVERRIDE_PROPERTY_REGEX.test(key)) { | ||
overrides.push({ | ||
identifiers: overrideIdentifiersFromKey(key), | ||
keys: ( (Object.keys(contents[key]))), | ||
keys: ( Object.keys(contents[key])), | ||
contents: toValuesTree(contents[key], message => console.error(`Conflict in default settings file: ${message}`)), | ||
@@ -107,3 +111,3 @@ }); | ||
this.onDidChangeConfiguration = Event.None; | ||
this.configurationModel = ( (new ConfigurationModel())); | ||
this.configurationModel = ( new ConfigurationModel()); | ||
} | ||
@@ -118,5 +122,5 @@ async initialize() { return this.configurationModel; } | ||
this.logService = logService; | ||
this._onDidChangeConfiguration = this._register(( (new Emitter()))); | ||
this._onDidChangeConfiguration = this._register(( new Emitter())); | ||
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; | ||
this._configurationModel = ( (new ConfigurationModel())); | ||
this._configurationModel = ( new ConfigurationModel()); | ||
} | ||
@@ -133,3 +137,3 @@ get configurationModel() { return this._configurationModel; } | ||
const keys = []; | ||
const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties(); | ||
const configurationProperties = ( Registry.as(Extensions.Configuration)).getConfigurationProperties(); | ||
for (const key of properties) { | ||
@@ -156,3 +160,3 @@ const config = configurationProperties[key]; | ||
onDidChangePolicies(policyNames) { | ||
const policyConfigurations = ( (Registry.as(Extensions.Configuration))).getPolicyConfigurations(); | ||
const policyConfigurations = ( Registry.as(Extensions.Configuration)).getPolicyConfigurations(); | ||
const keys = coalesce(policyNames.map(policyName => policyConfigurations.get(policyName))); | ||
@@ -162,3 +166,3 @@ this.update(keys, true); | ||
update(keys, trigger) { | ||
const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties(); | ||
const configurationProperties = ( Registry.as(Extensions.Configuration)).getConfigurationProperties(); | ||
const changed = []; | ||
@@ -182,3 +186,3 @@ const wasEmpty = this._configurationModel.isEmpty(); | ||
const old = this._configurationModel; | ||
this._configurationModel = ( (new ConfigurationModel())); | ||
this._configurationModel = ( new ConfigurationModel()); | ||
for (const key of old.keys) { | ||
@@ -201,6 +205,6 @@ this._configurationModel.setValue(key, old.getValue(key)); | ||
}; | ||
PolicyConfiguration = ( (__decorate([ | ||
( (__param(1, IPolicyService))), | ||
( (__param(2, ILogService))) | ||
], PolicyConfiguration))); | ||
PolicyConfiguration = ( __decorate([ | ||
( __param(1, IPolicyService)), | ||
( __param(2, ILogService)) | ||
], PolicyConfiguration)); | ||
class ConfigurationService extends Disposable { | ||
@@ -210,14 +214,14 @@ constructor(settingsResource, fileService, policyService, logService) { | ||
this.settingsResource = settingsResource; | ||
this._onDidChangeConfiguration = this._register(( (new Emitter()))); | ||
this._onDidChangeConfiguration = this._register(( new Emitter())); | ||
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; | ||
this.defaultConfiguration = this._register(( (new DefaultConfiguration()))); | ||
this.policyConfiguration = policyService instanceof NullPolicyService ? ( (new NullPolicyConfiguration())) : this._register(( (new PolicyConfiguration(this.defaultConfiguration, policyService, logService)))); | ||
this.userConfiguration = this._register(( (new UserSettings(this.settingsResource, undefined, extUriBiasedIgnorePathCase, fileService)))); | ||
this.configuration = ( (new Configuration( | ||
this.defaultConfiguration = this._register(( new DefaultConfiguration())); | ||
this.policyConfiguration = policyService instanceof NullPolicyService ? ( new NullPolicyConfiguration()) : this._register(( new PolicyConfiguration(this.defaultConfiguration, policyService, logService))); | ||
this.userConfiguration = this._register(( new UserSettings(this.settingsResource, undefined, extUriBiasedIgnorePathCase, fileService))); | ||
this.configuration = ( new Configuration( | ||
this.defaultConfiguration.configurationModel, | ||
this.policyConfiguration.configurationModel, | ||
(new ConfigurationModel()), | ||
(new ConfigurationModel()) | ||
))); | ||
this.reloadConfigurationScheduler = this._register(( (new RunOnceScheduler(() => this.reloadConfiguration(), 50)))); | ||
( new ConfigurationModel()), | ||
( new ConfigurationModel()) | ||
)); | ||
this.reloadConfigurationScheduler = this._register(( new RunOnceScheduler(() => this.reloadConfiguration(), 50))); | ||
this._register(this.defaultConfiguration.onDidChangeConfiguration(({ defaults, properties }) => this.onDidDefaultConfigurationChange(defaults, properties))); | ||
@@ -229,8 +233,3 @@ this._register(this.policyConfiguration.onDidChangeConfiguration(model => this.onDidPolicyConfigurationChange(model))); | ||
const [defaultModel, policyModel, userModel] = await Promise.all([this.defaultConfiguration.initialize(), this.policyConfiguration.initialize(), this.userConfiguration.loadConfiguration()]); | ||
this.configuration = ( (new Configuration( | ||
defaultModel, | ||
policyModel, | ||
(new ConfigurationModel()), | ||
userModel | ||
))); | ||
this.configuration = ( new Configuration(defaultModel, policyModel, ( new ConfigurationModel()), userModel)); | ||
} | ||
@@ -246,3 +245,3 @@ getConfigurationData() { | ||
updateValue(key, value, arg3, arg4) { | ||
return Promise.reject(( (new Error('not supported')))); | ||
return Promise.reject(( new Error('not supported'))); | ||
} | ||
@@ -253,5 +252,3 @@ inspect(key) { | ||
keys() { | ||
return ( | ||
(this.configuration.keys(undefined)) | ||
); | ||
return ( this.configuration.keys(undefined)); | ||
} | ||
@@ -278,3 +275,3 @@ async reloadConfiguration() { | ||
trigger(configurationChange, previous, source) { | ||
const event = ( (new ConfigurationChangeEvent(configurationChange, { data: previous }, this.configuration))); | ||
const event = ( new ConfigurationChangeEvent(configurationChange, { data: previous }, this.configuration)); | ||
event.source = source; | ||
@@ -300,3 +297,3 @@ event.sourceConfig = this.getTargetConfiguration(source); | ||
this.languageService = languageService; | ||
this._onDidChangeConfiguration = this._register(( (new Emitter()))); | ||
this._onDidChangeConfiguration = this._register(( new Emitter())); | ||
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; | ||
@@ -307,3 +304,3 @@ this._register(this.configurationService.onDidChangeConfiguration(e => this._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(e)))); | ||
if (typeof arg3 === 'string') { | ||
return this._getValue(resource, Position$2.isIPosition(arg2) ? arg2 : null, arg3); | ||
return this._getValue(resource, Position.isIPosition(arg2) ? arg2 : null, arg3); | ||
} | ||
@@ -395,7 +392,7 @@ return this._getValue(resource, null, typeof arg2 === 'string' ? arg2 : undefined); | ||
}; | ||
TextResourceConfigurationService = ( (__decorate([ | ||
( (__param(0, IConfigurationService))), | ||
( (__param(1, IModelService))), | ||
( (__param(2, ILanguageService))) | ||
], TextResourceConfigurationService))); | ||
TextResourceConfigurationService = ( __decorate([ | ||
( __param(0, IConfigurationService)), | ||
( __param(1, IModelService)), | ||
( __param(2, ILanguageService)) | ||
], TextResourceConfigurationService)); | ||
const FOLDER_CONFIG_FOLDER_NAME = '.vscode'; | ||
@@ -415,2 +412,279 @@ const defaultSettingsSchemaId = 'vscode://schemas/settings/default'; | ||
USER_STANDALONE_CONFIGURATIONS[TASKS_CONFIGURATION_KEY] = `${TASKS_CONFIGURATION_KEY}.json`; | ||
class Memento { | ||
constructor(id, storageService) { | ||
this.storageService = storageService; | ||
this.id = Memento.COMMON_PREFIX + id; | ||
} | ||
getMemento(scope, target) { | ||
switch (scope) { | ||
case 1 : { | ||
let workspaceMemento = Memento.workspaceMementos.get(this.id); | ||
if (!workspaceMemento) { | ||
workspaceMemento = ( new ScopedMemento(this.id, scope, target, this.storageService)); | ||
Memento.workspaceMementos.set(this.id, workspaceMemento); | ||
} | ||
return workspaceMemento.getMemento(); | ||
} | ||
case 0 : { | ||
let profileMemento = Memento.profileMementos.get(this.id); | ||
if (!profileMemento) { | ||
profileMemento = ( new ScopedMemento(this.id, scope, target, this.storageService)); | ||
Memento.profileMementos.set(this.id, profileMemento); | ||
} | ||
return profileMemento.getMemento(); | ||
} | ||
case -1 : { | ||
let applicationMemento = Memento.applicationMementos.get(this.id); | ||
if (!applicationMemento) { | ||
applicationMemento = ( new ScopedMemento(this.id, scope, target, this.storageService)); | ||
Memento.applicationMementos.set(this.id, applicationMemento); | ||
} | ||
return applicationMemento.getMemento(); | ||
} | ||
} | ||
} | ||
saveMemento() { | ||
Memento.workspaceMementos.get(this.id)?.save(); | ||
Memento.profileMementos.get(this.id)?.save(); | ||
Memento.applicationMementos.get(this.id)?.save(); | ||
} | ||
static clear(scope) { | ||
switch (scope) { | ||
case 1 : | ||
Memento.workspaceMementos.clear(); | ||
break; | ||
case 0 : | ||
Memento.profileMementos.clear(); | ||
break; | ||
case -1 : | ||
Memento.applicationMementos.clear(); | ||
break; | ||
} | ||
} | ||
} | ||
Memento.applicationMementos = ( new Map()); | ||
Memento.profileMementos = ( new Map()); | ||
Memento.workspaceMementos = ( new Map()); | ||
Memento.COMMON_PREFIX = 'memento/'; | ||
class ScopedMemento { | ||
constructor(id, scope, target, storageService) { | ||
this.id = id; | ||
this.scope = scope; | ||
this.target = target; | ||
this.storageService = storageService; | ||
this.mementoObj = this.load(); | ||
} | ||
getMemento() { | ||
return this.mementoObj; | ||
} | ||
load() { | ||
const memento = this.storageService.get(this.id, this.scope); | ||
if (memento) { | ||
try { | ||
return JSON.parse(memento); | ||
} | ||
catch (error) { | ||
onUnexpectedError(`[memento]: failed to parse contents: ${error} (id: ${this.id}, scope: ${this.scope}, contents: ${memento})`); | ||
} | ||
} | ||
return {}; | ||
} | ||
save() { | ||
if (!isEmptyObject(this.mementoObj)) { | ||
this.storageService.store(this.id, JSON.stringify(this.mementoObj), this.scope, this.target); | ||
} | ||
else { | ||
this.storageService.remove(this.id, this.scope); | ||
} | ||
} | ||
} | ||
const ASSIGNMENT_STORAGE_KEY = 'VSCode.ABExp.FeatureData'; | ||
const ASSIGNMENT_REFETCH_INTERVAL = 0; | ||
var TargetPopulation; | ||
( (function(TargetPopulation) { | ||
TargetPopulation["Team"] = "team"; | ||
TargetPopulation["Internal"] = "internal"; | ||
TargetPopulation["Insiders"] = "insider"; | ||
TargetPopulation["Public"] = "public"; | ||
})(TargetPopulation || (TargetPopulation = {}))); | ||
var Filters; | ||
( (function(Filters) { | ||
Filters["Market"] = "X-MSEdge-Market"; | ||
Filters["CorpNet"] = "X-FD-Corpnet"; | ||
Filters["ApplicationVersion"] = "X-VSCode-AppVersion"; | ||
Filters["Build"] = "X-VSCode-Build"; | ||
Filters["ClientId"] = "X-MSEdge-ClientId"; | ||
Filters["ExtensionName"] = "X-VSCode-ExtensionName"; | ||
Filters["ExtensionVersion"] = "X-VSCode-ExtensionVersion"; | ||
Filters["Language"] = "X-VSCode-Language"; | ||
Filters["TargetPopulation"] = "X-VSCode-TargetPopulation"; | ||
})(Filters || (Filters = {}))); | ||
class AssignmentFilterProvider { | ||
constructor(version, appName, machineId, targetPopulation) { | ||
this.version = version; | ||
this.appName = appName; | ||
this.machineId = machineId; | ||
this.targetPopulation = targetPopulation; | ||
} | ||
getFilterValue(filter) { | ||
switch (filter) { | ||
case Filters.ApplicationVersion: | ||
return this.version; | ||
case Filters.Build: | ||
return this.appName; | ||
case Filters.ClientId: | ||
return this.machineId; | ||
case Filters.Language: | ||
return language; | ||
case Filters.ExtensionName: | ||
return 'vscode-core'; | ||
case Filters.ExtensionVersion: | ||
return '999999.0'; | ||
case Filters.TargetPopulation: | ||
return this.targetPopulation; | ||
default: | ||
return ''; | ||
} | ||
} | ||
getFilters() { | ||
const filters = ( new Map()); | ||
const filterValues = ( Object.values(Filters)); | ||
for (const value of filterValues) { | ||
filters.set(value, this.getFilterValue(value)); | ||
} | ||
return filters; | ||
} | ||
} | ||
class BaseAssignmentService { | ||
constructor(getMachineId, configurationService, productService, telemetry, keyValueStorage) { | ||
this.getMachineId = getMachineId; | ||
this.configurationService = configurationService; | ||
this.productService = productService; | ||
this.telemetry = telemetry; | ||
this.keyValueStorage = keyValueStorage; | ||
this.networkInitialized = false; | ||
if (productService.tasConfig && this.experimentsEnabled && getTelemetryLevel(this.configurationService) === 3 ) { | ||
this.tasClient = this.setupTASClient(); | ||
} | ||
const overrideDelaySetting = this.configurationService.getValue('experiments.overrideDelay'); | ||
const overrideDelay = typeof overrideDelaySetting === 'number' ? overrideDelaySetting : 0; | ||
this.overrideInitDelay = ( new Promise(resolve => setTimeout(resolve, overrideDelay))); | ||
} | ||
get experimentsEnabled() { | ||
return true; | ||
} | ||
async getTreatment(name) { | ||
await this.overrideInitDelay; | ||
const override = this.configurationService.getValue('experiments.override.' + name); | ||
if (override !== undefined) { | ||
return override; | ||
} | ||
if (!this.tasClient) { | ||
return undefined; | ||
} | ||
if (!this.experimentsEnabled) { | ||
return undefined; | ||
} | ||
let result; | ||
const client = await this.tasClient; | ||
if (this.networkInitialized) { | ||
result = client.getTreatmentVariable('vscode', name); | ||
} | ||
else { | ||
result = await client.getTreatmentVariableAsync('vscode', name, true); | ||
} | ||
result = client.getTreatmentVariable('vscode', name); | ||
return result; | ||
} | ||
async setupTASClient() { | ||
const targetPopulation = this.productService.quality === 'stable' ? TargetPopulation.Public : TargetPopulation.Insiders; | ||
const machineId = await this.getMachineId(); | ||
const filterProvider = ( new AssignmentFilterProvider( | ||
this.productService.version, | ||
this.productService.nameLong, | ||
machineId, | ||
targetPopulation | ||
)); | ||
const tasConfig = this.productService.tasConfig; | ||
const tasClient = new ((await import('tas-client-umd').then(module => module.default ?? module)).ExperimentationService)({ | ||
filterProviders: [filterProvider], | ||
telemetry: this.telemetry, | ||
storageKey: ASSIGNMENT_STORAGE_KEY, | ||
keyValueStorage: this.keyValueStorage, | ||
featuresTelemetryPropertyName: tasConfig.featuresTelemetryPropertyName, | ||
assignmentContextTelemetryPropertyName: tasConfig.assignmentContextTelemetryPropertyName, | ||
telemetryEventName: tasConfig.telemetryEventName, | ||
endpoint: tasConfig.endpoint, | ||
refetchInterval: ASSIGNMENT_REFETCH_INTERVAL, | ||
}); | ||
await tasClient.initializePromise; | ||
tasClient.initialFetch.then(() => this.networkInitialized = true); | ||
return tasClient; | ||
} | ||
} | ||
const IWorkbenchAssignmentService = ( createDecorator('WorkbenchAssignmentService')); | ||
class MementoKeyValueStorage { | ||
constructor(memento) { | ||
this.memento = memento; | ||
this.mementoObj = memento.getMemento(-1 , 1 ); | ||
} | ||
async getValue(key, defaultValue) { | ||
const value = await this.mementoObj[key]; | ||
return value || defaultValue; | ||
} | ||
setValue(key, value) { | ||
this.mementoObj[key] = value; | ||
this.memento.saveMemento(); | ||
} | ||
} | ||
class WorkbenchAssignmentServiceTelemetry { | ||
constructor(telemetryService, productService) { | ||
this.telemetryService = telemetryService; | ||
this.productService = productService; | ||
} | ||
get assignmentContext() { | ||
return this._lastAssignmentContext?.split(';'); | ||
} | ||
setSharedProperty(name, value) { | ||
if (name === this.productService.tasConfig?.assignmentContextTelemetryPropertyName) { | ||
this._lastAssignmentContext = value; | ||
} | ||
this.telemetryService.setExperimentProperty(name, value); | ||
} | ||
postEvent(eventName, props) { | ||
const data = {}; | ||
for (const [key, value] of props.entries()) { | ||
data[key] = value; | ||
} | ||
this.telemetryService.publicLog(eventName, data); | ||
} | ||
} | ||
(class WorkbenchAssignmentService extends BaseAssignmentService { | ||
constructor(telemetryService, storageService, configurationService, productService) { | ||
super(() => { | ||
return telemetryService.getTelemetryInfo().then(telemetryInfo => { | ||
return telemetryInfo.machineId; | ||
}); | ||
}, configurationService, productService, ( new WorkbenchAssignmentServiceTelemetry(telemetryService, productService)), ( new MementoKeyValueStorage(( new Memento('experiment.service.memento', storageService))))); | ||
this.telemetryService = telemetryService; | ||
} | ||
get experimentsEnabled() { | ||
return this.configurationService.getValue('workbench.enableExperiments') === true; | ||
} | ||
async getTreatment(name) { | ||
const result = await super.getTreatment(name); | ||
this.telemetryService.publicLog2('tasClientReadTreatmentComplete', { treatmentName: name, treatmentValue: JSON.stringify(result) }); | ||
return result; | ||
} | ||
async getCurrentExperiments() { | ||
if (!this.tasClient) { | ||
return undefined; | ||
} | ||
if (!this.experimentsEnabled) { | ||
return undefined; | ||
} | ||
await this.tasClient; | ||
return this.telemetry?.assignmentContext; | ||
} | ||
}); | ||
let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchemasContribution extends Disposable { | ||
@@ -423,3 +697,3 @@ constructor(workspaceContextService, environmentService, workspaceTrustManagementService) { | ||
this.registerConfigurationSchemas(); | ||
const configurationRegistry = ( (Registry.as(Extensions.Configuration))); | ||
const configurationRegistry = ( Registry.as(Extensions.Configuration)); | ||
this._register(configurationRegistry.onDidUpdateConfiguration(e => this.registerConfigurationSchemas())); | ||
@@ -430,3 +704,3 @@ this._register(configurationRegistry.onDidSchemaChange(e => this.registerConfigurationSchemas())); | ||
registerConfigurationSchemas() { | ||
const jsonRegistry = ( (Registry.as(Extensions$1.JSONContribution))); | ||
const jsonRegistry = ( Registry.as(Extensions$1.JSONContribution)); | ||
const allSettingsSchema = { | ||
@@ -488,3 +762,3 @@ properties: allSettings.properties, | ||
jsonRegistry.registerSchema(defaultSettingsSchemaId, { | ||
properties: ( (Object.keys(allSettings.properties))).reduce((result, key) => { | ||
properties: ( Object.keys(allSettings.properties)).reduce((result, key) => { | ||
result[key] = { | ||
@@ -496,3 +770,3 @@ ...allSettings.properties[key], | ||
}, {}), | ||
patternProperties: ( (Object.keys(allSettings.patternProperties))).reduce((result, key) => { | ||
patternProperties: ( Object.keys(allSettings.patternProperties)).reduce((result, key) => { | ||
result[key] = { | ||
@@ -531,6 +805,6 @@ ...allSettings.patternProperties[key], | ||
type: 'object', | ||
description: ( (localize( | ||
description: ( localize( | ||
'configurationDefaults.description', | ||
'Contribute defaults for configurations' | ||
))), | ||
)), | ||
properties: { | ||
@@ -564,7 +838,44 @@ ...machineOverridableSettings.properties, | ||
}; | ||
RegisterConfigurationSchemasContribution = ( (__decorate([ | ||
( (__param(0, IWorkspaceContextService))), | ||
( (__param(1, IWorkbenchEnvironmentService))), | ||
( (__param(2, IWorkspaceTrustManagementService))) | ||
], RegisterConfigurationSchemasContribution))); | ||
RegisterConfigurationSchemasContribution = ( __decorate([ | ||
( __param(0, IWorkspaceContextService)), | ||
( __param(1, IWorkbenchEnvironmentService)), | ||
( __param(2, IWorkspaceTrustManagementService)) | ||
], RegisterConfigurationSchemasContribution)); | ||
let UpdateExperimentalSettingsDefaults = class UpdateExperimentalSettingsDefaults extends Disposable { | ||
constructor(workbenchAssignmentService) { | ||
super(); | ||
this.workbenchAssignmentService = workbenchAssignmentService; | ||
this.processedExperimentalSettings = ( new Set()); | ||
this.configurationRegistry = ( Registry.as(Extensions.Configuration)); | ||
this.processExperimentalSettings(( Object.keys(this.configurationRegistry.getConfigurationProperties()))); | ||
this._register(this.configurationRegistry.onDidUpdateConfiguration(({ properties }) => this.processExperimentalSettings(properties))); | ||
} | ||
async processExperimentalSettings(properties) { | ||
const overrides = {}; | ||
const allProperties = this.configurationRegistry.getConfigurationProperties(); | ||
for (const property of properties) { | ||
const schema = allProperties[property]; | ||
if (!schema?.tags?.includes('experimental')) { | ||
continue; | ||
} | ||
if (this.processedExperimentalSettings.has(property)) { | ||
continue; | ||
} | ||
this.processedExperimentalSettings.add(property); | ||
try { | ||
const value = await this.workbenchAssignmentService.getTreatment(`config.${property}`); | ||
if (!isUndefined(value) && !equals(value, schema.default)) { | ||
overrides[property] = value; | ||
} | ||
} | ||
catch (error) { } | ||
} | ||
if (( Object.keys(overrides)).length) { | ||
this.configurationRegistry.registerDefaultConfigurations([{ overrides, source: ( localize('experimental', "Experiments")) }]); | ||
} | ||
} | ||
}; | ||
UpdateExperimentalSettingsDefaults = ( __decorate([ | ||
( __param(0, IWorkbenchAssignmentService)) | ||
], UpdateExperimentalSettingsDefaults)); | ||
function updateUserConfiguration(configurationJson) { | ||
@@ -574,3 +885,3 @@ const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService); | ||
} | ||
const configurationRegistry = ( Registry.as(Extensions.Configuration)); | ||
const configurationRegistry = Registry.as(Extensions.Configuration); | ||
let InjectedConfigurationService = class InjectedConfigurationService extends ConfigurationService { | ||
@@ -594,8 +905,8 @@ constructor(userDataProfilesService, fileService, policyService, logService) { | ||
}; | ||
InjectedConfigurationService = ( __decorate([ | ||
( __param(0, IUserDataProfilesService)), | ||
( __param(1, IFileService)), | ||
( __param(2, IPolicyService)), | ||
( __param(3, ILogService)) | ||
], InjectedConfigurationService)); | ||
InjectedConfigurationService = __decorate([ | ||
__param(0, IUserDataProfilesService), | ||
__param(1, IFileService), | ||
__param(2, IPolicyService), | ||
__param(3, ILogService) | ||
], InjectedConfigurationService); | ||
function initialize(instantiationService) { | ||
@@ -609,6 +920,6 @@ instantiationService.createInstance(RegisterConfigurationSchemasContribution); | ||
...getServiceOverride$2(), | ||
[( IConfigurationService.toString())]: new SyncDescriptor(InjectedConfigurationService), | ||
[( ITextResourceConfigurationService.toString())]: new SyncDescriptor(TextResourceConfigurationService) | ||
[IConfigurationService.toString()]: new SyncDescriptor(InjectedConfigurationService), | ||
[ITextResourceConfigurationService.toString()]: new SyncDescriptor(TextResourceConfigurationService) | ||
}; | ||
} | ||
export { configurationRegistry, getServiceOverride as default, updateUserConfiguration }; |
@@ -76,2 +76,14 @@ import { Event } from 'monaco-editor/esm/vs/base/common/event.js'; | ||
} | ||
function insert(array, element) { | ||
array.push(element); | ||
return () => remove(array, element); | ||
} | ||
function remove(array, element) { | ||
const index = array.indexOf(element); | ||
if (index > -1) { | ||
array.splice(index, 1); | ||
return element; | ||
} | ||
return undefined; | ||
} | ||
function shuffle(array, _seed) { | ||
@@ -515,2 +527,2 @@ let rand; | ||
} | ||
export { ContextKeyExprType as C, NoOpNotification as N, RawContextKey as R, __decorate as _, __param as a, __classPrivateFieldSet as b, __classPrivateFieldGet as c, coalesceInPlace as d, delta as e, NotificationsFilter as f, NeverShowAgainScope as g, flatten as h, index as i, mapArrayOrNot as m, shuffle as s }; | ||
export { ContextKeyExprType as C, NoOpNotification as N, RawContextKey as R, __classPrivateFieldSet as _, __classPrivateFieldGet as a, __decorate as b, coalesceInPlace as c, __param as d, delta as e, NotificationsFilter as f, flatten as g, NeverShowAgainScope as h, insert as i, index as j, mapArrayOrNot as m, shuffle as s }; |
@@ -1,7 +0,8 @@ | ||
import { E as Emitter } from './missing-services.js'; | ||
import { E as Emitter } from './polyfill.js'; | ||
import './missing-services.js'; | ||
import { g as getServiceOverride$1, D as DialogHandlerContribution } from './layout.js'; | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
import { DeferredPromise } from 'monaco-editor/esm/vs/base/common/async.js'; | ||
import { g as IWorkbenchEnvironmentService } from './services2.js'; | ||
import { e as IWorkbenchEnvironmentService } from './services2.js'; | ||
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js'; | ||
@@ -15,9 +16,9 @@ import { o as onServicesInitialized } from './tools.js'; | ||
this.dialogs = []; | ||
this._onWillShowDialog = this._register(( (new Emitter()))); | ||
this._onWillShowDialog = this._register(( new Emitter())); | ||
this.onWillShowDialog = this._onWillShowDialog.event; | ||
this._onDidShowDialog = this._register(( (new Emitter()))); | ||
this._onDidShowDialog = this._register(( new Emitter())); | ||
this.onDidShowDialog = this._onDidShowDialog.event; | ||
} | ||
show(dialog) { | ||
const promise = ( (new DeferredPromise())); | ||
const promise = ( new DeferredPromise()); | ||
const item = { | ||
@@ -44,3 +45,3 @@ args: dialog, | ||
this.logService = logService; | ||
this.model = this._register(( (new DialogsModel()))); | ||
this.model = this._register(( new DialogsModel())); | ||
this.onWillShowDialog = this.model.onWillShowDialog; | ||
@@ -85,6 +86,6 @@ this.onDidShowDialog = this.model.onDidShowDialog; | ||
}; | ||
DialogService = ( (__decorate([ | ||
( (__param(0, IWorkbenchEnvironmentService))), | ||
( (__param(1, ILogService))) | ||
], DialogService))); | ||
DialogService = ( __decorate([ | ||
( __param(0, IWorkbenchEnvironmentService)), | ||
( __param(1, ILogService)) | ||
], DialogService)); | ||
function initialize(instantiationService) { | ||
@@ -96,3 +97,3 @@ instantiationService.createInstance(DialogHandlerContribution); | ||
return { | ||
[( IDialogService.toString())]: new SyncDescriptor(DialogService), | ||
[IDialogService.toString()]: new SyncDescriptor(DialogService), | ||
...getServiceOverride$1(container) | ||
@@ -99,0 +100,0 @@ }; |
@@ -1,4 +0,5 @@ | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { l as format2, m as getServiceMachineId, E as Emitter, n as ResourceQueue, o as isReadableStream, p as peekStream, q as peekReadable, s as bufferToReadable, t as streamToBuffer, v as consumeStream, w as transform, x as isReadableBufferedStream, y as listenStream, z as bufferedStreamToBuffer, A as readableToBuffer, u as unsupported, C as newWriteableBufferStream, D as newWriteableStream } from './missing-services.js'; | ||
import { I as IFileService, j as IProductService, S as Services, t as FileSystemProviderError, o as FileSystemProviderErrorCode, u as FileChangesEvent, v as FileOperationError, w as hasOpenReadWriteCloseCapability, x as hasReadWriteCapability, y as hasFileReadStreamCapability, z as toFileSystemProviderErrorCode, B as ensureFileSystemProviderError, F as FileType, a as FilePermission, D as etag, E as FileOperationEvent, G as toFileOperationResult, H as ETAG_DISABLED, J as hasFileAtomicReadCapability, N as NotModifiedSinceFileOperationError, K as hasFileFolderCopyCapability, L as hasFileCloneCapability, M as createFileSystemProviderError, C as CancellationTokenSource } from './services2.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { E as Emitter, b as isReadableStream, e as peekStream, h as peekReadable, j as bufferToReadable, s as streamToBuffer, k as consumeStream, t as transform, l as isReadableBufferedStream, m as listenStream, n as bufferedStreamToBuffer, o as readableToBuffer, q as newWriteableBufferStream, u as newWriteableStream } from './polyfill.js'; | ||
import { g as format2, h as getServiceMachineId, R as ResourceQueue, u as unsupported } from './missing-services.js'; | ||
import { v as FileSystemProviderError, b as FileSystemProviderErrorCode, F as FileType, w as ensureFileSystemProviderError, x as createFileSystemProviderError, y as FileChangesEvent, p as FileOperationError, z as hasOpenReadWriteCloseCapability, B as hasReadWriteCapability, D as hasFileReadStreamCapability, E as toFileSystemProviderErrorCode, a as FilePermission, G as etag, H as FileOperationEvent, J as toFileOperationResult, K as ETAG_DISABLED, L as hasFileAtomicReadCapability, N as NotModifiedSinceFileOperationError, M as hasFileFolderCopyCapability, O as hasFileCloneCapability, C as CancellationTokenSource, d as IFileService, l as IProductService, S as Services } from './services2.js'; | ||
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js'; | ||
@@ -18,3 +19,3 @@ import { canceled } from 'monaco-editor/esm/vs/base/common/errors.js'; | ||
import { Event } from 'monaco-editor/esm/vs/base/common/event.js'; | ||
import { bi as supportsTelemetry, bj as getTelemetryLevel, bd as DEFAULT_EXTENSION, E as Disposable$1 } from './extHost.js'; | ||
import { bj as supportsTelemetry, bg as getTelemetryLevel, D as DEFAULT_EXTENSION, G as Disposable$1 } from './extHost.js'; | ||
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js'; | ||
@@ -35,3 +36,3 @@ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js'; | ||
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource'; | ||
const IExtensionResourceLoaderService = ( (createDecorator('extensionResourceLoaderService'))); | ||
const IExtensionResourceLoaderService = ( createDecorator('extensionResourceLoaderService')); | ||
class AbstractExtensionResourceLoaderService { | ||
@@ -47,3 +48,3 @@ constructor(_fileService, _storageService, _productService, _environmentService, _configurationService) { | ||
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate; | ||
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(( (URI.parse(this._extensionGalleryResourceUrlTemplate)))) : undefined; | ||
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(( URI.parse(this._extensionGalleryResourceUrlTemplate))) : undefined; | ||
} | ||
@@ -56,5 +57,5 @@ } | ||
if (this._extensionGalleryResourceUrlTemplate) { | ||
const uri = ( (URI.parse( | ||
const uri = ( URI.parse( | ||
format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' }) | ||
))); | ||
)); | ||
return this._isWebExtensionResourceEndPoint(uri) ? uri.with({ scheme: RemoteAuthorities.getPreferredWebSchema() }) : uri; | ||
@@ -113,3 +114,3 @@ } | ||
this.name = name; | ||
this.entries = ( (new Map())); | ||
this.entries = ( new Map()); | ||
} | ||
@@ -123,4 +124,4 @@ } | ||
this.onDidChangeCapabilities = Event.None; | ||
this.root = ( (new Directory(''))); | ||
this._onDidChangeFile = this._register(( (new Emitter()))); | ||
this.root = ( new Directory('')); | ||
this._onDidChangeFile = this._register(( new Emitter())); | ||
this.onDidChangeFile = this._onDidChangeFile.event; | ||
@@ -159,3 +160,3 @@ this._bufferedChanges = []; | ||
if (!entry) { | ||
entry = ( (new File$1(basename$1))); | ||
entry = ( new File$1(basename$1)); | ||
parent.entries.set(basename$1, entry); | ||
@@ -200,3 +201,3 @@ this._fireSoon({ type: 1 , resource }); | ||
const parent = this._lookupAsDirectory(dirname$1, false); | ||
const entry = ( (new Directory(basename$1))); | ||
const entry = ( new Directory(basename$1)); | ||
parent.entries.set(entry.name, entry); | ||
@@ -342,17 +343,17 @@ parent.mtime = Date.now(); | ||
this.BUFFER_SIZE = 256 * 1024; | ||
this._onDidChangeFileSystemProviderRegistrations = this._register(( (new Emitter()))); | ||
this._onDidChangeFileSystemProviderRegistrations = this._register(( new Emitter())); | ||
this.onDidChangeFileSystemProviderRegistrations = this._onDidChangeFileSystemProviderRegistrations.event; | ||
this._onWillActivateFileSystemProvider = this._register(( (new Emitter()))); | ||
this._onWillActivateFileSystemProvider = this._register(( new Emitter())); | ||
this.onWillActivateFileSystemProvider = this._onWillActivateFileSystemProvider.event; | ||
this._onDidChangeFileSystemProviderCapabilities = this._register(( (new Emitter()))); | ||
this._onDidChangeFileSystemProviderCapabilities = this._register(( new Emitter())); | ||
this.onDidChangeFileSystemProviderCapabilities = this._onDidChangeFileSystemProviderCapabilities.event; | ||
this.provider = ( (new Map())); | ||
this._onDidRunOperation = this._register(( (new Emitter()))); | ||
this.provider = ( new Map()); | ||
this._onDidRunOperation = this._register(( new Emitter())); | ||
this.onDidRunOperation = this._onDidRunOperation.event; | ||
this._onDidFilesChange = this._register(( (new Emitter()))); | ||
this._onDidFilesChange = this._register(( new Emitter())); | ||
this.onDidFilesChange = this._onDidFilesChange.event; | ||
this._onDidWatchError = this._register(( (new Emitter()))); | ||
this._onDidWatchError = this._register(( new Emitter())); | ||
this.onDidWatchError = this._onDidWatchError.event; | ||
this.activeWatchers = ( (new Map())); | ||
this.writeQueue = this._register(( (new ResourceQueue()))); | ||
this.activeWatchers = ( new Map()); | ||
this.writeQueue = this._register(( new ResourceQueue())); | ||
} | ||
@@ -363,8 +364,8 @@ registerProvider(scheme, provider) { | ||
} | ||
const providerDisposables = ( (new DisposableStore())); | ||
const providerDisposables = ( new DisposableStore()); | ||
this.provider.set(scheme, provider); | ||
this._onDidChangeFileSystemProviderRegistrations.fire({ added: true, scheme, provider }); | ||
providerDisposables.add(provider.onDidChangeFile(changes => this._onDidFilesChange.fire(( (new FileChangesEvent(changes, !this.isPathCaseSensitive(provider))))))); | ||
providerDisposables.add(provider.onDidChangeFile(changes => this._onDidFilesChange.fire(( new FileChangesEvent(changes, !this.isPathCaseSensitive(provider)))))); | ||
if (typeof provider.onDidWatchError === 'function') { | ||
providerDisposables.add(provider.onDidWatchError(error => this._onDidWatchError.fire(( (new Error(error)))))); | ||
providerDisposables.add(provider.onDidWatchError(error => this._onDidWatchError.fire(( new Error(error))))); | ||
} | ||
@@ -415,9 +416,9 @@ providerDisposables.add(provider.onDidChangeCapabilities(() => this._onDidChangeFileSystemProviderCapabilities.fire({ provider, scheme }))); | ||
if (!provider) { | ||
const error = ( (new Error())); | ||
const error = ( new Error()); | ||
error.name = 'ENOPRO'; | ||
error.message = ( (localize( | ||
error.message = ( localize( | ||
'noProviderFound', | ||
"No file system provider found for resource '{0}'", | ||
(resource.toString()) | ||
))); | ||
( resource.toString()) | ||
)); | ||
throw error; | ||
@@ -559,3 +560,3 @@ } | ||
const fileStat = await this.writeFile(resource, bufferOrReadableOrStream); | ||
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 0 , fileStat)))); | ||
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 0 , fileStat))); | ||
return fileStat; | ||
@@ -595,3 +596,3 @@ } | ||
} | ||
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 4 )))); | ||
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 4 ))); | ||
} | ||
@@ -634,15 +635,13 @@ catch (error) { | ||
async doReadFileAtomic(provider, resource, options, token) { | ||
return ( | ||
(new Promise((resolve, reject) => { | ||
this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => { | ||
try { | ||
const content = await this.doReadFile(provider, resource, options, token); | ||
resolve(content); | ||
} | ||
catch (error) { | ||
reject(error); | ||
} | ||
}); | ||
})) | ||
); | ||
return ( new Promise((resolve, reject) => { | ||
this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => { | ||
try { | ||
const content = await this.doReadFile(provider, resource, options, token); | ||
resolve(content); | ||
} | ||
catch (error) { | ||
reject(error); | ||
} | ||
}); | ||
})); | ||
} | ||
@@ -664,3 +663,3 @@ async doReadFile(provider, resource, options, token) { | ||
async doReadFileStream(provider, resource, options, token) { | ||
const cancellableSource = ( (new CancellationTokenSource(token))); | ||
const cancellableSource = ( new CancellationTokenSource(token)); | ||
const statPromise = this.validateReadFile(resource, options).then(stat => stat, error => { | ||
@@ -697,8 +696,8 @@ cancellableSource.cancel(); | ||
} | ||
const message = ( (localize( | ||
const message = ( localize( | ||
'err.read', | ||
"Unable to read file '{0}' ({1})", | ||
this.resourceForError(resource), | ||
(ensureFileSystemProviderError(error).toString()) | ||
))); | ||
( ensureFileSystemProviderError(error).toString()) | ||
)); | ||
if (error instanceof NotModifiedSinceFileOperationError) { | ||
@@ -716,8 +715,8 @@ throw new NotModifiedSinceFileOperationError(message, error.stat, options); | ||
data: data => data instanceof VSBuffer ? data : VSBuffer.wrap(data), | ||
error: error => ( (new FileOperationError( (localize( | ||
error: error => ( new FileOperationError(( localize( | ||
'err.read', | ||
"Unable to read file '{0}' ({1})", | ||
this.resourceForError(resource), | ||
(ensureFileSystemProviderError(error).toString()) | ||
)), toFileOperationResult(error), options))) | ||
( ensureFileSystemProviderError(error).toString()) | ||
)), toFileOperationResult(error), options)) | ||
}, data => VSBuffer.concat(data)); | ||
@@ -730,8 +729,8 @@ } | ||
bufferSize: this.BUFFER_SIZE, | ||
errorTransformer: error => ( (new FileOperationError( (localize( | ||
errorTransformer: error => ( new FileOperationError(( localize( | ||
'err.read', | ||
"Unable to read file '{0}' ({1})", | ||
this.resourceForError(resource), | ||
(ensureFileSystemProviderError(error).toString()) | ||
)), toFileOperationResult(error), options))) | ||
( ensureFileSystemProviderError(error).toString()) | ||
)), toFileOperationResult(error), options)) | ||
}, token); | ||
@@ -799,3 +798,3 @@ return stream; | ||
async doCanMoveCopy(source, target, mode, overwrite) { | ||
if (( (source.toString())) !== ( (target.toString()))) { | ||
if (( source.toString()) !== ( target.toString())) { | ||
try { | ||
@@ -817,7 +816,7 @@ const sourceProvider = mode === 'move' ? this.throwIfFileSystemIsReadonly(await this.withWriteProvider(source), source) : await this.withReadProvider(source); | ||
const fileStat = await this.resolve(target, { resolveMetadata: true }); | ||
this._onDidRunOperation.fire(( (new FileOperationEvent( | ||
this._onDidRunOperation.fire(( new FileOperationEvent( | ||
source, | ||
mode === 'move' ? 2 : 3 , | ||
fileStat | ||
)))); | ||
))); | ||
return fileStat; | ||
@@ -830,11 +829,11 @@ } | ||
const fileStat = await this.resolve(target, { resolveMetadata: true }); | ||
this._onDidRunOperation.fire(( (new FileOperationEvent( | ||
this._onDidRunOperation.fire(( new FileOperationEvent( | ||
source, | ||
mode === 'copy' ? 3 : 2 , | ||
fileStat | ||
)))); | ||
))); | ||
return fileStat; | ||
} | ||
async doMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite) { | ||
if (( (source.toString())) === ( (target.toString()))) { | ||
if (( source.toString()) === ( target.toString())) { | ||
return mode; | ||
@@ -944,3 +943,3 @@ } | ||
const fileStat = await this.resolve(resource, { resolveMetadata: true }); | ||
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 0 , fileStat)))); | ||
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 0 , fileStat))); | ||
return fileStat; | ||
@@ -1020,3 +1019,3 @@ } | ||
await provider.delete(resource, { recursive, useTrash }); | ||
this._onDidRunOperation.fire(( (new FileOperationEvent(resource, 1 )))); | ||
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 1 ))); | ||
} | ||
@@ -1040,3 +1039,3 @@ async cloneFile(source, target) { | ||
watch(resource, options = { recursive: false, excludes: [] }) { | ||
const disposables = ( (new DisposableStore())); | ||
const disposables = ( new DisposableStore()); | ||
let watchDisposed = false; | ||
@@ -1126,21 +1125,19 @@ let disposeWatch = () => { watchDisposed = true; }; | ||
} | ||
return ( | ||
(new Promise((resolve, reject) => { | ||
listenStream(stream, { | ||
onData: async (chunk) => { | ||
stream.pause(); | ||
try { | ||
await this.doWriteBuffer(provider, handle, chunk, chunk.byteLength, posInFile, 0); | ||
} | ||
catch (error) { | ||
return reject(error); | ||
} | ||
posInFile += chunk.byteLength; | ||
setTimeout(() => stream.resume()); | ||
}, | ||
onError: error => reject(error), | ||
onEnd: () => resolve() | ||
}); | ||
})) | ||
); | ||
return ( new Promise((resolve, reject) => { | ||
listenStream(stream, { | ||
onData: async (chunk) => { | ||
stream.pause(); | ||
try { | ||
await this.doWriteBuffer(provider, handle, chunk, chunk.byteLength, posInFile, 0); | ||
} | ||
catch (error) { | ||
return reject(error); | ||
} | ||
posInFile += chunk.byteLength; | ||
setTimeout(() => stream.resume()); | ||
}, | ||
onError: error => reject(error), | ||
onEnd: () => resolve() | ||
}); | ||
})); | ||
} | ||
@@ -1255,10 +1252,8 @@ async doWriteReadableBufferedQueued(provider, handle, readable) { | ||
} | ||
return ( | ||
(resource.toString(true)) | ||
); | ||
return ( resource.toString(true)); | ||
} | ||
}; | ||
FileService = ( (__decorate([ | ||
( (__param(0, ILogService))) | ||
], FileService))); | ||
FileService = ( __decorate([ | ||
( __param(0, ILogService)) | ||
], FileService)); | ||
let SimpleExtensionResourceLoaderService = class SimpleExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { | ||
@@ -1270,12 +1265,12 @@ constructor(fileService, storageService, productService, environmentService, configurationService) { | ||
const result = await this._fileService.readFile(uri); | ||
return ( result.value.toString()); | ||
return result.value.toString(); | ||
} | ||
}; | ||
SimpleExtensionResourceLoaderService = ( __decorate([ | ||
( __param(0, IFileService)), | ||
( __param(1, IStorageService)), | ||
( __param(2, IProductService)), | ||
( __param(3, IEnvironmentService)), | ||
( __param(4, IConfigurationService)) | ||
], SimpleExtensionResourceLoaderService)); | ||
SimpleExtensionResourceLoaderService = __decorate([ | ||
__param(0, IFileService), | ||
__param(1, IStorageService), | ||
__param(2, IProductService), | ||
__param(3, IEnvironmentService), | ||
__param(4, IConfigurationService) | ||
], SimpleExtensionResourceLoaderService); | ||
registerSingleton(IExtensionResourceLoaderService, SimpleExtensionResourceLoaderService); | ||
@@ -1306,3 +1301,3 @@ class File { | ||
async stat(resource) { | ||
const file = this.files.get(( resource.toString())); | ||
const file = this.files.get(resource.toString()); | ||
if (file != null) { | ||
@@ -1314,3 +1309,3 @@ return file; | ||
async readFile(resource) { | ||
const file = this.files.get(( resource.toString())); | ||
const file = this.files.get(resource.toString()); | ||
if (file != null) { | ||
@@ -1327,5 +1322,5 @@ return encoder.encode(await file.getContent()); | ||
registerFile(resource, getContent) { | ||
this.files.set(( resource.toString()), new File(getContent)); | ||
this.files.set(resource.toString(), new File(getContent)); | ||
return new Disposable$1(() => { | ||
this.files.delete(( resource.toString())); | ||
this.files.delete(resource.toString()); | ||
}); | ||
@@ -1343,5 +1338,5 @@ } | ||
}; | ||
MemoryFileService = ( __decorate([ | ||
( __param(0, ILogService)) | ||
], MemoryFileService)); | ||
MemoryFileService = __decorate([ | ||
__param(0, ILogService) | ||
], MemoryFileService); | ||
function registerExtensionFile(resource, getContent) { | ||
@@ -1352,6 +1347,6 @@ return extensionFileSystemProvider.registerFile(resource, getContent); | ||
return { | ||
[( IFileService.toString())]: new SyncDescriptor(MemoryFileService), | ||
[( IExtensionResourceLoaderService.toString())]: new SyncDescriptor(SimpleExtensionResourceLoaderService) | ||
[IFileService.toString()]: new SyncDescriptor(MemoryFileService), | ||
[IExtensionResourceLoaderService.toString()]: new SyncDescriptor(SimpleExtensionResourceLoaderService) | ||
}; | ||
} | ||
export { IExtensionResourceLoaderService as I, getRemoteAuthority as a, getServiceOverride as g, registerExtensionFile as r }; |
@@ -1,5 +0,6 @@ | ||
import { L as ITextMateService, I as IExtensionService, K as parse, M as getNodeType } from './missing-services.js'; | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { p as parse, w as getNodeType } from './polyfill.js'; | ||
import { n as ITextMateService, I as IExtensionService } from './missing-services.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { g as getParseErrorMessage } from './jsonErrorMessages.js'; | ||
import { I as IExtensionResourceLoaderService, r as registerExtensionFile, g as getServiceOverride$1 } from './files.js'; | ||
import { I as IExtensionResourceLoaderService, g as getServiceOverride$1, r as registerExtensionFile } from './files.js'; | ||
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
@@ -16,3 +17,3 @@ import { hash } from 'monaco-editor/esm/vs/base/common/hash.js'; | ||
import { S as Services } from './services2.js'; | ||
import { bd as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { D as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { joinPath } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
@@ -19,0 +20,0 @@ function isStringArr(something) { |
@@ -1,5 +0,6 @@ | ||
import { J as ExtensionMessageCollector } from './missing-services.js'; | ||
import './polyfill.js'; | ||
import { m as ExtensionMessageCollector } from './missing-services.js'; | ||
import { W as WorkbenchLanguageService } from './languageService.js'; | ||
import { g as getExtensionPoint, c as consoleExtensionMessageHandler } from './tools.js'; | ||
import { bd as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { D as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { S as Services } from './services2.js'; | ||
@@ -18,5 +19,5 @@ import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js'; | ||
return { | ||
[( ILanguageService.toString())]: new SyncDescriptor(WorkbenchLanguageService) | ||
[ILanguageService.toString()]: new SyncDescriptor(WorkbenchLanguageService) | ||
}; | ||
} | ||
export { getServiceOverride as default, setLanguages }; |
@@ -1,4 +0,4 @@ | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { f as ExtensionsRegistry, I as IExtensionService } from './missing-services.js'; | ||
import { O as FILES_ASSOCIATIONS_CONFIG } from './services2.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { I as IExtensionService, E as ExtensionsRegistry } from './missing-services.js'; | ||
import { P as FILES_ASSOCIATIONS_CONFIG } from './services2.js'; | ||
import { parse } from 'monaco-editor/esm/vs/base/common/glob.js'; | ||
@@ -5,0 +5,0 @@ import { posix } from 'monaco-editor/esm/vs/base/common/path.js'; |
@@ -0,1 +1,3 @@ | ||
import './polyfill.js'; | ||
import './missing-services.js'; | ||
import getServiceOverride$1 from './notifications.js'; | ||
@@ -2,0 +4,0 @@ import getServiceOverride$2 from './dialogs.js'; |
@@ -1,4 +0,5 @@ | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { g as ILanguageDetectionService, E as Emitter, u as unsupported } from './missing-services.js'; | ||
import { MutableDisposable, Disposable, toDisposable, ImmortalReference, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { E as Emitter } from './polyfill.js'; | ||
import { d as ILanguageDetectionService, u as unsupported } from './missing-services.js'; | ||
import { Disposable, MutableDisposable, dispose, toDisposable, ImmortalReference } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
import { w as withUndefinedAsNull } from './types.js'; | ||
@@ -11,3 +12,3 @@ import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js'; | ||
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js'; | ||
import { e as ITextFileService, I as IFileService, b as IUriIdentityService, c as IEditorService, q as SIDE_GROUP, A as ACTIVE_GROUP, s as isPreferredGroup } from './services2.js'; | ||
import { d as IFileService, f as IUriIdentityService, I as ITextFileService, c as SIDE_GROUP, A as ACTIVE_GROUP, i as IEditorService, u as isPreferredGroup } from './services2.js'; | ||
import { MultiModelEditStackElement } from 'monaco-editor/esm/vs/editor/common/model/editStack.js'; | ||
@@ -32,3 +33,3 @@ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js'; | ||
constructor() { | ||
this.references = ( (new Map())); | ||
this.references = ( new Map()); | ||
} | ||
@@ -107,3 +108,3 @@ acquire(key, ...args) { | ||
super(...arguments); | ||
this._onWillDispose = this._register(( (new Emitter()))); | ||
this._onWillDispose = this._register(( new Emitter())); | ||
this.onWillDispose = this._onWillDispose.event; | ||
@@ -136,4 +137,4 @@ this.disposed = false; | ||
this.textEditorModelHandle = undefined; | ||
this.modelDisposeListener = this._register(( (new MutableDisposable()))); | ||
this.autoDetectLanguageThrottler = this._register(( (new ThrottledDelayer(BaseTextEditorModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY)))); | ||
this.modelDisposeListener = this._register(( new MutableDisposable())); | ||
this.autoDetectLanguageThrottler = this._register(( new ThrottledDelayer(BaseTextEditorModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY))); | ||
this._hasLanguageSetExplicitly = false; | ||
@@ -196,7 +197,7 @@ if (textEditorModelHandle) { | ||
if (languageName) { | ||
this.accessibilityService.alert(( (localize( | ||
this.accessibilityService.alert(( localize( | ||
'languageAutoDetected', | ||
"Language {0} was automatically detected and set as the language mode.", | ||
languageName | ||
)))); | ||
))); | ||
} | ||
@@ -268,8 +269,8 @@ } | ||
BaseTextEditorModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY = 600; | ||
BaseTextEditorModel = ( (__decorate([ | ||
( (__param(0, IModelService))), | ||
( (__param(1, ILanguageService))), | ||
( (__param(2, ILanguageDetectionService))), | ||
( (__param(3, IAccessibilityService))) | ||
], BaseTextEditorModel))); | ||
BaseTextEditorModel = ( __decorate([ | ||
( __param(0, IModelService)), | ||
( __param(1, ILanguageService)), | ||
( __param(2, ILanguageDetectionService)), | ||
( __param(3, IAccessibilityService)) | ||
], BaseTextEditorModel)); | ||
let TextResourceEditorModel = class TextResourceEditorModel extends BaseTextEditorModel { | ||
@@ -286,8 +287,8 @@ constructor(resource, languageService, modelService, languageDetectionService, accessibilityService) { | ||
}; | ||
TextResourceEditorModel = ( (__decorate([ | ||
( (__param(1, ILanguageService))), | ||
( (__param(2, IModelService))), | ||
( (__param(3, ILanguageDetectionService))), | ||
( (__param(4, IAccessibilityService))) | ||
], TextResourceEditorModel))); | ||
TextResourceEditorModel = ( __decorate([ | ||
( __param(1, ILanguageService)), | ||
( __param(2, IModelService)), | ||
( __param(3, ILanguageDetectionService)), | ||
( __param(4, IAccessibilityService)) | ||
], TextResourceEditorModel)); | ||
class TextFileEditorModel {} | ||
@@ -338,7 +339,7 @@ let ModelUndoRedoParticipant = class ModelUndoRedoParticipant extends Disposable { | ||
}; | ||
ModelUndoRedoParticipant = ( (__decorate([ | ||
( (__param(0, IModelService))), | ||
( (__param(1, ITextModelService))), | ||
( (__param(2, IUndoRedoService))) | ||
], ModelUndoRedoParticipant))); | ||
ModelUndoRedoParticipant = ( __decorate([ | ||
( __param(0, IModelService)), | ||
( __param(1, ITextModelService)), | ||
( __param(2, IUndoRedoService)) | ||
], ModelUndoRedoParticipant)); | ||
let ResourceModelCollection = class ResourceModelCollection extends ReferenceCollection { | ||
@@ -351,4 +352,4 @@ constructor(instantiationService, textFileService, fileService, modelService) { | ||
this.modelService = modelService; | ||
this.providers = ( (new Map())); | ||
this.modelsToDispose = ( (new Set())); | ||
this.providers = ( new Map()); | ||
this.modelsToDispose = ( new Set()); | ||
} | ||
@@ -360,3 +361,3 @@ createReferencedObject(key) { | ||
this.modelsToDispose.delete(key); | ||
const resource = ( (URI.parse(key))); | ||
const resource = ( URI.parse(key)); | ||
if (resource.scheme === Schemas.inMemory) { | ||
@@ -404,3 +405,3 @@ const cachedModel = this.modelService.getModel(resource); | ||
destroyReferencedObject(key, modelPromise) { | ||
const resource = ( (URI.parse(key))); | ||
const resource = ( URI.parse(key)); | ||
if (resource.scheme === Schemas.untitled || resource.scheme === Schemas.inMemory) { | ||
@@ -457,3 +458,3 @@ return; | ||
async resolveTextModelContent(key) { | ||
const resource = ( (URI.parse(key))); | ||
const resource = ( URI.parse(key)); | ||
const providersForScheme = this.providers.get(resource.scheme) || []; | ||
@@ -469,8 +470,8 @@ for (const provider of providersForScheme) { | ||
}; | ||
ResourceModelCollection = ( (__decorate([ | ||
( (__param(0, IInstantiationService))), | ||
( (__param(1, ITextFileService))), | ||
( (__param(2, IFileService))), | ||
( (__param(3, IModelService))) | ||
], ResourceModelCollection))); | ||
ResourceModelCollection = ( __decorate([ | ||
( __param(0, IInstantiationService)), | ||
( __param(1, ITextFileService)), | ||
( __param(2, IFileService)), | ||
( __param(3, IModelService)) | ||
], ResourceModelCollection)); | ||
let TextModelResolverService = class TextModelResolverService extends Disposable { | ||
@@ -485,8 +486,8 @@ constructor(instantiationService, fileService, undoRedoService, modelService, uriIdentityService) { | ||
this.resourceModelCollection = this.instantiationService.createInstance(ResourceModelCollection); | ||
this.asyncModelCollection = ( (new AsyncReferenceCollection(this.resourceModelCollection))); | ||
this._register(( (new ModelUndoRedoParticipant(this.modelService, this, this.undoRedoService)))); | ||
this.asyncModelCollection = ( new AsyncReferenceCollection(this.resourceModelCollection)); | ||
this._register(( new ModelUndoRedoParticipant(this.modelService, this, this.undoRedoService))); | ||
} | ||
async createModelReference(resource) { | ||
resource = this.uriIdentityService.asCanonicalUri(resource); | ||
return await this.asyncModelCollection.acquire(( (resource.toString()))); | ||
return await this.asyncModelCollection.acquire(( resource.toString())); | ||
} | ||
@@ -503,9 +504,9 @@ registerTextModelContentProvider(scheme, provider) { | ||
}; | ||
TextModelResolverService = ( (__decorate([ | ||
( (__param(0, IInstantiationService))), | ||
( (__param(1, IFileService))), | ||
( (__param(2, IUndoRedoService))), | ||
( (__param(3, IModelService))), | ||
( (__param(4, IUriIdentityService))) | ||
], TextModelResolverService))); | ||
TextModelResolverService = ( __decorate([ | ||
( __param(0, IInstantiationService)), | ||
( __param(1, IFileService)), | ||
( __param(2, IUndoRedoService)), | ||
( __param(3, IModelService)), | ||
( __param(4, IUriIdentityService)) | ||
], TextModelResolverService)); | ||
function applyTextEditorOptions(options, editor, scrollType) { | ||
@@ -623,9 +624,9 @@ let applied = false; | ||
}; | ||
CodeEditorService = ( (__decorate([ | ||
( (__param(0, IEditorService))), | ||
( (__param(1, IThemeService))), | ||
( (__param(2, IConfigurationService))) | ||
], CodeEditorService))); | ||
const DEFAULT_EDITOR_MIN_DIMENSIONS = ( (new Dimension(220, 70))); | ||
const DEFAULT_EDITOR_MAX_DIMENSIONS = ( (new Dimension(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY))); | ||
CodeEditorService = ( __decorate([ | ||
( __param(0, IEditorService)), | ||
( __param(1, IThemeService)), | ||
( __param(2, IConfigurationService)) | ||
], CodeEditorService)); | ||
const DEFAULT_EDITOR_MIN_DIMENSIONS = ( new Dimension(220, 70)); | ||
const DEFAULT_EDITOR_MAX_DIMENSIONS = ( new Dimension(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY)); | ||
class SimpleEditorPane { | ||
@@ -721,5 +722,5 @@ constructor(editor) { | ||
}; | ||
EditorService = ( __decorate([ | ||
( __param(1, ITextModelService)) | ||
], EditorService)); | ||
EditorService = __decorate([ | ||
__param(1, ITextModelService) | ||
], EditorService); | ||
let CustomTextModelResolverService = class CustomTextModelResolverService extends TextModelResolverService { | ||
@@ -743,16 +744,16 @@ constructor(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService) { | ||
}; | ||
CustomTextModelResolverService = ( __decorate([ | ||
( __param(0, IInstantiationService)), | ||
( __param(1, IFileService)), | ||
( __param(2, IUndoRedoService)), | ||
( __param(3, IModelService)), | ||
( __param(4, IUriIdentityService)) | ||
], CustomTextModelResolverService)); | ||
CustomTextModelResolverService = __decorate([ | ||
__param(0, IInstantiationService), | ||
__param(1, IFileService), | ||
__param(2, IUndoRedoService), | ||
__param(3, IModelService), | ||
__param(4, IUriIdentityService) | ||
], CustomTextModelResolverService); | ||
function getServiceOverride(openEditor) { | ||
return { | ||
[( ITextModelService.toString())]: new SyncDescriptor(CustomTextModelResolverService), | ||
[( ICodeEditorService.toString())]: new SyncDescriptor(CodeEditorService), | ||
[( IEditorService.toString())]: new SyncDescriptor(EditorService, [openEditor]) | ||
[ITextModelService.toString()]: new SyncDescriptor(CustomTextModelResolverService), | ||
[ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService), | ||
[IEditorService.toString()]: new SyncDescriptor(EditorService, [openEditor]) | ||
}; | ||
} | ||
export { getServiceOverride as default }; |
@@ -1,3 +0,4 @@ | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
export { C as ContextKeyExprType } from './contextkey.js'; | ||
import './polyfill.js'; | ||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js'; | ||
@@ -15,3 +16,3 @@ export { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js'; | ||
import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js'; | ||
import { StandaloneDiffEditor, StandaloneEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js'; | ||
import { StandaloneEditor, StandaloneDiffEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js'; | ||
import { isObject } from 'monaco-editor/esm/vs/base/common/types.js'; | ||
@@ -79,3 +80,3 @@ import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js'; | ||
} | ||
const targetKeys = ( (Object.keys(target))); | ||
const targetKeys = ( Object.keys(target)); | ||
targetKeys.forEach(k => { | ||
@@ -124,3 +125,3 @@ const baseValue = base[k]; | ||
static validateOptions(options) { | ||
const result = ( (new ValidatedEditorOptions())); | ||
const result = ( new ValidatedEditorOptions()); | ||
for (const editorOption of editorOptionsRegistry) { | ||
@@ -133,3 +134,3 @@ const value = (editorOption.name === '_never_' ? undefined : options[editorOption.name]); | ||
static computeOptions(options, env) { | ||
const result = ( (new ComputedEditorOptions())); | ||
const result = ( new ComputedEditorOptions()); | ||
for (const editorOption of editorOptionsRegistry) { | ||
@@ -147,3 +148,3 @@ result._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id))); | ||
} | ||
if (( (Object.keys(a))).length !== ( (Object.keys(b))).length) { | ||
if (( Object.keys(a)).length !== ( Object.keys(b)).length) { | ||
return false; | ||
@@ -168,3 +169,3 @@ } | ||
} | ||
return (somethingChanged ? (new ConfigurationChangedEvent(result)) : null); | ||
return (somethingChanged ? ( new ConfigurationChangedEvent(result)) : null); | ||
} | ||
@@ -219,3 +220,3 @@ static applyUpdate(options, update) { | ||
} | ||
if (( Object.keys(editorSettingsToApply)).length > 0) { | ||
if (Object.keys(editorSettingsToApply).length > 0) { | ||
this.lastAppliedEditorOptions = editorConfiguration; | ||
@@ -233,6 +234,6 @@ super.updateOptions(editorSettingsToApply); | ||
}; | ||
ConfiguredStandaloneEditor = ( __decorate([ | ||
( __param(3, IInstantiationService)), | ||
( __param(4, ITextResourceConfigurationService)) | ||
], ConfiguredStandaloneEditor)); | ||
ConfiguredStandaloneEditor = __decorate([ | ||
__param(3, IInstantiationService), | ||
__param(4, ITextResourceConfigurationService) | ||
], ConfiguredStandaloneEditor); | ||
class ConfiguredStandaloneDiffEditor extends StandaloneDiffEditor { | ||
@@ -255,3 +256,3 @@ _createInnerEditor(instantiationService, container, options) { | ||
}; | ||
const registry = ( Registry.as(Extensions.JSONContribution)); | ||
const registry = Registry.as(Extensions.JSONContribution); | ||
function getJsonSchemas(fileMatchs = {}) { | ||
@@ -258,0 +259,0 @@ return Object.entries(registry.getSchemaContributions().schemas) |
@@ -1,2 +0,2 @@ | ||
export { f as IEditorGroupsService, c as IEditorService, I as IFileService, l as IHostService, k as ILanguageStatusService, d as IPaneCompositePartService, i as IPathService, j as IProductService, m as ISnippetsService, e as ITextFileService, b as IUriIdentityService, g as IWorkbenchEnvironmentService, h as IWorkingCopyFileService, S as Services } from './services2.js'; | ||
export { j as IEditorGroupsService, i as IEditorService, d as IFileService, o as IHostService, n as ILanguageStatusService, k as IPaneCompositePartService, h as IPathService, l as IProductService, t as ISnippetsService, I as ITextFileService, f as IUriIdentityService, e as IWorkbenchEnvironmentService, g as IWorkingCopyFileService, S as Services } from './services2.js'; | ||
export { C as ContextKeyExprType, f as NotificationsFilter } from './contextkey.js'; | ||
@@ -3,0 +3,0 @@ export { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js'; |
@@ -1,6 +0,258 @@ | ||
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js'; | ||
import { createDecorator, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js'; | ||
import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js'; | ||
import { b as __decorate, d as __param, i as insert } from './contextkey.js'; | ||
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js'; | ||
import { isWindows, OS } from 'monaco-editor/esm/vs/base/common/platform.js'; | ||
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js'; | ||
import { basename } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
import { win32, posix } from 'monaco-editor/esm/vs/base/common/path.js'; | ||
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js'; | ||
import { DisposableStore, SafeDisposable, Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
import { LinkedList } from 'monaco-editor/esm/vs/base/common/linkedList.js'; | ||
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js'; | ||
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js'; | ||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js'; | ||
import { localize } from 'monaco-editor/esm/vs/nls.js'; | ||
import { raceCancellation, Promises } from 'monaco-editor/esm/vs/base/common/async.js'; | ||
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js'; | ||
import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/map.js'; | ||
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js'; | ||
import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js'; | ||
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js'; | ||
import 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js'; | ||
import 'monaco-editor/esm/vs/platform/commands/common/commands.js'; | ||
import 'monaco-editor/esm/vs/platform/notification/common/notification.js'; | ||
import 'monaco-editor/esm/vs/editor/browser/services/bulkEditService.js'; | ||
import 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js'; | ||
import 'monaco-editor/esm/vs/editor/common/languages/language.js'; | ||
import 'monaco-editor/esm/vs/editor/common/languages/languageConfigurationRegistry.js'; | ||
import 'monaco-editor/esm/vs/editor/common/services/editorWorker.js'; | ||
import 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js'; | ||
import 'monaco-editor/esm/vs/editor/common/services/model.js'; | ||
import 'monaco-editor/esm/vs/editor/common/services/resolverService.js'; | ||
import 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js'; | ||
import 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js'; | ||
import 'monaco-editor/esm/vs/platform/markers/common/markers.js'; | ||
import 'monaco-editor/esm/vs/platform/opener/common/opener.js'; | ||
import 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js'; | ||
import 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js'; | ||
import 'monaco-editor/esm/vs/platform/theme/common/themeService.js'; | ||
import 'monaco-editor/esm/vs/base/common/severity.js'; | ||
class EventProfiling { | ||
constructor(name) { | ||
this._listenerCount = 0; | ||
this._invocationCount = 0; | ||
this._elapsedOverall = 0; | ||
this._name = `${name}_${EventProfiling._idPool++}`; | ||
} | ||
start(listenerCount) { | ||
this._stopWatch = ( new StopWatch(true)); | ||
this._listenerCount = listenerCount; | ||
} | ||
stop() { | ||
if (this._stopWatch) { | ||
const elapsed = this._stopWatch.elapsed(); | ||
this._elapsedOverall += elapsed; | ||
this._invocationCount += 1; | ||
console.info(`did FIRE ${this._name}: elapsed_ms: ${elapsed.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`); | ||
this._stopWatch = undefined; | ||
} | ||
} | ||
} | ||
EventProfiling._idPool = 0; | ||
class Stacktrace { | ||
constructor(value) { | ||
this.value = value; | ||
} | ||
static create() { | ||
return ( new Stacktrace(( new Error()).stack ?? '')); | ||
} | ||
print() { | ||
console.warn(this.value.split('\n').slice(2).join('\n')); | ||
} | ||
} | ||
class Listener { | ||
constructor(callback, callbackThis, stack) { | ||
this.callback = callback; | ||
this.callbackThis = callbackThis; | ||
this.stack = stack; | ||
this.subscription = ( new SafeDisposable()); | ||
} | ||
invoke(e) { | ||
this.callback.call(this.callbackThis, e); | ||
} | ||
} | ||
class Emitter { | ||
constructor(options) { | ||
this._disposed = false; | ||
this._options = options; | ||
this._leakageMon = undefined; | ||
this._perfMon = this._options?._profName ? ( new EventProfiling(this._options._profName)) : undefined; | ||
this._deliveryQueue = this._options?.deliveryQueue; | ||
} | ||
dispose() { | ||
if (!this._disposed) { | ||
this._disposed = true; | ||
if (this._listeners) { | ||
this._listeners.clear(); | ||
} | ||
this._deliveryQueue?.clear(this); | ||
this._options?.onLastListenerRemove?.(); | ||
this._leakageMon?.dispose(); | ||
} | ||
} | ||
get event() { | ||
if (!this._event) { | ||
this._event = (callback, thisArgs, disposables) => { | ||
if (!this._listeners) { | ||
this._listeners = ( new LinkedList()); | ||
} | ||
const firstListener = this._listeners.isEmpty(); | ||
if (firstListener && this._options?.onFirstListenerAdd) { | ||
this._options.onFirstListenerAdd(this); | ||
} | ||
let removeMonitor; | ||
let stack; | ||
if (this._leakageMon && this._listeners.size >= 30) { | ||
stack = Stacktrace.create(); | ||
removeMonitor = this._leakageMon.check(stack, this._listeners.size + 1); | ||
} | ||
const listener = ( new Listener(callback, thisArgs, stack)); | ||
const removeListener = this._listeners.push(listener); | ||
if (firstListener && this._options?.onFirstListenerDidAdd) { | ||
this._options.onFirstListenerDidAdd(this); | ||
} | ||
if (this._options?.onListenerDidAdd) { | ||
this._options.onListenerDidAdd(this, callback, thisArgs); | ||
} | ||
const result = listener.subscription.set(() => { | ||
removeMonitor?.(); | ||
if (!this._disposed) { | ||
removeListener(); | ||
if (this._options && this._options.onLastListenerRemove) { | ||
const hasListeners = (this._listeners && !this._listeners.isEmpty()); | ||
if (!hasListeners) { | ||
this._options.onLastListenerRemove(this); | ||
} | ||
} | ||
} | ||
}); | ||
if (disposables instanceof DisposableStore) { | ||
disposables.add(result); | ||
} | ||
else if (Array.isArray(disposables)) { | ||
disposables.push(result); | ||
} | ||
return result; | ||
}; | ||
} | ||
return this._event; | ||
} | ||
fire(event) { | ||
if (this._listeners) { | ||
if (!this._deliveryQueue) { | ||
this._deliveryQueue = ( new PrivateEventDeliveryQueue()); | ||
} | ||
for (const listener of this._listeners) { | ||
this._deliveryQueue.push(this, listener, event); | ||
} | ||
this._perfMon?.start(this._deliveryQueue.size); | ||
this._deliveryQueue.deliver(); | ||
this._perfMon?.stop(); | ||
} | ||
} | ||
hasListeners() { | ||
if (!this._listeners) { | ||
return false; | ||
} | ||
return (!this._listeners.isEmpty()); | ||
} | ||
} | ||
class EventDeliveryQueue { | ||
constructor() { | ||
this._queue = ( new LinkedList()); | ||
} | ||
get size() { | ||
return this._queue.size; | ||
} | ||
push(emitter, listener, event) { | ||
this._queue.push(( new EventDeliveryQueueElement(emitter, listener, event))); | ||
} | ||
clear(emitter) { | ||
const newQueue = ( new LinkedList()); | ||
for (const element of this._queue) { | ||
if (element.emitter !== emitter) { | ||
newQueue.push(element); | ||
} | ||
} | ||
this._queue = newQueue; | ||
} | ||
deliver() { | ||
while (this._queue.size > 0) { | ||
const element = this._queue.shift(); | ||
try { | ||
element.listener.invoke(element.event); | ||
} | ||
catch (e) { | ||
onUnexpectedError(e); | ||
} | ||
} | ||
} | ||
} | ||
class PrivateEventDeliveryQueue extends EventDeliveryQueue { | ||
clear(emitter) { | ||
this._queue.clear(); | ||
} | ||
} | ||
class EventDeliveryQueueElement { | ||
constructor(emitter, listener, event) { | ||
this.emitter = emitter; | ||
this.listener = listener; | ||
this.event = event; | ||
} | ||
} | ||
class AsyncEmitter extends Emitter { | ||
async fireAsync(data, token, promiseJoin) { | ||
if (!this._listeners) { | ||
return; | ||
} | ||
if (!this._asyncDeliveryQueue) { | ||
this._asyncDeliveryQueue = ( new LinkedList()); | ||
} | ||
for (const listener of this._listeners) { | ||
this._asyncDeliveryQueue.push([listener, data]); | ||
} | ||
while (this._asyncDeliveryQueue.size > 0 && !token.isCancellationRequested) { | ||
const [listener, data] = this._asyncDeliveryQueue.shift(); | ||
const thenables = []; | ||
const event = { | ||
...data, | ||
token, | ||
waitUntil: (p) => { | ||
if (Object.isFrozen(thenables)) { | ||
throw new Error('waitUntil can NOT be called asynchronous'); | ||
} | ||
if (promiseJoin) { | ||
p = promiseJoin(p, listener.callback); | ||
} | ||
thenables.push(p); | ||
} | ||
}; | ||
try { | ||
listener.invoke(event); | ||
} | ||
catch (e) { | ||
onUnexpectedError(e); | ||
continue; | ||
} | ||
await Promise.allSettled(thenables).then(values => { | ||
for (const value of values) { | ||
if (value.status === 'rejected') { | ||
onUnexpectedError(value.reason); | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
function refineServiceDecorator(serviceIdentifier) { | ||
@@ -10,5 +262,34 @@ return serviceIdentifier; | ||
const CancellationTokenSource = monaco.CancellationTokenSource; | ||
const IFileService = ( (createDecorator('fileService'))); | ||
const WINDOWS_INVALID_FILE_CHARS = /[\\/:\*\?"<>\|]/g; | ||
const UNIX_INVALID_FILE_CHARS = /[\\/]/g; | ||
const WINDOWS_FORBIDDEN_NAMES = /^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i; | ||
function isValidBasename(name, isWindowsOS = isWindows) { | ||
const invalidFileChars = isWindowsOS ? WINDOWS_INVALID_FILE_CHARS : UNIX_INVALID_FILE_CHARS; | ||
if (!name || name.length === 0 || /^\s+$/.test(name)) { | ||
return false; | ||
} | ||
invalidFileChars.lastIndex = 0; | ||
if (invalidFileChars.test(name)) { | ||
return false; | ||
} | ||
if (isWindowsOS && WINDOWS_FORBIDDEN_NAMES.test(name)) { | ||
return false; | ||
} | ||
if (name === '.' || name === '..') { | ||
return false; | ||
} | ||
if (isWindowsOS && name[name.length - 1] === '.') { | ||
return false; | ||
} | ||
if (isWindowsOS && name.length !== name.trim().length) { | ||
return false; | ||
} | ||
if (name.length > 255) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
const IFileService = ( createDecorator('fileService')); | ||
var FileType; | ||
( ((function(FileType) { | ||
( (function(FileType) { | ||
FileType[FileType["Unknown"] = 0] = "Unknown"; | ||
@@ -18,7 +299,7 @@ FileType[FileType["File"] = 1] = "File"; | ||
FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink"; | ||
})(FileType || (FileType = {})))); | ||
})(FileType || (FileType = {}))); | ||
var FilePermission; | ||
( ((function(FilePermission) { | ||
( (function(FilePermission) { | ||
FilePermission[FilePermission["Readonly"] = 1] = "Readonly"; | ||
})(FilePermission || (FilePermission = {})))); | ||
})(FilePermission || (FilePermission = {}))); | ||
function hasReadWriteCapability(provider) { | ||
@@ -46,3 +327,3 @@ return !!((provider.capabilities & 2) ); | ||
var FileSystemProviderErrorCode; | ||
( ((function(FileSystemProviderErrorCode) { | ||
( (function(FileSystemProviderErrorCode) { | ||
FileSystemProviderErrorCode["FileExists"] = "EntryExists"; | ||
@@ -58,3 +339,3 @@ FileSystemProviderErrorCode["FileNotFound"] = "EntryNotFound"; | ||
FileSystemProviderErrorCode["Unknown"] = "Unknown"; | ||
})(FileSystemProviderErrorCode || (FileSystemProviderErrorCode = {})))); | ||
})(FileSystemProviderErrorCode || (FileSystemProviderErrorCode = {}))); | ||
class FileSystemProviderError extends Error { | ||
@@ -67,3 +348,3 @@ constructor(message, code) { | ||
function createFileSystemProviderError(error, code) { | ||
const providerError = ( (new FileSystemProviderError( (error.toString()), code))); | ||
const providerError = ( new FileSystemProviderError(( error.toString()), code)); | ||
markAsFileSystemProviderError(providerError, code); | ||
@@ -74,3 +355,3 @@ return providerError; | ||
if (!error) { | ||
return createFileSystemProviderError(( (localize('unknownError', "Unknown Error"))), FileSystemProviderErrorCode.Unknown); | ||
return createFileSystemProviderError(( localize('unknownError', "Unknown Error")), FileSystemProviderErrorCode.Unknown); | ||
} | ||
@@ -152,3 +433,3 @@ return error; | ||
this.rawChanges = changes; | ||
const entriesByType = ( (new Map())); | ||
const entriesByType = ( new Map()); | ||
for (const change of changes) { | ||
@@ -257,6 +538,6 @@ const array = entriesByType.get(change.type); | ||
} | ||
return ( (stat.mtime.toString(29))) + ( (stat.size.toString(31))); | ||
return ( stat.mtime.toString(29)) + ( stat.size.toString(31)); | ||
} | ||
const IUriIdentityService = ( (createDecorator('IUriIdentityService'))); | ||
const IEditorGroupsService = ( (createDecorator('editorGroupsService'))); | ||
const IUriIdentityService = ( createDecorator('IUriIdentityService')); | ||
const IEditorGroupsService = ( createDecorator('editorGroupsService')); | ||
function isEditorGroup(obj) { | ||
@@ -266,3 +547,3 @@ const group = obj; | ||
} | ||
const IEditorService = ( (createDecorator('editorService'))); | ||
const IEditorService = ( createDecorator('editorService')); | ||
const ACTIVE_GROUP = -1; | ||
@@ -274,15 +555,367 @@ const SIDE_GROUP = -2; | ||
} | ||
const ITextFileService = ( (createDecorator('textFileService'))); | ||
const ITextFileService = ( createDecorator('textFileService')); | ||
const IWorkbenchEnvironmentService = refineServiceDecorator(IEnvironmentService); | ||
const IWorkingCopyFileService = ( (createDecorator('workingCopyFileService'))); | ||
const IPathService = ( (createDecorator('pathService'))); | ||
const IPaneCompositePartService = ( (createDecorator('paneCompositePartService'))); | ||
const IProductService = ( (createDecorator('productService'))); | ||
const IWorkingCopyService = ( createDecorator('workingCopyService')); | ||
let WorkingCopyFileOperationParticipant = class WorkingCopyFileOperationParticipant extends Disposable { | ||
constructor(logService, configurationService) { | ||
super(); | ||
this.logService = logService; | ||
this.configurationService = configurationService; | ||
this.participants = ( new LinkedList()); | ||
} | ||
addFileOperationParticipant(participant) { | ||
const remove = this.participants.push(participant); | ||
return toDisposable(() => remove()); | ||
} | ||
async participate(files, operation, undoInfo, token) { | ||
const timeout = this.configurationService.getValue('files.participants.timeout'); | ||
if (typeof timeout !== 'number' || timeout <= 0) { | ||
return; | ||
} | ||
for (const participant of this.participants) { | ||
try { | ||
await participant.participate(files, operation, undoInfo, timeout, token); | ||
} | ||
catch (err) { | ||
this.logService.warn(err); | ||
} | ||
} | ||
} | ||
dispose() { | ||
this.participants.clear(); | ||
} | ||
}; | ||
WorkingCopyFileOperationParticipant = ( __decorate([ | ||
( __param(0, ILogService)), | ||
( __param(1, IConfigurationService)) | ||
], WorkingCopyFileOperationParticipant)); | ||
let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySaveParticipant extends Disposable { | ||
constructor(progressService, logService) { | ||
super(); | ||
this.progressService = progressService; | ||
this.logService = logService; | ||
this.saveParticipants = []; | ||
} | ||
get length() { return this.saveParticipants.length; } | ||
addSaveParticipant(participant) { | ||
const remove = insert(this.saveParticipants, participant); | ||
return toDisposable(() => remove()); | ||
} | ||
participate(workingCopy, context, token) { | ||
const cts = ( new CancellationTokenSource(token)); | ||
return this.progressService.withProgress({ | ||
title: ( localize('saveParticipants', "Saving '{0}'", workingCopy.name)), | ||
location: 15 , | ||
cancellable: true, | ||
delay: workingCopy.isDirty() ? 3000 : 5000 | ||
}, async (progress) => { | ||
workingCopy.model?.pushStackElement(); | ||
for (const saveParticipant of this.saveParticipants) { | ||
if (cts.token.isCancellationRequested || workingCopy.isDisposed()) { | ||
break; | ||
} | ||
try { | ||
const promise = saveParticipant.participate(workingCopy, context, progress, cts.token); | ||
await raceCancellation(promise, cts.token); | ||
} | ||
catch (err) { | ||
this.logService.warn(err); | ||
} | ||
} | ||
workingCopy.model?.pushStackElement(); | ||
}, () => { | ||
cts.dispose(true); | ||
}); | ||
} | ||
dispose() { | ||
this.saveParticipants.splice(0, this.saveParticipants.length); | ||
} | ||
}; | ||
StoredFileWorkingCopySaveParticipant = ( __decorate([ | ||
( __param(0, IProgressService)), | ||
( __param(1, ILogService)) | ||
], StoredFileWorkingCopySaveParticipant)); | ||
const IWorkingCopyFileService = ( createDecorator('workingCopyFileService')); | ||
let WorkingCopyFileService = class WorkingCopyFileService extends Disposable { | ||
constructor(fileService, workingCopyService, instantiationService, uriIdentityService) { | ||
super(); | ||
this.fileService = fileService; | ||
this.workingCopyService = workingCopyService; | ||
this.instantiationService = instantiationService; | ||
this.uriIdentityService = uriIdentityService; | ||
this._onWillRunWorkingCopyFileOperation = this._register(( new AsyncEmitter())); | ||
this.onWillRunWorkingCopyFileOperation = this._onWillRunWorkingCopyFileOperation.event; | ||
this._onDidFailWorkingCopyFileOperation = this._register(( new AsyncEmitter())); | ||
this.onDidFailWorkingCopyFileOperation = this._onDidFailWorkingCopyFileOperation.event; | ||
this._onDidRunWorkingCopyFileOperation = this._register(( new AsyncEmitter())); | ||
this.onDidRunWorkingCopyFileOperation = this._onDidRunWorkingCopyFileOperation.event; | ||
this.correlationIds = 0; | ||
this.fileOperationParticipants = this._register(this.instantiationService.createInstance(WorkingCopyFileOperationParticipant)); | ||
this.saveParticipants = this._register(this.instantiationService.createInstance(StoredFileWorkingCopySaveParticipant)); | ||
this.workingCopyProviders = []; | ||
this._register(this.registerWorkingCopyProvider(resource => { | ||
return this.workingCopyService.workingCopies.filter(workingCopy => { | ||
if (this.fileService.hasProvider(resource)) { | ||
return this.uriIdentityService.extUri.isEqualOrParent(workingCopy.resource, resource); | ||
} | ||
return this.uriIdentityService.extUri.isEqual(workingCopy.resource, resource); | ||
}); | ||
})); | ||
} | ||
create(operations, token, undoInfo) { | ||
return this.doCreateFileOrFolder(operations, true, token, undoInfo); | ||
} | ||
createFolder(operations, token, undoInfo) { | ||
return this.doCreateFileOrFolder(operations, false, token, undoInfo); | ||
} | ||
async doCreateFileOrFolder(operations, isFile, token, undoInfo) { | ||
if (operations.length === 0) { | ||
return []; | ||
} | ||
if (isFile) { | ||
const validateCreates = await Promises.settled(operations.map(operation => this.fileService.canCreateFile(operation.resource, { overwrite: operation.overwrite }))); | ||
const error = validateCreates.find(validateCreate => validateCreate instanceof Error); | ||
if (error instanceof Error) { | ||
throw error; | ||
} | ||
} | ||
const files = operations.map(operation => ({ target: operation.resource })); | ||
await this.runFileOperationParticipants(files, 0 , undoInfo, token); | ||
const event = { correlationId: this.correlationIds++, operation: 0 , files }; | ||
await this._onWillRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
let stats; | ||
try { | ||
if (isFile) { | ||
stats = await Promises.settled(operations.map(operation => this.fileService.createFile(operation.resource, operation.contents, { overwrite: operation.overwrite }))); | ||
} | ||
else { | ||
stats = await Promises.settled(operations.map(operation => this.fileService.createFolder(operation.resource))); | ||
} | ||
} | ||
catch (error) { | ||
await this._onDidFailWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
throw error; | ||
} | ||
await this._onDidRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
return stats; | ||
} | ||
async move(operations, token, undoInfo) { | ||
return this.doMoveOrCopy(operations, true, token, undoInfo); | ||
} | ||
async copy(operations, token, undoInfo) { | ||
return this.doMoveOrCopy(operations, false, token, undoInfo); | ||
} | ||
async doMoveOrCopy(operations, move, token, undoInfo) { | ||
const stats = []; | ||
for (const { file: { source, target }, overwrite } of operations) { | ||
const validateMoveOrCopy = await (move ? this.fileService.canMove(source, target, overwrite) : this.fileService.canCopy(source, target, overwrite)); | ||
if (validateMoveOrCopy instanceof Error) { | ||
throw validateMoveOrCopy; | ||
} | ||
} | ||
const files = operations.map(o => o.file); | ||
await this.runFileOperationParticipants(files, move ? 2 : 3 , undoInfo, token); | ||
const event = { correlationId: this.correlationIds++, operation: move ? 2 : 3 , files }; | ||
await this._onWillRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
try { | ||
for (const { file: { source, target }, overwrite } of operations) { | ||
if (!this.uriIdentityService.extUri.isEqual(source, target)) { | ||
const dirtyWorkingCopies = (move ? [...this.getDirty(source), ...this.getDirty(target)] : this.getDirty(target)); | ||
await Promises.settled(dirtyWorkingCopies.map(dirtyWorkingCopy => dirtyWorkingCopy.revert({ soft: true }))); | ||
} | ||
if (move) { | ||
stats.push(await this.fileService.move(source, target, overwrite)); | ||
} | ||
else { | ||
stats.push(await this.fileService.copy(source, target, overwrite)); | ||
} | ||
} | ||
} | ||
catch (error) { | ||
await this._onDidFailWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
throw error; | ||
} | ||
await this._onDidRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
return stats; | ||
} | ||
async delete(operations, token, undoInfo) { | ||
for (const operation of operations) { | ||
const validateDelete = await this.fileService.canDelete(operation.resource, { recursive: operation.recursive, useTrash: operation.useTrash }); | ||
if (validateDelete instanceof Error) { | ||
throw validateDelete; | ||
} | ||
} | ||
const files = operations.map(operation => ({ target: operation.resource })); | ||
await this.runFileOperationParticipants(files, 1 , undoInfo, token); | ||
const event = { correlationId: this.correlationIds++, operation: 1 , files }; | ||
await this._onWillRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
for (const operation of operations) { | ||
const dirtyWorkingCopies = this.getDirty(operation.resource); | ||
await Promises.settled(dirtyWorkingCopies.map(dirtyWorkingCopy => dirtyWorkingCopy.revert({ soft: true }))); | ||
} | ||
try { | ||
for (const operation of operations) { | ||
await this.fileService.del(operation.resource, { recursive: operation.recursive, useTrash: operation.useTrash }); | ||
} | ||
} | ||
catch (error) { | ||
await this._onDidFailWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
throw error; | ||
} | ||
await this._onDidRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None ); | ||
} | ||
addFileOperationParticipant(participant) { | ||
return this.fileOperationParticipants.addFileOperationParticipant(participant); | ||
} | ||
runFileOperationParticipants(files, operation, undoInfo, token) { | ||
return this.fileOperationParticipants.participate(files, operation, undoInfo, token); | ||
} | ||
get hasSaveParticipants() { return this.saveParticipants.length > 0; } | ||
addSaveParticipant(participant) { | ||
return this.saveParticipants.addSaveParticipant(participant); | ||
} | ||
runSaveParticipants(workingCopy, context, token) { | ||
return this.saveParticipants.participate(workingCopy, context, token); | ||
} | ||
registerWorkingCopyProvider(provider) { | ||
const remove = insert(this.workingCopyProviders, provider); | ||
return toDisposable(remove); | ||
} | ||
getDirty(resource) { | ||
const dirtyWorkingCopies = ( new Set()); | ||
for (const provider of this.workingCopyProviders) { | ||
for (const workingCopy of provider(resource)) { | ||
if (workingCopy.isDirty()) { | ||
dirtyWorkingCopies.add(workingCopy); | ||
} | ||
} | ||
} | ||
return Array.from(dirtyWorkingCopies); | ||
} | ||
}; | ||
WorkingCopyFileService = ( __decorate([ | ||
( __param(0, IFileService)), | ||
( __param(1, IWorkingCopyService)), | ||
( __param(2, IInstantiationService)), | ||
( __param(3, IUriIdentityService)) | ||
], WorkingCopyFileService)); | ||
function isVirtualResource(resource) { | ||
return resource.scheme !== Schemas.file && resource.scheme !== Schemas.vscodeRemote; | ||
} | ||
function getVirtualWorkspaceLocation(workspace) { | ||
if (workspace.folders.length) { | ||
return workspace.folders.every(f => isVirtualResource(f.uri)) ? workspace.folders[0].uri : undefined; | ||
} | ||
else if (workspace.configuration && isVirtualResource(workspace.configuration)) { | ||
return workspace.configuration; | ||
} | ||
return undefined; | ||
} | ||
function getVirtualWorkspaceScheme(workspace) { | ||
return getVirtualWorkspaceLocation(workspace)?.scheme; | ||
} | ||
const IRemoteAgentService = ( createDecorator('remoteAgentService')); | ||
const IPathService = ( createDecorator('pathService')); | ||
let AbstractPathService = class AbstractPathService { | ||
constructor(localUserHome, remoteAgentService, environmentService, contextService) { | ||
this.localUserHome = localUserHome; | ||
this.remoteAgentService = remoteAgentService; | ||
this.environmentService = environmentService; | ||
this.contextService = contextService; | ||
this.resolveOS = (async () => { | ||
const env = await this.remoteAgentService.getEnvironment(); | ||
return env?.os || OS; | ||
})(); | ||
this.resolveUserHome = (async () => { | ||
const env = await this.remoteAgentService.getEnvironment(); | ||
const userHome = this.maybeUnresolvedUserHome = env?.userHome ?? localUserHome; | ||
return userHome; | ||
})(); | ||
} | ||
hasValidBasename(resource, arg2, basename) { | ||
if (typeof arg2 === 'string' || typeof arg2 === 'undefined') { | ||
return this.resolveOS.then(os => this.doHasValidBasename(resource, os, arg2)); | ||
} | ||
return this.doHasValidBasename(resource, arg2, basename); | ||
} | ||
doHasValidBasename(resource, os, name) { | ||
if (resource.scheme === Schemas.file || resource.scheme === Schemas.vscodeRemote) { | ||
return isValidBasename(name ?? basename(resource), os === 1 ); | ||
} | ||
return true; | ||
} | ||
get defaultUriScheme() { | ||
return AbstractPathService.findDefaultUriScheme(this.environmentService, this.contextService); | ||
} | ||
static findDefaultUriScheme(environmentService, contextService) { | ||
if (environmentService.remoteAuthority) { | ||
return Schemas.vscodeRemote; | ||
} | ||
const virtualWorkspace = getVirtualWorkspaceScheme(contextService.getWorkspace()); | ||
if (virtualWorkspace) { | ||
return virtualWorkspace; | ||
} | ||
const firstFolder = contextService.getWorkspace().folders[0]; | ||
if (firstFolder) { | ||
return firstFolder.uri.scheme; | ||
} | ||
const configuration = contextService.getWorkspace().configuration; | ||
if (configuration) { | ||
return configuration.scheme; | ||
} | ||
return Schemas.file; | ||
} | ||
userHome(options) { | ||
return options?.preferLocal ? this.localUserHome : this.resolveUserHome; | ||
} | ||
get resolvedUserHome() { | ||
return this.maybeUnresolvedUserHome; | ||
} | ||
get path() { | ||
return this.resolveOS.then(os => { | ||
return os === 1 ? | ||
win32 : | ||
posix; | ||
}); | ||
} | ||
async fileURI(_path) { | ||
let authority = ''; | ||
const os = await this.resolveOS; | ||
if (os === 1 ) { | ||
_path = _path.replace(/\\/g, '/'); | ||
} | ||
if (_path[0] === '/' && _path[1] === '/') { | ||
const idx = _path.indexOf('/', 2); | ||
if (idx === -1) { | ||
authority = _path.substring(2); | ||
_path = '/'; | ||
} | ||
else { | ||
authority = _path.substring(2, idx); | ||
_path = _path.substring(idx) || '/'; | ||
} | ||
} | ||
return ( URI.from({ | ||
scheme: Schemas.file, | ||
authority, | ||
path: _path, | ||
query: '', | ||
fragment: '' | ||
})); | ||
} | ||
}; | ||
AbstractPathService = ( __decorate([ | ||
( __param(1, IRemoteAgentService)), | ||
( __param(2, IWorkbenchEnvironmentService)), | ||
( __param(3, IWorkspaceContextService)) | ||
], AbstractPathService)); | ||
const IPaneCompositePartService = ( createDecorator('paneCompositePartService')); | ||
const IProductService = ( createDecorator('productService')); | ||
const productSchemaId = 'vscode://schemas/vscode-product'; | ||
const ILanguageStatusService = ( (createDecorator('ILanguageStatusService'))); | ||
const IHostService = ( (createDecorator('hostService'))); | ||
const ISnippetsService = ( (createDecorator('snippetService'))); | ||
const ILanguageStatusService = ( createDecorator('ILanguageStatusService')); | ||
const IHostService = ( createDecorator('hostService')); | ||
const ISnippetsService = ( createDecorator('snippetService')); | ||
let services; | ||
var Services; | ||
( (function(Services) { | ||
(function (Services) { | ||
Services.get = () => { | ||
@@ -305,3 +938,3 @@ return services ?? {}; | ||
Services.install = install; | ||
})(Services || (Services = {}))); | ||
export { ACTIVE_GROUP as A, ensureFileSystemProviderError as B, CancellationTokenSource as C, etag as D, FileOperationEvent as E, FileType as F, toFileOperationResult as G, ETAG_DISABLED as H, IFileService as I, hasFileAtomicReadCapability as J, hasFileFolderCopyCapability as K, hasFileCloneCapability as L, createFileSystemProviderError as M, NotModifiedSinceFileOperationError as N, FILES_ASSOCIATIONS_CONFIG as O, Services as S, FilePermission as a, IUriIdentityService as b, IEditorService as c, IPaneCompositePartService as d, ITextFileService as e, IEditorGroupsService as f, IWorkbenchEnvironmentService as g, IWorkingCopyFileService as h, IPathService as i, IProductService as j, ILanguageStatusService as k, IHostService as l, ISnippetsService as m, markAsFileSystemProviderError as n, FileSystemProviderErrorCode as o, productSchemaId as p, SIDE_GROUP as q, refineServiceDecorator as r, isPreferredGroup as s, FileSystemProviderError as t, FileChangesEvent as u, FileOperationError as v, hasOpenReadWriteCloseCapability as w, hasReadWriteCapability as x, hasFileReadStreamCapability as y, toFileSystemProviderErrorCode as z }; | ||
})(Services || (Services = {})); | ||
export { ACTIVE_GROUP as A, hasReadWriteCapability as B, CancellationTokenSource as C, hasFileReadStreamCapability as D, toFileSystemProviderErrorCode as E, FileType as F, etag as G, FileOperationEvent as H, ITextFileService as I, toFileOperationResult as J, ETAG_DISABLED as K, hasFileAtomicReadCapability as L, hasFileFolderCopyCapability as M, NotModifiedSinceFileOperationError as N, hasFileCloneCapability as O, FILES_ASSOCIATIONS_CONFIG as P, Services as S, FilePermission as a, FileSystemProviderErrorCode as b, SIDE_GROUP as c, IFileService as d, IWorkbenchEnvironmentService as e, IUriIdentityService as f, IWorkingCopyFileService as g, IPathService as h, IEditorService as i, IEditorGroupsService as j, IPaneCompositePartService as k, IProductService as l, markAsFileSystemProviderError as m, ILanguageStatusService as n, IHostService as o, FileOperationError as p, productSchemaId as q, refineServiceDecorator as r, IRemoteAgentService as s, ISnippetsService as t, isPreferredGroup as u, FileSystemProviderError as v, ensureFileSystemProviderError as w, createFileSystemProviderError as x, FileChangesEvent as y, hasOpenReadWriteCloseCapability as z }; |
@@ -1,8 +0,9 @@ | ||
import { F as IUserDataProfileService, b as ILifecycleService, J as ExtensionMessageCollector, K as parse, M as getNodeType, f as ExtensionsRegistry } from './missing-services.js'; | ||
import { m as ISnippetsService, I as IFileService, e as ITextFileService, S as Services } from './services2.js'; | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { p as parse, w as getNodeType } from './polyfill.js'; | ||
import { j as IUserDataProfileService, b as ILifecycleService, E as ExtensionsRegistry, m as ExtensionMessageCollector } from './missing-services.js'; | ||
import { t as ISnippetsService, d as IFileService, I as ITextFileService, S as Services } from './services2.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import * as monacoSuggest from 'monaco-editor/esm/vs/editor/contrib/suggest/browser/suggest.js'; | ||
import { extname as extname$1, basename as basename$1 } from 'monaco-editor/esm/vs/base/common/path.js'; | ||
import { extname, basename } from 'monaco-editor/esm/vs/base/common/path.js'; | ||
import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js'; | ||
import { joinPath, isEqualOrParent, extname, basename, relativePath } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
import { relativePath, isEqualOrParent, extname as extname$1, basename as basename$1, joinPath } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
import { IdleValue } from 'monaco-editor/esm/vs/base/common/async.js'; | ||
@@ -15,3 +16,3 @@ import { isObject } from 'monaco-editor/esm/vs/base/common/types.js'; | ||
import { l as languagesExtPoint } from './languageService.js'; | ||
import { bd as DEFAULT_EXTENSION, bk as Range$2 } from './extHost.js'; | ||
import { bk as Range, D as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js'; | ||
@@ -34,3 +35,3 @@ import { getWordAtText } from 'monaco-editor/esm/vs/editor/common/core/wordHelper.js'; | ||
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js'; | ||
import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js'; | ||
import { g as getExtensionPoint, o as onServicesInitialized, c as consoleExtensionMessageHandler } from './tools.js'; | ||
import { g as getServiceOverride$1 } from './workspaceContext.js'; | ||
@@ -52,4 +53,4 @@ import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js'; | ||
this.codeSnippet = body; | ||
const textmateSnippet = ( (new SnippetParser())).parse(body, false); | ||
const placeholders = ( (new Map())); | ||
const textmateSnippet = ( new SnippetParser()).parse(body, false); | ||
const placeholders = ( new Map()); | ||
let placeholderMax = 0; | ||
@@ -73,3 +74,3 @@ for (const placeholder of textmateSnippet.placeholders) { | ||
placeholders.set(marker.name, index); | ||
const synthetic = ( (new Placeholder(index))).appendChild(( (new Text(marker.name)))); | ||
const synthetic = ( new Placeholder(index)).appendChild(( new Text(marker.name))); | ||
textmateSnippet.replace(marker, [synthetic]); | ||
@@ -110,3 +111,3 @@ this.isBogous = true; | ||
this.prefixLow = prefix.toLowerCase(); | ||
this._bodyInsights = ( (new IdleValue(() => ( (new SnippetBodyInsights(this.body)))))); | ||
this._bodyInsights = ( new IdleValue(() => ( new SnippetBodyInsights(this.body)))); | ||
} | ||
@@ -141,3 +142,3 @@ get codeSnippet() { | ||
this.data = []; | ||
this.isGlobalSnippets = extname$1(location.path) === '.code-snippets'; | ||
this.isGlobalSnippets = extname(location.path) === '.code-snippets'; | ||
this.isUserSnippets = !this._extension; | ||
@@ -154,3 +155,3 @@ } | ||
_filepathSelect(selector, bucket) { | ||
if (selector + '.json' === basename$1(this.location.path)) { | ||
if (selector + '.json' === basename(this.location.path)) { | ||
bucket.push(...this.data); | ||
@@ -185,5 +186,3 @@ } | ||
const content = await this._fileService.readFile(this.location); | ||
return ( | ||
(content.value.toString()) | ||
); | ||
return ( content.value.toString()); | ||
} | ||
@@ -245,14 +244,14 @@ } | ||
else if (this.source === 2 ) { | ||
source = ( (localize('source.workspaceSnippetGlobal', "Workspace Snippet"))); | ||
source = ( localize('source.workspaceSnippetGlobal', "Workspace Snippet")); | ||
} | ||
else { | ||
if (this.isGlobalSnippets) { | ||
source = ( (localize('source.userSnippetGlobal', "Global User Snippet"))); | ||
source = ( localize('source.userSnippetGlobal', "Global User Snippet")); | ||
} | ||
else { | ||
source = ( (localize('source.userSnippet', "User Snippet"))); | ||
source = ( localize('source.userSnippet', "User Snippet")); | ||
} | ||
} | ||
for (const _prefix of Array.isArray(prefix) ? prefix : Iterable.single(prefix)) { | ||
bucket.push(( (new Snippet( | ||
bucket.push(( new Snippet( | ||
Boolean(isFileTemplate), | ||
@@ -266,5 +265,5 @@ scopes, | ||
this.source, | ||
this._extension ? `${relativePath(this._extension.extensionLocation, this.location)}/${name}` : `${basename$1(this.location.path)}/${name}`, | ||
this._extension ? `${relativePath(this._extension.extensionLocation, this.location)}/${name}` : `${basename(this.location.path)}/${name}`, | ||
this._extension?.identifier | ||
)))); | ||
))); | ||
} | ||
@@ -285,3 +284,3 @@ } | ||
this.label = { label: snippet.prefix, description: snippet.name }; | ||
this.detail = ( (localize( | ||
this.detail = ( localize( | ||
'detail.snippet', | ||
@@ -291,3 +290,3 @@ "{0} ({1})", | ||
snippet.source | ||
))); | ||
)); | ||
this.insertText = snippet.codeSnippet; | ||
@@ -302,3 +301,3 @@ this.extensionId = snippet.extensionId; | ||
resolve() { | ||
this.documentation = ( (new MarkdownString())).appendCodeblock('', ( (new SnippetParser())).text(this.snippet.codeSnippet)); | ||
this.documentation = ( new MarkdownString()).appendCodeblock('', ( new SnippetParser()).text(this.snippet.codeSnippet)); | ||
return this; | ||
@@ -318,6 +317,6 @@ } | ||
async provideCompletionItems(model, position, context) { | ||
const sw = ( (new StopWatch(true))); | ||
const sw = ( new StopWatch(true)); | ||
const languageId = this._getLanguageIdAtPosition(model, position); | ||
const languageConfig = this._languageConfigurationService.getLanguageConfiguration(languageId); | ||
const snippets = ( (new Set(await this._snippets.getSnippets(languageId)))); | ||
const snippets = ( new Set(await this._snippets.getSnippets(languageId))); | ||
const lineContentLow = model.getLineContent(position.lineNumber).toLowerCase(); | ||
@@ -357,5 +356,5 @@ const wordUntil = model.getWordUntilPosition(position).word.toLowerCase(); | ||
} | ||
const replace = Range$2.fromPositions(startPosition, { lineNumber: position.lineNumber, column: endColumn }); | ||
const replace = Range.fromPositions(startPosition, { lineNumber: position.lineNumber, column: endColumn }); | ||
const insert = replace.setEndPosition(position.lineNumber, position.column); | ||
suggestions.push(( (new SnippetCompletion(snippet, { replace, insert })))); | ||
suggestions.push(( new SnippetCompletion(snippet, { replace, insert }))); | ||
snippets.delete(snippet); | ||
@@ -369,5 +368,5 @@ break; | ||
for (const snippet of snippets) { | ||
const insert = Range$2.fromPositions(position); | ||
const insert = Range.fromPositions(position); | ||
const replace = lineContentLow.indexOf(snippet.prefixLow, columnOffset) === columnOffset ? insert.setEndPosition(position.lineNumber, position.column + snippet.prefixLow.length) : insert; | ||
suggestions.push(( (new SnippetCompletion(snippet, { replace, insert })))); | ||
suggestions.push(( new SnippetCompletion(snippet, { replace, insert }))); | ||
} | ||
@@ -381,3 +380,3 @@ } | ||
for (; to < suggestions.length && item.label === suggestions[to].label; to++) { | ||
suggestions[to].label.label = ( (localize( | ||
suggestions[to].label.label = ( localize( | ||
'snippetSuggest.longLabel', | ||
@@ -387,6 +386,6 @@ "{0}, {1}", | ||
suggestions[to].snippet.name | ||
))); | ||
)); | ||
} | ||
if (to > i + 1) { | ||
suggestions[i].label.label = ( (localize( | ||
suggestions[i].label.label = ( localize( | ||
'snippetSuggest.longLabel', | ||
@@ -396,3 +395,3 @@ "{0}, {1}", | ||
suggestions[i].snippet.name | ||
))); | ||
)); | ||
i = to; | ||
@@ -418,12 +417,12 @@ } | ||
}; | ||
SnippetCompletionProvider = ( (__decorate([ | ||
( (__param(0, ILanguageService))), | ||
( (__param(1, ISnippetsService))), | ||
( (__param(2, ILanguageConfigurationService))) | ||
], SnippetCompletionProvider))); | ||
SnippetCompletionProvider = ( __decorate([ | ||
( __param(0, ILanguageService)), | ||
( __param(1, ISnippetsService)), | ||
( __param(2, ILanguageConfigurationService)) | ||
], SnippetCompletionProvider)); | ||
var snippetExt; | ||
( ((function(snippetExt) { | ||
( (function(snippetExt) { | ||
function toValidSnippet(extension, snippet, languageService) { | ||
if (isFalsyOrWhitespace(snippet.path)) { | ||
extension.collector.error(( (localize( | ||
extension.collector.error(( localize( | ||
'invalid.path.0', | ||
@@ -433,7 +432,7 @@ "Expected string in `contributes.{0}.path`. Provided value: {1}", | ||
String(snippet.path) | ||
)))); | ||
))); | ||
return null; | ||
} | ||
if (isFalsyOrWhitespace(snippet.language) && !snippet.path.endsWith('.code-snippets')) { | ||
extension.collector.error(( (localize( | ||
extension.collector.error(( localize( | ||
'invalid.language.0', | ||
@@ -443,7 +442,7 @@ "When omitting the language, the value of `contributes.{0}.path` must be a `.code-snippets`-file. Provided value: {1}", | ||
String(snippet.path) | ||
)))); | ||
))); | ||
return null; | ||
} | ||
if (!isFalsyOrWhitespace(snippet.language) && !languageService.isRegisteredLanguageId(snippet.language)) { | ||
extension.collector.error(( (localize( | ||
extension.collector.error(( localize( | ||
'invalid.language', | ||
@@ -453,3 +452,3 @@ "Unknown language in `contributes.{0}.language`. Provided value: {1}", | ||
String(snippet.language) | ||
)))); | ||
))); | ||
return null; | ||
@@ -460,3 +459,3 @@ } | ||
if (!isEqualOrParent(snippetLocation, extensionLocation)) { | ||
extension.collector.error(( (localize( | ||
extension.collector.error(( localize( | ||
'invalid.path.1', | ||
@@ -467,3 +466,3 @@ "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", | ||
extensionLocation.path | ||
)))); | ||
))); | ||
return null; | ||
@@ -478,3 +477,3 @@ } | ||
snippetExt.snippetsContribution = { | ||
description: ( (localize('vscode.extension.contributes.snippets', 'Contributes snippets.'))), | ||
description: ( localize('vscode.extension.contributes.snippets', 'Contributes snippets.')), | ||
type: 'array', | ||
@@ -487,13 +486,13 @@ defaultSnippets: [{ body: [{ language: '', path: '' }] }], | ||
language: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.snippets-language', | ||
'Language identifier for which this snippet is contributed to.' | ||
))), | ||
)), | ||
type: 'string' | ||
}, | ||
path: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.snippets-path', | ||
'Path of the snippets file. The path is relative to the extension folder and typically starts with \'./snippets/\'.' | ||
))), | ||
)), | ||
type: 'string' | ||
@@ -504,8 +503,8 @@ } | ||
}; | ||
snippetExt.point = ( (ExtensionsRegistry.registerExtensionPoint({ | ||
snippetExt.point = ( ExtensionsRegistry.registerExtensionPoint({ | ||
extensionPoint: 'snippets', | ||
deps: [languagesExtPoint], | ||
jsonSchema: snippetExt.snippetsContribution | ||
}))); | ||
})(snippetExt || (snippetExt = {})))); | ||
})); | ||
})(snippetExt || (snippetExt = {}))); | ||
function watch(service, resource, callback) { | ||
@@ -527,3 +526,3 @@ return combinedDisposable(service.watch(resource), service.onDidFilesChange(e => { | ||
catch { } | ||
this._ignored = isStringArray(data) ? ( (new Set(data))) : ( (new Set())); | ||
this._ignored = isStringArray(data) ? ( new Set(data)) : ( new Set()); | ||
} | ||
@@ -549,5 +548,5 @@ isIgnored(id) { | ||
SnippetEnablement._key = 'snippets.ignoredSnippets'; | ||
SnippetEnablement = ( (__decorate([ | ||
( (__param(0, IStorageService))) | ||
], SnippetEnablement))); | ||
SnippetEnablement = ( __decorate([ | ||
( __param(0, IStorageService)) | ||
], SnippetEnablement)); | ||
let SnippetUsageTimestamps = class SnippetUsageTimestamps { | ||
@@ -564,3 +563,3 @@ constructor(_storageService) { | ||
} | ||
this._usages = Array.isArray(data) ? ( (new Map(data))) : ( (new Map())); | ||
this._usages = Array.isArray(data) ? ( new Map(data)) : ( new Map()); | ||
} | ||
@@ -578,5 +577,5 @@ getUsageTimestamp(id) { | ||
SnippetUsageTimestamps._key = 'snippets.usageTimestamps'; | ||
SnippetUsageTimestamps = ( (__decorate([ | ||
( (__param(0, IStorageService))) | ||
], SnippetUsageTimestamps))); | ||
SnippetUsageTimestamps = ( __decorate([ | ||
( __param(0, IStorageService)) | ||
], SnippetUsageTimestamps)); | ||
let SnippetsService = class SnippetsService { | ||
@@ -592,5 +591,5 @@ constructor(_environmentService, _userDataProfileService, _contextService, _languageService, _logService, _fileService, _textfileService, _extensionResourceLoaderService, lifecycleService, instantiationService, languageConfigurationService) { | ||
this._extensionResourceLoaderService = _extensionResourceLoaderService; | ||
this._disposables = ( (new DisposableStore())); | ||
this._disposables = ( new DisposableStore()); | ||
this._pendingWork = []; | ||
this._files = ( (new ResourceMap())); | ||
this._files = ( new ResourceMap()); | ||
this._pendingWork.push(Promise.resolve(lifecycleService.when(3 ).then(() => { | ||
@@ -601,3 +600,3 @@ this._initExtensionSnippets(); | ||
}))); | ||
setSnippetSuggestSupport(( (new SnippetCompletionProvider(this._languageService, this, languageConfigurationService)))); | ||
setSnippetSuggestSupport(( new SnippetCompletionProvider(this._languageService, this, languageConfigurationService))); | ||
this._enablement = instantiationService.createInstance(SnippetEnablement); | ||
@@ -625,5 +624,3 @@ this._usageTimestamps = instantiationService.createInstance(SnippetUsageTimestamps); | ||
await this._joinSnippets(); | ||
return ( | ||
(this._files.values()) | ||
); | ||
return ( this._files.values()); | ||
} | ||
@@ -636,6 +633,6 @@ async getSnippets(languageId, opts) { | ||
if (this._languageService.isRegisteredLanguageId(languageId)) { | ||
for (const file of ( (this._files.values()))) { | ||
for (const file of ( this._files.values())) { | ||
promises.push(file.load() | ||
.then(file => file.select(languageId, result)) | ||
.catch(err => this._logService.error(err, ( (file.location.toString()))))); | ||
.catch(err => this._logService.error(err, ( file.location.toString())))); | ||
} | ||
@@ -645,6 +642,6 @@ } | ||
else { | ||
for (const file of ( (this._files.values()))) { | ||
for (const file of ( this._files.values())) { | ||
promises.push(file.load() | ||
.then(file => insertInto(result, result.length, file.data)) | ||
.catch(err => this._logService.error(err, ( (file.location.toString()))))); | ||
.catch(err => this._logService.error(err, ( file.location.toString())))); | ||
} | ||
@@ -658,3 +655,3 @@ } | ||
if (this._languageService.isRegisteredLanguageId(languageId)) { | ||
for (const file of ( (this._files.values()))) { | ||
for (const file of ( this._files.values())) { | ||
file.load().catch(_err => { }); | ||
@@ -739,3 +736,3 @@ file.select(languageId, result); | ||
else { | ||
const file = ( (new SnippetFile( | ||
const file = ( new SnippetFile( | ||
3 , | ||
@@ -747,3 +744,3 @@ validContribution.location, | ||
this._extensionResourceLoaderService | ||
))); | ||
)); | ||
this._files.set(file.location, file); | ||
@@ -753,14 +750,10 @@ if (this._environmentService.isExtensionDevelopment) { | ||
if (file.data.some(snippet => snippet.isBogous)) { | ||
extension.collector.warn(( (localize( | ||
extension.collector.warn(( localize( | ||
'badVariableUse', | ||
"One or more snippets from the extension '{0}' very likely confuse snippet-variables and snippet-placeholders (see https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details)", | ||
extension.description.name | ||
)))); | ||
))); | ||
} | ||
}, err => { | ||
extension.collector.warn(( (localize( | ||
'badFile', | ||
"The snippet file \"{0}\" could not be read.", | ||
(file.location.toString()) | ||
)))); | ||
extension.collector.warn(( localize('badFile', "The snippet file \"{0}\" could not be read.", ( file.location.toString())))); | ||
}); | ||
@@ -774,3 +767,3 @@ } | ||
_initWorkspaceSnippets() { | ||
const disposables = ( (new DisposableStore())); | ||
const disposables = ( new DisposableStore()); | ||
const updateWorkspaceSnippets = () => { | ||
@@ -803,3 +796,3 @@ disposables.clear(); | ||
async _initUserSnippets() { | ||
const disposables = ( (new DisposableStore())); | ||
const disposables = ( new DisposableStore()); | ||
const updateUserSnippets = async () => { | ||
@@ -821,3 +814,3 @@ disposables.clear(); | ||
_initFolderSnippets(source, folder, bucket) { | ||
const disposables = ( (new DisposableStore())); | ||
const disposables = ( new DisposableStore()); | ||
const addFolderSnippets = async () => { | ||
@@ -835,3 +828,3 @@ disposables.clear(); | ||
catch (err) { | ||
this._logService.error(`Failed snippets from folder '${( ( folder.toString()))}'`, err); | ||
this._logService.error(`Failed snippets from folder '${( folder.toString())}'`, err); | ||
} | ||
@@ -849,6 +842,6 @@ }; | ||
_addSnippetFile(uri, source) { | ||
const ext = extname(uri); | ||
const ext = extname$1(uri); | ||
if (source === 1 && ext === '.json') { | ||
const langName = basename(uri).replace(/\.json/, ''); | ||
this._files.set(uri, ( (new SnippetFile( | ||
const langName = basename$1(uri).replace(/\.json/, ''); | ||
this._files.set(uri, ( new SnippetFile( | ||
source, | ||
@@ -860,6 +853,6 @@ uri, | ||
this._extensionResourceLoaderService | ||
)))); | ||
))); | ||
} | ||
else if (ext === '.code-snippets') { | ||
this._files.set(uri, ( (new SnippetFile( | ||
this._files.set(uri, ( new SnippetFile( | ||
source, | ||
@@ -871,3 +864,3 @@ uri, | ||
this._extensionResourceLoaderService | ||
)))); | ||
))); | ||
} | ||
@@ -879,15 +872,15 @@ return { | ||
}; | ||
SnippetsService = ( (__decorate([ | ||
( (__param(0, IEnvironmentService))), | ||
( (__param(1, IUserDataProfileService))), | ||
( (__param(2, IWorkspaceContextService))), | ||
( (__param(3, ILanguageService))), | ||
( (__param(4, ILogService))), | ||
( (__param(5, IFileService))), | ||
( (__param(6, ITextFileService))), | ||
( (__param(7, IExtensionResourceLoaderService))), | ||
( (__param(8, ILifecycleService))), | ||
( (__param(9, IInstantiationService))), | ||
( (__param(10, ILanguageConfigurationService))) | ||
], SnippetsService))); | ||
SnippetsService = ( __decorate([ | ||
( __param(0, IEnvironmentService)), | ||
( __param(1, IUserDataProfileService)), | ||
( __param(2, IWorkspaceContextService)), | ||
( __param(3, ILanguageService)), | ||
( __param(4, ILogService)), | ||
( __param(5, IFileService)), | ||
( __param(6, ITextFileService)), | ||
( __param(7, IExtensionResourceLoaderService)), | ||
( __param(8, ILifecycleService)), | ||
( __param(9, IInstantiationService)), | ||
( __param(10, ILanguageConfigurationService)) | ||
], SnippetsService)); | ||
const snippetExtensionPoint = getExtensionPoint('snippets'); | ||
@@ -911,5 +904,5 @@ function setSnippets(snippets, getContent, extension = Services.get().extension ?? DEFAULT_EXTENSION) { | ||
...getServiceOverride$1(), | ||
[( ISnippetsService.toString())]: new SyncDescriptor(SnippetsService) | ||
[ISnippetsService.toString()]: new SyncDescriptor(SnippetsService) | ||
}; | ||
} | ||
export { getServiceOverride as default, setSnippets }; |
@@ -1,4 +0,5 @@ | ||
import { _ as __decorate, a as __param } from './contextkey.js'; | ||
import { f as ExtensionsRegistry, J as ExtensionMessageCollector, L as ITextMateService, E as Emitter } from './missing-services.js'; | ||
export { L as ITextMateService } from './missing-services.js'; | ||
import { b as __decorate, d as __param } from './contextkey.js'; | ||
import { E as Emitter } from './polyfill.js'; | ||
import { E as ExtensionsRegistry, n as ITextMateService, m as ExtensionMessageCollector } from './missing-services.js'; | ||
export { n as ITextMateService } from './missing-services.js'; | ||
import { l as languagesExtPoint } from './languageService.js'; | ||
@@ -8,5 +9,5 @@ import { localize } from 'monaco-editor/esm/vs/nls.js'; | ||
import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js'; | ||
import { joinPath, isEqualOrParent, isEqual } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
import { I as IExtensionResourceLoaderService, r as registerExtensionFile, g as getServiceOverride$1 } from './files.js'; | ||
import { TokenizationRegistry, EncodedTokenizationResult } from 'monaco-editor/esm/vs/editor/common/languages.js'; | ||
import { isEqual, joinPath, isEqualOrParent } from 'monaco-editor/esm/vs/base/common/resources.js'; | ||
import { I as IExtensionResourceLoaderService, g as getServiceOverride$1, r as registerExtensionFile } from './files.js'; | ||
import { EncodedTokenizationResult, TokenizationRegistry } from 'monaco-editor/esm/vs/editor/common/languages.js'; | ||
import { TokenMetadata } from 'monaco-editor/esm/vs/editor/common/encodedTokenAttributes.js'; | ||
@@ -25,16 +26,16 @@ import { createStyleSheet } from 'monaco-editor/esm/vs/base/browser/dom.js'; | ||
import { nullTokenizeEncoded } from 'monaco-editor/esm/vs/editor/common/languages/nullTokenize.js'; | ||
import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js'; | ||
import { g as getExtensionPoint, o as onServicesInitialized, c as consoleExtensionMessageHandler } from './tools.js'; | ||
import { S as Services } from './services2.js'; | ||
import { bd as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { D as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { c as createInjectedClass } from './injection.js'; | ||
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js'; | ||
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js'; | ||
const grammarsExtPoint = ( (ExtensionsRegistry.registerExtensionPoint({ | ||
const grammarsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({ | ||
extensionPoint: 'grammars', | ||
deps: [languagesExtPoint], | ||
jsonSchema: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars', | ||
'Contributes textmate tokenizers.' | ||
))), | ||
)), | ||
type: 'array', | ||
@@ -47,34 +48,34 @@ defaultSnippets: [{ body: [{ language: '${1:id}', scopeName: 'source.${2:id}', path: './syntaxes/${3:id}.tmLanguage.' }] }], | ||
language: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.language', | ||
'Language identifier for which this syntax is contributed to.' | ||
))), | ||
)), | ||
type: 'string' | ||
}, | ||
scopeName: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.scopeName', | ||
'Textmate scope name used by the tmLanguage file.' | ||
))), | ||
)), | ||
type: 'string' | ||
}, | ||
path: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.path', | ||
'Path of the tmLanguage file. The path is relative to the extension folder and typically starts with \'./syntaxes/\'.' | ||
))), | ||
)), | ||
type: 'string' | ||
}, | ||
embeddedLanguages: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.embeddedLanguages', | ||
'A map of scope name to language id if this grammar contains embedded languages.' | ||
))), | ||
)), | ||
type: 'object' | ||
}, | ||
tokenTypes: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.tokenTypes', | ||
'A map of scope name to token types.' | ||
))), | ||
)), | ||
type: 'object', | ||
@@ -86,6 +87,6 @@ additionalProperties: { | ||
injectTo: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.injectTo', | ||
'List of language scope names to which this grammar is injected to.' | ||
))), | ||
)), | ||
type: 'array', | ||
@@ -97,6 +98,6 @@ items: { | ||
balancedBracketScopes: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.balancedBracketScopes', | ||
'Defines which scope names contain balanced brackets.' | ||
))), | ||
)), | ||
type: 'array', | ||
@@ -109,6 +110,6 @@ items: { | ||
unbalancedBracketScopes: { | ||
description: ( (localize( | ||
description: ( localize( | ||
'vscode.extension.contributes.grammars.unbalancedBracketScopes', | ||
'Defines which scope names do not contain balanced brackets.' | ||
))), | ||
)), | ||
type: 'array', | ||
@@ -124,3 +125,3 @@ items: { | ||
} | ||
}))); | ||
})); | ||
class TMScopeRegistry extends Disposable { | ||
@@ -139,4 +140,4 @@ constructor() { | ||
console.warn(`Overwriting grammar scope name to file mapping for scope ${def.scopeName}.\n` + | ||
`Old grammar file: ${( ( existingRegistration.location.toString()))}.\n` + | ||
`New grammar file: ${( ( def.location.toString()))}`); | ||
`Old grammar file: ${( existingRegistration.location.toString())}.\n` + | ||
`New grammar file: ${( def.location.toString())}`); | ||
} | ||
@@ -156,6 +157,6 @@ } | ||
this._initialState = vscodeTextmate.INITIAL; | ||
this._scopeRegistry = this._register(( (new TMScopeRegistry()))); | ||
this._scopeRegistry = this._register(( new TMScopeRegistry())); | ||
this._injections = {}; | ||
this._injectedEmbeddedLanguages = {}; | ||
this._languageToScope = ( (new Map())); | ||
this._languageToScope = ( new Map()); | ||
this._grammarRegistry = this._register(new vscodeTextmate.Registry({ | ||
@@ -236,3 +237,3 @@ onigLib: onigLib, | ||
for (const injected of injectedEmbeddedLanguages) { | ||
for (const scope of ( (Object.keys(injected)))) { | ||
for (const scope of ( Object.keys(injected))) { | ||
embeddedLanguages[scope] = injected[scope]; | ||
@@ -242,3 +243,3 @@ } | ||
} | ||
const containsEmbeddedLanguages = (( (Object.keys(embeddedLanguages))).length > 0); | ||
const containsEmbeddedLanguages = (( Object.keys(embeddedLanguages)).length > 0); | ||
let grammar; | ||
@@ -270,3 +271,3 @@ try { | ||
super(); | ||
this._onDidEncounterLanguage = this._register(( (new Emitter()))); | ||
this._onDidEncounterLanguage = this._register(( new Emitter())); | ||
this.onDidEncounterLanguage = this._onDidEncounterLanguage.event; | ||
@@ -288,5 +289,3 @@ this._grammar = grammar; | ||
console.warn(`Time limit reached when tokenizing line: ${line.substring(0, 100)}`); | ||
return ( | ||
(new EncodedTokenizationResult(textMateResult.tokens, state)) | ||
); | ||
return ( new EncodedTokenizationResult(textMateResult.tokens, state)); | ||
} | ||
@@ -312,5 +311,3 @@ if (this._containsEmbeddedLanguages) { | ||
} | ||
return ( | ||
(new EncodedTokenizationResult(textMateResult.tokens, endState)) | ||
); | ||
return ( new EncodedTokenizationResult(textMateResult.tokens, endState)); | ||
} | ||
@@ -328,3 +325,3 @@ } | ||
this._progressService = _progressService; | ||
this._onDidEncounterLanguage = this._register(( (new Emitter()))); | ||
this._onDidEncounterLanguage = this._register(( new Emitter())); | ||
this.onDidEncounterLanguage = this._onDidEncounterLanguage.event; | ||
@@ -361,3 +358,3 @@ this._vscodeOniguruma = null; | ||
if (grammar.embeddedLanguages) { | ||
const scopes = ( (Object.keys(grammar.embeddedLanguages))); | ||
const scopes = ( Object.keys(grammar.embeddedLanguages)); | ||
for (let i = 0, len = scopes.length; i < len; i++) { | ||
@@ -376,3 +373,3 @@ const scope = scopes[i]; | ||
if (grammar.tokenTypes) { | ||
const scopes = ( (Object.keys(grammar.tokenTypes))); | ||
const scopes = ( Object.keys(grammar.tokenTypes)); | ||
for (const scope of scopes) { | ||
@@ -435,3 +432,3 @@ const tokenType = grammar.tokenTypes[scope]; | ||
if (this._debugMode) { | ||
this._notificationService.error(( (localize('alreadyDebugging', "Already Logging.")))); | ||
this._notificationService.error(( localize('alreadyDebugging', "Already Logging."))); | ||
return; | ||
@@ -444,9 +441,9 @@ } | ||
location: 15 , | ||
buttons: [( (localize('stop', "Stop")))] | ||
buttons: [( localize('stop', "Stop"))] | ||
}, (progress) => { | ||
progress.report({ | ||
message: ( (localize( | ||
message: ( localize( | ||
'progress1', | ||
"Preparing to log TM Grammar parsing. Press Stop when finished." | ||
))) | ||
)) | ||
}); | ||
@@ -456,7 +453,5 @@ return this._getVSCodeOniguruma().then((vscodeOniguruma) => { | ||
progress.report({ | ||
message: ( (localize('progress2', "Now logging TM Grammar parsing. Press Stop when finished."))) | ||
message: ( localize('progress2', "Now logging TM Grammar parsing. Press Stop when finished.")) | ||
}); | ||
return ( | ||
(new Promise((resolve, reject) => { })) | ||
); | ||
return ( new Promise((resolve, reject) => { })); | ||
}); | ||
@@ -488,7 +483,7 @@ }, (choice) => { | ||
} | ||
this._grammarFactory = ( (new TMGrammarFactory({ | ||
this._grammarFactory = ( new TMGrammarFactory({ | ||
logTrace: (msg) => this._logService.trace(msg), | ||
logError: (msg, err) => this._logService.error(msg, err), | ||
readFile: (resource) => this._extensionResourceLoaderService.readExtensionResource(resource) | ||
}, this._grammarDefinitions || [], vscodeTextmate, onigLib))); | ||
}, this._grammarDefinitions || [], vscodeTextmate, onigLib)); | ||
this._onDidCreateGrammarFactory(this._grammarDefinitions || []); | ||
@@ -517,3 +512,3 @@ this._updateTheme(this._grammarFactory, this._themeService.getColorTheme(), true); | ||
} | ||
const tokenization = ( (new TMTokenization(r.grammar, r.initialState, r.containsEmbeddedLanguages))); | ||
const tokenization = ( new TMTokenization(r.grammar, r.initialState, r.containsEmbeddedLanguages)); | ||
tokenization.onDidEncounterLanguage((encodedLanguageId) => { | ||
@@ -526,5 +521,3 @@ if (!this._encounteredLanguages[encodedLanguageId]) { | ||
}); | ||
return ( | ||
(new TMTokenizationSupportWithLineLimit(languageId, encodedLanguageId, tokenization, this._configurationService)) | ||
); | ||
return ( new TMTokenizationSupportWithLineLimit(languageId, encodedLanguageId, tokenization, this._configurationService)); | ||
} | ||
@@ -544,3 +537,3 @@ catch (err) { | ||
for (let i = 1, len = colorMap.length; i < len; i++) { | ||
result[i] = ( (Color.fromHex(colorMap[i]))); | ||
result[i] = ( Color.fromHex(colorMap[i])); | ||
} | ||
@@ -589,3 +582,3 @@ return result; | ||
if (syntax.language && ((typeof syntax.language !== 'string') || !this._languageService.isRegisteredLanguageId(syntax.language))) { | ||
collector.error(( (localize( | ||
collector.error(( localize( | ||
'invalid.language', | ||
@@ -595,7 +588,7 @@ "Unknown language in `contributes.{0}.language`. Provided value: {1}", | ||
String(syntax.language) | ||
)))); | ||
))); | ||
return false; | ||
} | ||
if (!syntax.scopeName || (typeof syntax.scopeName !== 'string')) { | ||
collector.error(( (localize( | ||
collector.error(( localize( | ||
'invalid.scopeName', | ||
@@ -605,7 +598,7 @@ "Expected string in `contributes.{0}.scopeName`. Provided value: {1}", | ||
String(syntax.scopeName) | ||
)))); | ||
))); | ||
return false; | ||
} | ||
if (!syntax.path || (typeof syntax.path !== 'string')) { | ||
collector.error(( (localize( | ||
collector.error(( localize( | ||
'invalid.path.0', | ||
@@ -615,7 +608,7 @@ "Expected string in `contributes.{0}.path`. Provided value: {1}", | ||
String(syntax.path) | ||
)))); | ||
))); | ||
return false; | ||
} | ||
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || syntax.injectTo.some(scope => typeof scope !== 'string'))) { | ||
collector.error(( (localize( | ||
collector.error(( localize( | ||
'invalid.injectTo', | ||
@@ -625,7 +618,7 @@ "Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}", | ||
JSON.stringify(syntax.injectTo) | ||
)))); | ||
))); | ||
return false; | ||
} | ||
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) { | ||
collector.error(( (localize( | ||
collector.error(( localize( | ||
'invalid.embeddedLanguages', | ||
@@ -635,7 +628,7 @@ "Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}", | ||
JSON.stringify(syntax.embeddedLanguages) | ||
)))); | ||
))); | ||
return false; | ||
} | ||
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) { | ||
collector.error(( (localize( | ||
collector.error(( localize( | ||
'invalid.tokenTypes', | ||
@@ -645,3 +638,3 @@ "Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}", | ||
JSON.stringify(syntax.tokenTypes) | ||
)))); | ||
))); | ||
return false; | ||
@@ -651,3 +644,3 @@ } | ||
if (!isEqualOrParent(grammarLocation, extensionLocation)) { | ||
collector.warn(( (localize( | ||
collector.warn(( localize( | ||
'invalid.path.1', | ||
@@ -658,3 +651,3 @@ "Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.", | ||
extensionLocation.path | ||
)))); | ||
))); | ||
} | ||
@@ -697,11 +690,11 @@ return true; | ||
}; | ||
AbstractTextMateService = ( (__decorate([ | ||
( (__param(0, ILanguageService))), | ||
( (__param(1, IWorkbenchThemeService))), | ||
( (__param(2, IExtensionResourceLoaderService))), | ||
( (__param(3, INotificationService))), | ||
( (__param(4, ILogService))), | ||
( (__param(5, IConfigurationService))), | ||
( (__param(6, IProgressService))) | ||
], AbstractTextMateService))); | ||
AbstractTextMateService = ( __decorate([ | ||
( __param(0, ILanguageService)), | ||
( __param(1, IWorkbenchThemeService)), | ||
( __param(2, IExtensionResourceLoaderService)), | ||
( __param(3, INotificationService)), | ||
( __param(4, ILogService)), | ||
( __param(5, IConfigurationService)), | ||
( __param(6, IProgressService)) | ||
], AbstractTextMateService)); | ||
let TMTokenizationSupportWithLineLimit = class TMTokenizationSupportWithLineLimit { | ||
@@ -737,5 +730,5 @@ constructor(languageId, encodedLanguageId, actual, _configurationService) { | ||
}; | ||
TMTokenizationSupportWithLineLimit = ( (__decorate([ | ||
( (__param(3, IConfigurationService))) | ||
], TMTokenizationSupportWithLineLimit))); | ||
TMTokenizationSupportWithLineLimit = ( __decorate([ | ||
( __param(3, IConfigurationService)) | ||
], TMTokenizationSupportWithLineLimit)); | ||
let TextMateService = class TextMateService extends createInjectedClass(AbstractTextMateService) { | ||
@@ -750,5 +743,5 @@ constructor(loadVSCodeOnigurumWASM, instantiationService) { | ||
}; | ||
TextMateService = ( __decorate([ | ||
( __param(1, IInstantiationService)) | ||
], TextMateService)); | ||
TextMateService = __decorate([ | ||
__param(1, IInstantiationService) | ||
], TextMateService); | ||
const extensionPoint = getExtensionPoint('grammars'); | ||
@@ -772,5 +765,5 @@ function setGrammars(grammars, getContent, extension = Services.get().extension ?? DEFAULT_EXTENSION) { | ||
...getServiceOverride$1(), | ||
[( ITextMateService.toString())]: new SyncDescriptor(TextMateService, [getOnigLib]) | ||
[ITextMateService.toString()]: new SyncDescriptor(TextMateService, [getOnigLib]) | ||
}; | ||
} | ||
export { getServiceOverride as default, setGrammars }; |
@@ -1,7 +0,8 @@ | ||
import { f as ExtensionsRegistry, J as ExtensionMessageCollector } from './missing-services.js'; | ||
import './polyfill.js'; | ||
import { E as ExtensionsRegistry, m as ExtensionMessageCollector } from './missing-services.js'; | ||
import { g as getTokenClassificationRegistry, a as typeAndModifierIdPattern } from './tokenClassificationRegistry.js'; | ||
import { localize } from 'monaco-editor/esm/vs/nls.js'; | ||
import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js'; | ||
import { g as getExtensionPoint, o as onServicesInitialized, c as consoleExtensionMessageHandler } from './tools.js'; | ||
import { S as Services } from './services2.js'; | ||
import { bd as DEFAULT_EXTENSION } from './extHost.js'; | ||
import { D as DEFAULT_EXTENSION } from './extHost.js'; | ||
const tokenClassificationRegistry = getTokenClassificationRegistry(); | ||
@@ -8,0 +9,0 @@ const tokenTypeExtPoint$1 = ( ExtensionsRegistry.registerExtensionPoint({ |
@@ -1,2 +0,2 @@ | ||
import { E as Emitter } from './missing-services.js'; | ||
import { E as Emitter } from './polyfill.js'; | ||
import { localize } from 'monaco-editor/esm/vs/nls.js'; | ||
@@ -23,3 +23,3 @@ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js'; | ||
} | ||
( ((function(TokenStyle) { | ||
( (function(TokenStyle) { | ||
function toJSONObject(style) { | ||
@@ -38,12 +38,10 @@ return { | ||
const boolOrUndef = (b) => (typeof b === 'boolean') ? b : undefined; | ||
const colorOrUndef = (s) => (typeof s === 'string') ? ( (Color.fromHex(s))) : undefined; | ||
return ( | ||
(new TokenStyle( | ||
colorOrUndef(obj._foreground), | ||
boolOrUndef(obj._bold), | ||
boolOrUndef(obj._underline), | ||
boolOrUndef(obj._strikethrough), | ||
boolOrUndef(obj._italic) | ||
)) | ||
); | ||
const colorOrUndef = (s) => (typeof s === 'string') ? ( Color.fromHex(s)) : undefined; | ||
return ( new TokenStyle( | ||
colorOrUndef(obj._foreground), | ||
boolOrUndef(obj._bold), | ||
boolOrUndef(obj._underline), | ||
boolOrUndef(obj._strikethrough), | ||
boolOrUndef(obj._italic) | ||
)); | ||
} | ||
@@ -70,11 +68,9 @@ return undefined; | ||
function fromData(data) { | ||
return ( | ||
(new TokenStyle( | ||
data.foreground, | ||
data.bold, | ||
data.underline, | ||
data.strikethrough, | ||
data.italic | ||
)) | ||
); | ||
return ( new TokenStyle( | ||
data.foreground, | ||
data.bold, | ||
data.underline, | ||
data.strikethrough, | ||
data.italic | ||
)); | ||
} | ||
@@ -85,3 +81,3 @@ TokenStyle.fromData = fromData; | ||
if (foreground !== undefined) { | ||
foregroundColor = ( (Color.fromHex(foreground))); | ||
foregroundColor = ( Color.fromHex(foreground)); | ||
} | ||
@@ -109,10 +105,8 @@ if (fontStyle !== undefined) { | ||
} | ||
return ( | ||
(new TokenStyle(foregroundColor, bold, underline, strikethrough, italic)) | ||
); | ||
return ( new TokenStyle(foregroundColor, bold, underline, strikethrough, italic)); | ||
} | ||
TokenStyle.fromSettings = fromSettings; | ||
})(TokenStyle || (TokenStyle = {})))); | ||
})(TokenStyle || (TokenStyle = {}))); | ||
var SemanticTokenRule; | ||
( ((function(SemanticTokenRule) { | ||
( (function(SemanticTokenRule) { | ||
function fromJSONObject(registry, o) { | ||
@@ -152,6 +146,6 @@ if (o && typeof o._selector === 'string' && o._style) { | ||
SemanticTokenRule.is = is; | ||
})(SemanticTokenRule || (SemanticTokenRule = {})))); | ||
})(SemanticTokenRule || (SemanticTokenRule = {}))); | ||
class TokenClassificationRegistry { | ||
constructor() { | ||
this._onDidChangeSchema = ( (new Emitter())); | ||
this._onDidChangeSchema = ( new Emitter()); | ||
this.onDidChangeSchema = this._onDidChangeSchema.event; | ||
@@ -171,7 +165,7 @@ this.currentTypeNumber = 0; | ||
type: 'object', | ||
description: ( (localize('schema.token.settings', 'Colors and styles for the token.'))), | ||
description: ( localize('schema.token.settings', 'Colors and styles for the token.')), | ||
properties: { | ||
foreground: { | ||
type: 'string', | ||
description: ( (localize('schema.token.foreground', 'Foreground color for the token.'))), | ||
description: ( localize('schema.token.foreground', 'Foreground color for the token.')), | ||
format: 'color-hex', | ||
@@ -182,20 +176,20 @@ default: '#ff0000' | ||
type: 'string', | ||
deprecationMessage: ( (localize( | ||
deprecationMessage: ( localize( | ||
'schema.token.background.warning', | ||
'Token background colors are currently not supported.' | ||
))) | ||
)) | ||
}, | ||
fontStyle: { | ||
type: 'string', | ||
description: ( (localize( | ||
description: ( localize( | ||
'schema.token.fontStyle', | ||
'Sets the all font styles of the rule: \'italic\', \'bold\', \'underline\' or \'strikethrough\' or a combination. All styles that are not listed are unset. The empty string unsets all styles.' | ||
))), | ||
)), | ||
pattern: fontStylePattern, | ||
patternErrorMessage: ( (localize( | ||
patternErrorMessage: ( localize( | ||
'schema.fontStyle.error', | ||
'Font style must be \'italic\', \'bold\', \'underline\' or \'strikethrough\' or a combination. The empty string unsets all styles.' | ||
))), | ||
)), | ||
defaultSnippets: [ | ||
{ label: ( (localize('schema.token.fontStyle.none', 'None (clear inherited style)'))), bodyText: '""' }, | ||
{ label: ( localize('schema.token.fontStyle.none', 'None (clear inherited style)')), bodyText: '""' }, | ||
{ body: 'italic' }, | ||
@@ -220,27 +214,27 @@ { body: 'bold' }, | ||
type: 'boolean', | ||
description: ( (localize( | ||
description: ( localize( | ||
'schema.token.bold', | ||
'Sets or unsets the font style to bold. Note, the presence of \'fontStyle\' overrides this setting.' | ||
))), | ||
)), | ||
}, | ||
italic: { | ||
type: 'boolean', | ||
description: ( (localize( | ||
description: ( localize( | ||
'schema.token.italic', | ||
'Sets or unsets the font style to italic. Note, the presence of \'fontStyle\' overrides this setting.' | ||
))), | ||
)), | ||
}, | ||
underline: { | ||
type: 'boolean', | ||
description: ( (localize( | ||
description: ( localize( | ||
'schema.token.underline', | ||
'Sets or unsets the font style to underline. Note, the presence of \'fontStyle\' overrides this setting.' | ||
))), | ||
)), | ||
}, | ||
strikethrough: { | ||
type: 'boolean', | ||
description: ( (localize( | ||
description: ( localize( | ||
'schema.token.strikethrough', | ||
'Sets or unsets the font style to strikethrough. Note, the presence of \'fontStyle\' overrides this setting.' | ||
))), | ||
)), | ||
} | ||
@@ -332,6 +326,6 @@ }, | ||
getTokenTypes() { | ||
return ( (Object.keys(this.tokenTypeById))).map(id => this.tokenTypeById[id]); | ||
return ( Object.keys(this.tokenTypeById)).map(id => this.tokenTypeById[id]); | ||
} | ||
getTokenModifiers() { | ||
return ( (Object.keys(this.tokenModifierById))).map(id => this.tokenModifierById[id]); | ||
return ( Object.keys(this.tokenModifierById)).map(id => this.tokenModifierById[id]); | ||
} | ||
@@ -365,3 +359,3 @@ getTokenStylingSchema() { | ||
}; | ||
return ( (Object.keys(this.tokenTypeById))).sort(sorter).map(k => `- \`${k}\`: ${this.tokenTypeById[k].description}`).join('\n'); | ||
return ( Object.keys(this.tokenTypeById)).sort(sorter).map(k => `- \`${k}\`: ${this.tokenTypeById[k].description}`).join('\n'); | ||
} | ||
@@ -393,3 +387,3 @@ } | ||
function createDefaultTokenClassificationRegistry() { | ||
const registry = ( (new TokenClassificationRegistry())); | ||
const registry = ( new TokenClassificationRegistry()); | ||
function registerTokenType(id, description, scopesToProbe = [], superType, deprecationMessage) { | ||
@@ -411,34 +405,34 @@ registry.registerTokenType(id, description, superType, deprecationMessage); | ||
} | ||
registerTokenType('comment', ( (localize('comment', "Style for comments."))), [['comment']]); | ||
registerTokenType('string', ( (localize('string', "Style for strings."))), [['string']]); | ||
registerTokenType('keyword', ( (localize('keyword', "Style for keywords."))), [['keyword.control']]); | ||
registerTokenType('number', ( (localize('number', "Style for numbers."))), [['constant.numeric']]); | ||
registerTokenType('regexp', ( (localize('regexp', "Style for expressions."))), [['constant.regexp']]); | ||
registerTokenType('operator', ( (localize('operator', "Style for operators."))), [['keyword.operator']]); | ||
registerTokenType('namespace', ( (localize('namespace', "Style for namespaces."))), [['entity.name.namespace']]); | ||
registerTokenType('type', ( (localize('type', "Style for types."))), [['entity.name.type'], ['support.type']]); | ||
registerTokenType('struct', ( (localize('struct', "Style for structs."))), [['entity.name.type.struct']]); | ||
registerTokenType('class', ( (localize('class', "Style for classes."))), [['entity.name.type.class'], ['support.class']]); | ||
registerTokenType('interface', ( (localize('interface', "Style for interfaces."))), [['entity.name.type.interface']]); | ||
registerTokenType('enum', ( (localize('enum', "Style for enums."))), [['entity.name.type.enum']]); | ||
registerTokenType('typeParameter', ( (localize('typeParameter', "Style for type parameters."))), [['entity.name.type.parameter']]); | ||
registerTokenType('function', ( (localize('function', "Style for functions"))), [['entity.name.function'], ['support.function']]); | ||
registerTokenType('member', ( (localize('member', "Style for member functions"))), [], 'method', 'Deprecated use `method` instead'); | ||
registerTokenType('method', ( (localize('method', "Style for method (member functions)"))), [['entity.name.function.member'], ['support.function']]); | ||
registerTokenType('macro', ( (localize('macro', "Style for macros."))), [['entity.name.function.preprocessor']]); | ||
registerTokenType('variable', ( (localize('variable', "Style for variables."))), [['variable.other.readwrite'], ['entity.name.variable']]); | ||
registerTokenType('parameter', ( (localize('parameter', "Style for parameters."))), [['variable.parameter']]); | ||
registerTokenType('property', ( (localize('property', "Style for properties."))), [['variable.other.property']]); | ||
registerTokenType('enumMember', ( (localize('enumMember', "Style for enum members."))), [['variable.other.enummember']]); | ||
registerTokenType('event', ( (localize('event', "Style for events."))), [['variable.other.event']]); | ||
registerTokenType('decorator', ( (localize('decorator', "Style for decorators & annotations."))), [['entity.name.decorator'], ['entity.name.function']]); | ||
registerTokenType('label', ( (localize('labels', "Style for labels. "))), undefined); | ||
registry.registerTokenModifier('declaration', ( (localize('declaration', "Style for all symbol declarations."))), undefined); | ||
registry.registerTokenModifier('documentation', ( (localize('documentation', "Style to use for references in documentation."))), undefined); | ||
registry.registerTokenModifier('static', ( (localize('static', "Style to use for symbols that are static."))), undefined); | ||
registry.registerTokenModifier('abstract', ( (localize('abstract', "Style to use for symbols that are abstract."))), undefined); | ||
registry.registerTokenModifier('deprecated', ( (localize('deprecated', "Style to use for symbols that are deprecated."))), undefined); | ||
registry.registerTokenModifier('modification', ( (localize('modification', "Style to use for write accesses."))), undefined); | ||
registry.registerTokenModifier('async', ( (localize('async', "Style to use for symbols that are async."))), undefined); | ||
registry.registerTokenModifier('readonly', ( (localize('readonly', "Style to use for symbols that are readonly."))), undefined); | ||
registerTokenType('comment', ( localize('comment', "Style for comments.")), [['comment']]); | ||
registerTokenType('string', ( localize('string', "Style for strings.")), [['string']]); | ||
registerTokenType('keyword', ( localize('keyword', "Style for keywords.")), [['keyword.control']]); | ||
registerTokenType('number', ( localize('number', "Style for numbers.")), [['constant.numeric']]); | ||
registerTokenType('regexp', ( localize('regexp', "Style for expressions.")), [['constant.regexp']]); | ||
registerTokenType('operator', ( localize('operator', "Style for operators.")), [['keyword.operator']]); | ||
registerTokenType('namespace', ( localize('namespace', "Style for namespaces.")), [['entity.name.namespace']]); | ||
registerTokenType('type', ( localize('type', "Style for types.")), [['entity.name.type'], ['support.type']]); | ||
registerTokenType('struct', ( localize('struct', "Style for structs.")), [['entity.name.type.struct']]); | ||
registerTokenType('class', ( localize('class', "Style for classes.")), [['entity.name.type.class'], ['support.class']]); | ||
registerTokenType('interface', ( localize('interface', "Style for interfaces.")), [['entity.name.type.interface']]); | ||
registerTokenType('enum', ( localize('enum', "Style for enums.")), [['entity.name.type.enum']]); | ||
registerTokenType('typeParameter', ( localize('typeParameter', "Style for type parameters.")), [['entity.name.type.parameter']]); | ||
registerTokenType('function', ( localize('function', "Style for functions")), [['entity.name.function'], ['support.function']]); | ||
registerTokenType('member', ( localize('member', "Style for member functions")), [], 'method', 'Deprecated use `method` instead'); | ||
registerTokenType('method', ( localize('method', "Style for method (member functions)")), [['entity.name.function.member'], ['support.function']]); | ||
registerTokenType('macro', ( localize('macro', "Style for macros.")), [['entity.name.function.preprocessor']]); | ||
registerTokenType('variable', ( localize('variable', "Style for variables.")), [['variable.other.readwrite'], ['entity.name.variable']]); | ||
registerTokenType('parameter', ( localize('parameter', "Style for parameters.")), [['variable.parameter']]); | ||
registerTokenType('property', ( localize('property', "Style for properties.")), [['variable.other.property']]); | ||
registerTokenType('enumMember', ( localize('enumMember', "Style for enum members.")), [['variable.other.enummember']]); | ||
registerTokenType('event', ( localize('event', "Style for events.")), [['variable.other.event']]); | ||
registerTokenType('decorator', ( localize('decorator', "Style for decorators & annotations.")), [['entity.name.decorator'], ['entity.name.function']]); | ||
registerTokenType('label', ( localize('labels', "Style for labels. ")), undefined); | ||
registry.registerTokenModifier('declaration', ( localize('declaration', "Style for all symbol declarations.")), undefined); | ||
registry.registerTokenModifier('documentation', ( localize('documentation', "Style to use for references in documentation.")), undefined); | ||
registry.registerTokenModifier('static', ( localize('static', "Style to use for symbols that are static.")), undefined); | ||
registry.registerTokenModifier('abstract', ( localize('abstract', "Style to use for symbols that are abstract.")), undefined); | ||
registry.registerTokenModifier('deprecated', ( localize('deprecated', "Style to use for symbols that are deprecated.")), undefined); | ||
registry.registerTokenModifier('modification', ( localize('modification', "Style to use for write accesses.")), undefined); | ||
registry.registerTokenModifier('async', ( localize('async', "Style to use for symbols that are async.")), undefined); | ||
registry.registerTokenModifier('readonly', ( localize('readonly', "Style to use for symbols that are readonly.")), undefined); | ||
registerTokenStyleDefault('variable.readonly', [['variable.other.constant']]); | ||
@@ -477,5 +471,5 @@ registerTokenStyleDefault('property.readonly', [['variable.other.constant.property']]); | ||
const tokenStylingSchemaId = 'vscode://schemas/token-styling'; | ||
const schemaRegistry = ( Registry.as(Extensions.JSONContribution)); | ||
const schemaRegistry = Registry.as(Extensions.JSONContribution); | ||
schemaRegistry.registerSchema(tokenStylingSchemaId, tokenClassificationRegistry.getTokenStylingSchema()); | ||
const delayer = ( (new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(tokenStylingSchemaId), 200))); | ||
const delayer = ( new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(tokenStylingSchemaId), 200)); | ||
tokenClassificationRegistry.onDidChangeSchema(() => { | ||
@@ -482,0 +476,0 @@ if (!delayer.isScheduled()) { |
@@ -1,3 +0,4 @@ | ||
import { f as ExtensionsRegistry } from './missing-services.js'; | ||
import { E as ExtensionsRegistry } from './missing-services.js'; | ||
import { EventEmitter } from 'vscode'; | ||
import './services2.js'; | ||
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js'; | ||
@@ -4,0 +5,0 @@ import Severity from 'monaco-editor/esm/vs/base/common/severity.js'; |
@@ -46,2 +46,2 @@ import { r as refineServiceDecorator } from './services2.js'; | ||
})(ExtensionData || (ExtensionData = {}))); | ||
export { ExtensionData as E, IWorkbenchThemeService as I, ThemeSettings as T, VS_DARK_THEME as V, VS_LIGHT_THEME as a, VS_HC_THEME as b, VS_HC_LIGHT_THEME as c, THEME_SCOPE_OPEN_PAREN as d, THEME_SCOPE_CLOSE_PAREN as e, THEME_SCOPE_WILDCARD as f, themeScopeRegex as t }; | ||
export { ExtensionData as E, IWorkbenchThemeService as I, THEME_SCOPE_OPEN_PAREN as T, VS_HC_LIGHT_THEME as V, THEME_SCOPE_CLOSE_PAREN as a, THEME_SCOPE_WILDCARD as b, VS_HC_THEME as c, VS_LIGHT_THEME as d, VS_DARK_THEME as e, ThemeSettings as f, themeScopeRegex as t }; |
@@ -0,1 +1,2 @@ | ||
import './polyfill.js'; | ||
import { u as unsupported } from './missing-services.js'; | ||
@@ -46,5 +47,5 @@ import { S as Services } from './services2.js'; | ||
return { | ||
[( IWorkspaceContextService.toString())]: new SyncDescriptor(SimpleWorkspaceContextService) | ||
[IWorkspaceContextService.toString()]: new SyncDescriptor(SimpleWorkspaceContextService) | ||
}; | ||
} | ||
export { getServiceOverride as g }; |
{ | ||
"name": "@codingame/monaco-vscode-api", | ||
"version": "1.69.7", | ||
"version": "1.69.8", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "VSCode public API plugged on the monaco editor", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2909649
71629
45151
5
102