Skip to content

Commit

Permalink
Merge pull request #430 from CodinGame/various-fixes
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
CGNonofr authored May 13, 2024
2 parents 7dc838b + cac31b5 commit 4f55fc8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
},
"config": {
"vscode": {
"version": "1.89.0",
"ref": "1.89.0",
"commit": "9645520c4ae4961f1e927dca9b291f786f11013e"
"version": "1.89.1",
"ref": "1.89.1",
"commit": "dc96b837cf6bb4af9cd736aa3af08cf8279f7685"
},
"monaco": {
"ref": "v0.48.0",
Expand Down
8 changes: 5 additions & 3 deletions src/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export async function startup (instantiationService: IInstantiationService): Pro
await Promise.all(serviceInitializePreParticipants.map(participant => participant(accessor)))
})

await instantiationService.invokeFunction(async accessor => {
setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {}))
setBaseLayerHoverDelegate(accessor.get(IHoverService))
})

await instantiationService.invokeFunction(async accessor => {
const lifecycleService = accessor.get(ILifecycleService)

Expand All @@ -63,9 +68,6 @@ export async function startup (instantiationService: IInstantiationService): Pro
void instantiationService.invokeFunction(async accessor => {
const lifecycleService = accessor.get(ILifecycleService)

setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {}))
setBaseLayerHoverDelegate(accessor.get(IHoverService))

Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).start(accessor)
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory).start(accessor)

Expand Down
6 changes: 3 additions & 3 deletions src/service-override/tools/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ export class MonacoDelegateEditorGroupsService<D extends IEditorGroupsService> e
this._onDidChangeActiveGroup.fire(this.activeGroup)
}
}
const remoteActiveGroup = (editor: StandaloneEditor | undefined) => {
const removeActiveGroup = (editor: StandaloneEditor | undefined) => {
if (!emptyDelegate && this.activeGroupOverride === this.additionalGroups.find(group => group.editor === editor)) {
updateActiveGroup(undefined)
}
Expand All @@ -568,11 +568,11 @@ export class MonacoDelegateEditorGroupsService<D extends IEditorGroupsService> e
// It happens when the focus goes from the editor itself to the overflow widgets dom node
timeout = window.setTimeout(() => {
timeout = undefined
remoteActiveGroup(editor)
removeActiveGroup(editor)
}, 100)
}
editor.onDidDispose(() => {
remoteActiveGroup(editor)
removeActiveGroup(editor)
})
editor.onDidFocusEditorText(onEditorFocused)
editor.onDidFocusEditorWidget(onEditorFocused)
Expand Down
11 changes: 10 additions & 1 deletion src/service-override/tools/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { EditorInputFactoryObject, RegisteredEditorInfo, RegisteredEditorOptions
import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService.service'
import { EditorInput, IEditorCloseHandler } from 'vs/workbench/common/editor/editorInput'
import { EditorExtensions, EditorInputCapabilities, IEditorFactoryRegistry, IEditorOpenContext, IEditorSerializer, Verbosity } from 'vs/workbench/common/editor'
import { IEditorOptions } from 'vs/platform/editor/common/editor'
import { IEditorOptions, IResourceEditorInput } from 'vs/platform/editor/common/editor'
import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'
import { Categories } from 'vs/platform/action/common/actionCommonCategories'
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'
Expand Down Expand Up @@ -200,6 +200,15 @@ abstract class SimpleEditorInput extends EditorInput {
this.dirty = dirty
this._onDidChangeDirty.fire()
}

public override toUntyped (): IResourceEditorInput | undefined {
if (this.resource == null) {
return undefined
}
return {
resource: this.resource
}
}
}

function registerEditorPane<Services extends BrandedService[]> (
Expand Down

1 comment on commit 4f55fc8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.