void updateEditorInlays() {
    final Project project = editor.getProject();
    if (project == null) {
      return;
    }
    final String text = editor.getDocument().getText();
    final Template template = TemplateManager.getInstance(project).createTemplate("", "", text);
    final int segmentsCount = template.getSegmentsCount();
    final InlayModel inlayModel = editor.getInlayModel();
    final HashSet<String> variables = new HashSet<>(inlays.keySet());
    final Configuration configuration = editor.getUserData(CURRENT_CONFIGURATION_KEY);
    if (configuration == null) return;
    int variableNameLength = 0;
    for (int i = 0; i < segmentsCount; i++) {
      final int offset = template.getSegmentOffset(i);
      final String name = template.getSegmentName(i);
      variableNameLength += name.length() + 2;
      final NamedScriptableDefinition variable = configuration.findVariable(name);
      final String labelText = myShortFilterTextProvider.getShortFilterText(variable);
      if (labelText.isEmpty()) {
        continue;
      }
      variables.remove(name);
      final Inlay<FilterRenderer> inlay = inlays.get(name);
      if (inlay == null) {
        inlays.put(name, inlayModel.addInlineElement(offset + variableNameLength, new FilterRenderer(labelText)));
      }
      else {
        final FilterRenderer renderer = inlay.getRenderer();
        renderer.setText(labelText);
        inlay.update();
      }
    }
    final NamedScriptableDefinition contextVariable = configuration.findVariable(Configuration.CONTEXT_VAR_NAME);
    final String labelText = myShortFilterTextProvider.getShortFilterText(contextVariable);
    if (!labelText.isEmpty()) {
      variables.remove(Configuration.CONTEXT_VAR_NAME);
      final Inlay<FilterRenderer> inlay = inlays.get(Configuration.CONTEXT_VAR_NAME);
      if (inlay == null) {
        inlays.put(Configuration.CONTEXT_VAR_NAME,
                   inlayModel.addBlockElement(text.length() + variableNameLength, true, false, 0,
                                              new FilterRenderer("whole template: " + labelText)));
      }
      else {
        final FilterRenderer renderer = inlay.getRenderer();
        renderer.setText("whole template: " + labelText);
        inlay.update();
      }
    }
    for (String variable : variables) {
      Disposer.dispose(inlays.remove(variable));
    }
  }
void updateEditorInlays()