Giter Club home page Giter Club logo

sublimedlangautoimport's Introduction

Sublime 3/4 Dlang Auto-Import

Sublime 3/4 D AutoImport plugin. Add "import ...." for symbol. It provides the dlang_auto_import command.

Demo

Demo

Features

In code like this:

class Uno : IStylable
{
    //
}

will be auto added "import ui.istylable : IStylable;" at begin of file. Like this:

import ui.istylable : IStylable;

class Uno : IStylable
{
    //
}

Algo

  • Scan project files, using ST3 index
  • Grep for Symbol
  • Grep file for "module ..."
  • Get module.name
  • Check for existing "module ... : Symbol"
  • Build line "import module_name : Symbol;"
  • Insert in text.
    • after last "import ..."
    • after "module ..."
    • at top

Installation

Install DlangAutoImport from Package Control.

Then add a keybinding of your choice for the dlang_auto_import command, by adding a line like this to your keybindings file:

{ "keys": ["alt+a"], "command": "dlang_auto_import" },

You can also try it out immediately by choosing "D: import ..." from the context menu or command pallete.

Hint

For auto-comlition Phobos/core/sys/std D keywords (Linux):

  1. Menu: Project / Edit Project

  2. edit

{
    "folders":
    [
        {
            "path": "."
        },
        {
            "path": "/usr/include/dmd/druntime",
            "file_include_patterns": ["*.d"]
        },
        {
            "path": "/usr/include/dmd/phobos",
            "file_include_patterns": ["*.d"]
        }
    ]
}

sublimedlangautoimport's People

Contributors

vitalfadeev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.