Skip to content

Commit b2000e2

Browse files
committed
editor.semanticHighlighting is not an editor instance option
1 parent 65fee79 commit b2000e2

6 files changed

Lines changed: 64 additions & 117 deletions

File tree

src/vs/editor/common/config/commonEditorConfig.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,11 @@ const editorConfiguration: IConfigurationNode = {
484484
default: true,
485485
description: nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.")
486486
},
487+
'editor.semanticHighlighting.enabled': {
488+
type: 'boolean',
489+
default: true,
490+
description: nls.localize('semanticHighlighting.enabled', "Controls whether the semanticHighlighting is shown for the languages that support it.")
491+
},
487492
'editor.stablePeek': {
488493
type: 'boolean',
489494
default: false,

src/vs/editor/common/config/editorOptions.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,55 +1588,6 @@ class EditorHover extends BaseEditorOption<EditorOption.hover, EditorHoverOption
15881588

15891589
//#endregion
15901590

1591-
//#region semantic highlighting
1592-
1593-
/**
1594-
* Configuration options for semantic highlighting
1595-
*/
1596-
export interface IEditorSemanticHighlightingOptions {
1597-
/**
1598-
* Enable semantic highlighting.
1599-
* Defaults to true.
1600-
*/
1601-
enabled?: boolean;
1602-
}
1603-
1604-
/**
1605-
* @internal
1606-
*/
1607-
export type EditorSemanticHighlightingOptions = Readonly<Required<IEditorSemanticHighlightingOptions>>;
1608-
1609-
class EditorSemanticHighlighting extends BaseEditorOption<EditorOption.semanticHighlighting, EditorSemanticHighlightingOptions> {
1610-
1611-
constructor() {
1612-
const defaults: EditorSemanticHighlightingOptions = {
1613-
enabled: true
1614-
};
1615-
super(
1616-
EditorOption.semanticHighlighting, 'semanticHighlighting', defaults,
1617-
{
1618-
'editor.semanticHighlighting.enabled': {
1619-
type: 'boolean',
1620-
default: defaults.enabled,
1621-
description: nls.localize('semanticHighlighting.enabled', "Controls whether the semanticHighlighting is shown for the languages that support it.")
1622-
}
1623-
}
1624-
);
1625-
}
1626-
1627-
public validate(_input: any): EditorSemanticHighlightingOptions {
1628-
if (typeof _input !== 'object') {
1629-
return this.defaultValue;
1630-
}
1631-
const input = _input as IEditorSemanticHighlightingOptions;
1632-
return {
1633-
enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled)
1634-
};
1635-
}
1636-
}
1637-
1638-
//#endregion
1639-
16401591
//#region layoutInfo
16411592

16421593
/**
@@ -3245,7 +3196,6 @@ export const enum EditorOption {
32453196
selectionClipboard,
32463197
selectionHighlight,
32473198
selectOnLineNumbers,
3248-
semanticHighlighting,
32493199
showFoldingControls,
32503200
showUnused,
32513201
snippetSuggestions,
@@ -3715,7 +3665,6 @@ export const EditorOptions = {
37153665
selectOnLineNumbers: register(new EditorBooleanOption(
37163666
EditorOption.selectOnLineNumbers, 'selectOnLineNumbers', true,
37173667
)),
3718-
semanticHighlighting: register(new EditorSemanticHighlighting()),
37193668
showFoldingControls: register(new EditorStringEnumOption(
37203669
EditorOption.showFoldingControls, 'showFoldingControls',
37213670
'mouseover' as 'always' | 'mouseover',

src/vs/editor/common/services/modelServiceImpl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Disposable, IDisposable, DisposableStore } from 'vs/base/common/lifecyc
88
import * as platform from 'vs/base/common/platform';
99
import * as errors from 'vs/base/common/errors';
1010
import { URI } from 'vs/base/common/uri';
11-
import { EDITOR_MODEL_DEFAULTS, IEditorSemanticHighlightingOptions } from 'vs/editor/common/config/editorOptions';
11+
import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions';
1212
import { EditOperation } from 'vs/editor/common/core/editOperation';
1313
import { Range } from 'vs/editor/common/core/range';
1414
import { DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, IIdentifiedSingleEditOperation, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model';
@@ -26,6 +26,10 @@ import { SparseEncodedTokens, MultilineTokens2 } from 'vs/editor/common/model/to
2626
import { IThemeService } from 'vs/platform/theme/common/themeService';
2727
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
2828

29+
export interface IEditorSemanticHighlightingOptions {
30+
enabled?: boolean;
31+
}
32+
2933
function MODEL_ID(resource: URI): string {
3034
return resource.toString();
3135
}

src/vs/editor/common/standalone/standaloneEnums.ts

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -250,32 +250,31 @@ export enum EditorOption {
250250
selectionClipboard = 82,
251251
selectionHighlight = 83,
252252
selectOnLineNumbers = 84,
253-
semanticHighlighting = 85,
254-
showFoldingControls = 86,
255-
showUnused = 87,
256-
snippetSuggestions = 88,
257-
smoothScrolling = 89,
258-
stopRenderingLineAfter = 90,
259-
suggest = 91,
260-
suggestFontSize = 92,
261-
suggestLineHeight = 93,
262-
suggestOnTriggerCharacters = 94,
263-
suggestSelection = 95,
264-
tabCompletion = 96,
265-
useTabStops = 97,
266-
wordSeparators = 98,
267-
wordWrap = 99,
268-
wordWrapBreakAfterCharacters = 100,
269-
wordWrapBreakBeforeCharacters = 101,
270-
wordWrapColumn = 102,
271-
wordWrapMinified = 103,
272-
wrappingIndent = 104,
273-
wrappingStrategy = 105,
274-
editorClassName = 106,
275-
pixelRatio = 107,
276-
tabFocusMode = 108,
277-
layoutInfo = 109,
278-
wrappingInfo = 110
253+
showFoldingControls = 85,
254+
showUnused = 86,
255+
snippetSuggestions = 87,
256+
smoothScrolling = 88,
257+
stopRenderingLineAfter = 89,
258+
suggest = 90,
259+
suggestFontSize = 91,
260+
suggestLineHeight = 92,
261+
suggestOnTriggerCharacters = 93,
262+
suggestSelection = 94,
263+
tabCompletion = 95,
264+
useTabStops = 96,
265+
wordSeparators = 97,
266+
wordWrap = 98,
267+
wordWrapBreakAfterCharacters = 99,
268+
wordWrapBreakBeforeCharacters = 100,
269+
wordWrapColumn = 101,
270+
wordWrapMinified = 102,
271+
wrappingIndent = 103,
272+
wrappingStrategy = 104,
273+
editorClassName = 105,
274+
pixelRatio = 106,
275+
tabFocusMode = 107,
276+
layoutInfo = 108,
277+
wrappingInfo = 109
279278
}
280279

281280
/**

src/vs/monaco.d.ts

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,17 +3245,6 @@ declare namespace monaco.editor {
32453245

32463246
export type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;
32473247

3248-
/**
3249-
* Configuration options for semantic highlighting
3250-
*/
3251-
export interface IEditorSemanticHighlightingOptions {
3252-
/**
3253-
* Enable semantic highlighting.
3254-
* Defaults to true.
3255-
*/
3256-
enabled?: boolean;
3257-
}
3258-
32593248
/**
32603249
* A description for the overview ruler position.
32613250
*/
@@ -3797,32 +3786,31 @@ declare namespace monaco.editor {
37973786
selectionClipboard = 82,
37983787
selectionHighlight = 83,
37993788
selectOnLineNumbers = 84,
3800-
semanticHighlighting = 85,
3801-
showFoldingControls = 86,
3802-
showUnused = 87,
3803-
snippetSuggestions = 88,
3804-
smoothScrolling = 89,
3805-
stopRenderingLineAfter = 90,
3806-
suggest = 91,
3807-
suggestFontSize = 92,
3808-
suggestLineHeight = 93,
3809-
suggestOnTriggerCharacters = 94,
3810-
suggestSelection = 95,
3811-
tabCompletion = 96,
3812-
useTabStops = 97,
3813-
wordSeparators = 98,
3814-
wordWrap = 99,
3815-
wordWrapBreakAfterCharacters = 100,
3816-
wordWrapBreakBeforeCharacters = 101,
3817-
wordWrapColumn = 102,
3818-
wordWrapMinified = 103,
3819-
wrappingIndent = 104,
3820-
wrappingStrategy = 105,
3821-
editorClassName = 106,
3822-
pixelRatio = 107,
3823-
tabFocusMode = 108,
3824-
layoutInfo = 109,
3825-
wrappingInfo = 110
3789+
showFoldingControls = 85,
3790+
showUnused = 86,
3791+
snippetSuggestions = 87,
3792+
smoothScrolling = 88,
3793+
stopRenderingLineAfter = 89,
3794+
suggest = 90,
3795+
suggestFontSize = 91,
3796+
suggestLineHeight = 92,
3797+
suggestOnTriggerCharacters = 93,
3798+
suggestSelection = 94,
3799+
tabCompletion = 95,
3800+
useTabStops = 96,
3801+
wordSeparators = 97,
3802+
wordWrap = 98,
3803+
wordWrapBreakAfterCharacters = 99,
3804+
wordWrapBreakBeforeCharacters = 100,
3805+
wordWrapColumn = 101,
3806+
wordWrapMinified = 102,
3807+
wrappingIndent = 103,
3808+
wrappingStrategy = 104,
3809+
editorClassName = 105,
3810+
pixelRatio = 106,
3811+
tabFocusMode = 107,
3812+
layoutInfo = 108,
3813+
wrappingInfo = 109
38263814
}
38273815
export const EditorOptions: {
38283816
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
@@ -3910,7 +3898,6 @@ declare namespace monaco.editor {
39103898
selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>;
39113899
selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>;
39123900
selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>;
3913-
semanticHighlighting: IEditorOption<EditorOption.semanticHighlighting, any>;
39143901
showFoldingControls: IEditorOption<EditorOption.showFoldingControls, 'always' | 'mouseover'>;
39153902
showUnused: IEditorOption<EditorOption.showUnused, boolean>;
39163903
snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, 'none' | 'top' | 'bottom' | 'inline'>;

src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation';
2929
import { ColorThemeData, TokenStyleDefinitions, TokenStyleDefinition } from 'vs/workbench/services/themes/common/colorThemeData';
3030
import { TokenStylingRule, TokenStyleData } from 'vs/platform/theme/common/tokenClassificationRegistry';
3131
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
32-
import type { IEditorSemanticHighlightingOptions } from 'vs/editor/common/config/editorOptions';
32+
33+
export interface IEditorSemanticHighlightingOptions {
34+
enabled?: boolean;
35+
}
3336

3437
class InspectEditorTokensController extends Disposable implements IEditorContribution {
3538

0 commit comments

Comments
 (0)