Change:
Found no duplicated for this one Currently it's hardcoded I propose a config entry for long line length If you're object, I'd like to create pull request for this feature Your thoughts?
I think this makes sense as a workspace setting that defaults to the current value. Feel free to make a PR!

Discussion:
} ], "git.ignoreLimitWarning": true <del> } </del>  No newline at end of file <ins> } </ins>

'default': EDITOR_DEFAULTS.contribInfo.lightbulbEnabled, 'description': nls.localize('codeActions', "Enables the code action lightbulb in the editor.") }, <ins> 'editor.maxTokenizationLineLength': { 'type': 'integer', 'default': 20_000, 'description': nls.localize('maxTokenizationLineLength', "Configures length of lines, for which tokenization process will be skipped for performance reasons") }, </ins> 'editor.codeActionsOnSave': { 'type': 'object', 'properties': {

*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import * as nls from 'vs/nls'; </del> import * as dom from 'vs/base/browser/dom'; import { Color } from 'vs/base/common/color'; import { onUnexpectedError } from 'vs/base/common/errors';

import * as types from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token'; <del> import { IState, ITokenizationSupport, LanguageId, TokenMetadata, TokenizationRegistry } from 'vs/editor/common/modes'; </del> <ins> import { IState, ITokenizationSupport, LanguageId, TokenizationRegistry, TokenMetadata } from 'vs/editor/common/modes'; </ins> import { nullTokenize2 } from 'vs/editor/common/modes/nullMode'; import { generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization'; import { IModeService } from 'vs/editor/common/services/modeService'; <ins> import * as nls from 'vs/nls'; </ins> import { IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry'; <del> import { IEmbeddedLanguagesMap, ITMSyntaxExtensionPoint, TokenTypesContribution, grammarsExtPoint } from 'vs/workbench/services/textMate/electron-browser/TMGrammars'; </del> import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService'; <ins> import { grammarsExtPoint, IEmbeddedLanguagesMap, ITMSyntaxExtensionPoint, TokenTypesContribution } from 'vs/workbench/services/textMate/electron-browser/TMGrammars'; </ins> import { ITokenColorizationRule, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IEmbeddedLanguagesMap as IEmbeddedLanguagesMap2, IGrammar, ITokenTypeMap, Registry, StackElement, StandardTokenType } from 'vscode-textmate'; <ins> import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; </ins> import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; export class TMScopeRegistry {

@IWorkbenchThemeService private readonly _themeService: IWorkbenchThemeService, @IFileService private readonly _fileService: IFileService, @INotificationService private readonly _notificationService: INotificationService, <del> @ILogService private readonly _logService: ILogService </del> <ins> @ILogService private readonly _logService: ILogService, @IConfigurationService private readonly _configurationService: ConfigurationService </ins> ) { super(); this._styleElement = dom.createStyleSheet();

private _registerDefinitionIfAvailable(modeId: string): void { if (this._languageToScope.has(modeId)) { const promise = this._createGrammar(modeId).then((r) => { <del> return new TMTokenization(this._scopeRegistry, r.languageId, r.grammar, r.initialState, r.containsEmbeddedLanguages, this._notificationService); </del> <ins> return new TMTokenization(this._scopeRegistry, r.languageId, r.grammar, r.initialState, r.containsEmbeddedLanguages, this._notificationService, this._configurationService); </ins> }, e => { onUnexpectedError(e); return null;

private readonly _containsEmbeddedLanguages: boolean; private readonly _seenLanguages: boolean[]; private readonly _initialState: StackElement; <ins> private _maxTokenizationLineLength: number; </ins> private _tokenizationWarningAlreadyShown: boolean; <del> constructor(scopeRegistry: TMScopeRegistry, languageId: LanguageId, grammar: IGrammar, initialState: StackElement, containsEmbeddedLanguages: boolean, @INotificationService private readonly notificationService: INotificationService) { </del> <ins> constructor(scopeRegistry: TMScopeRegistry, languageId: LanguageId, grammar: IGrammar, initialState: StackElement, containsEmbeddedLanguages: boolean, @INotificationService private readonly notificationService: INotificationService, @IConfigurationService readonly configurationService: IConfigurationService) { </ins> this._scopeRegistry = scopeRegistry; this._languageId = languageId; this._grammar = grammar; this._initialState = initialState; this._containsEmbeddedLanguages = containsEmbeddedLanguages; this._seenLanguages = []; <ins> this._maxTokenizationLineLength = configurationService.getValue<number>('editor.maxTokenizationLineLength'); </ins> } public getInitialState(): IState {

throw new Error('Unexpected: offsetDelta should be 0.'); } <del> // Do not attempt to tokenize if a line has over 20k if (line.length >= 20000) { </del> <ins> // Do not attempt to tokenize if a line is too long if (line.length >= this._maxTokenizationLineLength) { </ins> if (!this._tokenizationWarningAlreadyShown) { this._tokenizationWarningAlreadyShown = true; <del> this.notificationService.warn(nls.localize('too many characters', "Tokenization is skipped for lines longer than 20k characters for performance reasons.")); </del> <ins> this.notificationService.warn(nls.localize('too many characters', 'Tokenization is skipped for long lines for performance reasons. The length of a long line can be set by configuring editor.maxTokenizationLineLength in settings')); </ins> } <del> console.log(`Line (${line.substr(0, 15)}...): longer than 20k characters, tokenization skipped.`); </del> <ins> console.log(`Line (${line.substr(0, 15)}...): longer than ${this._maxTokenizationLineLength} characters, tokenization skipped.`); </ins> return nullTokenize2(this._languageId, line, state, offsetDelta); }