Git Product home page Git Product logo

flycheck-dmd-dub's Introduction

flycheck-dmd-dub

Actions Status Coverage Status MELPA

Emacs lisp to read dependency information from dub and add syntax highlighting via flycheck that resolves package dependencies.

Basically tells emacs/flycheck how to call dmd with the right -I and -J flags.

Usage

Add this to your .emacs / init.el:

(add-hook 'd-mode-hook 'flycheck-dmd-dub-set-variables)

Installation

Install from MELPA or MELPA Stable with:

M-x package-install RET flycheck-dmd-dub.

flycheck-dmd-dub's People

Contributors

atilaneves avatar cybershadow avatar klknn avatar nordlow avatar purcell avatar shadowcreator avatar spacebat avatar syohex avatar tom-tan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flycheck-dmd-dub's Issues

Error in json-readtable-error upon load

Because

(add-hook 'd-mode-hook 'flycheck-dmd-dub-set-include-path)

doesn't work anymore, I instead guessed that I should use

(add-hook 'd-mode-hook 'flycheck-dmd-dub-set-variables)

but when loading a D-file (which lies in a sub-directory of a project root directory containing a dub.sdl) into d-mode this errors as

Debugger entered--Lisp error: (json-readtable-error 114)
  signal(json-readtable-error (114))
  json-read()
  json-read-from-string("rawRead must take a non-empty buffer\n")
  fldd--set-variables-from-json-string("rawRead must take a non-empty buffer\n")
  fldd--set-variables-from-dub-describe("/home/per/")
  flycheck-dmd-dub-set-variables()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook d-mode-hook d-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook d-mode-hook d-mode-hook))
  run-mode-hooks(d-mode-hook)
  d-mode()
  funcall-interactively(d-mode)
  call-interactively(d-mode record nil)
  command-execute(d-mode record)
  #f(compiled-function (cmd) #<bytecode 0x192843d>)("d-mode")
  ivy-call()
  ...

. What's wrong?

Unable to use flycheck-dmd-dub with sub-packages

Hey, using sub-packages in dub breaks flycheck-dmd-dub. It is running dub describe in the sub-package folder instead of the package folder.

Debugger entered--Lisp error: (wrong-type-argument integerp nil)
  fldd--get-dub-package-dirs-output("Error executing command describe: Root package SUB_PACKAGE_1 contains reference to invalid package PACKAGE:SUB_PACKAGE_2\n\n")
  fldd--get-dub-package-dirs()
  ac-dcd-find-imports-dub()
  ac-dcd-add-imports()
  call-interactively(ac-dcd-add-imports record nil)
  command-execute(ac-dcd-add-imports record)
  execute-extended-command(nil "ac-dcd-add-imports")
  call-interactively(execute-extended-command nil nil)

can't seem to get this to work

I added the recommended line to my init.el, but when I open my app.d in emacs, flycheck still does not recognize the includes from inside my package directory. Is there anything additional I should be doing here? My dub project hierarchy is the same as the default made by dub init.

package_name/dub.json
package_name/source/app.d
package_name/source/package_name/{all the files I am including}

emacs version: 24.4.1
flycheck-dmd-dub version: 20140814.1259 (melpa)
flycheck version: 20150125.601 (melpa)

Emacs's own json-read-file errors when trying to parse my dub.json

get-dub-package-dirs calls json-read-file which in turn errors when called on

https://github.com/nordlow/justd/blob/master/dub.json

as

Debugger entered--Lisp error: (json-string-format "doesn't start with '\"'!")
  signal(json-string-format ("doesn't start with '\"'!"))
  (if (char-equal (json-peek) 34) nil (signal (quote json-string-format) (list "doesn't start with '\"'!")))
  json-read-string()
  json-read-object()
  apply(json-read-object nil)
  json-read()
  json-read-object()
  apply(json-read-object nil)
  json-read()
  json-read-file("~/justd/dub.json")
  eval((json-read-file "~/justd/dub.json"))
  eval-expression((json-read-file "~/justd/dub.json") nil)
  funcall-interactively(eval-expression (json-read-file "~/justd/dub.json") nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

My dub.json is accepted by DUB.

I've tried removing lines but I can't understand what is wrong.

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.