Skip to content

Commit

Permalink
Fix deprecations, update build processes
Browse files Browse the repository at this point in the history
  • Loading branch information
kinglozzer committed Aug 12, 2023
1 parent e71767c commit fb2c45e
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 78 deletions.
52 changes: 37 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## [Unreleased]

### Added

### Changed
Expand All @@ -11,7 +12,16 @@

### Fixed

## [1.0.3]
## 1.0.4

### Changed
- Updated Silverstripe icons with new open source icons

### Fixed
- Fixed deprecated APIs, updated minimum supported version to 2022.3

## 1.0.3

### Changed
- More flexible <% require %> syntax
- Replaced usage of IntelliJ internal API
Expand All @@ -21,33 +31,39 @@
### Fixed
- Issue with lookups annotations

## [1.0.2]
## 1.0.2

### Fixed
- Fixed issue with parsing of float arguments in lookups (#21)

## [1.0.1]
## 1.0.1

### Changed
- Improved `BraceMatcher` to highlight start / end of tags as well as braces/parentheses (#18)

### Fixed
- Slightly more permissive lexing of translation entities (#20)

## [1.0.0]
## 1.0.0
Initial stable release

## [0.3.3]
## 0.3.3

### Changed
- Block stack in parser shouldn’t be static (#16)

## [0.3.2]
## 0.3.2

### Fixed
- Intermittent issues indexing projects (#14)

## [0.3.1]
## 0.3.1

### Fixed
- Issues with numbers in translation keys (#12)

## [0.3.0]
## 0.3.0

### Added
- Support for generic open & closed block statements (e.g. cacheinclude cache statements)

Expand All @@ -61,38 +77,44 @@ Initial stable release
### Fixed
- Issue with background indexing of templates (#3)

## [0.2.3]
## 0.2.3

### Fixed
- Further issues with how $Variables without {} braces were handled

## [0.2.2]
## 0.2.2

### Fixed
- Regression in how $Variables without {} braces were handled

## [0.2.1]
## 0.2.1

### Fixed
- Issues with typing `$` or `>` in an empty template
- Includes with numbers in file name were broken
- Annotations for includes using double-backslash separators were broken

## [0.2.0]
## 0.2.0

### Added
- Support for renaming/moving include files (auto-update references)

### Fixed
- Broken click to navigate to include
- Stale references to includes when include statement is changed

## [0.1.0]
## 0.1.0

### Added
- Live templates for code completion/surrounding

### Fixed
- Issues with include statements/references triggering exceptions

## [0.0.2]
## 0.0.2

### Fixed
- Some include files wouldn’t be recognised as valid in SS4 projects

## [0.0.1]
## 0.0.1
- Initial release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This plugin adds Silverstripe template support to PHPStorm and other JetBrains I

## Platform requirements

This plugin requires PHPStorm (or other IDEA-based IDE) to be running version 2020.3 or greater.
This plugin requires PHPStorm (or other IDEA-based IDE) to be running version 2022.3 or greater.

## Installation

Expand Down
54 changes: 0 additions & 54 deletions build.gradle

This file was deleted.

57 changes: 57 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.changelog.Changelog

plugins {
id("java")
id("org.jetbrains.intellij") version "1.15.0"
id("org.jetbrains.changelog") version "2.1.2"
}

group = "com.kinglozzer"
version = "1.0.4"

sourceSets {
main {
java.srcDirs("src/main/java", "src/main/gen")
}
}

repositories {
mavenCentral()
}

intellij {
version.set("2022.3")
}

tasks {
test {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
}

patchPluginXml {
untilBuild.set("")

changeNotes.set(provider {
changelog.renderItem(
changelog
.getLatest()
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
})
}
}

changelog {
version.set("1.0.4")
path.set(file("CHANGELOG.md").canonicalPath)
header.set(provider { "${version.get()}" })
itemPrefix.set("-")
keepUnreleasedSection.set(true)
unreleasedTerm.set("[Unreleased]")
groups.set(listOf("Added", "Changed", "Deprecated", "Removed", "Fixed"))
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class SilverstripeContextType extends TemplateContextType {
protected SilverstripeContextType() {
super("Silverstripe", "Silverstripe");
super("Silverstripe");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class SilverstripeHTMLContextType extends TemplateContextType {
protected SilverstripeHTMLContextType() {
super("Silverstripe HTML", "Silverstripe");
super("Silverstripe");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFileSystemItem;
import com.intellij.psi.search.FilenameIndex;
import com.intellij.psi.util.CachedValueProvider;
import com.intellij.psi.util.CachedValuesManager;
import com.intellij.util.text.VersionComparatorUtil;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

import static com.intellij.psi.search.GlobalSearchScope.allScope;

public final class SilverstripeVersionUtil {
Expand All @@ -33,13 +36,13 @@ public static boolean isSilverstripe4OrMore(@NotNull Project project) {
private static String computeSilverstripeVersion(@NotNull Project project) {
String version = "3";

PsiFileSystemItem[] candidates = FilenameIndex.getFilesByName(project, "framework", allScope(project), true);
for (PsiFileSystemItem candidate : candidates) {
Collection<VirtualFile> candidates = FilenameIndex.getVirtualFilesByName("framework", allScope(project));
for (VirtualFile candidate : candidates) {
if (!candidate.isDirectory()) {
continue;
}

PsiFileSystemItem parent = candidate.getParent();
VirtualFile parent = candidate.getParent();
if (parent != null && parent.isDirectory() && parent.getName().equals("silverstripe")) {
parent = parent.getParent();
if (parent != null && parent.isDirectory() && parent.getName().equals("vendor")) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
<editorHighlighterProvider filetype="Silverstripe" implementationClass="com.kinglozzer.silverstripe.ide.highlighting.SilverstripeEditorHighlighterProvider"/>
<colorSettingsPage implementation="com.kinglozzer.silverstripe.ide.highlighting.SilverstripeColorSettingsPage"/>

<liveTemplateContext implementation="com.kinglozzer.silverstripe.ide.templates.SilverstripeContextType"/>
<liveTemplateContext implementation="com.kinglozzer.silverstripe.ide.templates.SilverstripeHTMLContextType"/>
<liveTemplateContext contextId="SILVERSTRIPE" implementation="com.kinglozzer.silverstripe.ide.templates.SilverstripeContextType"/>
<liveTemplateContext contextId="SILVERSTRIPE_HTML" implementation="com.kinglozzer.silverstripe.ide.templates.SilverstripeHTMLContextType"/>
<defaultLiveTemplates file="liveTemplates/Silverstripe"/>
</extensions>
</idea-plugin>

0 comments on commit fb2c45e

Please sign in to comment.