|
| 1 | +/*! ***************************************************************************** |
| 2 | +Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +Licensed under the Apache License, Version 2.0 (the "License"); you may not use |
| 4 | +this file except in compliance with the License. You may obtain a copy of the |
| 5 | +License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +
|
| 7 | +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 8 | +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED |
| 9 | +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, |
| 10 | +MERCHANTABLITY OR NON-INFRINGEMENT. |
| 11 | +
|
| 12 | +See the Apache Version 2.0 License for specific language governing permissions |
| 13 | +and limitations under the License. |
| 14 | +***************************************************************************** */ |
| 15 | + |
| 16 | +export enum ScriptElementKind { |
| 17 | + unknown = '', |
| 18 | + warning = 'warning', |
| 19 | + /** predefined type (void) or keyword (class) */ |
| 20 | + keyword = 'keyword', |
| 21 | + /** top level script node */ |
| 22 | + scriptElement = 'script', |
| 23 | + /** module foo {} */ |
| 24 | + moduleElement = 'module', |
| 25 | + /** class X {} */ |
| 26 | + classElement = 'class', |
| 27 | + /** var x = class X {} */ |
| 28 | + localClassElement = 'local class', |
| 29 | + /** interface Y {} */ |
| 30 | + interfaceElement = 'interface', |
| 31 | + /** type T = ... */ |
| 32 | + typeElement = 'type', |
| 33 | + /** enum E */ |
| 34 | + enumElement = 'enum', |
| 35 | + enumMemberElement = 'enum member', |
| 36 | + /** |
| 37 | + * Inside module and script only |
| 38 | + * const v = .. |
| 39 | + */ |
| 40 | + variableElement = 'var', |
| 41 | + /** Inside function */ |
| 42 | + localVariableElement = 'local var', |
| 43 | + /** using foo = ... */ |
| 44 | + variableUsingElement = 'using', |
| 45 | + /** await using foo = ... */ |
| 46 | + variableAwaitUsingElement = 'await using', |
| 47 | + /** |
| 48 | + * Inside module and script only |
| 49 | + * function f() { } |
| 50 | + */ |
| 51 | + functionElement = 'function', |
| 52 | + /** Inside function */ |
| 53 | + localFunctionElement = 'local function', |
| 54 | + /** class X { [public|private]* foo() {} } */ |
| 55 | + memberFunctionElement = 'method', |
| 56 | + /** class X { [public|private]* [get|set] foo:number; } */ |
| 57 | + memberGetAccessorElement = 'getter', |
| 58 | + memberSetAccessorElement = 'setter', |
| 59 | + /** |
| 60 | + * class X { [public|private]* foo:number; } |
| 61 | + * interface Y { foo:number; } |
| 62 | + */ |
| 63 | + memberVariableElement = 'property', |
| 64 | + /** class X { [public|private]* accessor foo: number; } */ |
| 65 | + memberAccessorVariableElement = 'accessor', |
| 66 | + /** |
| 67 | + * class X { constructor() { } } |
| 68 | + * class X { static { } } |
| 69 | + */ |
| 70 | + constructorImplementationElement = 'constructor', |
| 71 | + /** interface Y { ():number; } */ |
| 72 | + callSignatureElement = 'call', |
| 73 | + /** interface Y { []:number; } */ |
| 74 | + indexSignatureElement = 'index', |
| 75 | + /** interface Y { new():Y; } */ |
| 76 | + constructSignatureElement = 'construct', |
| 77 | + /** function foo(*Y*: string) */ |
| 78 | + parameterElement = 'parameter', |
| 79 | + typeParameterElement = 'type parameter', |
| 80 | + primitiveType = 'primitive type', |
| 81 | + label = 'label', |
| 82 | + alias = 'alias', |
| 83 | + constElement = 'const', |
| 84 | + letElement = 'let', |
| 85 | + directory = 'directory', |
| 86 | + externalModuleName = 'external module name', |
| 87 | + /** |
| 88 | + * <JsxTagName attribute1 attribute2={0} /> |
| 89 | + * @deprecated |
| 90 | + */ |
| 91 | + jsxAttribute = 'JSX attribute', |
| 92 | + /** String literal */ |
| 93 | + string = 'string', |
| 94 | + /** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */ |
| 95 | + link = 'link', |
| 96 | + /** Jsdoc @link: in `{@link C link text}`, the entity name "C" */ |
| 97 | + linkName = 'link name', |
| 98 | + /** Jsdoc @link: in `{@link C link text}`, the link text "link text" */ |
| 99 | + linkText = 'link text', |
| 100 | +} |
| 101 | + |
| 102 | +export enum DiagnosticCategory { |
| 103 | + Warning = 0, |
| 104 | + Error = 1, |
| 105 | + Suggestion = 2, |
| 106 | + Message = 3, |
| 107 | +} |
0 commit comments