File tree 1 file changed +11
-2
lines changed
src/languageservice/services
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -691,8 +691,17 @@ export class YamlCompletion {
691
691
} ) ;
692
692
}
693
693
694
- const hasMatchingAlias = ( propSchema : JSONSchema ) : boolean => {
694
+ const hasMatchingProperty = ( key : string , propSchema : JSONSchema ) : boolean => {
695
695
return node . items . some ( ( pair ) => {
696
+ if ( ! isScalar ( pair . key ) || typeof pair . key . value !== 'string' ) {
697
+ return false ;
698
+ }
699
+
700
+ const ignoreCase = shouldIgnoreCase ( propSchema , 'key' ) ;
701
+ if ( ignoreCase && pair . key . value . toUpperCase ( ) === key . toUpperCase ( ) && pair . key . value !== key ) {
702
+ return true ;
703
+ }
704
+
696
705
if ( Array . isArray ( propSchema . aliases ) ) {
697
706
return propSchema . aliases . some ( ( alias ) => {
698
707
if ( ! isScalar ( pair . key ) || typeof pair . key . value !== 'string' ) {
@@ -749,7 +758,7 @@ export class YamlCompletion {
749
758
typeof propertySchema === 'object' &&
750
759
! propertySchema . deprecationMessage &&
751
760
! propertySchema [ 'doNotSuggest' ] &&
752
- ! hasMatchingAlias ( propertySchema )
761
+ ! hasMatchingProperty ( key , propertySchema )
753
762
) {
754
763
let identCompensation = '' ;
755
764
if ( nodeParent && isSeq ( nodeParent ) && node . items . length <= 1 && ! hasOnlyWhitespace ) {
You can’t perform that action at this time.
0 commit comments