GithubHelp home page GithubHelp logo

json-error-mode's Introduction

json-error - An Emacs minor mode that provides json syntax error checking

This is an Emacs minor mode that provides syntax error checking and highlighting for json buffers. It implements a json parser in elisp to provide accurate checking.

Currently the parser is only used to check for syntax errors. While it could also be used for normal (font-lock) syntax highlighting and indenting, other javascript major modes handle that fairly well (like js-mode). Since the main feature I wanted was error checking, that was the first thing to be implemented.

To enable js-mode and json-error-mode for .json files add something like this to your config:

(require 'js-mode)
(require 'json-error)

(add-to-list 'auto-mode-alist '(".json$" . js-mode))
;; load json-error-mode when looking at json files
(add-hook 'js-mode-hook
      (lambda ()
        (when (string-match "\\.json$" (buffer-file-name))
          (json-error-mode))))

Internals

The json parser is a port of the go json parser to elisp. The buffer updating and reparsing is mostly borrowed from js2-mode.

Steve Yegge gets a huge shout-out for showing us how awesome really good emacs modes can be. He also gets a small fist-shake for not just implementing this in js2-mode in 2008.

json-error-mode's People

Contributors

muirmanders avatar

Watchers

 avatar  avatar  avatar

Forkers

muirmanders

json-error-mode's Issues

json-error-error-face == ๐Ÿ’ฉ

Firstly, thank you for your amazing package! It is amazing!

Lastly, if the json-error-error-face inherited from the basic error face instead of choosing its own colors, it would automatically be styled by themes and work better in low color environments.

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.