Git Product home page Git Product logo

scss-analyzer's Introduction

scss-analyzer is released under the MIT license. Current npm package version. Help us

Sass Analyzer

Sass Analyzer is project to make instrumentation around sass files easier in an editing environment. Currently the analyzer can be used to pass valid scss text and get contexual hints as output. This output can be used by an editor to provide code hinting.

Brackets Extension

See scss-analyzer in action in this code hinting extension for Brackets

Getting Started

Require as: var Analyzer = require("scss-analyzer").Analyzer;

Create a sass file analyzer instance associated with some valid sass text var sassAnalyzer = new Analyzer(filepath, text);

Following are the APIs that are meant to be used with the analyzer

var hints = sassAnalyzer.getAllHints();
var hints = sassAnalyzer.getAllGlobalHints();
var hints = sassAnalyzer.getHints("mixin"); //pass a type string
var hints = sassAnalyzer.getHints(["mixin", "imports", "variables"]); //pass an array of types
var hints = sassAnalyzer.getHintsForCursorPos(["variable", "import"], {line: 98, column: 22});

The analyzer is meant to be stateful, once text is passed, the analyzer gets associated with the text and analyzes the text based on the given type parametes.

The above APIs can be called more than one with the same or different type parameters

Also one a type has been queried, the results are cached and not computed again. So if a user does getAllHints once, then he can hold the hint data as long as he holds a valid analyzer.

A reset API is also provided for helping in debugging various workflows, but functionally is not necessary. It simply resets the cache and we can call getHints and getAllHints again to recompute the hints.

Built With

  • Fault tolerant fork of gonzales-pe - CSS parser with support of preprocessors

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

scss-analyzer's People

Contributors

shubhsnov avatar

Watchers

 avatar  avatar

scss-analyzer's Issues

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.