lukaskleinschmidt / kirby-types

IDE Helper for Kirby
MIT License
18 stars 0 forks source link

Type definition file contains wrong namespace #3

Closed bezin closed 9 months ago

bezin commented 9 months ago

Hi Lukas,

I am once again evaluating this wonderful plugin! Fantastic work! I had one issue come up though:

The type definition file type hints the return type for my Site and Page fields with \Kirby\Cms\Field, however the correct class would be \Kirby\Content\Field from Kirby 4.0 onwards. Since ˙\Kirby\Cms\Field` is deprecated, I think the new class namespace should be used.

\Kirby\Cms\Field is actually aliased to Kirby\Content\Field, but apparently the deprecated aliases are not added to the type definition file. Is there a specific reasoning behind this?

I can provide a PR, but I first wanted to hear your thoughts!

Cheers

lukaskleinschmidt commented 9 months ago

What version are you using? Version 2.0.0 should have actually address the changed namespace issue.

I just checked and at least the Kirby\Content\Field namespaces seem to be correct. But there seems to be an issue with some of the aliases defined by kirby: https://github.com/getkirby/kirby/commit/127406f4a712eeaeaeb9dd38b160ca8866882bf5

The three aliases starting with Kirby\Options are wrong and should actually use the singular namespace Kirby\Option. I will create a PR for that on the Kirby repo directly.

lukaskleinschmidt commented 9 months ago

Ah you were faster 😄 https://github.com/getkirby/kirby/commit/e739d357efcb08d46a5dd5408bfc5f7c6e6169d2

bezin commented 9 months ago

I was gonna say yes, but that did not fix this issue – however now when I tried that again it looks indeed alright 😅 So I'll close this for now. Thank you!