Skip to content

Commit 9e73dc1

Browse files
committed
Fix memoize
1 parent 8df89df commit 9e73dc1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/clojure/com/github/clojure_lsp/intellij/extension/semantic_token_provider.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
(doto (.clone (.getDefaultAttributes text-attribute-key))
2222
(.setFontType Font/BOLD))))
2323

24-
(def ^:private bold-function-declaration
24+
(defn ^:private bold-function-declaration* []
2525
(make-bold SemanticTokensHighlightingColors/FUNCTION_DECLARATION))
2626

27+
(def ^:private bold-function-declaration (memoize bold-function-declaration*))
28+
2729
(defn -getTextAttributesKey [_ ^String token-type ^List token-modifiers ^PsiFile psi-file]
2830
(condp = token-type
2931
SemanticTokenTypes/Namespace SemanticTokensHighlightingColors/STATIC_PROPERTY
3032
SemanticTokenTypes/Function (if (modifier? SemanticTokenModifiers/Definition token-modifiers)
31-
bold-function-declaration
33+
(bold-function-declaration)
3234
SemanticTokensHighlightingColors/MACRO)
3335
SemanticTokenTypes/Type SemanticTokensHighlightingColors/STATIC_PROPERTY
3436
SemanticTokenTypes/Variable SemanticTokensHighlightingColors/READONLY_VARIABLE

0 commit comments

Comments
 (0)