New file extension - Problem when opening such files

Hi there, i am new to obsidian plugin development. I want to add a new file extension with a new custom view. I managed to do that by checking some tutorials (New Filetype).

It works but there is one problem.
When opening the new files via the standard file explorer it always opens a new tab instead of using the already opened view, I want to behave it like the standard files like .md or .canvas to open in an existing tab.

If i am registering the “file-open” event i can see that when i click on one of the files with the new file type, the “file” variable is null while on the other files (standard ones) its filled.

What am i doing wrong?
Thanks for your help

If i am extending my new view from “TextFileView” instead of “ItemView” it works. But how do i get an “ItemView” to do this?

If your view is for displaying file contents, then you should inherit from FileView instead of ItemView (FileView inherits from ItemView). Or its subclasses like EditableFileView or TextFileView if they fit better to your needs.

Thanks.
My view doesnt show files. It shows a pixiJS scene. But yea, it will have a file for each scene but its not a TextFile. I can live with it that i have to inherit from text file, but it doesnt feel right :man_shrugging:

I said FileView, not TextFileView.

Thanks. I’ll use that.