mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Use includes instead of indexOf (#167778)
This commit is contained in:
parent
2a16bdb467
commit
968026a46d
|
@ -289,7 +289,7 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
|
|||
args['language'] = vscode.window.activeTextEditor.document.languageId;
|
||||
} else {
|
||||
const excludedLanguages = vscode.workspace.getConfiguration('emmet')['excludeLanguages'] ? vscode.workspace.getConfiguration('emmet')['excludeLanguages'] : [];
|
||||
if (excludedLanguages.indexOf(vscode.window.activeTextEditor.document.languageId) > -1) {
|
||||
if (excludedLanguages.includes(vscode.window.activeTextEditor.document.languageId)) {
|
||||
return fallbackTab();
|
||||
}
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ export function isValidLocationForEmmetAbbreviation(document: vscode.TextDocumen
|
|||
const typeAttribute = (currentHtmlNode.attributes || []).filter(x => x.name.toString() === 'type')[0];
|
||||
const typeValue = typeAttribute ? typeAttribute.value.toString() : '';
|
||||
|
||||
if (allowedMimeTypesInScriptTag.indexOf(typeValue) > -1) {
|
||||
if (allowedMimeTypesInScriptTag.includes(typeValue)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
|
|||
private provideCompletionItemsInternal(document: vscode.TextDocument, position: vscode.Position, context: vscode.CompletionContext): Thenable<vscode.CompletionList | undefined> | undefined {
|
||||
const emmetConfig = vscode.workspace.getConfiguration('emmet');
|
||||
const excludedLanguages = emmetConfig['excludeLanguages'] ? emmetConfig['excludeLanguages'] : [];
|
||||
if (excludedLanguages.indexOf(document.languageId) > -1) {
|
||||
if (excludedLanguages.includes(document.languageId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue