Restrict html/css to only handling file and untitled files. Part of #48777

This commit is contained in:
Pine Wu
2018-04-26 10:58:17 -07:00
parent f3ba8606e1
commit 0dfeec2eef
3 changed files with 22 additions and 3 deletions

View File

@@ -171,7 +171,12 @@ connection.onDidChangeConfiguration((change) => {
let enableFormatter = globalSettings && globalSettings.html && globalSettings.html.format && globalSettings.html.format.enable;
if (enableFormatter) {
if (!formatterRegistration) {
let documentSelector: DocumentSelector = [{ language: 'html' }, { language: 'handlebars' }]; // don't register razor, the formatter does more harm than good
let documentSelector: DocumentSelector = [
{ language: 'html', scheme: 'file' },
{ language: 'html', scheme: 'untitled' },
{ language: 'handlebars', scheme: 'file' },
{ language: 'handlebars', scheme: 'untitled' }
]; // don't register razor, the formatter does more harm than good
formatterRegistration = connection.client.register(DocumentRangeFormattingRequest.type, { documentSelector });
}
} else if (formatterRegistration) {