Giter VIP home page Giter VIP logo

jsonnet-mode's People

Contributors

adamwg avatar andor avatar anguslees avatar benley avatar knoepfel avatar mgyucht avatar russell avatar seh avatar shields-fn avatar svend avatar tminor avatar yuezhu avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

jsonnet-mode's Issues

Formatting with syntax errors replaces the buffer

When running jsonnet-reformat-buffer if there's an error the whole buffer is replaced by the output of the fmt command. In that case an undo will give you back the buffer content but it would be better if checking first if there's an error and in that case log to the *jsonnet* buffer, if not reformat in place.

make indentation consistent with jsonnet fmt

Is there an easy way to get the indentation strategy to be consistent with jsonnet fmt?

For example jsonnet fmt gives:

function()
  "bar"

but the jsonnet-mode indentation wants to do:

function()
"bar"

Multiline string literals not matched correctly

Some examples:

{
  // This gets highlighted as a multiline string, but it should not be:
  foo1: |
    bar
  |;

  // This too:
  foo2: | bar |;

  // This too:
  foo3: = |||||
    bar
  |||||;

  // This one gets interrupted at the | in the middle, and the rest of
  // the file gets highlighted as a string until another | shows up:
  foo4: |||
    bar | this text should still be inside the triple-pipe string
  |||;

  // this line should be a comment but it's highlighted as a string?

  // if I add a single | it ends the incorrect string match

  // now it's back to normal and this is a comment again
}

here's what that looks like in a screenshot:

screenshot from 2018-08-27 16-38-30

A string containing "/*" causes indentation to be messed up

/* inside a string is treated as though it begins a multiline comment for indentation purposes.

Example:

{
  foo = "/dir/*",
              bar = "should not be indented",
              baz = "*/ <--- this will end the extra indentation",
  quz = "back to where it should be",
}

How to specify external variable and use the mode for qbec

I am trying to use this mode for qbec files, which contains custom external variable:

local env = std.extVar('qbec.io/env');

And I got the error in *Messages*:

undefined external variable: qbec.io/env

I tried to customize jsonnet command with this:

 (jsonnet-command "jsonnet --ext-str qbec.io/env=testenv")

But it didn't help.

Could you please help me to understand what exactly is wrong here?

UPD: apparently that error comes from flycheck, not from jsonnet-mode, but:
When I call jsonnet-eval-function it returns:

apply: Searching for program: No such file or directory, jsonnet --ext-str qbec.io/env=testenv

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

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.

Some warnings on compile

When I am trying to install latest version I have errors in compule log.

jsonnet-mode version: 20200930.1418
emacs versiion: GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2020-08-12

Code to install:

(use-package jsonnet-mode
  :ensure t)

Messages:

In jsonnet-smie-rules:
jsonnet-mode.el:178:33:Warning: value returned from (member x4 '("]" "}" ")"))
    is unused
jsonnet-mode.el:178:33:Warning: value returned from (member x4 '("]" "}" ")"))
    is unused

In jsonnet-eval-buffer:
jsonnet-mode.el:629:4:Warning: `(directories (cons (file-name-directory
    file-to-eval) search-dirs))' is a malformed function
jsonnet-mode.el:638:36:Warning: reference to free variable `directories'

In end of data:
jsonnet-mode.el:775:1:Warning: the following functions are not known to be
    defined: some, lexical-let

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.