Explorar el Código

Fixes #2037 saving autolinks w/ bogus cache props

main
Eric Amodio hace 2 años
padre
commit
b44249404e
Se han modificado 2 ficheros con 11 adiciones y 1 borrados
  1. +7
    -0
      CHANGELOG.md
  2. +4
    -1
      src/annotations/autolinks.ts

+ 7
- 0
CHANGELOG.md Ver fichero

@ -4,6 +4,12 @@ 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]
## Fixed
- Fixes [#2037](https://github.com/gitkraken/vscode-gitlens/issues/2037) - Autolinks can end up getting saved with invalid (cached) properties
## [12.1.0] - 2022-06-14
## Added
@ -4213,6 +4219,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Initial release but still heavily a work in progress.
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/v12.1.0...HEAD
[12.1.0]: https://github.com/gitkraken/vscode-gitlens/compare/v12.0.7...gitkraken:v12.1.0
[12.0.6]: https://github.com/gitkraken/vscode-gitlens/compare/v12.0.6...gitkraken:v12.0.7
[12.0.6]: https://github.com/gitkraken/vscode-gitlens/compare/v12.0.5...gitkraken:v12.0.6

+ 4
- 1
src/annotations/autolinks.ts Ver fichero

@ -61,7 +61,9 @@ export class Autolinks implements Disposable {
private onConfigurationChanged(e?: ConfigurationChangeEvent) {
if (configuration.changed(e, 'autolinks')) {
this._references = this.container.config.autolinks ?? [];
const autolinks = configuration.get('autolinks');
// Since VS Code's configuration objects are live we need to copy them to avoid writing back to the configuration
this._references = autolinks != null ? autolinks.map(a => ({ ...a })) : [];
}
}
@ -199,6 +201,7 @@ export class Autolinks implements Disposable {
issuesOrPullRequests?: Map<string, IssueOrPullRequest | PromiseCancelledError | undefined>,
): ref is CacheableAutolinkReference | DynamicAutolinkReference {
if (isDynamic(ref)) return true;
if (!ref.prefix || !ref.url) return false;
try {
if (ref.messageMarkdownRegex == null) {

Cargando…
Cancelar
Guardar