New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow text search providers to give messages with links that trigger researching. #123213
Conversation
setHandler(handler: (href: string) => void) { | ||
this.handler = handler; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just add an options?
bag to the ctor of Link
instead of a mutable setHandler
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I initially didn't just because the injected openerService
means everywhere this is constructed would need to explicitly pass the empty bag or undefined.
@@ -579,7 +579,7 @@ export abstract class ViewPane extends Pane implements IView { | |||
if (typeof node === 'string') { | |||
append(p, document.createTextNode(node)); | |||
} else { | |||
const link = this.instantiationService.createInstance(Link, node); | |||
const link = this.instantiationService.createInstance(Link, node, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last parameter is optional, does the instantiation service make you pass it in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS doesn't allow the required service injection parameters follow an optional parameter.
if (parsed.scheme === Schemas.command) { | ||
const result = await this.commandService.executeCommand(parsed.path); | ||
if ((result as any)?.triggerSearch) { | ||
this.triggerQueryChange(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What command are you going to use this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remoteHub.enableIndexing
b38064f
to
cb616bc
Compare
cc @joaomoreno this modifies the Link class to allow setting a custom opener, to enable search to interpret the output of commands in provider messages in a way specific to the particular search UI.