Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log grammar collisions without a stack trace. #8418

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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] || {};
}

}