From 1b63f33d4372aa9b519e7fbb873798af683d4790 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sat, 17 Aug 2024 05:47:05 -0700 Subject: [PATCH] Colored autocompletion icons --- src-web/components/core/Editor/Editor.css | 33 ++++++++++++----------- src-web/hooks/useTemplateFunctions.ts | 2 +- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src-web/components/core/Editor/Editor.css b/src-web/components/core/Editor/Editor.css index 6106be7b..365ff6d6 100644 --- a/src-web/components/core/Editor/Editor.css +++ b/src-web/components/core/Editor/Editor.css @@ -216,28 +216,35 @@ @apply shadow-lg bg-surface rounded text-text-subtle border border-border-subtle z-50 pointer-events-auto text-editor; .cm-completionIcon { - @apply italic font-mono; + @apply font-mono opacity-80 italic; &::after { - content: 'x' !important; /* Default (eg. for GraphQL) */ + content: 'a' !important; /* Default (eg. for GraphQL) */ + } + + &.cm-completionIcon-function::after { + content: 'f' !important; + @apply text-info; + } + + &.cm-completionIcon-variable::after { + content: 'x' !important; + @apply text-primary; + } + + &.cm-completionIcon-constant::after { + content: 'c' !important; + @apply text-notice; } &.cm-completionIcon-class::after { content: 'o' !important; } - &.cm-completionIcon-constant::after { - content: 'c' !important; - } - &.cm-completionIcon-enum::after { content: 'e' !important; } - &.cm-completionIcon-function::after { - content: 'z' !important; - } - &.cm-completionIcon-interface::after { content: 'i' !important; } @@ -259,16 +266,12 @@ } &.cm-completionIcon-text::after { - content: 'x' !important; + content: 't' !important; } &.cm-completionIcon-type::after { content: 't' !important; } - - &.cm-completionIcon-variable::after { - content: 'x' !important; - } } &.cm-completionInfo-right { diff --git a/src-web/hooks/useTemplateFunctions.ts b/src-web/hooks/useTemplateFunctions.ts index 117a5f7d..c1602e23 100644 --- a/src-web/hooks/useTemplateFunctions.ts +++ b/src-web/hooks/useTemplateFunctions.ts @@ -54,7 +54,7 @@ export function useTemplateFunctions() { { name: 'Unix (ms)', value: 'unix_millis' }, ], optional: true, - defaultValue: 'RFC3339', + defaultValue: 'rfc3339', }, ], },