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

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Aug 24, 2020

Signed-off-by: Akos Kitta kittaakos@typefox.io

What it does

From now on, TextMate grammar collisions are logged without a stack trace.

Before:

logger-protocol.ts:112 root WARN Error: 'cpp' language is remapped from 'source.cpp.embedded.macro' to 'source.cpp' scope
    at TextmateRegistry.push.../../packages/monaco/lib/browser/textmate/textmate-registry.js.TextmateRegistry.mapLanguageIdToTextmateGrammar (file:///Users/akos.kitta/git/theia/examples/electron/lib/43.bundle.js:2259:26)
    at file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7275:125
    at pushContribution (file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7133:32)
    at _loop_15 (file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7275:21)
    at file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7284:25
logger-protocol.ts:112 root WARN Error: a registered grammar configuration for 'cpp' language is overridden
    at TextmateRegistry.push.../../packages/monaco/lib/browser/textmate/textmate-registry.js.TextmateRegistry.registerGrammarConfiguration (file:///Users/akos.kitta/git/theia/examples/electron/lib/43.bundle.js:2297:26)
    at file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7276:133
    at pushContribution (file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7133:32)
    at _loop_15 (file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7276:21)
    at file:///Users/akos.kitta/git/theia/examples/electron/lib/53.bundle.js:7284:25

After:

logger-protocol.ts:112 root WARN 'cpp' language is remapped from 'source.cpp.embedded.macro' to 'source.cpp' scope
logger-protocol.ts:112 root WARN a registered grammar configuration for 'cpp' language is overridden

How to test

Start the app and check the browser logs.

Review checklist

Reminder for reviewers

@akosyakov
Copy link
Member

I think we can do it always.

@kittaakos
Copy link
Contributor Author

I think we can do it always.

Even better, let me do an update. Do you want me to keep this customizable? Or dropping the Error and logging the message (string) is sufficient?

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
@kittaakos kittaakos changed the title Made the TextMate warnings customizable. Log grammar collisions without a stack trace. Aug 24, 2020
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kittaakos kittaakos merged commit d5e26ec into master Aug 24, 2020
@kittaakos kittaakos deleted the textmate-log-warn branch August 24, 2020 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants