Code Monkey home page Code Monkey logo

dkit's Introduction

DKit for Sublime Text

DKit is a package to aid developing D programs using Sublime Text 3.

Features

  • Autocompletion using DCD (D Completion Daemon).
  • Integration with DUB build system.
  • Simple build systems using rdmd and dub.

TODO

  • Find a better way to show call tips (there are some sublime text limitations).
  • Better DUB integration

Installation

Currently I would like to postpone supporting Sublime Package Control installation until things stabilize with the plugin and proper testing is done on all platforms. Only Linux has been tested so far. Although it should work properly on other operating systems. (I welcome any feedback)

To install the plugin:

  1. Clone this repository into your Sublime Text packages folder. You can find where your folder is located by clicking on 'Preferences -> Browse Packages'. Alternatively, on Linux, look in your ~/.config/sublime-text-3/Packages/, or in sublime-text-3\Data\Packages on Windows.

  2. You'll need to install DCD first. Follow the steps in DCD's readme.

  3. Do not run the server. DKit will automatically run the server when needed.

  4. Go to 'Preferences -> Package Settings -> DKit -> Settings - User', and set it up like 'Settings - Default' to match your system. Notably you need to set dcd_path to your DCD's installation path.

  5. Setup include_paths to your DMD installation. + On Linux, the default path to dlang includes are either (/usr/include/dmd/phobos and /usr/include/dmd/druntime/import) or (/usr/include/dlang/dmd/) on Arch-based distributions + On Windows, you should have your includes point to d\\src\\phobos and d\\src\\druntime\\import

  6. You can also add include_paths per project.

  7. To use DUB features, you'll need to have DUB installed and in your PATH environment variable.

  8. You might want to add custom key bindings for Goto Definition and Show Documentation commands or other commands. You can do that by going to Preferences -> Key Bindings - User and having the following as an example: [{ "keys": ["ctrl+shift+g"], "command": "dcd_goto_definition" }, { "keys": ["ctrl+\\"], "command": "dcd_show_documentation" }]

Available Commands

  • DKit: Restart DCD Autocompletion Server
    • If you notice that the autocompletion stopped working, try running this command to resolve the issue.
  • DKit: Update Import Paths
    • If you have just added a new file to your project or created a Sublime project from a DUB package, run this command to update the imports.
  • DKit: List Installed DUB Packages
    • This command lists the DUB packages installed as reported by DUB.
  • DKit: Create DUB Package File
    • This command creates a dub package template file.
  • DKit: Create Project From DUB Package File
    • You can create a Sublime project from a DUB package file using this command. Open the DUB package file, then run this to create the project.
  • DKit: Goto Definition (requires at least DCD 0.3.0-beta)
    • Use goto definition by setting the cursor in the symbol that you want to goto, and then running the command. The default keybinding for this command is ctrl+shift+g.
  • DKit: Show Documentation (requires at least DCD 0.3.0-beta)
    • Use show documentation by setting the cursor in the symbol that you want to see documentation for, and then running the command. The default keybinding for this command is ctrl+\.

Troubleshooting

  • If you find that your includes are not being suggested, try running DKit: Update Import Paths command in Sublime.
  • If you notice that the autocompletion stopped working, try running DKit: Restart DCD Autocompletion Server command in Sublime.
  • For other problems, please use the issue tracker.

Linting

There is a sublime plugin for linting D code that uses dscanner at the following link.

Questions

Please use GitHub's issue tracker for questions and problems.

dkit's People

Contributors

yazd avatar dgileadi avatar gosella avatar avitebskiy avatar hackerpilot avatar kniteli avatar yannick avatar dazoe avatar

Watchers

Alexander Degtyarev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.