Coder Social home page Coder Social logo

dymk / dcd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dlang-community/dcd

0.0 2.0 0.0 202 KB

The D Completion Daemon is an auto-complete program for the D programming language

License: GNU General Public License v3.0

D 75.62% Shell 0.42% Emacs Lisp 9.59% Lua 14.38%

dcd's Introduction

#Overview The D Completion Daemon is an auto-complete program for the D programming language.

Teaser

DCD consists of a client and a server. The client (dcd-client) is used by a text editor script or from the command line. The server (dcd-server) is responsible for caching imported files, calculating autocomplete information, and sending it back to the client.

#Status This program is still in an alpha state.

  • Working:
    • Autocompletion of properties of built-in types such as int, float, double, etc.
    • Autocompletion of __traits, scope, and extern arguments
    • Autocompletion of enums
    • Autocompletion of class, struct, and interface instances.
    • Display of call tips for functions, constructors, and variables of function type
    • alias declarations
    • import statement completions
  • Not working:
    • Automatic starting of the server by the client
    • Windows support (I don't know that it won't work, but this program is not tested on Windows yet)
    • UFCS
    • Autocompletion of declarations with template arguments
    • Fields inherited from super classes or implemented interfaces.
    • auto declarations
    • alias this
    • Determining the type of an enum member when no base type is specified, but the first member has an initialaizer
    • Public imports
    • That one feature that you REALLY needed

#Setup

  1. Run git submodule update --init after cloning this repository to grab the MessagePack library and the parser from DScanner.
  2. run the build.sh script to build the client and server.
  3. Configure your text editor to call the dcd-client program. See the editors folder for directions on configuring your specific editor.
  4. Start the dcd-server program before editing code.

#Client

##Get autocomplete information The primary use case of the client is to query the server for autocomplete information. To do this, provide the client with the file that the user is editing along with the cursor position (in bytes).

dcd-client -c123 sourcefile.d

This will cause the client to print a listing of completions to stdout. The client will print either a listing of function call tips, or a listing of of completions depending on if the cursor was directly after a dot character or after a left parethesis.

The file name is optional. If it is not specified, input will be read from stdin.

###Dot completion When the first line of output is "identifiers", the editor should display a completion list. ####Output format A line containing the string "identifiers" followed by the completions that are available, one per line. Each line consists of the completion name folled by a tab character, followed by a completion kind #####Completion kinds

  • c - class name
  • i - interface name
  • s - struct name
  • u - union name
  • v - variable name
  • m - member variable name
  • k - keyword, built-in version, scope statement
  • f - function or method
  • g - enum name
  • e - enum member
  • p - package name
  • M - module name

####Example output identifiers parts v name v location v qualifier v kind v type v resolvedType v calltip v getPartByName f

####Parenthesis completion When the first line of output is "calltips", the editor should display a function call tip. #####Output format A line containing the string "calltips", followed by zero or more lines, each containing a call tip for an overload of the given function. #####Example output calltips ACSymbol findSymbolInCurrentScope(size_t cursorPosition, string name)

##Clear server's autocomplete cache dcd-client --clearCache

##Add import search path Import paths can be added to the server without restarting it. To accomplish this, run the client with the -I option:

dcd-client -Ipath/to/imports

#Server The server must be running for the DCD client to provide autocomplete information. In future versions the client may start the server if it is not running, but for now it must be started manually.

Configuration Files

The server will attempt to read the file ~/.config/dcd on startup. If it exists, each line of the file is interpreted as a path that should be searched when looking for module imports.

##Shut down the server The server can be shut down by running the client with the correct option:

dcd-client --shutdown

Import directories

Import directories can be specified on the command line at startup:

dcd-server -I/home/user/code/one -I/home/user/code/two

Port number

The --port or -p option lets you specify the port number that the server will listen on.

dcd's People

Contributors

dav1dde avatar hackerpilot avatar

Watchers

 avatar  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.