2

I have a problem with Angular project and syntax of TypeScript, I make a new empty Angular project but PhpStorm (2019.2.1) don't recognize TypeScript syntax.

enter image description here

3
  • 1
    Why dont use vscode ? Phpstorm meant for PHP development. Vscode have rich support for all language Commented Sep 13, 2019 at 9:51
  • 1
    @TonyNgo PhpStorm = WebStorm + PHP + DB -- stackoverflow.com/a/25647482/783119 Commented Sep 13, 2019 at 10:05
  • 3
    @danny36 Based on the file icon alone .. it suggests that this file is treated as XML file. 1) Ensure that JavaScript and TypeScript plugin is actually enabled 2) Check Settings (Preferences on macOS) | Editor | File Types -- look under "XML" file type -- ensure that no unusual pattern is present there (bottom list for that file type). Commented Sep 13, 2019 at 10:08

2 Answers 2

1

Looks like the .ts extension is assigned to XML file type in Settings | Editor | File Types. Please remove all .ts patterns from this file type and make sure that *.ts is listed among patterns registered for TypeScript:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

thank you this is the problem. I have ad .ts to xml file for a another project but phpstorm make this setting global.
file type settings are IDE-wide, there is no way to re-assign patterns for particular project only
0

For Angular and other JS,TS based Web development I recommend using :

  • Webstorm , it's by Jetbrains, same as PHPStorm
  • Visual Studio Code

However, if you follow these steps, you should not face such issue:

https://www.jetbrains.com/help/phpstorm/angular.html

Also, as in comments by LazyOne: PhpStorm syntax problem with Angular project

4 Comments

PhpStorm = WebStorm + PHP + DB. Some plugins needs to be installed manually/separately. Please check this link before making such statements: stackoverflow.com/a/25647482/783119
So why is the OP facing this issue?
Possible broken settings or accidental misconfiguration. .ts files getting recognized just fine here out of the box.
I too found that is completely supports Angular, thanks for pointing out, answer updated,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.