Reputation: 532
I have a project (Typo3) which uses Typoscript and TypeScript. Both filetypes use the same suffix *.ts
by default. Since I use external libraries I cannot change the suffixes to an alternative.
I know how to change the default file type association or register new ones in JetBrains products. But in that special case I need to you have both file types living side by side.
Is there any chance to scope the file type recognition by regex?
Upvotes: 1
Views: 589
Reputation: 10791
It's not final but there was a voting between core devs to change the file extension for typoscript core files and the majority was for .typoscript
and .tsconfig
.
.ts
never was an official file extension for typoscript, the core used `.txt'.
Even if the core will use these file extensions it will be possible to use any file extension for your own usage.
So the easiest way to avoid the conflicting .ts
for your files is to use something unique identifiable. For some projects I have seen the usage of .t3s
which some people avoid as there is no origin for the 3
in "typoscript".
.typoscript
and .tsconfig
look like matching candidates.
Upvotes: 1
Reputation: 165088
Is there any chance to scope the file type recognition by regex?
Not possible. Such recognition is all based on file name patterns which are IDE-wide (not even project-specific).
Unfortunately I could not find exact ticket (if it even exists... as it was suggested to create such ticket here).
The best tickets I could quickly find that I think are related:
Watch those and related tickets (star/vote/comment) to get notified on any progress.
The best I can offer in your situation (where you cannot change extension; to avoid lots of red warnings for one of the types) is to exclude folder(s) with such files from the project (Mark it as Excluded) or mark individual files as Plain Text so they are not get indexed by incorrect parser. Then you may use some another editor to edit such files...
P.S. Maybe you can use double extension for one of the types? For example *.ts.ts
or *.typo.ts
is more precise than *.ts
so will allow them for both to co-exist.
Upvotes: 2