mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Require second parameter for Map.set
Converts cover the was relying on the old signature to either use delete or have the correct types
This commit is contained in:
@@ -16,8 +16,13 @@ import { equals } from 'vs/base/common/arrays';
|
||||
|
||||
const _modeId2WordDefinition = new Map<string, RegExp>();
|
||||
export function setWordDefinitionFor(modeId: string, wordDefinition: RegExp | undefined): void {
|
||||
_modeId2WordDefinition.set(modeId, wordDefinition);
|
||||
if (!wordDefinition) {
|
||||
_modeId2WordDefinition.delete(modeId);
|
||||
} else {
|
||||
_modeId2WordDefinition.set(modeId, wordDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
export function getWordDefinitionFor(modeId: string): RegExp | undefined {
|
||||
return _modeId2WordDefinition.get(modeId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user