Drop razor support. Fix #66242

This commit is contained in:
Pine Wu
2019-02-24 17:03:15 -08:00
parent 56ecc5b559
commit 393b48d4a5
4 changed files with 5 additions and 21 deletions

View File

@@ -47,7 +47,7 @@ export function activate(context: ExtensionContext) {
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
};
let documentSelector = ['html', 'handlebars', 'razor'];
let documentSelector = ['html', 'handlebars'];
let embeddedLanguages = { css: true, javascript: true };
let dataPaths = [
@@ -78,7 +78,7 @@ export function activate(context: ExtensionContext) {
let param = client.code2ProtocolConverter.asTextDocumentPositionParams(document, position);
return client.sendRequest(TagCloseRequest.type, param);
};
disposable = activateTagClosing(tagRequestor, { html: true, handlebars: true, razor: true }, 'html.autoClosingTags');
disposable = activateTagClosing(tagRequestor, { html: true, handlebars: true }, 'html.autoClosingTags');
toDispose.push(disposable);
disposable = client.onTelemetry(e => {
@@ -143,21 +143,6 @@ export function activate(context: ExtensionContext) {
],
});
languages.setLanguageConfiguration('razor', {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
onEnterRules: [
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>/i,
action: { indentAction: IndentAction.IndentOutdent }
},
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
action: { indentAction: IndentAction.Indent }
}
],
});
const regionCompletionRegExpr = /^(\s*)(<(!(-(-\s*(#\w*)?)?)?)?)?$/;
languages.registerCompletionItemProvider(documentSelector, {
provideCompletionItems(doc, pos) {