From 9dbd9bbc8d25facf9a7d7390cb4b58df49183e32 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Wed, 13 May 2020 00:40:13 +0300 Subject: [PATCH] Replaced usage of deprecated API by new one --- resources/META-INF/plugin.xml | 9 +++++++-- src/com/zephir/ZephirFileTypeFactory.java | 20 ------------------- src/com/zephir/ZephirParserDefinition.java | 5 ----- .../zephir/actions/ZephirNewClassAction.java | 2 +- 4 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 src/com/zephir/ZephirFileTypeFactory.java diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index 2925754..f555bc8 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ com.zephir Zephir - 0.3.3 + 0.3.4 Zephir Team
    +
  • 0.3.4: Replaced usage of deprecated API by new one
  • 0.3.3: Fixed recognizing strings with regular expressions
  • 0.3.2: Completion list now shows members of class. Improved syntax support
  • 0.3.1: Fixed much bugs with syntax recognition, fixed extra space in completion for method params
  • @@ -48,7 +49,11 @@ com.intellij.modules.lang - + diff --git a/src/com/zephir/ZephirFileTypeFactory.java b/src/com/zephir/ZephirFileTypeFactory.java deleted file mode 100644 index d97d837..0000000 --- a/src/com/zephir/ZephirFileTypeFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2014-2019 Zephir Team -// -// This source file is subject the MIT license, that is bundled with -// this package in the file LICENSE, and is available through the -// world-wide-web at the following url: -// -// https://github.com/zephir-lang/idea-plugin/blob/master/LICENSE - -package com.zephir; - -import com.intellij.openapi.fileTypes.FileTypeConsumer; -import com.intellij.openapi.fileTypes.FileTypeFactory; -import org.jetbrains.annotations.NotNull; - -public class ZephirFileTypeFactory extends FileTypeFactory { - @Override - public void createFileTypes(@NotNull FileTypeConsumer consumer) { - consumer.consume(ZephirFileType.INSTANCE); - } -} diff --git a/src/com/zephir/ZephirParserDefinition.java b/src/com/zephir/ZephirParserDefinition.java index c03c84e..5fd168a 100644 --- a/src/com/zephir/ZephirParserDefinition.java +++ b/src/com/zephir/ZephirParserDefinition.java @@ -76,9 +76,4 @@ public PsiElement createElement(ASTNode node) { public PsiFile createFile(FileViewProvider provider) { return new ZephirFile(provider); } - - @Override - public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode astNode, ASTNode astNode2) { - return SpaceRequirements.MAY; - } } diff --git a/src/com/zephir/actions/ZephirNewClassAction.java b/src/com/zephir/actions/ZephirNewClassAction.java index 6729887..0f263fa 100644 --- a/src/com/zephir/actions/ZephirNewClassAction.java +++ b/src/com/zephir/actions/ZephirNewClassAction.java @@ -38,7 +38,7 @@ protected String getActionName(PsiDirectory directory, String name, String templ @Override protected PsiFile createFile(String name, String templateName, PsiDirectory dir) { - final FileTemplate template = FileTemplateManager.getInstance().getInternalTemplate(templateName); + final FileTemplate template = FileTemplateManager.getInstance(dir.getProject()).getInternalTemplate(templateName); return createFileFromTemplate(name, template, dir); } }