Code change:
As mentioned in , the goal is to improve the first impression of semantic highlighting as well allow themes to opt-in to semantic highlighting. give themes a way to opt-in to semantic highlighting enable semantic coloring by default only the built-in themes. All other themes can be enabled by the theme author or in the user settings. show a notification when semantic coloring shows up the first time. The notification will point to the docs with background and information on how to configure the feature. fix the bugs found related to wrong token classification and color lookup. no longer show semantic color in imports
I like this feature. I think an individual config is better than a global one because it will allow us to use non-maintained themes that have semantic highlighting disabled and themes that have it enabled, without having to set the global config every time we change from a theme that uses it to one that doesn't
It's a good default setting
What are the reasons? It would be nice to know what most theme creators think, not just a few. Maybe some of us would like to use it A configuration could be to enable or disable that feature:
Changes pushed.
To verify: create TypeScript file . If semantic color is enabled, , and all get the function color Open a built-in in theme, semantic color should be enabled verify that the very first time the semantic colors are show, a notification dialog is shown Install a theme from the marketplace (e.g. ), semantic color should be disabled. try and semantic highlighting should be enabled verify
~Now that semantic highlighting is opt-in on a per theme basis, is there any way for a user to override that? I use Monokai Pro, which hasn't been updated in quite some time, and the developer seems fairly inactive now. The semantic highlighting was working great on 1.43, and I'd like to get it back now that it's been disabled in 1.43.1.~ ~I tried adding~ ~to my user config, but that didn't work.~ Edit: The above actually did work, except that semantic highlighting doesn't work on imports. I see now that this is the intended behavior. But why is semantic highlighting no longer available for import statements?
Make sure to also remove
Sorry, I was able to get semantic highlighting working by setting the config in my previous reply. But I'm wondering if it's possible to re-enable semantic highlighting on imports. On 1.43, variable names in import statements in Javascript would be highlighted based on their type. But on 1.43.1 with semantic highlighting enabled, import lines are no longer highlighted, as noted in your original message.

Related discussion:
text: <ins> /*--------------------------------------------------------------------------------------------- *  Copyright (c) Microsoft Corporation. All rights reserved. *  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; import * as path from 'vs/base/common/path'; import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { URI } from 'vs/base/common/uri'; import { ITextModel } from 'vs/editor/common/model'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; /** * Shows a message when semantic tokens are shown the first time. */ export class SemanticTokensHelp extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.semanticHighlightHelp'; constructor( _editor: ICodeEditor, @INotificationService _notificationService: INotificationService, @IOpenerService _openerService: IOpenerService, @IWorkbenchThemeService _themeService: IWorkbenchThemeService ) { super(); const toDispose = this._register(new DisposableStore()); const localToDispose = toDispose.add(new DisposableStore()); const installChangeTokenListener = (model: ITextModel) => { localToDispose.add(model.onDidChangeTokens((e) => { if (!e.semanticTokensApplied) { return; } toDispose.dispose(); // uninstall all listeners, makes sure the notification is only shown once per window const message = nls.localize( { key: 'semanticTokensHelp', comment: [ 'Variable 0 will be a file name.', 'Variable 1 will be a theme name.' ] }, "Semantic highlighting has been applied to '{0}' as the theme '{1}' has semantic highlighting enabled.", path.basename(model.uri.path), _themeService.getColorTheme().label ); _notificationService.prompt(Severity.Info, message, [ { label: nls.localize('learnMoreButton', "Learn More"), run: () => { const url = 'https://go.microsoft.com/fwlink/?linkid=2122588'; _openerService.open(URI.parse(url)); } } ], { neverShowAgain: { id: 'editor.contrib.semanticTokensHelp' } }); })); }; const model = _editor.getModel(); if (model !== null) { installChangeTokenListener(model); } toDispose.add(_editor.onDidChangeModel((e) => { localToDispose.clear(); const model = _editor.getModel(); if (!model) { return; } installChangeTokenListener(model); })); } } registerEditorContribution(SemanticTokensHelp.ID, SemanticTokensHelp); </ins>