Skip to content

Commit

Permalink
fix: support new vscode-scm scheme
Browse files Browse the repository at this point in the history
A recent change to VS Code changed the scheme used for the SCM input
from `vscode` to `vscode-scm`. Recognize either scheme as that of the
SCM input.

See:
microsoft/vscode#35571 (comment)
  • Loading branch information
joshbolduc committed Sep 5, 2022
1 parent e9aa78b commit 98fd242
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.ts
Expand Up @@ -3,6 +3,7 @@ import type { TextDocument } from 'vscode';
export const GIT_COMMIT_LANGUAGE_ID = 'git-commit';
const SCMINPUT_LANGUAGE_ID = 'scminput';
const VSCODE_URI_SCHEME = 'vscode';
const VSCODESCM_URI_SCHEME = 'vscode-scm';

export function isGitCommitDoc(doc: TextDocument) {
return doc.languageId === GIT_COMMIT_LANGUAGE_ID;
Expand All @@ -11,6 +12,7 @@ export function isGitCommitDoc(doc: TextDocument) {
export function isScmTextInput(doc: TextDocument) {
return (
doc.languageId === SCMINPUT_LANGUAGE_ID &&
doc.uri.scheme === VSCODE_URI_SCHEME
(doc.uri.scheme === VSCODE_URI_SCHEME ||
doc.uri.scheme === VSCODESCM_URI_SCHEME)
);
}

0 comments on commit 98fd242

Please sign in to comment.