Giter Club home page Giter Club logo

brackets-pretty-json's People

Contributors

ficristo avatar franciscomemoli avatar hpoom avatar inquire avatar stephenkeep avatar

Stargazers

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

Watchers

 avatar  avatar

brackets-pretty-json's Issues

Scrolls back to top

Whenever I run the pretty json command it scrolls me back up to the top of the file. It would be preferable if it stayed in the same place in the document after the command has run. If it helps I am on Brackets Mac sprint 41.

Feature Request: Turn back to one line

It would be great if you could have the reverse function, that is to turn many lines of JSON to one line.

I am editing some files which are one line, so I use your extension to turn it into many lines for readability. However to turn it back to one line I have use external tools.

Cheers

Remap command key

Cannot assign Shift-Cmd-P to PrettyJson.MakePrettyJson. It is already assigned to python-pep8.run /command/KeyBindingManager.js:463

I assume that Shift-Ctrp-B should be ok for this. I'm thinking B should come from beautiful, so there is no conflict.

Suggestion to parse the error

In the past days I was trying to write a brackets extension to lint json for myself.
For it I used https://github.com/zaach/jsonlint too and I was able to overwrite the error to have something more useful for me.
Since I used your extension and saw you do some custom parsing I decided to file this issue.
I'm not sure it is correct or documented but still something I think is useful.
(I changed a bit my code so I'm not sure everything is still correct)

linter.js

var jsonlint = require('jsonlint');
var parser = jsonlint.parser;
parser.parseError = parser.lexer.parseError = function (str, hash) {
    var err = new Error(str);
    err.line = hash.loc.first_line;
    err.col = hash.loc.last_column;
    err.token = hash.token;
    err.expected = hash.expected;
    throw err;
};

linterDomain.js

function cmdLintFile(text, fullPath, options) {
    try {
        jsonlinter.parse(text, options);
    } catch (e) {
        var message = 'Expecting: ' + e.expected.join(' or ') + '. Found: \'' + e.token + '\'.';
        var error = {
            pos: {
                line: e.line - 1,
                ch: e.col
            },
            message: message,
            type: domainName + '.type'
        };

        error.e = e;

        var remapped = { errors: [error] };
        return remapped;
    }
    return null;
}

FWIW I filed a similar issue at ingorichter/de.richter.brackets.jsonlint#4

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.