Skip to content

Commit c0934a0

Browse files
authored
feat: remove decorations column display support (#289)
1 parent 48e15d6 commit c0934a0

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
[
2828
"git.blame.decorations"
2929
],
30-
"${(config.git.blame.decorations === 'line' && 'file') || (config.git.blame.decorations === 'file' && 'none') || (clientApplication.isSourcegraph && experimentalFeatures.enableExtensionsDecorationsColumnView && 'file' || 'line')}",
30+
"${(config.git.blame.decorations === 'line' && 'file') || (config.git.blame.decorations === 'file' && 'none') || 'line'}",
3131
null
3232
],
3333
"category": "Git",
34-
"title": "${(config.git.blame.decorations === 'line' && 'Show blame for the whole file') || (config.git.blame.decorations === 'file' && 'Hide blame') || (clientApplication.isSourcegraph && experimentalFeatures.enableExtensionsDecorationsColumnView && 'Show blame for the whole file' || 'Show blame for selected lines')}",
34+
"title": "${(config.git.blame.decorations === 'line' && 'Show blame for the whole file') || (config.git.blame.decorations === 'file' && 'Hide blame') || 'Show blame for selected lines'}",
3535
"actionItem": {
3636
"label": "Blame",
37-
"description": "${(config.git.blame.decorations === 'line' && 'Show Git blame line annotations for the whole file') || (config.git.blame.decorations === 'file' && 'Hide Git blame line annotations') || (clientApplication.isSourcegraph && experimentalFeatures.enableExtensionsDecorationsColumnView && 'Show Git blame line annotations for the whole file' || 'Show Git blame line annotations on selected lines')}",
38-
"pressed": "((!clientApplication.isSourcegraph || !experimentalFeatures.enableExtensionsDecorationsColumnView) && config.git.blame.decorations === 'line') || (config.git.blame.decorations === 'file')",
37+
"description": "${(config.git.blame.decorations === 'line' && 'Show Git blame line annotations for the whole file') || (config.git.blame.decorations === 'file' && 'Hide Git blame line annotations') || 'Show Git blame line annotations on selected lines'}",
38+
"pressed": "(config.git.blame.decorations === 'line') || (config.git.blame.decorations === 'file')",
3939
"iconURL": "https://raw.githubusercontent.com/sourcegraph/sourcegraph-git-extras/63dd95962c43b95b3f3a9ea2aa0165d6b38a958c/icon/git_logo.svg?sanitize=true"
4040
}
4141
}
@@ -60,7 +60,11 @@
6060
"git.blame.decorations": {
6161
"description": "Whether to decorate all lines in a file, only selected lines, or none at all.",
6262
"type": "string",
63-
"enum": ["none", "line", "file"],
63+
"enum": [
64+
"none",
65+
"line",
66+
"file"
67+
],
6468
"default": "none"
6569
},
6670
"git.blame.showPreciseDate": {
@@ -140,7 +144,7 @@
140144
"prettier": "^1.19.1",
141145
"sinon": "^9.2.1",
142146
"source-map-support": "^0.5.12",
143-
"sourcegraph": "^25.6.0",
147+
"sourcegraph": "^25.7.0",
144148
"ts-node": "^8.10.2",
145149
"tslint": "^5.11.0",
146150
"typescript": "^4.1.2",

src/extension.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,9 @@ export interface Settings {
1010
['git.blame.lineDecorations']?: boolean
1111
['git.blame.decorateWholeFile']?: boolean
1212
['git.blame.showPreciseDate']?: boolean
13-
14-
experimentalFeatures?: {
15-
enableExtensionsDecorationsColumnView?: boolean
16-
}
1713
}
1814

19-
const isBlameForSelectedLinesEnabled = () =>
20-
!sourcegraph.configuration.get<Settings>().get('experimentalFeatures')?.enableExtensionsDecorationsColumnView ||
21-
sourcegraph.internal.clientApplication !== 'sourcegraph'
22-
23-
const decorationType =
24-
sourcegraph.app.createDecorationType && sourcegraph.app.createDecorationType({ display: 'column' })
15+
const decorationType = sourcegraph.app.createDecorationType && sourcegraph.app.createDecorationType()
2516

2617
const statusBarItemType = sourcegraph.app.createStatusBarItemType && sourcegraph.app.createStatusBarItemType()
2718

@@ -41,7 +32,7 @@ export function activate(context: sourcegraph.ExtensionContext): void {
4132
// When the configuration or current file changes, publish new decorations.
4233
context.subscriptions.add(
4334
combineLatest(configurationChanges, selectionChanges).subscribe(([, { editor, selections }]) =>
44-
decorate(editor, isBlameForSelectedLinesEnabled() ? selections : null)
35+
decorate(editor, selections)
4536
)
4637
)
4738
} else {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6601,10 +6601,10 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6:
66016601
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
66026602
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
66036603

6604-
sourcegraph@^25.6.0:
6605-
version "25.6.0"
6606-
resolved "https://registry.yarnpkg.com/sourcegraph/-/sourcegraph-25.6.0.tgz#fc23822a8e207e25ff9bfc217dad4a14bfbd1e84"
6607-
integrity sha512-BKe/hugALfgMyM38ecWpeFLtXvVklq++aUpGlm4Y3fY8/ufbUE/FAaYchF9qkidli8Usef5xnDRCKbAfsPRpWA==
6604+
sourcegraph@^25.7.0:
6605+
version "25.7.0"
6606+
resolved "https://registry.yarnpkg.com/sourcegraph/-/sourcegraph-25.7.0.tgz#fb1e7a0b7d0547447f524a1d0dcf18407e70cdbf"
6607+
integrity sha512-3Xdr480Ojkl9fZfaOH7xDy4N8YeQOyccNKVlObOJcj4SR7oFLOra1EFYoMrJPZ9axuD1hSi+34YCx5vocGlRzQ==
66086608

66096609
spawn-wrap@^1.4.2:
66106610
version "1.4.2"

0 commit comments

Comments
 (0)