Code review comment: Isn't it more suitable to represent these strings Eg:- "Receiver" constants?

Code under review:
private void annotateLeafPsiElementNodes(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
        IElementType elementType = ((LeafPsiElement) element).getElementType();
        if (elementType == BallerinaTypes.AT && element.getParent() instanceof AnnotationAttachmentNode) {
            Annotation annotation = holder.createInfoAnnotation(element, null);
            annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.ANNOTATION);
        } else if (elementType == BallerinaTypes.QUOTED_STRING) {
            
            String text = element.getText();
            Matcher matcher = VALID_ESCAPE_CHAR_PATTERN.matcher(text);
            
            int startOffset = ((LeafPsiElement) element).getStartOffset();
            
            while (matcher.find()) {
                
                String group = matcher.group(0);
                
                TextRange range = new TextRange(startOffset + matcher.start(),
                        startOffset + matcher.start() + group.length());
                
                Annotation annotation = holder.createInfoAnnotation(range, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.VALID_STRING_ESCAPE);
            }

            
            matcher = INVALID_ESCAPE_CHAR_PATTERN.matcher(text);
            
            startOffset = ((LeafPsiElement) element).getStartOffset();
            
            while (matcher.find()) {
                
                String group = matcher.group(3);
                if (group != null) {
                    
                    TextRange range = new TextRange(startOffset + matcher.start(3),
                            startOffset + matcher.start(3) + group.length());
                    
                    Annotation annotation = holder.createInfoAnnotation(range, "Invalid string escape");
                    annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.INVALID_STRING_ESCAPE);
                }
            }

            AnnotationAttributeNode annotationAttributeNode = PsiTreeUtil.getParentOfType(element,
                    AnnotationAttributeNode.class);
            boolean canHighlightParameters = canHighlightParameters(element);
            if (canHighlightParameters && annotationAttributeNode != null) {
                
                matcher = PATH_PARAMETERS_PATTERN.matcher(text);
                
                startOffset = ((LeafPsiElement) element).getStartOffset();
                
                while (matcher.find()) {
                    
                    String value = matcher.group(2);
                    if (value == null) {
                        continue;
                    }
                    
                    
                    TextRange range = new TextRange(startOffset + matcher.start(1),
                            startOffset + matcher.start(1) + value.length() + 2);
                    
                    boolean isMatchAvailable = isMatchingParamAvailable(annotationAttributeNode, value);
                    
                    if (isMatchAvailable) {
                        Annotation annotation = holder.createInfoAnnotation(range,
                                "Path parameter '" + value + "'");
                        annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.TEMPLATE_LANGUAGE_COLOR);
                    } else {
                        Annotation annotation = holder.createErrorAnnotation(range,
                                "Path parameter '" + value + "' not found in the resource signature");
                        annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.INVALID_STRING_ESCAPE);
                    }
                }
            }
        } else if (elementType == BallerinaTypes.STRING_TEMPLATE_LITERAL_START
                || elementType == BallerinaTypes.XML_START) {
            annotateKeyword(element, holder);
        } else if (elementType == BallerinaTypes.DOCUMENTATION_TEMPLATE_START ||
                elementType == BallerinaTypes.DEPRECATED_TEMPLATE_START) {
            
            annotateKeyword(element, holder, BallerinaSyntaxHighlightingColors.KEYWORD);
        } else if (elementType == BallerinaTypes.STRING_TEMPLATE_EXPRESSION_START
                || elementType == BallerinaTypes.XML_EXPRESSION_START) {
            annotateExpressionTemplateStart(element, holder);
        } else if (elementType == BallerinaTypes.STRING_TEMPLATE_TEXT || elementType == BallerinaTypes.XML_TEXT) {
            annotateText(element, holder);
        } else if (elementType == BallerinaTypes.EXPRESSION_END) {
            annotateStringLiteralTemplateEnd(element, holder);
        } else if (elementType == BallerinaTypes.DOCUMENTATION_TEMPLATE_ATTRIBUTE_START) {
            
            String msg = null;
            switch (element.getText().charAt(0)) {
                case 'T':
                    msg = "Receiver";
                    break;
                case 'P':
                    msg = "Parameter";
                    break;
                case 'R':
                    msg = "Return Value";
                    break;
                case 'F':
                    msg = "Field";
                    break;
                case 'V':
                    msg = "Variable";
                    break;
            }
            TextRange textRange = element.getTextRange();
            TextRange newTextRange = new TextRange(textRange.getStartOffset(), textRange.getEndOffset() - 2);
            Annotation annotation = holder.createInfoAnnotation(newTextRange, msg);
            annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.DOCUMENTATION_INLINE_CODE);
        } else if (element instanceof IdentifierPSINode) {
            if (element.getParent() instanceof DocumentationTemplateAttributeDescriptionNode) {
                Annotation annotation = holder.createInfoAnnotation(element, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.DOCUMENTATION_INLINE_CODE);
            }
            PsiReference reference = element.getReference();
            if (reference == null || reference instanceof RecordKeyReference) {
                return;
            }
            PsiElement resolvedElement = reference.resolve();
            if (resolvedElement == null) {
                return;
            }
            PsiElement parent = resolvedElement.getParent();
            if (parent instanceof ConstantDefinitionNode) {
                Annotation annotation = holder.createInfoAnnotation(element, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.CONSTANT);
            } else if (parent instanceof GlobalVariableDefinitionNode) {
                Annotation annotation = holder.createInfoAnnotation(element, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.GLOBAL_VARIABLE);
            }
        }
    }

Line commented on: msg = "Receiver";

Revised code:
private void annotateLeafPsiElementNodes(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
        IElementType elementType = ((LeafPsiElement) element).getElementType();
        if (elementType == BallerinaTypes.AT && element.getParent() instanceof AnnotationAttachmentNode) {
            Annotation annotation = holder.createInfoAnnotation(element, null);
            annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.ANNOTATION);
        } else if (elementType == BallerinaTypes.QUOTED_STRING) {
            
            String text = element.getText();
            Matcher matcher = VALID_ESCAPE_CHAR_PATTERN.matcher(text);
            
            int startOffset = ((LeafPsiElement) element).getStartOffset();
            
            while (matcher.find()) {
                
                String group = matcher.group(0);
                
                TextRange range = new TextRange(startOffset + matcher.start(),
                        startOffset + matcher.start() + group.length());
                
                Annotation annotation = holder.createInfoAnnotation(range, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.VALID_STRING_ESCAPE);
            }

            
            matcher = INVALID_ESCAPE_CHAR_PATTERN.matcher(text);
            
            startOffset = ((LeafPsiElement) element).getStartOffset();
            
            while (matcher.find()) {
                
                String group = matcher.group(3);
                if (group != null) {
                    
                    TextRange range = new TextRange(startOffset + matcher.start(3),
                            startOffset + matcher.start(3) + group.length());
                    
                    Annotation annotation = holder.createInfoAnnotation(range, "Invalid string escape");
                    annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.INVALID_STRING_ESCAPE);
                }
            }

            AnnotationAttributeNode annotationAttributeNode = PsiTreeUtil.getParentOfType(element,
                    AnnotationAttributeNode.class);
            boolean canHighlightParameters = canHighlightParameters(element);
            if (canHighlightParameters && annotationAttributeNode != null) {
                
                matcher = PATH_PARAMETERS_PATTERN.matcher(text);
                
                startOffset = ((LeafPsiElement) element).getStartOffset();
                
                while (matcher.find()) {
                    
                    String value = matcher.group(2);
                    if (value == null) {
                        continue;
                    }
                    
                    
                    TextRange range = new TextRange(startOffset + matcher.start(1),
                            startOffset + matcher.start(1) + value.length() + 2);
                    
                    boolean isMatchAvailable = isMatchingParamAvailable(annotationAttributeNode, value);
                    
                    if (isMatchAvailable) {
                        Annotation annotation = holder.createInfoAnnotation(range,
                                "Path parameter '" + value + "'");
                        annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.TEMPLATE_LANGUAGE_COLOR);
                    } else {
                        Annotation annotation = holder.createErrorAnnotation(range,
                                "Path parameter '" + value + "' not found in the resource signature");
                        annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.INVALID_STRING_ESCAPE);
                    }
                }
            }
        } else if (elementType == BallerinaTypes.STRING_TEMPLATE_LITERAL_START
                || elementType == BallerinaTypes.XML_START) {
            annotateKeyword(element, holder);
        } else if (elementType == BallerinaTypes.DOCUMENTATION_TEMPLATE_START ||
                elementType == BallerinaTypes.DEPRECATED_TEMPLATE_START) {
            
            annotateKeyword(element, holder, BallerinaSyntaxHighlightingColors.KEYWORD);
        } else if (elementType == BallerinaTypes.STRING_TEMPLATE_EXPRESSION_START
                || elementType == BallerinaTypes.XML_EXPRESSION_START) {
            annotateExpressionTemplateStart(element, holder);
        } else if (elementType == BallerinaTypes.STRING_TEMPLATE_TEXT || elementType == BallerinaTypes.XML_TEXT) {
            annotateText(element, holder);
        } else if (elementType == BallerinaTypes.EXPRESSION_END) {
            annotateStringLiteralTemplateEnd(element, holder);
        } else if (elementType == BallerinaTypes.DOCUMENTATION_TEMPLATE_ATTRIBUTE_START) {
            
            String msg = null;
            switch (element.getText().charAt(0)) {
                case 'T':
                    msg = "Receiver";
                    break;
                case 'P':
                    msg = "Parameter";
                    break;
                case 'R':
                    msg = "Return Value";
                    break;
                case 'F':
                    msg = "Field";
                    break;
                case 'V':
                    msg = "Variable";
                    break;
            }
            TextRange textRange = element.getTextRange();
            TextRange newTextRange = new TextRange(textRange.getStartOffset(), textRange.getEndOffset() - 2);
            Annotation annotation = holder.createInfoAnnotation(newTextRange, msg);
            annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.DOCUMENTATION_INLINE_CODE);
        } else if (element instanceof IdentifierPSINode) {
            if (element.getParent() instanceof DocumentationTemplateAttributeDescriptionNode) {
                Annotation annotation = holder.createInfoAnnotation(element, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.DOCUMENTATION_INLINE_CODE);
            }
            PsiReference reference = element.getReference();
            if (reference == null || reference instanceof RecordKeyReference) {
                return;
            }
            PsiElement resolvedElement = reference.resolve();
            if (resolvedElement == null) {
                return;
            }
            PsiElement parent = resolvedElement.getParent();
            if (parent instanceof ConstantDefinitionNode) {
                Annotation annotation = holder.createInfoAnnotation(element, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.CONSTANT);
            } else if (parent instanceof GlobalVariableDefinitionNode) {
                Annotation annotation = holder.createInfoAnnotation(element, null);
                annotation.setTextAttributes(BallerinaSyntaxHighlightingColors.GLOBAL_VARIABLE);
            }
        }
    }