Skip to content

Commit

Permalink
add less syntax support
Browse files Browse the repository at this point in the history
Pull Request URL: shinnn/vscode-stylelint#6
  • Loading branch information
patsissons authored and shinnn committed May 11, 2016
1 parent d19f804 commit 7092f5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.activate = function activateStylelint(context) {
}
}
}, {
documentSelector: ['css', 'sass'],
documentSelector: ['css', 'sass', 'less'],
synchronize: {
configurationSection: 'stylelint',
fileEvents: vscode.workspace.createFileSystemWatcher('**/{.stylelintrc,stylelint.config.js}')
Expand Down
7 changes: 6 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ let configOverrides;
const connection = langServer.createConnection(process.stdin, process.stdout);
const documents = new langServer.TextDocuments();

const syntaxConfig = {
'.scss': 'scss',
'.less': 'less'
};

function validate(document) {
return stylelintVSCode({
code: document.getText(),
config,
configOverrides,
configBasedir,
syntax: path.extname(String(document.uri)).toLowerCase() === '.scss' ? 'scss' : null
syntax: syntaxConfig[path.extname(String(document.uri)).toLowerCase()]
}).then(diagnostics => {
connection.sendDiagnostics({uri: document.uri, diagnostics});
}).catch(err => {
Expand Down

0 comments on commit 7092f5e

Please sign in to comment.