Skip to content

Commit

Permalink
Revert "Restrict html/css to only handling file and untitled files. P…
Browse files Browse the repository at this point in the history
…art of #48777"

This reverts commit 0dfeec2.
  • Loading branch information
octref committed May 2, 2018
1 parent 5a397a1 commit 76d4daa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
9 changes: 1 addition & 8 deletions extensions/css-language-features/client/src/cssMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ export function activate(context: ExtensionContext) {
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
};

let documentSelector = [
{ language: 'css', scheme: 'file' },
{ language: 'css', scheme: 'untitled' },
{ language: 'scss', scheme: 'file' },
{ language: 'scss', scheme: 'untitled' },
{ language: 'less', scheme: 'file' },
{ language: 'less', scheme: 'untitled' },
];
let documentSelector = ['css', 'scss', 'less'];

// Options to control the language client
let clientOptions: LanguageClientOptions = {
Expand Down
9 changes: 1 addition & 8 deletions extensions/html-language-features/client/src/htmlMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ export function activate(context: ExtensionContext) {
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
};

let documentSelector = [
{ language: 'html', scheme: 'file' },
{ language: 'html', scheme: 'untitled' },
{ language: 'handlebars', scheme: 'file' },
{ language: 'handlebars', scheme: 'untitled' },
{ language: 'razor', scheme: 'file' },
{ language: 'razor', scheme: 'untitled' }
];
let documentSelector = ['html', 'handlebars', 'razor'];
let embeddedLanguages = { css: true, javascript: true };

// Options to control the language client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ connection.onDidChangeConfiguration((change) => {
let enableFormatter = globalSettings && globalSettings.html && globalSettings.html.format && globalSettings.html.format.enable;
if (enableFormatter) {
if (!formatterRegistration) {
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
let documentSelector: DocumentSelector = [{ language: 'html' }, { language: 'handlebars' }]; // don't register razor, the formatter does more harm than good
formatterRegistration = connection.client.register(DocumentRangeFormattingRequest.type, { documentSelector });
}
} else if (formatterRegistration) {
Expand Down

0 comments on commit 76d4daa

Please sign in to comment.