forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use vscode watches for tsserver #2
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dc7891d
Use vscode watches for tsserver
sheetalkamat 3a9bcf6
Merge branch 'main' into canUseWatchEvents
sheetalkamat 70e0ddd
fix #195374
meganrogge 648864c
must call canActivityBarBeHidden after state is set (#195392)
sbatten 10d7700
fix #195401
meganrogge 7479c69
feat: render welcome message questions near input (#195405)
joyceerhl 11b906a
Merge pull request #195408 from microsoft/merogge/dialog-add
meganrogge 60310a6
fix #195280
meganrogge ebf16fa
fix #195281
meganrogge 728ac53
Merge pull request #195395 from microsoft/merogge/editor-fix
meganrogge fc9844e
Merge pull request #195415 from microsoft/merogge/next-code-block
meganrogge a15b229
other approach
meganrogge eaaab80
Merge pull request #195414 from microsoft/merogge/align-bindings
meganrogge b97005b
no need for cell output to update the editor height
amunger 901ac65
Implement chatAgent2 proposal (#194635)
roblourens e1ea8a5
Merge branch 'main' into canUseWatchEvents
bpasero a936df4
towards using new proposed watch API
bpasero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; | ||
import { revive } from 'vs/base/common/marshalling'; | ||
import { IProgress } from 'vs/platform/progress/common/progress'; | ||
import { ExtHostChatAgentsShape2, ExtHostContext, IChatResponseProgressDto, IExtensionChatAgentMetadata, MainContext, MainThreadChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; | ||
import { IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents'; | ||
import { IChatProgress } from 'vs/workbench/contrib/chat/common/chatService'; | ||
import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers'; | ||
|
||
|
||
type AgentData = { | ||
dispose: () => void; | ||
name: string; | ||
hasSlashCommands?: boolean; | ||
hasFollowups?: boolean; | ||
}; | ||
|
||
@extHostNamedCustomer(MainContext.MainThreadChatAgents2) | ||
export class MainThreadChatAgents implements MainThreadChatAgentsShape2, IDisposable { | ||
|
||
private readonly _agents = new DisposableMap<number, AgentData>; | ||
private readonly _pendingProgress = new Map<number, IProgress<IChatProgress>>(); | ||
private readonly _proxy: ExtHostChatAgentsShape2; | ||
|
||
constructor( | ||
extHostContext: IExtHostContext, | ||
@IChatAgentService private readonly _chatAgentService: IChatAgentService | ||
) { | ||
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2); | ||
} | ||
|
||
$unregisterAgent(handle: number): void { | ||
this._agents.deleteAndDispose(handle); | ||
} | ||
|
||
dispose(): void { | ||
this._agents.clearAndDisposeAll(); | ||
} | ||
|
||
$registerAgent(handle: number, name: string, metadata: IExtensionChatAgentMetadata): void { | ||
const d = this._chatAgentService.registerAgent({ | ||
id: name, | ||
metadata: revive(metadata), | ||
invoke: async (request, progress, history, token) => { | ||
const requestId = Math.random(); // Make this a guid | ||
this._pendingProgress.set(requestId, progress); | ||
try { | ||
return await this._proxy.$invokeAgent(handle, requestId, request, { history }, token) ?? {}; | ||
} finally { | ||
this._pendingProgress.delete(requestId); | ||
} | ||
}, | ||
provideSlashCommands: async (token) => { | ||
if (!this._agents.get(handle)?.hasSlashCommands) { | ||
return []; // safe an IPC call | ||
} | ||
return this._proxy.$provideSlashCommands(handle, token); | ||
} | ||
}); | ||
this._agents.set(handle, { name, dispose: d.dispose, hasSlashCommands: metadata.hasSlashCommands }); | ||
} | ||
|
||
$updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void { | ||
const data = this._agents.get(handle); | ||
if (!data) { | ||
throw new Error(`No agent with handle ${handle} registered`); | ||
} | ||
data.hasSlashCommands = metadataUpdate.hasSlashCommands; | ||
this._chatAgentService.updateAgent(data.name, revive(metadataUpdate)); | ||
} | ||
|
||
async $handleProgressChunk(requestId: number, chunk: IChatResponseProgressDto): Promise<void> { | ||
// TODO copy/move $acceptResponseProgress from MainThreadChat | ||
this._pendingProgress.get(requestId)?.report(revive(chunk) as any); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this is just
Since versions made using
fromVersionString
throw away pre-releases tags.