Skip to content

Commit 62a7eaf

Browse files
committed
Fixes #331 - Code lens shows on every import in Python
1 parent e170e9e commit 62a7eaf

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1212
- Marks temporary files (used when showing comparisions with previous revisions) as read-only to help avoid accidental edits/saving
1313

1414
### Fixed
15+
- Fixes [#331](https://github.com/eamodio/vscode-gitlens/issues/331) - Code lens shows on every import in Python
1516
- Fixes issues where quick pick menu progress indicators will get stuck in some cases because of a vscode api change in [Microsoft/vscode#46102](https://github.com/Microsoft/vscode/pull/46102)
1617

1718
## [8.2.0] - 2018-03-31

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,26 @@
238238
"document"
239239
]
240240
},
241+
{
242+
"language": "python",
243+
"symbolScopes": [
244+
"!Module"
245+
]
246+
},
241247
{
242248
"language": "scss",
243249
"scopes": [
244250
"document"
245251
]
246252
},
247253
{
248-
"language": "vue",
254+
"language": "stylus",
249255
"scopes": [
250256
"document"
251257
]
252258
},
253259
{
254-
"language": "stylus",
260+
"language": "vue",
255261
"scopes": [
256262
"document"
257263
]

src/gitCodeLensProvider.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ export class GitCodeLensProvider implements CodeLensProvider {
9595
symbolScopes: cfg.symbolScopes
9696
} as CodeLensLanguageScope;
9797
}
98+
else {
99+
if (languageScope.scopes === undefined) {
100+
languageScope.scopes = cfg.scopes;
101+
}
102+
if (languageScope.symbolScopes === undefined) {
103+
languageScope.symbolScopes = cfg.symbolScopes;
104+
}
105+
}
98106

99107
languageScope.symbolScopes = languageScope.symbolScopes != null
100108
? languageScope.symbolScopes = languageScope.symbolScopes.map(s => s.toLowerCase())

0 commit comments

Comments
 (0)