提交 0c1cb457 编写于 作者: A Alex Dima

Warn only if grammar paths are different

上级 f8cc441e
......@@ -38,11 +38,14 @@ export class TMScopeRegistry {
public register(scopeName: string, filePath: string, embeddedLanguages?: IEmbeddedLanguagesMap): void {
if (this._scopeNameToLanguageRegistration[scopeName]) {
console.warn(
`Overwriting grammar scope name to file mapping for scope ${scopeName}.\n` +
`Old grammar file: ${this._scopeNameToLanguageRegistration[scopeName].grammarFilePath}.\n` +
`New grammar file: ${filePath}`
);
const existingRegistration = this._scopeNameToLanguageRegistration[scopeName];
if (existingRegistration.grammarFilePath !== filePath) {
console.warn(
`Overwriting grammar scope name to file mapping for scope ${scopeName}.\n` +
`Old grammar file: ${existingRegistration.grammarFilePath}.\n` +
`New grammar file: ${filePath}`
);
}
}
this._scopeNameToLanguageRegistration[scopeName] = new TMLanguageRegistration(scopeName, filePath, embeddedLanguages);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册