Bläddra i källkod

Copies only known properties from autolinks

Refs #2037
main
Eric Amodio 2 år sedan
förälder
incheckning
1dcf1bd011
1 ändrade filer med 15 tillägg och 1 borttagningar
  1. +15
    -1
      src/annotations/autolinks.ts

+ 15
- 1
src/annotations/autolinks.ts Visa fil

@ -63,7 +63,21 @@ export class Autolinks implements Disposable {
if (configuration.changed(e, '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 })) : [];
this._references =
autolinks
?.filter(a => a.prefix && a.url)
/**
* Only allow properties defined by {@link AutolinkReference}
*/
?.map(a => ({
prefix: a.prefix,
url: a.url,
title: a.title,
alphanumeric: a.alphanumeric,
ignoreCase: a.ignoreCase,
type: a.type,
description: a.description,
})) ?? [];
}
}

Laddar…
Avbryt
Spara