From 2661e7a3ad0f086e15f294ffa72ac610613476e5 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 21 Jan 2022 20:29:28 +0100 Subject: [PATCH] Move `token.ts` to `/languages/` (#141174) --- build/monaco/monaco.d.ts.recipe | 2 +- src/vs/editor/common/languages.ts | 2 +- src/vs/editor/common/languages/nullMode.ts | 2 +- src/vs/editor/common/{core => languages}/token.ts | 0 src/vs/editor/common/model/textModelTokens.ts | 2 +- src/vs/editor/common/standalone/standaloneBase.ts | 2 +- .../contrib/comment/test/browser/lineCommentCommand.test.ts | 2 +- src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts | 2 +- src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts | 2 +- src/vs/editor/standalone/browser/standaloneEditor.ts | 2 +- src/vs/editor/standalone/browser/standaloneLanguages.ts | 2 +- src/vs/editor/standalone/common/monarch/monarchLexer.ts | 2 +- src/vs/editor/standalone/test/browser/monarch.test.ts | 2 +- .../editor/standalone/test/browser/standaloneLanguages.test.ts | 2 +- src/vs/editor/test/browser/controller/cursor.test.ts | 2 +- .../editor/test/browser/viewModel/modelLineProjection.test.ts | 2 +- .../test/common/model/bracketPairColorizer/tokenizer.test.ts | 2 +- src/vs/editor/test/common/model/model.modes.test.ts | 2 +- src/vs/editor/test/common/model/model.test.ts | 2 +- src/vs/editor/test/common/model/textModelWithTokens.test.ts | 2 +- src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts | 2 +- .../services/textMate/browser/abstractTextMateService.ts | 2 +- 22 files changed, 21 insertions(+), 21 deletions(-) rename src/vs/editor/common/{core => languages}/token.ts (100%) diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index d9c2766c094..106f696756b 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -50,7 +50,7 @@ declare namespace monaco { #include(vs/editor/common/core/position): IPosition, Position #include(vs/editor/common/core/range): IRange, Range #include(vs/editor/common/core/selection): ISelection, Selection, SelectionDirection -#include(vs/editor/common/core/token): Token +#include(vs/editor/common/languages/token): Token } declare namespace monaco.editor { diff --git a/src/vs/editor/common/languages.ts b/src/vs/editor/common/languages.ts index dea827c7643..295c49d3650 100644 --- a/src/vs/editor/common/languages.ts +++ b/src/vs/editor/common/languages.ts @@ -12,7 +12,7 @@ import { URI, UriComponents } from 'vs/base/common/uri'; import { IPosition, Position } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import * as model from 'vs/editor/common/model'; import { LanguageFeatureRegistry } from 'vs/editor/common/languages/languageFeatureRegistry'; import { TokenizationRegistry as TokenizationRegistryImpl } from 'vs/editor/common/languages/tokenizationRegistry'; diff --git a/src/vs/editor/common/languages/nullMode.ts b/src/vs/editor/common/languages/nullMode.ts index c38f3621be1..1ba4ef26d49 100644 --- a/src/vs/editor/common/languages/nullMode.ts +++ b/src/vs/editor/common/languages/nullMode.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Token, TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { Token, TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { ColorId, FontStyle, IState, LanguageId, MetadataConsts, StandardTokenType } from 'vs/editor/common/languages'; export const NullState: IState = new class implements IState { diff --git a/src/vs/editor/common/core/token.ts b/src/vs/editor/common/languages/token.ts similarity index 100% rename from src/vs/editor/common/core/token.ts rename to src/vs/editor/common/languages/token.ts diff --git a/src/vs/editor/common/model/textModelTokens.ts b/src/vs/editor/common/model/textModelTokens.ts index 61a9526b5ee..8b1eed75f3e 100644 --- a/src/vs/editor/common/model/textModelTokens.ts +++ b/src/vs/editor/common/model/textModelTokens.ts @@ -8,7 +8,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { LineTokens } from 'vs/editor/common/model/tokens/lineTokens'; import { Position } from 'vs/editor/common/core/position'; import { IRange } from 'vs/editor/common/core/range'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { ILanguageIdCodec, IState, ITokenizationSupport, StandardTokenType, TokenizationRegistry } from 'vs/editor/common/languages'; import { nullTokenizeEncoded } from 'vs/editor/common/languages/nullMode'; import { TextModel } from 'vs/editor/common/model/textModel'; diff --git a/src/vs/editor/common/standalone/standaloneBase.ts b/src/vs/editor/common/standalone/standaloneBase.ts index 2239e8d0234..9c9d5ccdc09 100644 --- a/src/vs/editor/common/standalone/standaloneBase.ts +++ b/src/vs/editor/common/standalone/standaloneBase.ts @@ -10,7 +10,7 @@ import { URI } from 'vs/base/common/uri'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { Token } from 'vs/editor/common/core/token'; +import { Token } from 'vs/editor/common/languages/token'; import * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums'; export class KeyMod { diff --git a/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts index f5f868b9d7c..868d176903e 100644 --- a/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/browser/lineCommentCommand.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { Selection } from 'vs/editor/common/core/selection'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { ICommand } from 'vs/editor/common/editorCommon'; import { ColorId, IState, MetadataConsts, TokenizationRegistry } from 'vs/editor/common/languages'; import { CommentRule } from 'vs/editor/common/languages/languageConfiguration'; diff --git a/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts b/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts index 48c27563de2..e9a7629eafb 100644 --- a/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts +++ b/src/vs/editor/contrib/suggest/test/browser/suggestModel.test.ts @@ -12,7 +12,7 @@ import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { Handler } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; import { TextModel } from 'vs/editor/common/model/textModel'; diff --git a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts index 7ef88b1a190..544fba7e375 100644 --- a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts +++ b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts @@ -12,7 +12,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { ContentWidgetPositionPreference, IActiveCodeEditor, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { Position } from 'vs/editor/common/core/position'; -import { Token } from 'vs/editor/common/core/token'; +import { Token } from 'vs/editor/common/languages/token'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; import { FontStyle, IState, ITokenizationSupport, StandardTokenType, TokenMetadata, TokenizationRegistry, ILanguageIdCodec } from 'vs/editor/common/languages'; diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts index 285c9e603c4..7e65568f723 100644 --- a/src/vs/editor/standalone/browser/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -13,7 +13,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService import { DiffNavigator, IDiffNavigator } from 'vs/editor/browser/widget/diffNavigator'; import { ApplyUpdateResult, ConfigurationChangedEvent, EditorOptions } from 'vs/editor/common/config/editorOptions'; import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo'; -import { Token } from 'vs/editor/common/core/token'; +import { Token } from 'vs/editor/common/languages/token'; import { EditorType } from 'vs/editor/common/editorCommon'; import { FindMatch, ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model'; import * as languages from 'vs/editor/common/languages'; diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index fe8c5915128..0189792b4de 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -8,7 +8,7 @@ import { Color } from 'vs/base/common/color'; import { IDisposable } from 'vs/base/common/lifecycle'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { Token, TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { Token, TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import * as model from 'vs/editor/common/model'; import * as languages from 'vs/editor/common/languages'; import { LanguageConfiguration } from 'vs/editor/common/languages/languageConfiguration'; diff --git a/src/vs/editor/standalone/common/monarch/monarchLexer.ts b/src/vs/editor/standalone/common/monarch/monarchLexer.ts index 3b40159d476..41c510cdf03 100644 --- a/src/vs/editor/standalone/common/monarch/monarchLexer.ts +++ b/src/vs/editor/standalone/common/monarch/monarchLexer.ts @@ -9,7 +9,7 @@ */ import { IDisposable } from 'vs/base/common/lifecycle'; -import { Token, TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { Token, TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import * as modes from 'vs/editor/common/languages'; import { NullState } from 'vs/editor/common/languages/nullMode'; import { TokenTheme } from 'vs/editor/common/languages/supports/tokenization'; diff --git a/src/vs/editor/standalone/test/browser/monarch.test.ts b/src/vs/editor/standalone/test/browser/monarch.test.ts index d423e251162..856172067fd 100644 --- a/src/vs/editor/standalone/test/browser/monarch.test.ts +++ b/src/vs/editor/standalone/test/browser/monarch.test.ts @@ -8,7 +8,7 @@ import { LanguageService } from 'vs/editor/common/services/languageService'; import { ILanguageService } from 'vs/editor/common/services/language'; import { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer'; import { compile } from 'vs/editor/standalone/common/monarch/monarchCompile'; -import { Token } from 'vs/editor/common/core/token'; +import { Token } from 'vs/editor/common/languages/token'; import { TokenizationRegistry } from 'vs/editor/common/languages'; import { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes'; import { ModesRegistry } from 'vs/editor/common/languages/modesRegistry'; diff --git a/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts b/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts index d476945d427..530cec2e6a6 100644 --- a/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts +++ b/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { Color } from 'vs/base/common/color'; import { Emitter } from 'vs/base/common/event'; import { DisposableStore } from 'vs/base/common/lifecycle'; -import { Token } from 'vs/editor/common/core/token'; +import { Token } from 'vs/editor/common/languages/token'; import { IState, LanguageId, MetadataConsts } from 'vs/editor/common/languages'; import { ModesRegistry } from 'vs/editor/common/languages/modesRegistry'; import { TokenTheme } from 'vs/editor/common/languages/supports/tokenization'; diff --git a/src/vs/editor/test/browser/controller/cursor.test.ts b/src/vs/editor/test/browser/controller/cursor.test.ts index 809bb2fd03b..16265df827b 100644 --- a/src/vs/editor/test/browser/controller/cursor.test.ts +++ b/src/vs/editor/test/browser/controller/cursor.test.ts @@ -10,7 +10,7 @@ import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/editor/common/editorCommon'; import { EndOfLinePreference, EndOfLineSequence, ITextModel } from 'vs/editor/common/model'; import { TextModel } from 'vs/editor/common/model/textModel'; diff --git a/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts b/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts index 15c6d75a0de..221e090252a 100644 --- a/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts +++ b/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts @@ -8,7 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { IViewLineTokens } from 'vs/editor/common/model/tokens/lineTokens'; import { Position } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { EndOfLinePreference } from 'vs/editor/common/model'; import { TextModel } from 'vs/editor/common/model/textModel'; import * as modes from 'vs/editor/common/languages'; diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts index a59961d145f..d8f9d6b37ce 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/tokenizer.test.ts @@ -5,7 +5,7 @@ import assert = require('assert'); import { DisposableStore } from 'vs/base/common/lifecycle'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { LanguageAgnosticBracketTokens } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets'; import { Length, lengthAdd, lengthsToRange, lengthZero } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; import { DenseKeyProvider } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet'; diff --git a/src/vs/editor/test/common/model/model.modes.test.ts b/src/vs/editor/test/common/model/model.modes.test.ts index 9a400492984..7556ac1bfab 100644 --- a/src/vs/editor/test/common/model/model.modes.test.ts +++ b/src/vs/editor/test/common/model/model.modes.test.ts @@ -8,7 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { TextModel } from 'vs/editor/common/model/textModel'; import * as modes from 'vs/editor/common/languages'; import { NullState } from 'vs/editor/common/languages/nullMode'; diff --git a/src/vs/editor/test/common/model/model.test.ts b/src/vs/editor/test/common/model/model.test.ts index 9e6965d25be..fed4c5ed3e7 100644 --- a/src/vs/editor/test/common/model/model.test.ts +++ b/src/vs/editor/test/common/model/model.test.ts @@ -8,7 +8,7 @@ import { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { TextModel } from 'vs/editor/common/model/textModel'; import { ModelRawContentChangedEvent, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from 'vs/editor/common/model/textModelEvents'; import { IState, MetadataConsts, TokenizationRegistry } from 'vs/editor/common/languages'; diff --git a/src/vs/editor/test/common/model/textModelWithTokens.test.ts b/src/vs/editor/test/common/model/textModelWithTokens.test.ts index 1cc1ab8101f..ff62e3b7196 100644 --- a/src/vs/editor/test/common/model/textModelWithTokens.test.ts +++ b/src/vs/editor/test/common/model/textModelWithTokens.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { IFoundBracket } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairs'; import { TextModel } from 'vs/editor/common/model/textModel'; import { ITokenizationSupport, MetadataConsts, TokenizationRegistry, StandardTokenType } from 'vs/editor/common/languages'; diff --git a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts index e930e242889..661251df73c 100644 --- a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts +++ b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { ColorId, FontStyle, IState, MetadataConsts, TokenizationRegistry } from 'vs/editor/common/languages'; import { tokenizeLineToHTML, _tokenizeToString } from 'vs/editor/common/languages/textToHtmlTokenizer'; import { LanguageIdCodec } from 'vs/editor/common/services/languagesRegistry'; diff --git a/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts b/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts index cc2b950ea2f..08a1677a7fa 100644 --- a/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts +++ b/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts @@ -12,7 +12,7 @@ import * as resources from 'vs/base/common/resources'; import * as types from 'vs/base/common/types'; import { equals as equalArray } from 'vs/base/common/arrays'; import { URI } from 'vs/base/common/uri'; -import { TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/core/token'; +import { TokenizationResult, EncodedTokenizationResult } from 'vs/editor/common/languages/token'; import { IState, ITokenizationSupport, LanguageId, TokenMetadata, TokenizationRegistry, StandardTokenType, ITokenizationSupportFactory } from 'vs/editor/common/languages'; import { nullTokenizeEncoded } from 'vs/editor/common/languages/nullMode'; import { generateTokensCSSForColorMap } from 'vs/editor/common/languages/supports/tokenization';