From 9225568eec5c88d49e91afd9f7f1b7a541bcbe4b Mon Sep 17 00:00:00 2001 From: Daniel Parnell Date: Mon, 12 Feb 2024 21:35:46 +1100 Subject: [PATCH] fixes for deprecations --- .../WGSLBuiltInCompletionContributor.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/wgslplugin/language/WGSLBuiltInCompletionContributor.java b/src/main/java/wgslplugin/language/WGSLBuiltInCompletionContributor.java index d6bed37..011a0d7 100644 --- a/src/main/java/wgslplugin/language/WGSLBuiltInCompletionContributor.java +++ b/src/main/java/wgslplugin/language/WGSLBuiltInCompletionContributor.java @@ -116,34 +116,41 @@ private Set getKeywords(PsiElement element) { } private LookupElement createStaticMethod(String name, List arguments) { + LayeredIcon icon = new LayeredIcon(2); + icon.setIcon(AllIcons.Nodes.Method, 0); + icon.setIcon(AllIcons.Nodes.StaticMark, 1); + return LookupElementBuilder.create(name) - .withIcon(new LayeredIcon(AllIcons.Nodes.Method, AllIcons.Nodes.StaticMark)) + .withIcon(icon) .withTailText("(" + String.join(", ", arguments) + ")") .withInsertHandler(WITH_PARAMETERS); } private LookupElement createRegularMethod(String name, List arguments) { return LookupElementBuilder.create(name) - .withIcon(new LayeredIcon(AllIcons.Nodes.Method)) + .withIcon(AllIcons.Nodes.Method) .withTailText("(" + String.join(", ", arguments) + ")") .withInsertHandler(WITH_PARAMETERS); } private LookupElement createGlobalConstant(String name, String type) { return LookupElementBuilder.create(name) - .withIcon(new LayeredIcon(AllIcons.Nodes.Constant)) + .withIcon(AllIcons.Nodes.Constant) .withTailText(":" + type); } private LookupElement createGlobalVariable(String name, String type) { return LookupElementBuilder.create(name) - .withIcon(new LayeredIcon(AllIcons.Nodes.Variable)) + .withIcon(AllIcons.Nodes.Variable) .withTailText(":" + type); } private LookupElement createStruct(String name) { + LayeredIcon icon = new LayeredIcon(2); + icon.setIcon(AllIcons.Nodes.Class, 0); + icon.setIcon(AllIcons.Nodes.StaticMark, 1); return LookupElementBuilder.create(name) - .withIcon(new LayeredIcon(AllIcons.Nodes.Class, AllIcons.Nodes.StaticMark)); + .withIcon(icon); } }