瀏覽代碼

Fixes issue with insiders caused by new `SymbolInformation` API changes

main
Eric Amodio 6 年之前
父節點
當前提交
197a4abfdc
共有 4 個檔案被更改,包括 21 行新增6 行删除
  1. +3
    -0
      CHANGELOG.md
  2. +1
    -0
      README.md
  3. +10
    -5
      src/gitCodeLensProvider.ts
  4. +7
    -1
      src/ui/welcome/index.html

+ 3
- 0
CHANGELOG.md 查看文件

@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
- Fixes issue with insiders builds because of the new `SymbolInformation` API changes (see [Microsoft/vscode#34968](https://github.com/Microsoft/vscode/issues/34968))
## [8.4.0] - 2018-06-19
### Added
- Adds completely revamped heatmap annotations

+ 1
- 0
README.md 查看文件

@ -26,6 +26,7 @@
- Fixes [#400](https://github.com/eamodio/vscode-gitlens/issues/412) - GitLens logging to debug console when debugging different extension
- Fixes [#409](https://github.com/eamodio/vscode-gitlens/issues/409) - Literal $(ellipsis) inserted into commit QuickPick menu entry placeholder text
- Fixes [#415](https://github.com/eamodio/vscode-gitlens/issues/415) - Branch names get mangled by color escapes — thanks to [PR #416](https://github.com/eamodio/vscode-gitlens/pull/416) by Roy Ivy III ([@rivy](https://github.com/rivy))
- Fixes issue with insiders builds because of the new `SymbolInformation` API changes (see [Microsoft/vscode#34968](https://github.com/Microsoft/vscode/issues/34968))
See the [release notes](https://github.com/eamodio/vscode-gitlens/blob/master/CHANGELOG.md "Open Release Notes") for the full set of changes

+ 10
- 5
src/gitCodeLensProvider.ts 查看文件

@ -165,7 +165,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
blameForRangeFn,
blameRange,
true,
fileSymbol.location.range,
getRangeFromSymbol(fileSymbol),
cfg.recentChange.command,
dirtyCommand
));
@ -182,7 +182,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
blameForRangeFn,
blameRange,
true,
fileSymbol.location.range,
getRangeFromSymbol(fileSymbol),
cfg.authors.command
));
}
@ -216,7 +216,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
if (valid) {
// Adjust the range to be for the whole file
if (symbol.location.range.start.line === 0 && symbol.location.range.end.line === 0) {
if (getRangeFromSymbol(symbol).start.line === 0 && getRangeFromSymbol(symbol).end.line === 0) {
range = documentRangeFn();
}
}
@ -248,14 +248,14 @@ export class GitCodeLensProvider implements CodeLensProvider {
break;
}
return valid ? range || symbol.location.range : undefined;
return valid ? range || getRangeFromSymbol(symbol) : undefined;
}
private provideCodeLens(lenses: CodeLens[], document: TextDocument, symbol: SymbolInformation, languageScope: Required<CodeLensLanguageScope>, documentRangeFn: () => Range, blame: GitBlame | undefined, gitUri: GitUri | undefined, cfg: ICodeLensConfig, dirty: boolean, dirtyCommand: Command | undefined): void {
const blameRange = this.validateSymbolAndGetBlameRange(symbol, languageScope, documentRangeFn);
if (blameRange === undefined) return;
const line = document.lineAt(symbol.location.range.start);
const line = document.lineAt(getRangeFromSymbol(symbol).start);
// Make sure there is only 1 lens per line
if (lenses.length && lenses[lenses.length - 1].range.start.line === line.lineNumber) return;
@ -433,4 +433,9 @@ export class GitCodeLensProvider implements CodeLensProvider {
if (cfg.recentChange.enabled) return Container.config.strings.codeLens.unsavedChanges.recentChangeOnly;
return Container.config.strings.codeLens.unsavedChanges.authorsOnly;
}
}
function getRangeFromSymbol(symbol: SymbolInformation) {
// Normalize the range to deal with the new api
return (symbol.location && symbol.location.range) || (symbol as any).range;
}

+ 7
- 1
src/ui/welcome/index.html 查看文件

@ -76,7 +76,6 @@
<a title="Maxim Pekurin (@pmaxim25)" href="https://github.com/pmaxim25">Maxim Pekurin</a>
<div class="changelog__details"></div>
</li>
<li>
<span class="changelog__badge changelog__badge--added">NEW</span>
Adds
@ -122,6 +121,13 @@
<a title="Roy Ivy III (@rivy)" href="https://github.com/rivy">Roy Ivy III</a>
<div class="changelog__details"></div>
</li>
<li>
<span class="changelog__badge changelog__badge--fixed">FIXED</span>
Fixes issue with insiders builds because of the new
<code>SymbolInformation</code> API changes (see
<a title="Open Microsoft/vscode Issue #34968" href="https://github.com/Microsoft/vscode/issues/34968">Microsoft/vscode#34968</a>)
<div class="changelog__details"></div>
</li>
<li class="changelog__list-item--version">
<span class="changelog__badge changelog__badge--version">8.3</span>

Loading…
取消
儲存