From 0a4424a3f5e0ebe21bb116998ef60ae025878f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Galliat?= Date: Sun, 1 Feb 2015 09:57:30 +0100 Subject: [PATCH] Sort data directly from the parser * See #352 --- src/parser.js | 3 +++ src/sassdoc.js | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.js b/src/parser.js index 3fd5ba49..d728510d 100644 --- a/src/parser.js +++ b/src/parser.js @@ -1,6 +1,7 @@ import { defer } from './utils'; import * as errors from './errors'; import AnnotationsApi from './annotation'; +import sorter from './sorter'; const ScssCommentParser = require('scss-comment-parser'); const through = require('through2'); @@ -27,6 +28,8 @@ export default class Parser { * Called with all found annotations except with type "unkown". */ postProcess(data) { + data = sorter(data); + Object.keys(this.annotations.list).forEach(key => { let annotation = this.annotations.list[key]; diff --git a/src/sassdoc.js b/src/sassdoc.js index cb81b7e2..972dd25a 100644 --- a/src/sassdoc.js +++ b/src/sassdoc.js @@ -36,9 +36,6 @@ export function parseFilter(env = {}) { let parser = new Parser(env, env.theme && env.theme.annotations); let filter = parser.stream(); - filter.promise - .then(data => sorter(data)); - return filter; }