Skip to content

Commit

Permalink
Log grammar collisions without a stack trace.
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
  • Loading branch information
Akos Kitta authored and kittaakos committed Aug 24, 2020
1 parent 9a07349 commit d5e26ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/monaco/src/browser/textmate/textmate-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class TextmateRegistry {
if (existingProvider) {
Promise.all([existingProvider.getGrammarDefinition(), provider.getGrammarDefinition()]).then(([a, b]) => {
if (a.location !== b.location || !a.location && !b.location) {
console.warn(new Error(`a registered grammar provider for '${scope}' scope is overridden`));
console.warn(`a registered grammar provider for '${scope}' scope is overridden`);
}
});
}
Expand All @@ -79,7 +79,7 @@ export class TextmateRegistry {
const scopes = this.languageIdToScope.get(languageId) || [];
const existingScope = scopes[0];
if (typeof existingScope === 'string') {
console.warn(new Error(`'${languageId}' language is remapped from '${existingScope}' to '${scope}' scope`));
console.warn(`'${languageId}' language is remapped from '${existingScope}' to '${scope}' scope`);
}
scopes.unshift(scope);
this.languageIdToScope.set(languageId, scopes);
Expand Down Expand Up @@ -109,7 +109,7 @@ export class TextmateRegistry {
const configs = this.languageToConfig.get(languageId) || [];
const existingConfig = configs[0];
if (existingConfig) {
console.warn(new Error(`a registered grammar configuration for '${languageId}' language is overridden`));
console.warn(`a registered grammar configuration for '${languageId}' language is overridden`);
}
configs.unshift(config);
this.languageToConfig.set(languageId, configs);
Expand All @@ -125,4 +125,5 @@ export class TextmateRegistry {
const configs = this.languageToConfig.get(languageId);
return configs && configs[0] || {};
}

}

0 comments on commit d5e26ec

Please sign in to comment.