Editing typescript

I'm using Xcode to build an Ionic2 app and need to work with Typescript files but XCode does not seem to interpret those correctly. Is there a plugin or other tool that I can use?

Hello BjornTikkanen,

There are many different code editors for the Mac that are more suitable for web development like this. Some examples might be BBEdit, Visual Studio Code, Sublime, Atom, and maybe 2 dozen more.

I don't think you'll get very far w/Xcode, at least as an interpreter...maybe as a brute force editor, in a pinch, but I'm sure there are better ways.


Seen this?


h t t p s : / / github.com/Microsoft/TypeScript

This is going to be needed now that we have ionic and native script. Apple probably won't add something to typescript though. It's be good to be able to at least view the code.

I would like to be able to at least view a TypeScript file in Xcode. I don't even need syntax analysis or highlighting. Isn't there a generic xclangspec file available somewhere that could be easily adapted to allow this?


My usecase is to wrap an Xcode workspace around my NativeScript projects in order to be able to utilize Xcode's git integration. I don't know of any other tool on the Mac that makes it so easy to remove single lines from a commit.

I have a workaround!

In Xcode, clicking on the .ts file just shows an enlarged view of its icon, right? (For me, Xcode just shows VLC's orange cone because it thinks it's an MPEG TS file)

Well, if you click on the "File Inspector" (icon in the right pane that looks like a sheet of paper), change the "Type" dropdown to "JavaScript Source", close the file, right click it, hover over "Open As", you'll see a new option to view "Source Code".

Before doing this, I went to Finder, right clicked the .ts file, selected "Get Info", changed the "Open with:" dropdown to Visual Studio Code. You may not have to do this though. I only did this to get rid of the VLC orange cone.
Editing typescript
 
 
Q