Open amannm opened 3 weeks ago
What IntelliJ version and pkl-intellij version are you on? I can't reproduce this error, and PklModule#properties
should be guaranteed to contain one element here, because it's a PklModule
.
What IntelliJ version and pkl-intellij version are you on? I can't reproduce this error, and
PklModule#properties
should be guaranteed to contain one element here, because it's aPklModule
.
I'm running runIde
but I'm also using the "new UI" mode in IntelliJ
@bioball are you using the new UI or the old one?
2024-08-19 12:32:43,075 [ 24485] SEVERE - #c.i.i.p.PluginManager - IntelliJ IDEA 2023.1.5 Build #IC-231.9392.1
2024-08-19 12:32:43,075 [ 24485] SEVERE - #c.i.i.p.PluginManager - JDK: 17.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-08-19 12:32:43,075 [ 24485] SEVERE - #c.i.i.p.PluginManager - OS: Mac OS X
2024-08-19 12:32:43,075 [ 24485] SEVERE - #c.i.i.p.PluginManager - Plugin to blame: Pkl version: 0.30.0-dev+4d0312f
It fails in a different way for 2024.latest when using the new UI (which is default now) which this also magically fixes
Hmm.. what flow are you using to trigger this error?
I'm using the new UI.
Hmm.. what flow are you using to trigger this error?
I'm using the new UI.
Ah, I see.
The issue is actually that we are calling PklPsiFactory.createIdentifier("bar2.pkl")
, and we create a module with contents bar.pkl = 42
, which is invalid Pkl, thus where the two properties comes from.
Two fixes:
.pkl
from the name before renaming.Lexer
from pkl-core for this (non-blocking, feel free to omit this from your PR).And let's keep using .single()
because that was helpful in flagging this error.
Ah, I see.
The issue is actually that we are calling
PklPsiFactory.createIdentifier("bar2.pkl")
, and we create a module with contentsbar.pkl = 42
, which is invalid Pkl, thus where the two properties comes from.Two fixes:
- We should drop the trailing
.pkl
from the name before renaming.- When creating an identifier with illegal identifier characters, we should wrap it with backticks so it becomes a valid identifier. We can copy class
Lexer
from pkl-core for this (non-blocking, feel free to omit this from your PR).And let's keep using
.single()
because that was helpful in flagging this error.
alright, it works using .removeSuffix(".pkl")
but I get the feeling there should be some PklFile
type discrimination happening somewhere else. Don't understand the codebase well enough yet
Refactor > Rename...
a Pkl file within the IDEPsiElement
has two properties (filename, extension) in the case ofPsiFile