validateapi

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DanglingActionRule

type DanglingActionRule struct {
	// contains filtered or unexported fields
}

DanglingActionRule checks for actions that don't exist in the action mappings.

func (*DanglingActionRule) Validate

func (r *DanglingActionRule) Validate(_ context.Context, validationContext *ValidationContext) error

Validate checks for dangling actions in the keymap setting.

type DuplicateMappingRule

type DuplicateMappingRule struct{}

DuplicateMappingRule detects duplicate mappings (same action and keys combination).

func (*DuplicateMappingRule) Validate

func (r *DuplicateMappingRule) Validate(_ context.Context, validationContext *ValidationContext) error

Validate checks for duplicate mappings and adds warnings to the report.

type KeybindConflictRule

type KeybindConflictRule struct{}

KeybindConflictRule checks for keybinding conflicts where multiple actions are mapped to the same key combination.

func (*KeybindConflictRule) Validate

func (r *KeybindConflictRule) Validate(_ context.Context, validationContext *ValidationContext) error

Validate checks for keybinding conflicts in the keymap setting.

type PotentialShadowingRule

type PotentialShadowingRule struct {
	// contains filtered or unexported fields
}

PotentialShadowingRule detects keybindings that might shadow critical system or editor shortcuts.

func (*PotentialShadowingRule) Validate

func (r *PotentialShadowingRule) Validate(_ context.Context, validationContext *ValidationContext) error

Validate checks for keybindings that might shadow critical system shortcuts.

type UnsupportedActionRule

type UnsupportedActionRule struct {
	// contains filtered or unexported fields
}

UnsupportedActionRule detects actions that cannot be exported to a specific target editor.

func (*UnsupportedActionRule) Validate

func (r *UnsupportedActionRule) Validate(_ context.Context, validationContext *ValidationContext) error

Validate checks for actions that cannot be exported to the target editor.

type ValidationContext

type ValidationContext struct {
	Setting *keymapv1.Keymap
	Report  *keymapv1.ValidationReport
	Options importapi.ImportOptions
}

ValidationContext holds all the necessary data for a validation rule to execute.

type ValidationRule

type ValidationRule interface {
	Validate(ctx context.Context, validationContext *ValidationContext) error
}

func NewDanglingActionRule

func NewDanglingActionRule(mappingConfig *mappings.MappingConfig) ValidationRule

NewDanglingActionRule creates a new dangling action validation rule.

func NewDuplicateMappingRule

func NewDuplicateMappingRule() ValidationRule

NewDuplicateMappingRule creates a new duplicate mapping validation rule.

func NewKeybindConflictRule

func NewKeybindConflictRule() ValidationRule

NewKeybindConflictRule creates a new keybinding conflict validation rule.

func NewPotentialShadowingRule

func NewPotentialShadowingRule(targetEditor pluginapi.EditorType, platform platform.Platform) ValidationRule

NewPotentialShadowingRule creates a new potential shadowing validation rule.

func NewUnsupportedActionRule

func NewUnsupportedActionRule(mappingConfig *mappings.MappingConfig, targetEditor pluginapi.EditorType) ValidationRule

NewUnsupportedActionRule creates a new unsupported action validation rule.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator is a chain of responsibility container for validation rules.

func NewValidator

func NewValidator(rules ...ValidationRule) *Validator

NewValidator creates a new validator with no rules.

func (*Validator) Validate

Validate executes all validation rules in the chain.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL