tminor / jsonnet-mode

Emacs major mode for editing Jsonnet files.
GNU General Public License v3.0
46 stars 17 forks source link

Setting `jsonnet-library-search-directories` does not work #32

Open ameyp opened 1 year ago

ameyp commented 1 year ago

After installing a library using jsonnet-bundler, I have tried:

  1. Setting the variable to the relative path to vendor
  2. Setting the variable to the absolute path to vendor
  3. Setting the variable to a list containing the relative path to vendor
  4. Setting the variable to a list containing the absolute path to vendor

None of the four worked, I still get an error on the import line saying couldn't open import ....

If I run jsonnet path/to/my.jsonnet -J path/to/vendor, that succeeds.

tminor commented 1 year ago

I think I'm able to reproduce this with jsonnet-eval-buffer (I have a test written that seems to, in any case), however your description isn't enough to reproduce the exact issue you're describing. Some information that would help: Emacs version, what command you're running (or minor mode if it's something like flycheck), minimal example to reproduce the exact issue you're reporting, etc.

ameyp commented 1 year ago

Emacs version: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) Modes: projectile-mode and flycheck-mode

I'm setting the variable in my .dir-locals.el at the project (git) root with:

(setq jsonnet-library-search-directories (list (concat (projectile-project-root) "vendor")))

As mentioned in the issue description, I've also tried setting it to just the path (aka without the list call) and to a relative path.

Minimal example: https://github.com/ameyp/jsonnet-test