ニュースな英語のホンヤクコンニャク

英語のニュースでお勉強。 知らない単語や表現を、こっそり調べてエラそうに説明してみるブログです。 元の記事から数日遅れることもありますので、ニュースとしては役に立たないこともある。IT系・技術系が主たる対象であります。スパム多過ぎでコメントは承認制にしましたーごめんあそばせー。

Swift用IDEを作るためにAtomをハック。LinuxとMacで動きます。

Hacking Atom to create a Swift IDE that runs on Linux and Mac

As of now theres no IDE available for swift that runs on linux which makes it kind of annoying to develop packages due to constant switching between text editor and terminal. I had never used Atom before but I wanted to see if it’ll live upto its name and let me hack it to integrate the Swift Package Manager and LLDB into it.

今のところ、Swift用のLinuxで動く利用可能な統合環境がありません。このためパッケージを開発するために、いつもテキストエディターとターミナルの間を切り替えていて、ちょっと困った感じになっています。 今までAtomを使ったことがありませんでしたが、それが名前負けしていないかどうかを確かめたいと思っていました。そこで、Swiftパッケージマネージャと LLDBをその中に統合しようとしたのです。

Well, end result:

で、最終的にこうなりました:

https://cdn-images-1.medium.com/max/1400/1%2A91oUt5vZvh07NrotFUZJug.png


詳解 Swift 改訂版
詳解 Swift 改訂版
posted with amazlet at 15.12.12
荻原 剛志
SBクリエイティブ
売り上げランキング: 10,849

Atom Swift Debugger

Atom Swift デバッガ

Atom is a text editor by Github which is marketed as “A hackable text editor for the 21st Century”. It is written in CoffeeScript which is pretty looking Javascript. Writing packages for Atom is easy and encouraged to customise the text editor to suit your needs. Your packages can have node dependencies and the entire project is OpenSourced.

Atom は「21世紀のハック可能なテキストエディタ」としてマーケティングされている GitHubによるテキストエディタです。 これは、Javascriptによく似ているCoffeeScriptで書かれています。 Atomのパッケージを書くのは簡単ですし、テキストエディタをあなたが望むとおりにカスタマイズするためにはお勧めの方法です。 あなたのパッケージはnodeへ依存を持つことが可能で、プロジェクト全体はオープンソースされています。

Swift Debugger is a small atom package I wrote which will run the swift build command then start lldb with the executable as argument bringing compiling and debugging of swift packages right inside Atom’s UI. You can toggle breakpoints in your files visually with a shortcut and the lldb will apply those breakpoints and break at those lines.

Swiftデバッガは、私が書いた小さなAtomのパッケージです。これは、ちゃんとAtomのUIの内部で、Swiftのビルドコマンドを実行し、Swiftパッケージのコンパイルデバッグに引数を与え、その実行可能モジュールの LLDB を開始します。

Since Atom works on Mac and Linux, the swift-debugger package also works on both.

AtomMacLinuxで動作することから、このSwiftデバッガパッケージも、その両方で動作します。

Tutorial

チュートリアル

Lets create a small swift project and try the debugger on a ubuntu machine. First install Atom if you don’t already have it. Then type this command on terminal :

Ubuntu上に、小さなSwiftのプロジェクトを作って、そのデバッガを試してみましょう。先にAtomをインストールしておいてください。そのうえで、ターミナルでこのようなコマンドをタイプします:

$ apm install swift-debugger language-swift
Installing swift-debugger to /home/aciid/.atom/packages ✓
Installing language-swift to /home/aciid/.atom/packages ✓

apm is Atom Package Manager which will fetch the latest version of the swift-debugger and install it. (language-swift is a package to provide syntax highlighting) Now enter this to create a simple swift package

apmは、Swiftデバッガの最新バージョンを読み込んでインストールするためのAtomパッケージマネージャです。(language-swiftは、シンタックスハイライトするためのパッケージです。)

Now enter this to create a simple swift package

さあ、これを入力して、単純なSwiftパッケージを作りましょう

$ mkdir MySwiftProject && touch MySwiftProject/main.swift && touch MySwiftProject/Package.swift

Now open this folder in atom using command line or open atom and browse to the folder you created.

コマンドラインを使って、Atomの中で、このフォルダーを開きましょう。もしくは、Atomを開いて、今作ったフォルダーを閲覧します。

$ atom MySwiftProject

https://cdn-images-1.medium.com/max/1200/1%2aLbN7lk1o8iS1OcZpnEUJ1Q.png


はじめてのAtomエディタ (I・O BOOKS)
清水 美樹
工学社
売り上げランキング: 502,277

続きは、元の記事で参照ください。Swiftデバッガは、以下のリポジトリで公開されています。

github.com


元記事は以下からどうぞ。

medium.com