-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: enhance view component support #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c9bab72
85b55c1
efc7a43
08628c4
c213ff1
aa6281a
ef9c60b
26c9b95
5b3ec9f
f1f9488
038beca
1ca4934
cf35033
ff63b9a
feeed0a
ae893a0
7965ef0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Format" type="GradleRunConfiguration" factoryName="Gradle"> | ||
<log_file alias="IDE logs" path="$PROJECT_DIR$/build/idea-sandbox/*/log/idea.log" show_all="true" /> | ||
<ExternalSystemSettings> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="ktfmtFormat" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" value="" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<RunAsTest>false</RunAsTest> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,17 @@ pluginVersion = 2025.0.1 | |
pluginSinceBuild = 243 | ||
|
||
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension | ||
platformType = IU | ||
platformVersion = 2025.1.1 | ||
platformType = PS | ||
platformVersion = 2025.2.1 | ||
|
||
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html | ||
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP | ||
#platformPlugins=com.jetbrains.php:243.25659.59,com.jetbrains.hackathon.indices.viewer:1.28 | ||
platformPlugins=com.jetbrains.php:251.25410.129,com.jetbrains.hackathon.indices.viewer:1.28 | ||
platformPlugins=com.jetbrains.php:253.17525.99,com.jetbrains.hackathon.indices.viewer:1.31 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to support at least 4 previous major versions of the IDE. Or as much as possible versions. Could you please downgrade the plugin to the 242 and check if everything works great? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can try, though there was a bit of a mess with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current web/poly types feature scope is to provide:
That can be pretty done with custom references providers and description providers. I have done a dynamic attributes provider. There should be another static provider for the default undeclared values. Like a map of tags and it's attributes. Descriptions can be done with
and use it across the project via several helperes |
||
# Example: platformBundledPlugins = com.intellij.java | ||
platformBundledPlugins = | ||
# Example: platformBundledModules = intellij.spellchecker | ||
platformBundledModules = | ||
platformBundledModules = intellij.spellchecker | ||
|
||
# Gradle Releases -> https://github.com/gradle/gradle/releases | ||
gradleVersion = 9.0.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" | ||
} | ||
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } | ||
|
||
rootProject.name = "tempest-phpstorm-plugin" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.github.tempest.framework | ||
|
||
import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler | ||
import com.intellij.openapi.editor.Editor | ||
import com.intellij.openapi.roots.ProjectFileIndex | ||
import com.intellij.openapi.vfs.findPsiFile | ||
import com.intellij.psi.PsiElement | ||
import com.intellij.psi.PsiFile | ||
import com.intellij.psi.html.HtmlTag | ||
import com.intellij.psi.search.FilenameIndex | ||
import com.intellij.psi.search.GlobalSearchScope | ||
import com.intellij.psi.util.PsiTreeUtil | ||
|
||
class ComponentGotoDeclarationHandler : GotoDeclarationHandler { | ||
override fun getGotoDeclarationTargets( | ||
element: PsiElement?, | ||
offset: Int, | ||
editor: Editor?, | ||
): Array<PsiElement>? { | ||
if (element == null) return null | ||
|
||
val tag = PsiTreeUtil.getParentOfType(element, HtmlTag::class.java) ?: return null | ||
if (!tag.name.startsWith("x-")) return null | ||
|
||
val project = tag.project | ||
val projectFileIndex = ProjectFileIndex.getInstance(project) | ||
val projectFiles = mutableListOf<PsiFile>() | ||
val libraryFiles = mutableListOf<PsiFile>() | ||
|
||
FilenameIndex.processFilesByName( | ||
tag.name + TempestFrameworkUtil.TEMPLATE_PREFIX, | ||
true, | ||
GlobalSearchScope.projectScope(project), | ||
) { virtualFile -> | ||
val psiFile = virtualFile.findPsiFile(project) ?: return@processFilesByName true | ||
|
||
if (projectFileIndex.isInSourceContent(virtualFile)) { | ||
projectFiles.add(psiFile) | ||
} else { | ||
libraryFiles.add(psiFile) | ||
} | ||
|
||
true | ||
} | ||
|
||
return when { | ||
projectFiles.isNotEmpty() -> projectFiles.toTypedArray() | ||
libraryFiles.isNotEmpty() -> libraryFiles.toTypedArray() | ||
else -> null | ||
} | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for me it looks a bit ugly than it was
Also looks like there is a custom line length? Editor has a soft limit, but the formatter does not count it.
Is it possible to configure it? It'd fix all these issues before merge or in a separate PR
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understood,
kotlinfmt
has very specific, non-configurable, opinionated setups. See: https://github.com/facebook/ktfmt#ktfmt-uses-a-2-space-indent-why-not-4-any-way-to-change-thatI went with the 4 space indent variant - that's what you see right now. The other is Google's opinionated version with 2 space indenting. Shall we try that?
I also don't necessarily want to opt-out of a specific formatter, since different IDEs and IDE setups will result in different formatting styles over the project, which can get nasty. We could say that we push a .idea-based formatting to the repo, but not every contributor will use JB IDEs so it won't enforce anything for them. I'm open to different formatting solutions as well, let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave code style "as is", there are more cons than pros using this formatter.
I usually use "optimize imports" option from the commit dialog in my IDEA.
To format a file a do cmd+option+l from time to time and that's totally fine for me.
To share a codestyle guides I usually use https://www.jetbrains.com/help/idea/editorconfig.html. VScode does support it as well.
CI? :)
Anyway, I'd leave all as is. If you want to collapse/expand lines or anything else I don't mind.