diff options
Diffstat (limited to 'contrib/dxc_2025_07_14/inc/dxcisense.h')
| -rw-r--r-- | contrib/dxc_2025_07_14/inc/dxcisense.h | 959 |
1 files changed, 959 insertions, 0 deletions
diff --git a/contrib/dxc_2025_07_14/inc/dxcisense.h b/contrib/dxc_2025_07_14/inc/dxcisense.h new file mode 100644 index 0000000..661de16 --- /dev/null +++ b/contrib/dxc_2025_07_14/inc/dxcisense.h | |||
| @@ -0,0 +1,959 @@ | |||
| 1 | /////////////////////////////////////////////////////////////////////////////// | ||
| 2 | // // | ||
| 3 | // dxcisense.h // | ||
| 4 | // Copyright (C) Microsoft Corporation. All rights reserved. // | ||
| 5 | // This file is distributed under the University of Illinois Open Source // | ||
| 6 | // License. See LICENSE.TXT for details. // | ||
| 7 | // // | ||
| 8 | // Provides declarations for the DirectX Compiler IntelliSense component. // | ||
| 9 | // // | ||
| 10 | /////////////////////////////////////////////////////////////////////////////// | ||
| 11 | |||
| 12 | #ifndef __DXC_ISENSE__ | ||
| 13 | #define __DXC_ISENSE__ | ||
| 14 | |||
| 15 | #include "dxcapi.h" | ||
| 16 | #ifndef _WIN32 | ||
| 17 | #include "WinAdapter.h" | ||
| 18 | #endif | ||
| 19 | |||
| 20 | typedef enum DxcGlobalOptions { | ||
| 21 | DxcGlobalOpt_None = 0x0, | ||
| 22 | DxcGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1, | ||
| 23 | DxcGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2, | ||
| 24 | DxcGlobalOpt_ThreadBackgroundPriorityForAll = | ||
| 25 | DxcGlobalOpt_ThreadBackgroundPriorityForIndexing | | ||
| 26 | DxcGlobalOpt_ThreadBackgroundPriorityForEditing | ||
| 27 | } DxcGlobalOptions; | ||
| 28 | |||
| 29 | typedef enum DxcTokenKind { | ||
| 30 | DxcTokenKind_Punctuation = | ||
| 31 | 0, // A token that contains some kind of punctuation. | ||
| 32 | DxcTokenKind_Keyword = 1, // A language keyword. | ||
| 33 | DxcTokenKind_Identifier = 2, // An identifier (that is not a keyword). | ||
| 34 | DxcTokenKind_Literal = 3, // A numeric, string, or character literal. | ||
| 35 | DxcTokenKind_Comment = 4, // A comment. | ||
| 36 | DxcTokenKind_Unknown = | ||
| 37 | 5, // An unknown token (possibly known to a future version). | ||
| 38 | DxcTokenKind_BuiltInType = 6, // A built-in type like int, void or float3. | ||
| 39 | } DxcTokenKind; | ||
| 40 | |||
| 41 | typedef enum DxcTypeKind { | ||
| 42 | DxcTypeKind_Invalid = | ||
| 43 | 0, // Reprents an invalid type (e.g., where no type is available). | ||
| 44 | DxcTypeKind_Unexposed = | ||
| 45 | 1, // A type whose specific kind is not exposed via this interface. | ||
| 46 | // Builtin types | ||
| 47 | DxcTypeKind_Void = 2, | ||
| 48 | DxcTypeKind_Bool = 3, | ||
| 49 | DxcTypeKind_Char_U = 4, | ||
| 50 | DxcTypeKind_UChar = 5, | ||
| 51 | DxcTypeKind_Char16 = 6, | ||
| 52 | DxcTypeKind_Char32 = 7, | ||
| 53 | DxcTypeKind_UShort = 8, | ||
| 54 | DxcTypeKind_UInt = 9, | ||
| 55 | DxcTypeKind_ULong = 10, | ||
| 56 | DxcTypeKind_ULongLong = 11, | ||
| 57 | DxcTypeKind_UInt128 = 12, | ||
| 58 | DxcTypeKind_Char_S = 13, | ||
| 59 | DxcTypeKind_SChar = 14, | ||
| 60 | DxcTypeKind_WChar = 15, | ||
| 61 | DxcTypeKind_Short = 16, | ||
| 62 | DxcTypeKind_Int = 17, | ||
| 63 | DxcTypeKind_Long = 18, | ||
| 64 | DxcTypeKind_LongLong = 19, | ||
| 65 | DxcTypeKind_Int128 = 20, | ||
| 66 | DxcTypeKind_Float = 21, | ||
| 67 | DxcTypeKind_Double = 22, | ||
| 68 | DxcTypeKind_LongDouble = 23, | ||
| 69 | DxcTypeKind_NullPtr = 24, | ||
| 70 | DxcTypeKind_Overload = 25, | ||
| 71 | DxcTypeKind_Dependent = 26, | ||
| 72 | DxcTypeKind_ObjCId = 27, | ||
| 73 | DxcTypeKind_ObjCClass = 28, | ||
| 74 | DxcTypeKind_ObjCSel = 29, | ||
| 75 | DxcTypeKind_FirstBuiltin = DxcTypeKind_Void, | ||
| 76 | DxcTypeKind_LastBuiltin = DxcTypeKind_ObjCSel, | ||
| 77 | |||
| 78 | DxcTypeKind_Complex = 100, | ||
| 79 | DxcTypeKind_Pointer = 101, | ||
| 80 | DxcTypeKind_BlockPointer = 102, | ||
| 81 | DxcTypeKind_LValueReference = 103, | ||
| 82 | DxcTypeKind_RValueReference = 104, | ||
| 83 | DxcTypeKind_Record = 105, | ||
| 84 | DxcTypeKind_Enum = 106, | ||
| 85 | DxcTypeKind_Typedef = 107, | ||
| 86 | DxcTypeKind_ObjCInterface = 108, | ||
| 87 | DxcTypeKind_ObjCObjectPointer = 109, | ||
| 88 | DxcTypeKind_FunctionNoProto = 110, | ||
| 89 | DxcTypeKind_FunctionProto = 111, | ||
| 90 | DxcTypeKind_ConstantArray = 112, | ||
| 91 | DxcTypeKind_Vector = 113, | ||
| 92 | DxcTypeKind_IncompleteArray = 114, | ||
| 93 | DxcTypeKind_VariableArray = 115, | ||
| 94 | DxcTypeKind_DependentSizedArray = 116, | ||
| 95 | DxcTypeKind_MemberPointer = 117 | ||
| 96 | } DxcTypeKind; | ||
| 97 | |||
| 98 | // Describes the severity of a particular diagnostic. | ||
| 99 | typedef enum DxcDiagnosticSeverity { | ||
| 100 | // A diagnostic that has been suppressed, e.g., by a command-line option. | ||
| 101 | DxcDiagnostic_Ignored = 0, | ||
| 102 | |||
| 103 | // This diagnostic is a note that should be attached to the previous | ||
| 104 | // (non-note) diagnostic. | ||
| 105 | DxcDiagnostic_Note = 1, | ||
| 106 | |||
| 107 | // This diagnostic indicates suspicious code that may not be wrong. | ||
| 108 | DxcDiagnostic_Warning = 2, | ||
| 109 | |||
| 110 | // This diagnostic indicates that the code is ill-formed. | ||
| 111 | DxcDiagnostic_Error = 3, | ||
| 112 | |||
| 113 | // This diagnostic indicates that the code is ill-formed such that future | ||
| 114 | // parser rec unlikely to produce useful results. | ||
| 115 | DxcDiagnostic_Fatal = 4 | ||
| 116 | |||
| 117 | } DxcDiagnosticSeverity; | ||
| 118 | |||
| 119 | // Options to control the display of diagnostics. | ||
| 120 | typedef enum DxcDiagnosticDisplayOptions { | ||
| 121 | // Display the source-location information where the diagnostic was located. | ||
| 122 | DxcDiagnostic_DisplaySourceLocation = 0x01, | ||
| 123 | |||
| 124 | // If displaying the source-location information of the diagnostic, | ||
| 125 | // also include the column number. | ||
| 126 | DxcDiagnostic_DisplayColumn = 0x02, | ||
| 127 | |||
| 128 | // If displaying the source-location information of the diagnostic, | ||
| 129 | // also include information about source ranges in a machine-parsable format. | ||
| 130 | DxcDiagnostic_DisplaySourceRanges = 0x04, | ||
| 131 | |||
| 132 | // Display the option name associated with this diagnostic, if any. | ||
| 133 | DxcDiagnostic_DisplayOption = 0x08, | ||
| 134 | |||
| 135 | // Display the category number associated with this diagnostic, if any. | ||
| 136 | DxcDiagnostic_DisplayCategoryId = 0x10, | ||
| 137 | |||
| 138 | // Display the category name associated with this diagnostic, if any. | ||
| 139 | DxcDiagnostic_DisplayCategoryName = 0x20, | ||
| 140 | |||
| 141 | // Display the severity of the diagnostic message. | ||
| 142 | DxcDiagnostic_DisplaySeverity = 0x200 | ||
| 143 | } DxcDiagnosticDisplayOptions; | ||
| 144 | |||
| 145 | typedef enum DxcTranslationUnitFlags { | ||
| 146 | // Used to indicate that no special translation-unit options are needed. | ||
| 147 | DxcTranslationUnitFlags_None = 0x0, | ||
| 148 | |||
| 149 | // Used to indicate that the parser should construct a "detailed" | ||
| 150 | // preprocessing record, including all macro definitions and instantiations. | ||
| 151 | DxcTranslationUnitFlags_DetailedPreprocessingRecord = 0x01, | ||
| 152 | |||
| 153 | // Used to indicate that the translation unit is incomplete. | ||
| 154 | DxcTranslationUnitFlags_Incomplete = 0x02, | ||
| 155 | |||
| 156 | // Used to indicate that the translation unit should be built with an | ||
| 157 | // implicit precompiled header for the preamble. | ||
| 158 | DxcTranslationUnitFlags_PrecompiledPreamble = 0x04, | ||
| 159 | |||
| 160 | // Used to indicate that the translation unit should cache some | ||
| 161 | // code-completion results with each reparse of the source file. | ||
| 162 | DxcTranslationUnitFlags_CacheCompletionResults = 0x08, | ||
| 163 | |||
| 164 | // Used to indicate that the translation unit will be serialized with | ||
| 165 | // SaveTranslationUnit. | ||
| 166 | DxcTranslationUnitFlags_ForSerialization = 0x10, | ||
| 167 | |||
| 168 | // DEPRECATED | ||
| 169 | DxcTranslationUnitFlags_CXXChainedPCH = 0x20, | ||
| 170 | |||
| 171 | // Used to indicate that function/method bodies should be skipped while | ||
| 172 | // parsing. | ||
| 173 | DxcTranslationUnitFlags_SkipFunctionBodies = 0x40, | ||
| 174 | |||
| 175 | // Used to indicate that brief documentation comments should be | ||
| 176 | // included into the set of code completions returned from this translation | ||
| 177 | // unit. | ||
| 178 | DxcTranslationUnitFlags_IncludeBriefCommentsInCodeCompletion = 0x80, | ||
| 179 | |||
| 180 | // Used to indicate that compilation should occur on the caller's thread. | ||
| 181 | DxcTranslationUnitFlags_UseCallerThread = 0x800 | ||
| 182 | } DxcTranslationUnitFlags; | ||
| 183 | |||
| 184 | typedef enum DxcCursorFormatting { | ||
| 185 | DxcCursorFormatting_Default = | ||
| 186 | 0x0, // Default rules, language-insensitive formatting. | ||
| 187 | DxcCursorFormatting_UseLanguageOptions = | ||
| 188 | 0x1, // Language-sensitive formatting. | ||
| 189 | DxcCursorFormatting_SuppressSpecifiers = 0x2, // Supresses type specifiers. | ||
| 190 | DxcCursorFormatting_SuppressTagKeyword = | ||
| 191 | 0x4, // Suppressed tag keyword (eg, 'class'). | ||
| 192 | DxcCursorFormatting_IncludeNamespaceKeyword = | ||
| 193 | 0x8, // Include namespace keyword. | ||
| 194 | } DxcCursorFormatting; | ||
| 195 | |||
| 196 | enum DxcCursorKind { | ||
| 197 | /* Declarations */ | ||
| 198 | DxcCursor_UnexposedDecl = | ||
| 199 | 1, // A declaration whose specific kind is not exposed via this interface. | ||
| 200 | DxcCursor_StructDecl = 2, // A C or C++ struct. | ||
| 201 | DxcCursor_UnionDecl = 3, // A C or C++ union. | ||
| 202 | DxcCursor_ClassDecl = 4, // A C++ class. | ||
| 203 | DxcCursor_EnumDecl = 5, // An enumeration. | ||
| 204 | DxcCursor_FieldDecl = 6, // A field (in C) or non-static data member (in C++) | ||
| 205 | // in a struct, union, or C++ class. | ||
| 206 | DxcCursor_EnumConstantDecl = 7, // An enumerator constant. | ||
| 207 | DxcCursor_FunctionDecl = 8, // A function. | ||
| 208 | DxcCursor_VarDecl = 9, // A variable. | ||
| 209 | DxcCursor_ParmDecl = 10, // A function or method parameter. | ||
| 210 | DxcCursor_ObjCInterfaceDecl = 11, // An Objective-C interface. | ||
| 211 | DxcCursor_ObjCCategoryDecl = 12, // An Objective-C interface for a category. | ||
| 212 | DxcCursor_ObjCProtocolDecl = 13, // An Objective-C protocol declaration. | ||
| 213 | DxcCursor_ObjCPropertyDecl = 14, // An Objective-C property declaration. | ||
| 214 | DxcCursor_ObjCIvarDecl = 15, // An Objective-C instance variable. | ||
| 215 | DxcCursor_ObjCInstanceMethodDecl = 16, // An Objective-C instance method. | ||
| 216 | DxcCursor_ObjCClassMethodDecl = 17, // An Objective-C class method. | ||
| 217 | DxcCursor_ObjCImplementationDecl = 18, // An Objective-C \@implementation. | ||
| 218 | DxcCursor_ObjCCategoryImplDecl = | ||
| 219 | 19, // An Objective-C \@implementation for a category. | ||
| 220 | DxcCursor_TypedefDecl = 20, // A typedef | ||
| 221 | DxcCursor_CXXMethod = 21, // A C++ class method. | ||
| 222 | DxcCursor_Namespace = 22, // A C++ namespace. | ||
| 223 | DxcCursor_LinkageSpec = 23, // A linkage specification, e.g. 'extern "C"'. | ||
| 224 | DxcCursor_Constructor = 24, // A C++ constructor. | ||
| 225 | DxcCursor_Destructor = 25, // A C++ destructor. | ||
| 226 | DxcCursor_ConversionFunction = 26, // A C++ conversion function. | ||
| 227 | DxcCursor_TemplateTypeParameter = 27, // A C++ template type parameter. | ||
| 228 | DxcCursor_NonTypeTemplateParameter = 28, // A C++ non-type template parameter. | ||
| 229 | DxcCursor_TemplateTemplateParameter = | ||
| 230 | 29, // A C++ template template parameter. | ||
| 231 | DxcCursor_FunctionTemplate = 30, // A C++ function template. | ||
| 232 | DxcCursor_ClassTemplate = 31, // A C++ class template. | ||
| 233 | DxcCursor_ClassTemplatePartialSpecialization = | ||
| 234 | 32, // A C++ class template partial specialization. | ||
| 235 | DxcCursor_NamespaceAlias = 33, // A C++ namespace alias declaration. | ||
| 236 | DxcCursor_UsingDirective = 34, // A C++ using directive. | ||
| 237 | DxcCursor_UsingDeclaration = 35, // A C++ using declaration. | ||
| 238 | DxcCursor_TypeAliasDecl = 36, // A C++ alias declaration | ||
| 239 | DxcCursor_ObjCSynthesizeDecl = 37, // An Objective-C \@synthesize definition. | ||
| 240 | DxcCursor_ObjCDynamicDecl = 38, // An Objective-C \@dynamic definition. | ||
| 241 | DxcCursor_CXXAccessSpecifier = 39, // An access specifier. | ||
| 242 | |||
| 243 | DxcCursor_FirstDecl = DxcCursor_UnexposedDecl, | ||
| 244 | DxcCursor_LastDecl = DxcCursor_CXXAccessSpecifier, | ||
| 245 | |||
| 246 | /* References */ | ||
| 247 | DxcCursor_FirstRef = 40, /* Decl references */ | ||
| 248 | DxcCursor_ObjCSuperClassRef = 40, | ||
| 249 | DxcCursor_ObjCProtocolRef = 41, | ||
| 250 | DxcCursor_ObjCClassRef = 42, | ||
| 251 | /** | ||
| 252 | * \brief A reference to a type declaration. | ||
| 253 | * | ||
| 254 | * A type reference occurs anywhere where a type is named but not | ||
| 255 | * declared. For example, given: | ||
| 256 | * | ||
| 257 | * \code | ||
| 258 | * typedef unsigned size_type; | ||
| 259 | * size_type size; | ||
| 260 | * \endcode | ||
| 261 | * | ||
| 262 | * The typedef is a declaration of size_type (DxcCursor_TypedefDecl), | ||
| 263 | * while the type of the variable "size" is referenced. The cursor | ||
| 264 | * referenced by the type of size is the typedef for size_type. | ||
| 265 | */ | ||
| 266 | DxcCursor_TypeRef = 43, // A reference to a type declaration. | ||
| 267 | DxcCursor_CXXBaseSpecifier = 44, | ||
| 268 | DxcCursor_TemplateRef = | ||
| 269 | 45, // A reference to a class template, function template, template | ||
| 270 | // template parameter, or class template partial specialization. | ||
| 271 | DxcCursor_NamespaceRef = 46, // A reference to a namespace or namespace alias. | ||
| 272 | DxcCursor_MemberRef = | ||
| 273 | 47, // A reference to a member of a struct, union, or class that occurs in | ||
| 274 | // some non-expression context, e.g., a designated initializer. | ||
| 275 | /** | ||
| 276 | * \brief A reference to a labeled statement. | ||
| 277 | * | ||
| 278 | * This cursor kind is used to describe the jump to "start_over" in the | ||
| 279 | * goto statement in the following example: | ||
| 280 | * | ||
| 281 | * \code | ||
| 282 | * start_over: | ||
| 283 | * ++counter; | ||
| 284 | * | ||
| 285 | * goto start_over; | ||
| 286 | * \endcode | ||
| 287 | * | ||
| 288 | * A label reference cursor refers to a label statement. | ||
| 289 | */ | ||
| 290 | DxcCursor_LabelRef = 48, // A reference to a labeled statement. | ||
| 291 | |||
| 292 | // A reference to a set of overloaded functions or function templates | ||
| 293 | // that has not yet been resolved to a specific function or function template. | ||
| 294 | // | ||
| 295 | // An overloaded declaration reference cursor occurs in C++ templates where | ||
| 296 | // a dependent name refers to a function. | ||
| 297 | DxcCursor_OverloadedDeclRef = 49, | ||
| 298 | DxcCursor_VariableRef = | ||
| 299 | 50, // A reference to a variable that occurs in some non-expression | ||
| 300 | // context, e.g., a C++ lambda capture list. | ||
| 301 | |||
| 302 | DxcCursor_LastRef = DxcCursor_VariableRef, | ||
| 303 | |||
| 304 | /* Error conditions */ | ||
| 305 | DxcCursor_FirstInvalid = 70, | ||
| 306 | DxcCursor_InvalidFile = 70, | ||
| 307 | DxcCursor_NoDeclFound = 71, | ||
| 308 | DxcCursor_NotImplemented = 72, | ||
| 309 | DxcCursor_InvalidCode = 73, | ||
| 310 | DxcCursor_LastInvalid = DxcCursor_InvalidCode, | ||
| 311 | |||
| 312 | /* Expressions */ | ||
| 313 | DxcCursor_FirstExpr = 100, | ||
| 314 | |||
| 315 | /** | ||
| 316 | * \brief An expression whose specific kind is not exposed via this | ||
| 317 | * interface. | ||
| 318 | * | ||
| 319 | * Unexposed expressions have the same operations as any other kind | ||
| 320 | * of expression; one can extract their location information, | ||
| 321 | * spelling, children, etc. However, the specific kind of the | ||
| 322 | * expression is not reported. | ||
| 323 | */ | ||
| 324 | DxcCursor_UnexposedExpr = 100, // An expression whose specific kind is not | ||
| 325 | // exposed via this interface. | ||
| 326 | DxcCursor_DeclRefExpr = | ||
| 327 | 101, // An expression that refers to some value declaration, such as a | ||
| 328 | // function, varible, or enumerator. | ||
| 329 | DxcCursor_MemberRefExpr = | ||
| 330 | 102, // An expression that refers to a member of a struct, union, class, | ||
| 331 | // Objective-C class, etc. | ||
| 332 | DxcCursor_CallExpr = 103, // An expression that calls a function. | ||
| 333 | DxcCursor_ObjCMessageExpr = 104, // An expression that sends a message to an | ||
| 334 | // Objective-C object or class. | ||
| 335 | DxcCursor_BlockExpr = 105, // An expression that represents a block literal. | ||
| 336 | DxcCursor_IntegerLiteral = 106, // An integer literal. | ||
| 337 | DxcCursor_FloatingLiteral = 107, // A floating point number literal. | ||
| 338 | DxcCursor_ImaginaryLiteral = 108, // An imaginary number literal. | ||
| 339 | DxcCursor_StringLiteral = 109, // A string literal. | ||
| 340 | DxcCursor_CharacterLiteral = 110, // A character literal. | ||
| 341 | DxcCursor_ParenExpr = | ||
| 342 | 111, // A parenthesized expression, e.g. "(1)". This AST node is only | ||
| 343 | // formed if full location information is requested. | ||
| 344 | DxcCursor_UnaryOperator = 112, // This represents the unary-expression's | ||
| 345 | // (except sizeof and alignof). | ||
| 346 | DxcCursor_ArraySubscriptExpr = 113, // [C99 6.5.2.1] Array Subscripting. | ||
| 347 | DxcCursor_BinaryOperator = | ||
| 348 | 114, // A builtin binary operation expression such as "x + y" or "x <= y". | ||
| 349 | DxcCursor_CompoundAssignOperator = 115, // Compound assignment such as "+=". | ||
| 350 | DxcCursor_ConditionalOperator = 116, // The ?: ternary operator. | ||
| 351 | DxcCursor_CStyleCastExpr = | ||
| 352 | 117, // An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ | ||
| 353 | // [expr.cast]), which uses the syntax (Type)expr, eg: (int)f. | ||
| 354 | DxcCursor_CompoundLiteralExpr = 118, // [C99 6.5.2.5] | ||
| 355 | DxcCursor_InitListExpr = 119, // Describes an C or C++ initializer list. | ||
| 356 | DxcCursor_AddrLabelExpr = | ||
| 357 | 120, // The GNU address of label extension, representing &&label. | ||
| 358 | DxcCursor_StmtExpr = | ||
| 359 | 121, // This is the GNU Statement Expression extension: ({int X=4; X;}) | ||
| 360 | DxcCursor_GenericSelectionExpr = 122, // Represents a C11 generic selection. | ||
| 361 | |||
| 362 | /** \brief Implements the GNU __null extension, which is a name for a null | ||
| 363 | * pointer constant that has integral type (e.g., int or long) and is the same | ||
| 364 | * size and alignment as a pointer. | ||
| 365 | * | ||
| 366 | * The __null extension is typically only used by system headers, which define | ||
| 367 | * NULL as __null in C++ rather than using 0 (which is an integer that may not | ||
| 368 | * match the size of a pointer). | ||
| 369 | */ | ||
| 370 | DxcCursor_GNUNullExpr = 123, | ||
| 371 | DxcCursor_CXXStaticCastExpr = 124, // C++'s static_cast<> expression. | ||
| 372 | DxcCursor_CXXDynamicCastExpr = 125, // C++'s dynamic_cast<> expression. | ||
| 373 | DxcCursor_CXXReinterpretCastExpr = | ||
| 374 | 126, // C++'s reinterpret_cast<> expression. | ||
| 375 | DxcCursor_CXXConstCastExpr = 127, // C++'s const_cast<> expression. | ||
| 376 | |||
| 377 | /** \brief Represents an explicit C++ type conversion that uses "functional" | ||
| 378 | * notion (C++ [expr.type.conv]). | ||
| 379 | * | ||
| 380 | * Example: | ||
| 381 | * \code | ||
| 382 | * x = int(0.5); | ||
| 383 | * \endcode | ||
| 384 | */ | ||
| 385 | DxcCursor_CXXFunctionalCastExpr = 128, | ||
| 386 | DxcCursor_CXXTypeidExpr = 129, // A C++ typeid expression (C++ [expr.typeid]). | ||
| 387 | DxcCursor_CXXBoolLiteralExpr = 130, // [C++ 2.13.5] C++ Boolean Literal. | ||
| 388 | DxcCursor_CXXNullPtrLiteralExpr = 131, // [C++0x 2.14.7] C++ Pointer Literal. | ||
| 389 | DxcCursor_CXXThisExpr = 132, // Represents the "this" expression in C++ | ||
| 390 | DxcCursor_CXXThrowExpr = 133, // [C++ 15] C++ Throw Expression, both 'throw' | ||
| 391 | // and 'throw' assignment-expression. | ||
| 392 | DxcCursor_CXXNewExpr = 134, // A new expression for memory allocation and | ||
| 393 | // constructor calls, e.g: "new CXXNewExpr(foo)". | ||
| 394 | DxcCursor_CXXDeleteExpr = | ||
| 395 | 135, // A delete expression for memory deallocation and destructor calls, | ||
| 396 | // e.g. "delete[] pArray". | ||
| 397 | DxcCursor_UnaryExpr = 136, // A unary expression. | ||
| 398 | DxcCursor_ObjCStringLiteral = | ||
| 399 | 137, // An Objective-C string literal i.e. @"foo". | ||
| 400 | DxcCursor_ObjCEncodeExpr = 138, // An Objective-C \@encode expression. | ||
| 401 | DxcCursor_ObjCSelectorExpr = 139, // An Objective-C \@selector expression. | ||
| 402 | DxcCursor_ObjCProtocolExpr = 140, // An Objective-C \@protocol expression. | ||
| 403 | |||
| 404 | /** \brief An Objective-C "bridged" cast expression, which casts between | ||
| 405 | * Objective-C pointers and C pointers, transferring ownership in the process. | ||
| 406 | * | ||
| 407 | * \code | ||
| 408 | * NSString *str = (__bridge_transfer NSString *)CFCreateString(); | ||
| 409 | * \endcode | ||
| 410 | */ | ||
| 411 | DxcCursor_ObjCBridgedCastExpr = 141, | ||
| 412 | |||
| 413 | /** \brief Represents a C++0x pack expansion that produces a sequence of | ||
| 414 | * expressions. | ||
| 415 | * | ||
| 416 | * A pack expansion expression contains a pattern (which itself is an | ||
| 417 | * expression) followed by an ellipsis. For example: | ||
| 418 | * | ||
| 419 | * \code | ||
| 420 | * template<typename F, typename ...Types> | ||
| 421 | * void forward(F f, Types &&...args) { | ||
| 422 | * f(static_cast<Types&&>(args)...); | ||
| 423 | * } | ||
| 424 | * \endcode | ||
| 425 | */ | ||
| 426 | DxcCursor_PackExpansionExpr = 142, | ||
| 427 | |||
| 428 | /** \brief Represents an expression that computes the length of a parameter | ||
| 429 | * pack. | ||
| 430 | * | ||
| 431 | * \code | ||
| 432 | * template<typename ...Types> | ||
| 433 | * struct count { | ||
| 434 | * static const unsigned value = sizeof...(Types); | ||
| 435 | * }; | ||
| 436 | * \endcode | ||
| 437 | */ | ||
| 438 | DxcCursor_SizeOfPackExpr = 143, | ||
| 439 | |||
| 440 | /* \brief Represents a C++ lambda expression that produces a local function | ||
| 441 | * object. | ||
| 442 | * | ||
| 443 | * \code | ||
| 444 | * void abssort(float *x, unsigned N) { | ||
| 445 | * std::sort(x, x + N, | ||
| 446 | * [](float a, float b) { | ||
| 447 | * return std::abs(a) < std::abs(b); | ||
| 448 | * }); | ||
| 449 | * } | ||
| 450 | * \endcode | ||
| 451 | */ | ||
| 452 | DxcCursor_LambdaExpr = 144, | ||
| 453 | DxcCursor_ObjCBoolLiteralExpr = 145, // Objective-c Boolean Literal. | ||
| 454 | DxcCursor_ObjCSelfExpr = | ||
| 455 | 146, // Represents the "self" expression in a ObjC method. | ||
| 456 | DxcCursor_LastExpr = DxcCursor_ObjCSelfExpr, | ||
| 457 | |||
| 458 | /* Statements */ | ||
| 459 | DxcCursor_FirstStmt = 200, | ||
| 460 | /** | ||
| 461 | * \brief A statement whose specific kind is not exposed via this | ||
| 462 | * interface. | ||
| 463 | * | ||
| 464 | * Unexposed statements have the same operations as any other kind of | ||
| 465 | * statement; one can extract their location information, spelling, | ||
| 466 | * children, etc. However, the specific kind of the statement is not | ||
| 467 | * reported. | ||
| 468 | */ | ||
| 469 | DxcCursor_UnexposedStmt = 200, | ||
| 470 | |||
| 471 | /** \brief A labelled statement in a function. | ||
| 472 | * | ||
| 473 | * This cursor kind is used to describe the "start_over:" label statement in | ||
| 474 | * the following example: | ||
| 475 | * | ||
| 476 | * \code | ||
| 477 | * start_over: | ||
| 478 | * ++counter; | ||
| 479 | * \endcode | ||
| 480 | * | ||
| 481 | */ | ||
| 482 | DxcCursor_LabelStmt = 201, | ||
| 483 | DxcCursor_CompoundStmt = | ||
| 484 | 202, // A group of statements like { stmt stmt }. This cursor kind is used | ||
| 485 | // to describe compound statements, e.g. function bodies. | ||
| 486 | DxcCursor_CaseStmt = 203, // A case statement. | ||
| 487 | DxcCursor_DefaultStmt = 204, // A default statement. | ||
| 488 | DxcCursor_IfStmt = 205, // An if statement | ||
| 489 | DxcCursor_SwitchStmt = 206, // A switch statement. | ||
| 490 | DxcCursor_WhileStmt = 207, // A while statement. | ||
| 491 | DxcCursor_DoStmt = 208, // A do statement. | ||
| 492 | DxcCursor_ForStmt = 209, // A for statement. | ||
| 493 | DxcCursor_GotoStmt = 210, // A goto statement. | ||
| 494 | DxcCursor_IndirectGotoStmt = 211, // An indirect goto statement. | ||
| 495 | DxcCursor_ContinueStmt = 212, // A continue statement. | ||
| 496 | DxcCursor_BreakStmt = 213, // A break statement. | ||
| 497 | DxcCursor_ReturnStmt = 214, // A return statement. | ||
| 498 | DxcCursor_GCCAsmStmt = 215, // A GCC inline assembly statement extension. | ||
| 499 | DxcCursor_AsmStmt = DxcCursor_GCCAsmStmt, | ||
| 500 | |||
| 501 | DxcCursor_ObjCAtTryStmt = | ||
| 502 | 216, // Objective-C's overall \@try-\@catch-\@finally statement. | ||
| 503 | DxcCursor_ObjCAtCatchStmt = 217, // Objective-C's \@catch statement. | ||
| 504 | DxcCursor_ObjCAtFinallyStmt = 218, // Objective-C's \@finally statement. | ||
| 505 | DxcCursor_ObjCAtThrowStmt = 219, // Objective-C's \@throw statement. | ||
| 506 | DxcCursor_ObjCAtSynchronizedStmt = | ||
| 507 | 220, // Objective-C's \@synchronized statement. | ||
| 508 | DxcCursor_ObjCAutoreleasePoolStmt = | ||
| 509 | 221, // Objective-C's autorelease pool statement. | ||
| 510 | DxcCursor_ObjCForCollectionStmt = 222, // Objective-C's collection statement. | ||
| 511 | |||
| 512 | DxcCursor_CXXCatchStmt = 223, // C++'s catch statement. | ||
| 513 | DxcCursor_CXXTryStmt = 224, // C++'s try statement. | ||
| 514 | DxcCursor_CXXForRangeStmt = 225, // C++'s for (* : *) statement. | ||
| 515 | |||
| 516 | DxcCursor_SEHTryStmt = | ||
| 517 | 226, // Windows Structured Exception Handling's try statement. | ||
| 518 | DxcCursor_SEHExceptStmt = | ||
| 519 | 227, // Windows Structured Exception Handling's except statement. | ||
| 520 | DxcCursor_SEHFinallyStmt = | ||
| 521 | 228, // Windows Structured Exception Handling's finally statement. | ||
| 522 | |||
| 523 | DxcCursor_MSAsmStmt = 229, // A MS inline assembly statement extension. | ||
| 524 | DxcCursor_NullStmt = 230, // The null satement ";": C99 6.8.3p3. | ||
| 525 | DxcCursor_DeclStmt = 231, // Adaptor class for mixing declarations with | ||
| 526 | // statements and expressions. | ||
| 527 | DxcCursor_OMPParallelDirective = 232, // OpenMP parallel directive. | ||
| 528 | DxcCursor_OMPSimdDirective = 233, // OpenMP SIMD directive. | ||
| 529 | DxcCursor_OMPForDirective = 234, // OpenMP for directive. | ||
| 530 | DxcCursor_OMPSectionsDirective = 235, // OpenMP sections directive. | ||
| 531 | DxcCursor_OMPSectionDirective = 236, // OpenMP section directive. | ||
| 532 | DxcCursor_OMPSingleDirective = 237, // OpenMP single directive. | ||
| 533 | DxcCursor_OMPParallelForDirective = 238, // OpenMP parallel for directive. | ||
| 534 | DxcCursor_OMPParallelSectionsDirective = | ||
| 535 | 239, // OpenMP parallel sections directive. | ||
| 536 | DxcCursor_OMPTaskDirective = 240, // OpenMP task directive. | ||
| 537 | DxcCursor_OMPMasterDirective = 241, // OpenMP master directive. | ||
| 538 | DxcCursor_OMPCriticalDirective = 242, // OpenMP critical directive. | ||
| 539 | DxcCursor_OMPTaskyieldDirective = 243, // OpenMP taskyield directive. | ||
| 540 | DxcCursor_OMPBarrierDirective = 244, // OpenMP barrier directive. | ||
| 541 | DxcCursor_OMPTaskwaitDirective = 245, // OpenMP taskwait directive. | ||
| 542 | DxcCursor_OMPFlushDirective = 246, // OpenMP flush directive. | ||
| 543 | DxcCursor_SEHLeaveStmt = | ||
| 544 | 247, // Windows Structured Exception Handling's leave statement. | ||
| 545 | DxcCursor_OMPOrderedDirective = 248, // OpenMP ordered directive. | ||
| 546 | DxcCursor_OMPAtomicDirective = 249, // OpenMP atomic directive. | ||
| 547 | DxcCursor_OMPForSimdDirective = 250, // OpenMP for SIMD directive. | ||
| 548 | DxcCursor_OMPParallelForSimdDirective = | ||
| 549 | 251, // OpenMP parallel for SIMD directive. | ||
| 550 | DxcCursor_OMPTargetDirective = 252, // OpenMP target directive. | ||
| 551 | DxcCursor_OMPTeamsDirective = 253, // OpenMP teams directive. | ||
| 552 | DxcCursor_OMPTaskgroupDirective = 254, // OpenMP taskgroup directive. | ||
| 553 | DxcCursor_OMPCancellationPointDirective = | ||
| 554 | 255, // OpenMP cancellation point directive. | ||
| 555 | DxcCursor_OMPCancelDirective = 256, // OpenMP cancel directive. | ||
| 556 | DxcCursor_LastStmt = DxcCursor_OMPCancelDirective, | ||
| 557 | |||
| 558 | DxcCursor_TranslationUnit = | ||
| 559 | 300, // Cursor that represents the translation unit itself. | ||
| 560 | |||
| 561 | /* Attributes */ | ||
| 562 | DxcCursor_FirstAttr = 400, | ||
| 563 | /** | ||
| 564 | * \brief An attribute whose specific kind is not exposed via this | ||
| 565 | * interface. | ||
| 566 | */ | ||
| 567 | DxcCursor_UnexposedAttr = 400, | ||
| 568 | |||
| 569 | DxcCursor_IBActionAttr = 401, | ||
| 570 | DxcCursor_IBOutletAttr = 402, | ||
| 571 | DxcCursor_IBOutletCollectionAttr = 403, | ||
| 572 | DxcCursor_CXXFinalAttr = 404, | ||
| 573 | DxcCursor_CXXOverrideAttr = 405, | ||
| 574 | DxcCursor_AnnotateAttr = 406, | ||
| 575 | DxcCursor_AsmLabelAttr = 407, | ||
| 576 | DxcCursor_PackedAttr = 408, | ||
| 577 | DxcCursor_PureAttr = 409, | ||
| 578 | DxcCursor_ConstAttr = 410, | ||
| 579 | DxcCursor_NoDuplicateAttr = 411, | ||
| 580 | DxcCursor_CUDAConstantAttr = 412, | ||
| 581 | DxcCursor_CUDADeviceAttr = 413, | ||
| 582 | DxcCursor_CUDAGlobalAttr = 414, | ||
| 583 | DxcCursor_CUDAHostAttr = 415, | ||
| 584 | DxcCursor_CUDASharedAttr = 416, | ||
| 585 | DxcCursor_LastAttr = DxcCursor_CUDASharedAttr, | ||
| 586 | |||
| 587 | /* Preprocessing */ | ||
| 588 | DxcCursor_PreprocessingDirective = 500, | ||
| 589 | DxcCursor_MacroDefinition = 501, | ||
| 590 | DxcCursor_MacroExpansion = 502, | ||
| 591 | DxcCursor_MacroInstantiation = DxcCursor_MacroExpansion, | ||
| 592 | DxcCursor_InclusionDirective = 503, | ||
| 593 | DxcCursor_FirstPreprocessing = DxcCursor_PreprocessingDirective, | ||
| 594 | DxcCursor_LastPreprocessing = DxcCursor_InclusionDirective, | ||
| 595 | |||
| 596 | /* Extra Declarations */ | ||
| 597 | /** | ||
| 598 | * \brief A module import declaration. | ||
| 599 | */ | ||
| 600 | DxcCursor_ModuleImportDecl = 600, | ||
| 601 | DxcCursor_FirstExtraDecl = DxcCursor_ModuleImportDecl, | ||
| 602 | DxcCursor_LastExtraDecl = DxcCursor_ModuleImportDecl | ||
| 603 | }; | ||
| 604 | |||
| 605 | enum DxcCursorKindFlags { | ||
| 606 | DxcCursorKind_None = 0, | ||
| 607 | DxcCursorKind_Declaration = 0x1, | ||
| 608 | DxcCursorKind_Reference = 0x2, | ||
| 609 | DxcCursorKind_Expression = 0x4, | ||
| 610 | DxcCursorKind_Statement = 0x8, | ||
| 611 | DxcCursorKind_Attribute = 0x10, | ||
| 612 | DxcCursorKind_Invalid = 0x20, | ||
| 613 | DxcCursorKind_TranslationUnit = 0x40, | ||
| 614 | DxcCursorKind_Preprocessing = 0x80, | ||
| 615 | DxcCursorKind_Unexposed = 0x100, | ||
| 616 | }; | ||
| 617 | |||
| 618 | enum DxcCodeCompleteFlags { | ||
| 619 | DxcCodeCompleteFlags_None = 0, | ||
| 620 | DxcCodeCompleteFlags_IncludeMacros = 0x1, | ||
| 621 | DxcCodeCompleteFlags_IncludeCodePatterns = 0x2, | ||
| 622 | DxcCodeCompleteFlags_IncludeBriefComments = 0x4, | ||
| 623 | }; | ||
| 624 | |||
| 625 | enum DxcCompletionChunkKind { | ||
| 626 | DxcCompletionChunk_Optional = 0, | ||
| 627 | DxcCompletionChunk_TypedText = 1, | ||
| 628 | DxcCompletionChunk_Text = 2, | ||
| 629 | DxcCompletionChunk_Placeholder = 3, | ||
| 630 | DxcCompletionChunk_Informative = 4, | ||
| 631 | DxcCompletionChunk_CurrentParameter = 5, | ||
| 632 | DxcCompletionChunk_LeftParen = 6, | ||
| 633 | DxcCompletionChunk_RightParen = 7, | ||
| 634 | DxcCompletionChunk_LeftBracket = 8, | ||
| 635 | DxcCompletionChunk_RightBracket = 9, | ||
| 636 | DxcCompletionChunk_LeftBrace = 10, | ||
| 637 | DxcCompletionChunk_RightBrace = 11, | ||
| 638 | DxcCompletionChunk_LeftAngle = 12, | ||
| 639 | DxcCompletionChunk_RightAngle = 13, | ||
| 640 | DxcCompletionChunk_Comma = 14, | ||
| 641 | DxcCompletionChunk_ResultType = 15, | ||
| 642 | DxcCompletionChunk_Colon = 16, | ||
| 643 | DxcCompletionChunk_SemiColon = 17, | ||
| 644 | DxcCompletionChunk_Equal = 18, | ||
| 645 | DxcCompletionChunk_HorizontalSpace = 19, | ||
| 646 | DxcCompletionChunk_VerticalSpace = 20, | ||
| 647 | }; | ||
| 648 | |||
| 649 | struct IDxcCursor; | ||
| 650 | struct IDxcDiagnostic; | ||
| 651 | struct IDxcFile; | ||
| 652 | struct IDxcInclusion; | ||
| 653 | struct IDxcIntelliSense; | ||
| 654 | struct IDxcIndex; | ||
| 655 | struct IDxcSourceLocation; | ||
| 656 | struct IDxcSourceRange; | ||
| 657 | struct IDxcToken; | ||
| 658 | struct IDxcTranslationUnit; | ||
| 659 | struct IDxcType; | ||
| 660 | struct IDxcUnsavedFile; | ||
| 661 | struct IDxcCodeCompleteResults; | ||
| 662 | struct IDxcCompletionResult; | ||
| 663 | struct IDxcCompletionString; | ||
| 664 | |||
| 665 | CROSS_PLATFORM_UUIDOF(IDxcCursor, "1467b985-288d-4d2a-80c1-ef89c42c40bc") | ||
| 666 | struct IDxcCursor : public IUnknown { | ||
| 667 | virtual HRESULT STDMETHODCALLTYPE | ||
| 668 | GetExtent(_Outptr_result_nullonfailure_ IDxcSourceRange **pRange) = 0; | ||
| 669 | virtual HRESULT STDMETHODCALLTYPE | ||
| 670 | GetLocation(_Outptr_result_nullonfailure_ IDxcSourceLocation **pResult) = 0; | ||
| 671 | virtual HRESULT STDMETHODCALLTYPE GetKind(_Out_ DxcCursorKind *pResult) = 0; | ||
| 672 | virtual HRESULT STDMETHODCALLTYPE | ||
| 673 | GetKindFlags(_Out_ DxcCursorKindFlags *pResult) = 0; | ||
| 674 | virtual HRESULT STDMETHODCALLTYPE | ||
| 675 | GetSemanticParent(_Outptr_result_nullonfailure_ IDxcCursor **pResult) = 0; | ||
| 676 | virtual HRESULT STDMETHODCALLTYPE | ||
| 677 | GetLexicalParent(_Outptr_result_nullonfailure_ IDxcCursor **pResult) = 0; | ||
| 678 | virtual HRESULT STDMETHODCALLTYPE | ||
| 679 | GetCursorType(_Outptr_result_nullonfailure_ IDxcType **pResult) = 0; | ||
| 680 | virtual HRESULT STDMETHODCALLTYPE GetNumArguments(_Out_ int *pResult) = 0; | ||
| 681 | virtual HRESULT STDMETHODCALLTYPE GetArgumentAt( | ||
| 682 | int index, _Outptr_result_nullonfailure_ IDxcCursor **pResult) = 0; | ||
| 683 | virtual HRESULT STDMETHODCALLTYPE | ||
| 684 | GetReferencedCursor(_Outptr_result_nullonfailure_ IDxcCursor **pResult) = 0; | ||
| 685 | /// <summary>For a cursor that is either a reference to or a declaration of | ||
| 686 | /// some entity, retrieve a cursor that describes the definition of that | ||
| 687 | /// entity.</summary> <remarks>Some entities can be declared multiple times | ||
| 688 | /// within a translation unit, but only one of those declarations can also be | ||
| 689 | /// a definition.</remarks> <returns>A cursor to the definition of this | ||
| 690 | /// entity; nullptr if there is no definition in this translation | ||
| 691 | /// unit.</returns> | ||
| 692 | virtual HRESULT STDMETHODCALLTYPE | ||
| 693 | GetDefinitionCursor(_Outptr_result_nullonfailure_ IDxcCursor **pResult) = 0; | ||
| 694 | virtual HRESULT STDMETHODCALLTYPE | ||
| 695 | FindReferencesInFile(_In_ IDxcFile *file, unsigned skip, unsigned top, | ||
| 696 | _Out_ unsigned *pResultLength, | ||
| 697 | _Outptr_result_buffer_maybenull_(*pResultLength) | ||
| 698 | IDxcCursor ***pResult) = 0; | ||
| 699 | /// <summary>Gets the name for the entity references by the cursor, e.g. foo | ||
| 700 | /// for an 'int foo' variable.</summary> | ||
| 701 | virtual HRESULT STDMETHODCALLTYPE | ||
| 702 | GetSpelling(_Outptr_result_maybenull_ LPSTR *pResult) = 0; | ||
| 703 | virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcCursor *other, | ||
| 704 | _Out_ BOOL *pResult) = 0; | ||
| 705 | virtual HRESULT STDMETHODCALLTYPE IsNull(_Out_ BOOL *pResult) = 0; | ||
| 706 | virtual HRESULT STDMETHODCALLTYPE IsDefinition(_Out_ BOOL *pResult) = 0; | ||
| 707 | /// <summary>Gets the display name for the cursor, including e.g. parameter | ||
| 708 | /// types for a function.</summary> | ||
| 709 | virtual HRESULT STDMETHODCALLTYPE GetDisplayName(_Out_ BSTR *pResult) = 0; | ||
| 710 | /// <summary>Gets the qualified name for the symbol the cursor refers | ||
| 711 | /// to.</summary> | ||
| 712 | virtual HRESULT STDMETHODCALLTYPE GetQualifiedName( | ||
| 713 | BOOL includeTemplateArgs, _Outptr_result_maybenull_ BSTR *pResult) = 0; | ||
| 714 | /// <summary>Gets a name for the cursor, applying the specified formatting | ||
| 715 | /// flags.</summary> | ||
| 716 | virtual HRESULT STDMETHODCALLTYPE | ||
| 717 | GetFormattedName(DxcCursorFormatting formatting, | ||
| 718 | _Outptr_result_maybenull_ BSTR *pResult) = 0; | ||
| 719 | /// <summary>Gets children in pResult up to top elements.</summary> | ||
| 720 | virtual HRESULT STDMETHODCALLTYPE | ||
| 721 | GetChildren(unsigned skip, unsigned top, _Out_ unsigned *pResultLength, | ||
| 722 | _Outptr_result_buffer_maybenull_(*pResultLength) | ||
| 723 | IDxcCursor ***pResult) = 0; | ||
| 724 | /// <summary>Gets the cursor following a location within a compound | ||
| 725 | /// cursor.</summary> | ||
| 726 | virtual HRESULT STDMETHODCALLTYPE | ||
| 727 | GetSnappedChild(_In_ IDxcSourceLocation *location, | ||
| 728 | _Outptr_result_maybenull_ IDxcCursor **pResult) = 0; | ||
| 729 | }; | ||
| 730 | |||
| 731 | CROSS_PLATFORM_UUIDOF(IDxcDiagnostic, "4f76b234-3659-4d33-99b0-3b0db994b564") | ||
| 732 | struct IDxcDiagnostic : public IUnknown { | ||
| 733 | virtual HRESULT STDMETHODCALLTYPE | ||
| 734 | FormatDiagnostic(DxcDiagnosticDisplayOptions options, | ||
| 735 | _Outptr_result_maybenull_ LPSTR *pResult) = 0; | ||
| 736 | virtual HRESULT STDMETHODCALLTYPE | ||
| 737 | GetSeverity(_Out_ DxcDiagnosticSeverity *pResult) = 0; | ||
| 738 | virtual HRESULT STDMETHODCALLTYPE | ||
| 739 | GetLocation(_Outptr_result_nullonfailure_ IDxcSourceLocation **pResult) = 0; | ||
| 740 | virtual HRESULT STDMETHODCALLTYPE | ||
| 741 | GetSpelling(_Outptr_result_maybenull_ LPSTR *pResult) = 0; | ||
| 742 | virtual HRESULT STDMETHODCALLTYPE | ||
| 743 | GetCategoryText(_Outptr_result_maybenull_ LPSTR *pResult) = 0; | ||
| 744 | virtual HRESULT STDMETHODCALLTYPE GetNumRanges(_Out_ unsigned *pResult) = 0; | ||
| 745 | virtual HRESULT STDMETHODCALLTYPE | ||
| 746 | GetRangeAt(unsigned index, | ||
| 747 | _Outptr_result_nullonfailure_ IDxcSourceRange **pResult) = 0; | ||
| 748 | virtual HRESULT STDMETHODCALLTYPE GetNumFixIts(_Out_ unsigned *pResult) = 0; | ||
| 749 | virtual HRESULT STDMETHODCALLTYPE | ||
| 750 | GetFixItAt(unsigned index, | ||
| 751 | _Outptr_result_nullonfailure_ IDxcSourceRange **pReplacementRange, | ||
| 752 | _Outptr_result_maybenull_ LPSTR *pText) = 0; | ||
| 753 | }; | ||
| 754 | |||
| 755 | CROSS_PLATFORM_UUIDOF(IDxcFile, "bb2fca9e-1478-47ba-b08c-2c502ada4895") | ||
| 756 | struct IDxcFile : public IUnknown { | ||
| 757 | /// <summary>Gets the file name for this file.</summary> | ||
| 758 | virtual HRESULT STDMETHODCALLTYPE | ||
| 759 | GetName(_Outptr_result_maybenull_ LPSTR *pResult) = 0; | ||
| 760 | /// <summary>Checks whether this file is equal to the other specified | ||
| 761 | /// file.</summary> | ||
| 762 | virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcFile *other, | ||
| 763 | _Out_ BOOL *pResult) = 0; | ||
| 764 | }; | ||
| 765 | |||
| 766 | CROSS_PLATFORM_UUIDOF(IDxcInclusion, "0c364d65-df44-4412-888e-4e552fc5e3d6") | ||
| 767 | struct IDxcInclusion : public IUnknown { | ||
| 768 | virtual HRESULT STDMETHODCALLTYPE | ||
| 769 | GetIncludedFile(_Outptr_result_nullonfailure_ IDxcFile **pResult) = 0; | ||
| 770 | virtual HRESULT STDMETHODCALLTYPE GetStackLength(_Out_ unsigned *pResult) = 0; | ||
| 771 | virtual HRESULT STDMETHODCALLTYPE | ||
| 772 | GetStackItem(unsigned index, | ||
| 773 | _Outptr_result_nullonfailure_ IDxcSourceLocation **pResult) = 0; | ||
| 774 | }; | ||
| 775 | |||
| 776 | CROSS_PLATFORM_UUIDOF(IDxcIntelliSense, "b1f99513-46d6-4112-8169-dd0d6053f17d") | ||
| 777 | struct IDxcIntelliSense : public IUnknown { | ||
| 778 | virtual HRESULT STDMETHODCALLTYPE | ||
| 779 | CreateIndex(_Outptr_result_nullonfailure_ IDxcIndex **index) = 0; | ||
| 780 | virtual HRESULT STDMETHODCALLTYPE GetNullLocation( | ||
| 781 | _Outptr_result_nullonfailure_ IDxcSourceLocation **location) = 0; | ||
| 782 | virtual HRESULT STDMETHODCALLTYPE | ||
| 783 | GetNullRange(_Outptr_result_nullonfailure_ IDxcSourceRange **location) = 0; | ||
| 784 | virtual HRESULT STDMETHODCALLTYPE | ||
| 785 | GetRange(_In_ IDxcSourceLocation *start, _In_ IDxcSourceLocation *end, | ||
| 786 | _Outptr_result_nullonfailure_ IDxcSourceRange **location) = 0; | ||
| 787 | virtual HRESULT STDMETHODCALLTYPE GetDefaultDiagnosticDisplayOptions( | ||
| 788 | _Out_ DxcDiagnosticDisplayOptions *pValue) = 0; | ||
| 789 | virtual HRESULT STDMETHODCALLTYPE | ||
| 790 | GetDefaultEditingTUOptions(_Out_ DxcTranslationUnitFlags *pValue) = 0; | ||
| 791 | virtual HRESULT STDMETHODCALLTYPE CreateUnsavedFile( | ||
| 792 | _In_ LPCSTR fileName, _In_ LPCSTR contents, unsigned contentLength, | ||
| 793 | _Outptr_result_nullonfailure_ IDxcUnsavedFile **pResult) = 0; | ||
| 794 | }; | ||
| 795 | |||
| 796 | CROSS_PLATFORM_UUIDOF(IDxcIndex, "937824a0-7f5a-4815-9ba7-7fc0424f4173") | ||
| 797 | struct IDxcIndex : public IUnknown { | ||
| 798 | virtual HRESULT STDMETHODCALLTYPE | ||
| 799 | SetGlobalOptions(DxcGlobalOptions options) = 0; | ||
| 800 | virtual HRESULT STDMETHODCALLTYPE | ||
| 801 | GetGlobalOptions(_Out_ DxcGlobalOptions *options) = 0; | ||
| 802 | virtual HRESULT STDMETHODCALLTYPE ParseTranslationUnit( | ||
| 803 | _In_z_ const char *source_filename, | ||
| 804 | _In_count_(num_command_line_args) const char *const *command_line_args, | ||
| 805 | int num_command_line_args, | ||
| 806 | _In_count_(num_unsaved_files) IDxcUnsavedFile **unsaved_files, | ||
| 807 | unsigned num_unsaved_files, DxcTranslationUnitFlags options, | ||
| 808 | _Out_ IDxcTranslationUnit **pTranslationUnit) = 0; | ||
| 809 | }; | ||
| 810 | |||
| 811 | CROSS_PLATFORM_UUIDOF(IDxcSourceLocation, | ||
| 812 | "8e7ddf1c-d7d3-4d69-b286-85fccba1e0cf") | ||
| 813 | struct IDxcSourceLocation : public IUnknown { | ||
| 814 | virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcSourceLocation *other, | ||
| 815 | _Out_ BOOL *pResult) = 0; | ||
| 816 | virtual HRESULT STDMETHODCALLTYPE GetSpellingLocation( | ||
| 817 | _Outptr_opt_ IDxcFile **pFile, _Out_opt_ unsigned *pLine, | ||
| 818 | _Out_opt_ unsigned *pCol, _Out_opt_ unsigned *pOffset) = 0; | ||
| 819 | virtual HRESULT STDMETHODCALLTYPE IsNull(_Out_ BOOL *pResult) = 0; | ||
| 820 | virtual HRESULT STDMETHODCALLTYPE | ||
| 821 | GetPresumedLocation(_Outptr_opt_ LPSTR *pFilename, _Out_opt_ unsigned *pLine, | ||
| 822 | _Out_opt_ unsigned *pCol) = 0; | ||
| 823 | }; | ||
| 824 | |||
| 825 | CROSS_PLATFORM_UUIDOF(IDxcSourceRange, "f1359b36-a53f-4e81-b514-b6b84122a13f") | ||
| 826 | struct IDxcSourceRange : public IUnknown { | ||
| 827 | virtual HRESULT STDMETHODCALLTYPE IsNull(_Out_ BOOL *pValue) = 0; | ||
| 828 | virtual HRESULT STDMETHODCALLTYPE | ||
| 829 | GetStart(_Out_ IDxcSourceLocation **pValue) = 0; | ||
| 830 | virtual HRESULT STDMETHODCALLTYPE | ||
| 831 | GetEnd(_Out_ IDxcSourceLocation **pValue) = 0; | ||
| 832 | virtual HRESULT STDMETHODCALLTYPE GetOffsets(_Out_ unsigned *startOffset, | ||
| 833 | _Out_ unsigned *endOffset) = 0; | ||
| 834 | }; | ||
| 835 | |||
| 836 | CROSS_PLATFORM_UUIDOF(IDxcToken, "7f90b9ff-a275-4932-97d8-3cfd234482a2") | ||
| 837 | struct IDxcToken : public IUnknown { | ||
| 838 | virtual HRESULT STDMETHODCALLTYPE GetKind(_Out_ DxcTokenKind *pValue) = 0; | ||
| 839 | virtual HRESULT STDMETHODCALLTYPE | ||
| 840 | GetLocation(_Out_ IDxcSourceLocation **pValue) = 0; | ||
| 841 | virtual HRESULT STDMETHODCALLTYPE | ||
| 842 | GetExtent(_Out_ IDxcSourceRange **pValue) = 0; | ||
| 843 | virtual HRESULT STDMETHODCALLTYPE GetSpelling(_Out_ LPSTR *pValue) = 0; | ||
| 844 | }; | ||
| 845 | |||
| 846 | CROSS_PLATFORM_UUIDOF(IDxcTranslationUnit, | ||
| 847 | "9677dee0-c0e5-46a1-8b40-3db3168be63d") | ||
| 848 | struct IDxcTranslationUnit : public IUnknown { | ||
| 849 | virtual HRESULT STDMETHODCALLTYPE GetCursor(_Out_ IDxcCursor **pCursor) = 0; | ||
| 850 | virtual HRESULT STDMETHODCALLTYPE | ||
| 851 | Tokenize(_In_ IDxcSourceRange *range, | ||
| 852 | _Outptr_result_buffer_maybenull_(*pTokenCount) IDxcToken ***pTokens, | ||
| 853 | _Out_ unsigned *pTokenCount) = 0; | ||
| 854 | virtual HRESULT STDMETHODCALLTYPE | ||
| 855 | GetLocation(_In_ IDxcFile *file, unsigned line, unsigned column, | ||
| 856 | _Outptr_result_nullonfailure_ IDxcSourceLocation **pResult) = 0; | ||
| 857 | virtual HRESULT STDMETHODCALLTYPE | ||
| 858 | GetNumDiagnostics(_Out_ unsigned *pValue) = 0; | ||
| 859 | virtual HRESULT STDMETHODCALLTYPE | ||
| 860 | GetDiagnostic(unsigned index, | ||
| 861 | _Outptr_result_nullonfailure_ IDxcDiagnostic **pValue) = 0; | ||
| 862 | virtual HRESULT STDMETHODCALLTYPE | ||
| 863 | GetFile(_In_ const char *name, | ||
| 864 | _Outptr_result_nullonfailure_ IDxcFile **pResult) = 0; | ||
| 865 | virtual HRESULT STDMETHODCALLTYPE | ||
| 866 | GetFileName(_Outptr_result_maybenull_ LPSTR *pResult) = 0; | ||
| 867 | virtual HRESULT STDMETHODCALLTYPE Reparse(_In_count_(num_unsaved_files) | ||
| 868 | IDxcUnsavedFile **unsaved_files, | ||
| 869 | unsigned num_unsaved_files) = 0; | ||
| 870 | virtual HRESULT STDMETHODCALLTYPE | ||
| 871 | GetCursorForLocation(_In_ IDxcSourceLocation *location, | ||
| 872 | _Outptr_result_nullonfailure_ IDxcCursor **pResult) = 0; | ||
| 873 | virtual HRESULT STDMETHODCALLTYPE GetLocationForOffset( | ||
| 874 | _In_ IDxcFile *file, unsigned offset, | ||
| 875 | _Outptr_result_nullonfailure_ IDxcSourceLocation **pResult) = 0; | ||
| 876 | virtual HRESULT STDMETHODCALLTYPE GetSkippedRanges( | ||
| 877 | _In_ IDxcFile *file, _Out_ unsigned *pResultCount, | ||
| 878 | _Outptr_result_buffer_(*pResultCount) IDxcSourceRange ***pResult) = 0; | ||
| 879 | virtual HRESULT STDMETHODCALLTYPE | ||
| 880 | GetDiagnosticDetails(unsigned index, DxcDiagnosticDisplayOptions options, | ||
| 881 | _Out_ unsigned *errorCode, _Out_ unsigned *errorLine, | ||
| 882 | _Out_ unsigned *errorColumn, _Out_ BSTR *errorFile, | ||
| 883 | _Out_ unsigned *errorOffset, _Out_ unsigned *errorLength, | ||
| 884 | _Out_ BSTR *errorMessage) = 0; | ||
| 885 | virtual HRESULT STDMETHODCALLTYPE GetInclusionList( | ||
| 886 | _Out_ unsigned *pResultCount, | ||
| 887 | _Outptr_result_buffer_(*pResultCount) IDxcInclusion ***pResult) = 0; | ||
| 888 | virtual HRESULT STDMETHODCALLTYPE CodeCompleteAt( | ||
| 889 | _In_ const char *fileName, unsigned line, unsigned column, | ||
| 890 | _In_ IDxcUnsavedFile **pUnsavedFiles, unsigned numUnsavedFiles, | ||
| 891 | _In_ DxcCodeCompleteFlags options, | ||
| 892 | _Outptr_result_nullonfailure_ IDxcCodeCompleteResults **pResult) = 0; | ||
| 893 | }; | ||
| 894 | |||
| 895 | CROSS_PLATFORM_UUIDOF(IDxcType, "2ec912fd-b144-4a15-ad0d-1c5439c81e46") | ||
| 896 | struct IDxcType : public IUnknown { | ||
| 897 | virtual HRESULT STDMETHODCALLTYPE | ||
| 898 | GetSpelling(_Outptr_result_z_ LPSTR *pResult) = 0; | ||
| 899 | virtual HRESULT STDMETHODCALLTYPE IsEqualTo(_In_ IDxcType *other, | ||
| 900 | _Out_ BOOL *pResult) = 0; | ||
| 901 | virtual HRESULT STDMETHODCALLTYPE GetKind(_Out_ DxcTypeKind *pResult) = 0; | ||
| 902 | }; | ||
| 903 | |||
| 904 | CROSS_PLATFORM_UUIDOF(IDxcUnsavedFile, "8ec00f98-07d0-4e60-9d7c-5a50b5b0017f") | ||
| 905 | struct IDxcUnsavedFile : public IUnknown { | ||
| 906 | virtual HRESULT STDMETHODCALLTYPE | ||
| 907 | GetFileName(_Outptr_result_z_ LPSTR *pFileName) = 0; | ||
| 908 | virtual HRESULT STDMETHODCALLTYPE | ||
| 909 | GetContents(_Outptr_result_z_ LPSTR *pContents) = 0; | ||
| 910 | virtual HRESULT STDMETHODCALLTYPE GetLength(_Out_ unsigned *pLength) = 0; | ||
| 911 | }; | ||
| 912 | |||
| 913 | CROSS_PLATFORM_UUIDOF(IDxcCodeCompleteResults, | ||
| 914 | "1E06466A-FD8B-45F3-A78F-8A3F76EBB552") | ||
| 915 | struct IDxcCodeCompleteResults : public IUnknown { | ||
| 916 | virtual HRESULT STDMETHODCALLTYPE GetNumResults(_Out_ unsigned *pResult) = 0; | ||
| 917 | virtual HRESULT STDMETHODCALLTYPE | ||
| 918 | GetResultAt(unsigned index, | ||
| 919 | _Outptr_result_nullonfailure_ IDxcCompletionResult **pResult) = 0; | ||
| 920 | }; | ||
| 921 | |||
| 922 | CROSS_PLATFORM_UUIDOF(IDxcCompletionResult, | ||
| 923 | "943C0588-22D0-4784-86FC-701F802AC2B6") | ||
| 924 | struct IDxcCompletionResult : public IUnknown { | ||
| 925 | virtual HRESULT STDMETHODCALLTYPE | ||
| 926 | GetCursorKind(_Out_ DxcCursorKind *pResult) = 0; | ||
| 927 | virtual HRESULT STDMETHODCALLTYPE GetCompletionString( | ||
| 928 | _Outptr_result_nullonfailure_ IDxcCompletionString **pResult) = 0; | ||
| 929 | }; | ||
| 930 | |||
| 931 | CROSS_PLATFORM_UUIDOF(IDxcCompletionString, | ||
| 932 | "06B51E0F-A605-4C69-A110-CD6E14B58EEC") | ||
| 933 | struct IDxcCompletionString : public IUnknown { | ||
| 934 | virtual HRESULT STDMETHODCALLTYPE | ||
| 935 | GetNumCompletionChunks(_Out_ unsigned *pResult) = 0; | ||
| 936 | virtual HRESULT STDMETHODCALLTYPE GetCompletionChunkKind( | ||
| 937 | unsigned chunkNumber, _Out_ DxcCompletionChunkKind *pResult) = 0; | ||
| 938 | virtual HRESULT STDMETHODCALLTYPE | ||
| 939 | GetCompletionChunkText(unsigned chunkNumber, _Out_ LPSTR *pResult) = 0; | ||
| 940 | }; | ||
| 941 | |||
| 942 | // Fun fact: 'extern' is required because const is by default static in C++, so | ||
| 943 | // CLSID_DxcIntelliSense is not visible externally (this is OK in C, since const | ||
| 944 | // is not by default static in C) | ||
| 945 | |||
| 946 | #ifdef _MSC_VER | ||
| 947 | #define CLSID_SCOPE __declspec(selectany) extern | ||
| 948 | #else | ||
| 949 | #define CLSID_SCOPE | ||
| 950 | #endif | ||
| 951 | |||
| 952 | CLSID_SCOPE const CLSID | ||
| 953 | CLSID_DxcIntelliSense = {/* 3047833c-d1c0-4b8e-9d40-102878605985 */ | ||
| 954 | 0x3047833c, | ||
| 955 | 0xd1c0, | ||
| 956 | 0x4b8e, | ||
| 957 | {0x9d, 0x40, 0x10, 0x28, 0x78, 0x60, 0x59, 0x85}}; | ||
| 958 | |||
| 959 | #endif | ||
