Nova

Extensions


Readme

Icarus provides first-class language support for Swift, C, C++, and Objective-C.

If you are Swift or C-family language developer, Icarus can provide you with first-class support for building client- and server-side applications and frameworks.

✨ Fun fact: This extension's debugging support was built entirely using Nova and Icarus. "Look ma, no Xcode!"

Features

Icarus adds:

  • 🖍️ Syntax highlighting, symbolication, and code folding using Tree-sitter grammars
  • 🧪 Language intelligence, completions, issues, and more via SourceKit-LSP
  • 🐛 Debugging via LLDB both locally and on supported remote platforms

Intelligence is provided using SourceKit-LSP from the Swift open-source project. This language server provides support for Swift natively and uses clangd behind the scenes for C-family languages.

Debugging is supported using LLDB.framework, distributed with both Apple's Xcode tools and the standalone Swift toolchain.

Requirements

Syntax highlighting, symbolication, and code folding for all supported languages are included out of the box.

For language intelligence, completions, and debugging, a Swift toolchain is required (even if you are just working with C-family languages, as the toolchain provides support for everything).

  • If you already have Apple's Xcode app in your /Applications folder, there should be nothing else you'll need to do.
  • Otherwise, the easiest way to get started is to download Apple's Xcode command-line tools using xcode-select --install.
  • Alternatively, you can install a development version of the Swift toolchain and select it for use in the extension preferences.

C / C++ and Compile Commands

Projects utilizing the C or C++ languages may need to provide a compile_commands.json file in the project root for some language features to work. This file can be generated by most common build systems, including CMake. For more information, check out the Clang documentation.

Building, Running, and Debugging Your Project

Local Debugging

To build and run your project, you will want to create a Task in Nova's tasks interface. Follow these steps for a quick way to get up and running:

  1. Open your project settings by clicking your project name in the toolbar.
  2. Next to "Tasks" in the settings list, click the plus button and choose LLDB Debug to add a new debugging task.
    • Name your task something descriptive if you'd like, such as the name of your built target, its configuration, etc.
    • Set the executable path to your product's path for running and debugging.
    • Tweak any additional options as needed, such as launch arguments.
  3. Click the disclosure triangle beside your task to expand out the Pipeline options.
  4. In the "Build" section, add one or more custom script steps to tell Nova how to interface with your build system.

For the Build pipeline step(s), it should just be a matter of adding the appropriate shell commands to a Build pipeline step to invoke and compile your target or product in the same way you'd build in a terminal.

Remote Debugging

Similarly to local debugging, remote debugging uses a Task in Nova's tasks interface.

  1. Open your project settings by clicking your project name in the toolbar.
  2. Next to "Tasks" in the settings list, click the plus button and choose LLDB Remote Debug to add a new debugging task.
    • Name your task something descriptive if you'd like, such as the name of your built target, its configuration, etc.
    • Set the LLDB platform plugin to an appropriate value for the target destination (such as remote-linux for Linux hosts, Docker containers, etc.). You can choose a value from the drop-down list populated with those supported by locally-installed copy of LLDB.
    • Set the executable path to your product's path for running and debugging. Note: this is the path to the executable on the remote host.
    • Add one or more path mappings to tell Nova how to translate between your local filesystem and the remote filesystem of the target, for properly setting up breakpoints and translating stack frames.
    • Tweak any additional options as needed, such as launch arguments.
  3. Click the disclosure triangle beside your task to expand out the Pipeline options.
  4. In the "Build" section, add one or more custom script steps to tell Nova how to interface with your build system.
    • For building directly within a Docker container, using docker exec <containerName> <command> <args…> is a very useful way to invoke a build system.
    • For building locally, you may need to ensure cross-compilation support is set up within your build system and products are sync'd to the remote host.

For the Build pipeline step(s), it should just be a matter of adding the appropriate shell commands to a Build pipeline step to invoke and compile your target or product in the same way you'd build in a terminal.


Changelog

Version 2.0

  • Added remote debugging support with LLDB, for debugging targets running on another computer, in a Docker container, etc. (https://github.com/panicinc/icarus/issues/4)
  • Added language support for Make, CMake, Strings, and Clang Module Map files.
  • Resolved an issue preventing LLDB launch arguments from working properly.
  • Added a configuration option for choosing the working directory of launched debugging targets.
  • Improved highlighting for Swift language features introduced in 5.9 / 5.10, such as actors, async/await, and macros.
  • Added highlighting for hashbang lines in Swift files.
  • Improved highlighting of the Swift core metatypes: Any, AnyClass, AnyObject, Type, and Protocol.
  • Fixed an issue preventing Swift protocol declarations from showing up as symbols and foldable.
  • Fixed an issue preventing Swift computed properties from showing up as foldable.
  • Migrated to a more robust Objective-C grammar, and rebased the Objective-C++ support on it.
  • Additional improvements to highlighting and symbolication for Swift and C++.

Version 1.0.2

  • Fixed an issue with C++ namespace highlight queries which could cause all C++ to fail to work properly.

Version 1.0.1

  • Fixed an issue with the file permissions of the debug adapter executable, which prevented it from being launched after the extension was installed.

Version 1.0

  • Initial release

License

MIT License

Copyright (c) 2023 Panic Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.