MCPcopy
hub / github.com/VSCodeVim/Vim / get

Function get

src/configuration/configuration.ts:527–548  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

525 return (target: any, propertyKey: string) => {
526 Object.defineProperty(target, propertyKey, {
527 get() {
528 // retrieve value from vim configuration
529 // if the value is not defined or empty
530 // look at the equivalent `editor` setting
531 // if that is not defined then defer to the default value
532 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
533 let val = this['_' + propertyKey];
534 if (val !== undefined && val !== '') {
535 // eslint-disable-next-line @typescript-eslint/no-unsafe-return
536 return val;
537 }
538
539 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
540 val = this.getConfiguration('editor').get(args.settingName, args.defaultValue);
541 if (args.map && val !== undefined) {
542 // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
543 val = args.map.get(val);
544 }
545
546 // eslint-disable-next-line @typescript-eslint/no-unsafe-return
547 return val;
548 },
549 set(value) {
550 // synchronize the vim setting with the `editor` equivalent
551 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access

Callers

nothing calls this directly

Calls 2

getConfigurationMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected