Skip to content

Commit

Permalink
Remove copilot code block scheme (microsoft#225071)
Browse files Browse the repository at this point in the history
This scheme is no longer used
  • Loading branch information
mjbvz authored Aug 7, 2024
1 parent 5eb2a65 commit ca51dd3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/vs/base/common/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ export namespace Schemas {
/** Scheme used for code blocks in chat. */
export const vscodeChatCodeBlock = 'vscode-chat-code-block';

/**
* Scheme used for backing documents created by copilot for chat.
*/
export const vscodeCopilotBackingChatCodeBlock = 'vscode-copilot-chat-code-block';

/** Scheme used for LHS of code compare (aka diff) blocks in chat. */
export const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/gotoSymbol/browser/goToSymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function shouldIncludeLocationLink(sourceModel: ITextModel, loc: LocationLink):
}

// Otherwise filter out locations from internal schemes
if (matchesSomeScheme(loc.uri, Schemas.walkThroughSnippet, Schemas.vscodeChatCodeBlock, Schemas.vscodeChatCodeCompareBlock, Schemas.vscodeCopilotBackingChatCodeBlock)) {
if (matchesSomeScheme(loc.uri, Schemas.walkThroughSnippet, Schemas.vscodeChatCodeBlock, Schemas.vscodeChatCodeCompareBlock)) {
return false;
}

Expand Down
1 change: 0 additions & 1 deletion src/vs/platform/markers/common/markerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const unsupportedSchemas = new Set([
Schemas.walkThrough,
Schemas.walkThroughSnippet,
Schemas.vscodeChatCodeBlock,
Schemas.vscodeCopilotBackingChatCodeBlock,
]);

class DoubleResourceMap<V> {
Expand Down
10 changes: 2 additions & 8 deletions src/vs/workbench/contrib/chat/browser/chatWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { disposableTimeout, timeout } from 'vs/base/common/async';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, DisposableStore, IDisposable, MutableDisposable, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { matchesScheme, Schemas } from 'vs/base/common/network';
import { Schemas } from 'vs/base/common/network';
import { extUri, isEqual } from 'vs/base/common/resources';
import { isDefined } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
Expand Down Expand Up @@ -223,13 +223,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
this._codeBlockModelCollection = this._register(instantiationService.createInstance(CodeBlockModelCollection));

this._register(codeEditorService.registerCodeEditorOpenHandler(async (input: ITextResourceEditorInput, _source: ICodeEditor | null, _sideBySide?: boolean): Promise<ICodeEditor | null> => {
let resource = input.resource;

// if trying to open backing documents, actually open the real chat code block doc
if (matchesScheme(resource, Schemas.vscodeCopilotBackingChatCodeBlock)) {
resource = resource.with({ scheme: Schemas.vscodeChatCodeBlock });
}

const resource = input.resource;
if (resource.scheme !== Schemas.vscodeChatCodeBlock) {
return null;
}
Expand Down

0 comments on commit ca51dd3

Please sign in to comment.