Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Nov 18, 2020
1 parent 085ca07 commit 5674004
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { Diagnostic, DiagnosticSeverity, Range } from 'vscode-languageserver';
let { validate } = require('csstree-validator/lib/validate');

export function wrapper({ code }) {
let errors = validate(code);
let diagnostics: Diagnostic[] = [];

errors.forEach(({ line, column, loc, message }) => {
for (const { line, column, loc, message } of validate(code)) {
let severity: DiagnosticSeverity = DiagnosticSeverity.Warning;
let range: Range;

Expand All @@ -29,7 +28,7 @@ export function wrapper({ code }) {
severity,
message: `[CSSTree] ${message}`
});
});
}

return Promise.resolve(diagnostics);
};

0 comments on commit 5674004

Please sign in to comment.