From f94818da36c58f9fc0d6d535677f6500a096f6de Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 22 May 2017 10:40:59 -0700 Subject: [PATCH] Also convert ClassificationTypeNames and CommandTypes/CommandNames --- src/harness/fourslash.ts | 105 ++++++++++++++------------- src/server/protocol.ts | 144 ++++++++++++++++++------------------- src/server/session.ts | 99 +------------------------ src/services/classifier.ts | 2 +- src/services/types.ts | 76 ++++++++++---------- 5 files changed, 167 insertions(+), 259 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index fc50e71478eab..7e2387ed6361b 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2174,7 +2174,7 @@ namespace FourSlash { } ts.zipWith(expected, actual, (expectedClassification, actualClassification) => { - const expectedType: string = (ts.ClassificationTypeNames)[expectedClassification.classificationType]; + const expectedType = expectedClassification.classificationType; if (expectedType !== actualClassification.classificationType) { this.raiseError("verifyClassifications failed - expected classifications type to be " + expectedType + ", but was " + @@ -3876,7 +3876,7 @@ namespace FourSlashInterface { /** * This method *requires* an ordered stream of classifications for a file, and spans are highly recommended. */ - public semanticClassificationsAre(...classifications: { classificationType: string; text: string; textSpan?: FourSlash.TextSpan }[]) { + public semanticClassificationsAre(...classifications: Classification[]) { this.state.verifySemanticClassifications(classifications); } @@ -4071,102 +4071,107 @@ namespace FourSlashInterface { } } + interface Classification { + classificationType: ts.ClassificationTypeNames; + text: string; + textSpan?: FourSlash.TextSpan; + } export namespace Classification { - export function comment(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("comment", text, position); + export function comment(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.comment, text, position); } - export function identifier(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("identifier", text, position); + export function identifier(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.identifier, text, position); } - export function keyword(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("keyword", text, position); + export function keyword(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.keyword, text, position); } - export function numericLiteral(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("numericLiteral", text, position); + export function numericLiteral(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.numericLiteral, text, position); } - export function operator(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("operator", text, position); + export function operator(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.operator, text, position); } - export function stringLiteral(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("stringLiteral", text, position); + export function stringLiteral(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.stringLiteral, text, position); } - export function whiteSpace(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("whiteSpace", text, position); + export function whiteSpace(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.whiteSpace, text, position); } - export function text(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("text", text, position); + export function text(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.text, text, position); } - export function punctuation(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("punctuation", text, position); + export function punctuation(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.punctuation, text, position); } - export function docCommentTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("docCommentTagName", text, position); + export function docCommentTagName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.docCommentTagName, text, position); } - export function className(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("className", text, position); + export function className(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.className, text, position); } - export function enumName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("enumName", text, position); + export function enumName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.enumName, text, position); } - export function interfaceName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("interfaceName", text, position); + export function interfaceName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.interfaceName, text, position); } - export function moduleName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("moduleName", text, position); + export function moduleName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.moduleName, text, position); } - export function typeParameterName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("typeParameterName", text, position); + export function typeParameterName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.typeParameterName, text, position); } - export function parameterName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("parameterName", text, position); + export function parameterName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.parameterName, text, position); } - export function typeAliasName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("typeAliasName", text, position); + export function typeAliasName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.typeAliasName, text, position); } - export function jsxOpenTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("jsxOpenTagName", text, position); + export function jsxOpenTagName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.jsxOpenTagName, text, position); } - export function jsxCloseTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("jsxCloseTagName", text, position); + export function jsxCloseTagName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.jsxCloseTagName, text, position); } - export function jsxSelfClosingTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("jsxSelfClosingTagName", text, position); + export function jsxSelfClosingTagName(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.jsxSelfClosingTagName, text, position); } - export function jsxAttribute(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("jsxAttribute", text, position); + export function jsxAttribute(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.jsxAttribute, text, position); } - export function jsxText(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("jsxText", text, position); + export function jsxText(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.jsxText, text, position); } - export function jsxAttributeStringLiteralValue(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { - return getClassification("jsxAttributeStringLiteralValue", text, position); + export function jsxAttributeStringLiteralValue(text: string, position?: number): Classification { + return getClassification(ts.ClassificationTypeNames.jsxAttributeStringLiteralValue, text, position); } - function getClassification(type: string, text: string, position?: number) { + function getClassification(classificationType: ts.ClassificationTypeNames, text: string, position?: number): Classification { return { - classificationType: type, + classificationType, text: text, textSpan: position === undefined ? undefined : { start: position, end: position + text.length } }; diff --git a/src/server/protocol.ts b/src/server/protocol.ts index de124714d68e0..c51743e1c392b 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2,103 +2,103 @@ * Declaration module describing the TypeScript Server protocol */ namespace ts.server.protocol { - export namespace CommandTypes { - export type Brace = "brace"; + export enum CommandTypes { + Brace = "brace", /* @internal */ - export type BraceFull = "brace-full"; - export type BraceCompletion = "braceCompletion"; - export type Change = "change"; - export type Close = "close"; - export type Completions = "completions"; + BraceFull = "brace-full", + BraceCompletion = "braceCompletion", + Change = "change", + Close = "close", + Completions = "completions", /* @internal */ - export type CompletionsFull = "completions-full"; - export type CompletionDetails = "completionEntryDetails"; - export type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; - export type CompileOnSaveEmitFile = "compileOnSaveEmitFile"; - export type Configure = "configure"; - export type Definition = "definition"; + CompletionsFull = "completions-full", + CompletionDetails = "completionEntryDetails", + CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList", + CompileOnSaveEmitFile = "compileOnSaveEmitFile", + Configure = "configure", + Definition = "definition", /* @internal */ - export type DefinitionFull = "definition-full"; - export type Implementation = "implementation"; + DefinitionFull = "definition-full", + Implementation = "implementation", /* @internal */ - export type ImplementationFull = "implementation-full"; - export type Exit = "exit"; - export type Format = "format"; - export type Formatonkey = "formatonkey"; + ImplementationFull = "implementation-full", + Exit = "exit", + Format = "format", + Formatonkey = "formatonkey", /* @internal */ - export type FormatFull = "format-full"; + FormatFull = "format-full", /* @internal */ - export type FormatonkeyFull = "formatonkey-full"; + FormatonkeyFull = "formatonkey-full", /* @internal */ - export type FormatRangeFull = "formatRange-full"; - export type Geterr = "geterr"; - export type GeterrForProject = "geterrForProject"; - export type SemanticDiagnosticsSync = "semanticDiagnosticsSync"; - export type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; - export type NavBar = "navbar"; + FormatRangeFull = "formatRange-full", + Geterr = "geterr", + GeterrForProject = "geterrForProject", + SemanticDiagnosticsSync = "semanticDiagnosticsSync", + SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", + NavBar = "navbar", /* @internal */ - export type NavBarFull = "navbar-full"; - export type Navto = "navto"; + NavBarFull = "navbar-full", + Navto = "navto", /* @internal */ - export type NavtoFull = "navto-full"; - export type NavTree = "navtree"; - export type NavTreeFull = "navtree-full"; - export type Occurrences = "occurrences"; - export type DocumentHighlights = "documentHighlights"; + NavtoFull = "navto-full", + NavTree = "navtree", + NavTreeFull = "navtree-full", + Occurrences = "occurrences", + DocumentHighlights = "documentHighlights", /* @internal */ - export type DocumentHighlightsFull = "documentHighlights-full"; - export type Open = "open"; - export type Quickinfo = "quickinfo"; + DocumentHighlightsFull = "documentHighlights-full", + Open = "open", + Quickinfo = "quickinfo", /* @internal */ - export type QuickinfoFull = "quickinfo-full"; - export type References = "references"; + QuickinfoFull = "quickinfo-full", + References = "references", /* @internal */ - export type ReferencesFull = "references-full"; - export type Reload = "reload"; - export type Rename = "rename"; + ReferencesFull = "references-full", + Reload = "reload", + Rename = "rename", /* @internal */ - export type RenameInfoFull = "rename-full"; + RenameInfoFull = "rename-full", /* @internal */ - export type RenameLocationsFull = "renameLocations-full"; - export type Saveto = "saveto"; - export type SignatureHelp = "signatureHelp"; + RenameLocationsFull = "renameLocations-full", + Saveto = "saveto", + SignatureHelp = "signatureHelp", /* @internal */ - export type SignatureHelpFull = "signatureHelp-full"; - export type TypeDefinition = "typeDefinition"; - export type ProjectInfo = "projectInfo"; - export type ReloadProjects = "reloadProjects"; - export type Unknown = "unknown"; - export type OpenExternalProject = "openExternalProject"; - export type OpenExternalProjects = "openExternalProjects"; - export type CloseExternalProject = "closeExternalProject"; + SignatureHelpFull = "signatureHelp-full", + TypeDefinition = "typeDefinition", + ProjectInfo = "projectInfo", + ReloadProjects = "reloadProjects", + Unknown = "unknown", + OpenExternalProject = "openExternalProject", + OpenExternalProjects = "openExternalProjects", + CloseExternalProject = "closeExternalProject", /* @internal */ - export type SynchronizeProjectList = "synchronizeProjectList"; + SynchronizeProjectList = "synchronizeProjectList", /* @internal */ - export type ApplyChangedToOpenFiles = "applyChangedToOpenFiles"; + ApplyChangedToOpenFiles = "applyChangedToOpenFiles", /* @internal */ - export type EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full"; + EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full", /* @internal */ - export type Cleanup = "cleanup"; + Cleanup = "cleanup", /* @internal */ - export type OutliningSpans = "outliningSpans"; - export type TodoComments = "todoComments"; - export type Indentation = "indentation"; - export type DocCommentTemplate = "docCommentTemplate"; + OutliningSpans = "outliningSpans", + TodoComments = "todoComments", + Indentation = "indentation", + DocCommentTemplate = "docCommentTemplate", /* @internal */ - export type CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; + CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full", /* @internal */ - export type NameOrDottedNameSpan = "nameOrDottedNameSpan"; + NameOrDottedNameSpan = "nameOrDottedNameSpan", /* @internal */ - export type BreakpointStatement = "breakpointStatement"; - export type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; - export type GetCodeFixes = "getCodeFixes"; + BreakpointStatement = "breakpointStatement", + CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", + GetCodeFixes = "getCodeFixes", /* @internal */ - export type GetCodeFixesFull = "getCodeFixes-full"; - export type GetSupportedCodeFixes = "getSupportedCodeFixes"; + GetCodeFixesFull = "getCodeFixes-full", + GetSupportedCodeFixes = "getSupportedCodeFixes", - export type GetApplicableRefactors = "getApplicableRefactors"; - export type GetRefactorCodeActions = "getRefactorCodeActions"; - export type GetRefactorCodeActionsFull = "getRefactorCodeActions-full"; + GetApplicableRefactors = "getApplicableRefactors", + GetRefactorCodeActions = "getRefactorCodeActions", + GetRefactorCodeActionsFull = "getRefactorCodeActions-full", } /** diff --git a/src/server/session.ts b/src/server/session.ts index bae53dcafe8a0..846607cd5caf1 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -112,104 +112,7 @@ namespace ts.server { return true; } - export namespace CommandNames { - export const Brace: protocol.CommandTypes.Brace = "brace"; - /* @internal */ - export const BraceFull: protocol.CommandTypes.BraceFull = "brace-full"; - export const BraceCompletion: protocol.CommandTypes.BraceCompletion = "braceCompletion"; - export const Change: protocol.CommandTypes.Change = "change"; - export const Close: protocol.CommandTypes.Close = "close"; - export const Completions: protocol.CommandTypes.Completions = "completions"; - /* @internal */ - export const CompletionsFull: protocol.CommandTypes.CompletionsFull = "completions-full"; - export const CompletionDetails: protocol.CommandTypes.CompletionDetails = "completionEntryDetails"; - export const CompileOnSaveAffectedFileList: protocol.CommandTypes.CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList"; - export const CompileOnSaveEmitFile: protocol.CommandTypes.CompileOnSaveEmitFile = "compileOnSaveEmitFile"; - export const Configure: protocol.CommandTypes.Configure = "configure"; - export const Definition: protocol.CommandTypes.Definition = "definition"; - /* @internal */ - export const DefinitionFull: protocol.CommandTypes.DefinitionFull = "definition-full"; - export const Exit: protocol.CommandTypes.Exit = "exit"; - export const Format: protocol.CommandTypes.Format = "format"; - export const Formatonkey: protocol.CommandTypes.Formatonkey = "formatonkey"; - /* @internal */ - export const FormatFull: protocol.CommandTypes.FormatFull = "format-full"; - /* @internal */ - export const FormatonkeyFull: protocol.CommandTypes.FormatonkeyFull = "formatonkey-full"; - /* @internal */ - export const FormatRangeFull: protocol.CommandTypes.FormatRangeFull = "formatRange-full"; - export const Geterr: protocol.CommandTypes.Geterr = "geterr"; - export const GeterrForProject: protocol.CommandTypes.GeterrForProject = "geterrForProject"; - export const Implementation: protocol.CommandTypes.Implementation = "implementation"; - /* @internal */ - export const ImplementationFull: protocol.CommandTypes.ImplementationFull = "implementation-full"; - export const SemanticDiagnosticsSync: protocol.CommandTypes.SemanticDiagnosticsSync = "semanticDiagnosticsSync"; - export const SyntacticDiagnosticsSync: protocol.CommandTypes.SyntacticDiagnosticsSync = "syntacticDiagnosticsSync"; - export const NavBar: protocol.CommandTypes.NavBar = "navbar"; - /* @internal */ - export const NavBarFull: protocol.CommandTypes.NavBarFull = "navbar-full"; - export const NavTree: protocol.CommandTypes.NavTree = "navtree"; - export const NavTreeFull: protocol.CommandTypes.NavTreeFull = "navtree-full"; - export const Navto: protocol.CommandTypes.Navto = "navto"; - /* @internal */ - export const NavtoFull: protocol.CommandTypes.NavtoFull = "navto-full"; - export const Occurrences: protocol.CommandTypes.Occurrences = "occurrences"; - export const DocumentHighlights: protocol.CommandTypes.DocumentHighlights = "documentHighlights"; - /* @internal */ - export const DocumentHighlightsFull: protocol.CommandTypes.DocumentHighlightsFull = "documentHighlights-full"; - export const Open: protocol.CommandTypes.Open = "open"; - export const Quickinfo: protocol.CommandTypes.Quickinfo = "quickinfo"; - /* @internal */ - export const QuickinfoFull: protocol.CommandTypes.QuickinfoFull = "quickinfo-full"; - export const References: protocol.CommandTypes.References = "references"; - /* @internal */ - export const ReferencesFull: protocol.CommandTypes.ReferencesFull = "references-full"; - export const Reload: protocol.CommandTypes.Reload = "reload"; - export const Rename: protocol.CommandTypes.Rename = "rename"; - /* @internal */ - export const RenameInfoFull: protocol.CommandTypes.RenameInfoFull = "rename-full"; - /* @internal */ - export const RenameLocationsFull: protocol.CommandTypes.RenameLocationsFull = "renameLocations-full"; - export const Saveto: protocol.CommandTypes.Saveto = "saveto"; - export const SignatureHelp: protocol.CommandTypes.SignatureHelp = "signatureHelp"; - /* @internal */ - export const SignatureHelpFull: protocol.CommandTypes.SignatureHelpFull = "signatureHelp-full"; - export const TypeDefinition: protocol.CommandTypes.TypeDefinition = "typeDefinition"; - export const ProjectInfo: protocol.CommandTypes.ProjectInfo = "projectInfo"; - export const ReloadProjects: protocol.CommandTypes.ReloadProjects = "reloadProjects"; - export const Unknown: protocol.CommandTypes.Unknown = "unknown"; - export const OpenExternalProject: protocol.CommandTypes.OpenExternalProject = "openExternalProject"; - export const OpenExternalProjects: protocol.CommandTypes.OpenExternalProjects = "openExternalProjects"; - export const CloseExternalProject: protocol.CommandTypes.CloseExternalProject = "closeExternalProject"; - /* @internal */ - export const SynchronizeProjectList: protocol.CommandTypes.SynchronizeProjectList = "synchronizeProjectList"; - /* @internal */ - export const ApplyChangedToOpenFiles: protocol.CommandTypes.ApplyChangedToOpenFiles = "applyChangedToOpenFiles"; - /* @internal */ - export const EncodedSemanticClassificationsFull: protocol.CommandTypes.EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full"; - /* @internal */ - export const Cleanup: protocol.CommandTypes.Cleanup = "cleanup"; - /* @internal */ - export const OutliningSpans: protocol.CommandTypes.OutliningSpans = "outliningSpans"; - export const TodoComments: protocol.CommandTypes.TodoComments = "todoComments"; - export const Indentation: protocol.CommandTypes.Indentation = "indentation"; - export const DocCommentTemplate: protocol.CommandTypes.DocCommentTemplate = "docCommentTemplate"; - /* @internal */ - export const CompilerOptionsDiagnosticsFull: protocol.CommandTypes.CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full"; - /* @internal */ - export const NameOrDottedNameSpan: protocol.CommandTypes.NameOrDottedNameSpan = "nameOrDottedNameSpan"; - /* @internal */ - export const BreakpointStatement: protocol.CommandTypes.BreakpointStatement = "breakpointStatement"; - export const CompilerOptionsForInferredProjects: protocol.CommandTypes.CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects"; - export const GetCodeFixes: protocol.CommandTypes.GetCodeFixes = "getCodeFixes"; - /* @internal */ - export const GetCodeFixesFull: protocol.CommandTypes.GetCodeFixesFull = "getCodeFixes-full"; - export const GetSupportedCodeFixes: protocol.CommandTypes.GetSupportedCodeFixes = "getSupportedCodeFixes"; - - export const GetApplicableRefactors: protocol.CommandTypes.GetApplicableRefactors = "getApplicableRefactors"; - export const GetRefactorCodeActions: protocol.CommandTypes.GetRefactorCodeActions = "getRefactorCodeActions"; - export const GetRefactorCodeActionsFull: protocol.CommandTypes.GetRefactorCodeActionsFull = "getRefactorCodeActions-full"; - } + export import CommandNames = protocol.CommandTypes; export function formatMessage(msg: T, logger: server.Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string { const verboseLogging = logger.hasLevel(LogLevel.verbose); diff --git a/src/services/classifier.ts b/src/services/classifier.ts index 0deff25321206..acee8fe4b0eb0 100644 --- a/src/services/classifier.ts +++ b/src/services/classifier.ts @@ -573,7 +573,7 @@ namespace ts { } } - function getClassificationTypeName(type: ClassificationType) { + function getClassificationTypeName(type: ClassificationType): ClassificationTypeNames { switch (type) { case ClassificationType.comment: return ClassificationTypeNames.comment; case ClassificationType.identifier: return ClassificationTypeNames.identifier; diff --git a/src/services/types.ts b/src/services/types.ts index 6f0b3baf53216..6e6fa245e37d4 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -286,7 +286,7 @@ namespace ts { export interface ClassifiedSpan { textSpan: TextSpan; - classificationType: string; // ClassificationTypeNames + classificationType: ClassificationTypeNames; } /** @@ -804,43 +804,43 @@ namespace ts { jsxAttribute = "JSX attribute", } - export namespace ScriptElementKindModifier { - export const none = ""; - export const publicMemberModifier = "public"; - export const privateMemberModifier = "private"; - export const protectedMemberModifier = "protected"; - export const exportedModifier = "export"; - export const ambientModifier = "declare"; - export const staticModifier = "static"; - export const abstractModifier = "abstract"; - } - - export class ClassificationTypeNames { - public static comment = "comment"; - public static identifier = "identifier"; - public static keyword = "keyword"; - public static numericLiteral = "number"; - public static operator = "operator"; - public static stringLiteral = "string"; - public static whiteSpace = "whitespace"; - public static text = "text"; - - public static punctuation = "punctuation"; - - public static className = "class name"; - public static enumName = "enum name"; - public static interfaceName = "interface name"; - public static moduleName = "module name"; - public static typeParameterName = "type parameter name"; - public static typeAliasName = "type alias name"; - public static parameterName = "parameter name"; - public static docCommentTagName = "doc comment tag name"; - public static jsxOpenTagName = "jsx open tag name"; - public static jsxCloseTagName = "jsx close tag name"; - public static jsxSelfClosingTagName = "jsx self closing tag name"; - public static jsxAttribute = "jsx attribute"; - public static jsxText = "jsx text"; - public static jsxAttributeStringLiteralValue = "jsx attribute string literal value"; + export const enum ScriptElementKindModifier { + none = "", + publicMemberModifier = "public", + privateMemberModifier = "private", + protectedMemberModifier = "protected", + exportedModifier = "export", + ambientModifier = "declare", + staticModifier = "static", + abstractModifier = "abstract", + } + + export const enum ClassificationTypeNames { + comment = "comment", + identifier = "identifier", + keyword = "keyword", + numericLiteral = "number", + operator = "operator", + stringLiteral = "string", + whiteSpace = "whitespace", + text = "text", + + punctuation = "punctuation", + + className = "class name", + enumName = "enum name", + interfaceName = "interface name", + moduleName = "module name", + typeParameterName = "type parameter name", + typeAliasName = "type alias name", + parameterName = "parameter name", + docCommentTagName = "doc comment tag name", + jsxOpenTagName = "jsx open tag name", + jsxCloseTagName = "jsx close tag name", + jsxSelfClosingTagName = "jsx self closing tag name", + jsxAttribute = "jsx attribute", + jsxText = "jsx text", + jsxAttributeStringLiteralValue = "jsx attribute string literal value", } export const enum ClassificationType {