yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
4d517794e
master
1#pragma once 2 3#include "../../source/compiler-core/slang-json-value.h" 4#include "../../source/core/slang-rtti-info.h" 5#include "slang-com-helper.h" 6#include "slang-com-ptr.h" 7#include "slang.h" 8 9#include <optional> 10 11namespace Slang 12{ 13namespace LanguageServerProtocol 14{ 15struct ServerInfo 16{ 17String name ; 18String version ; 19 20static const StructRttiInfo g_rttiInfo ; 21}; 22 23enum class TextDocumentSyncKind 24{ 25None = 0 , 26Full = 1 , 27Incremental = 2 28}; 29 30struct TextDocumentSyncOptions 31{ 32bool openClose = false; 33int32_t change = int32_t (TextDocumentSyncKind ::None );// TextDocumentSyncKind 34static const StructRttiInfo g_rttiInfo ; 35}; 36 37struct WorkDoneProgressParams 38{ 39/** 40* An optional token that a server can use to report work done progress. 41*/ 42String workDoneToken ;// optional 43 44static const StructRttiInfo g_rttiInfo ; 45}; 46 47struct CompletionOptions :public WorkDoneProgressParams 48{ 49/** 50* Most tools trigger completion request automatically without explicitly 51* requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they 52* do so when the user starts to type an identifier. For example if the user 53* types `c` in a JavaScript file code complete will automatically pop up 54* present `console` besides others as a completion item. Characters that 55* make up identifiers don't need to be listed here. 56* 57* If code complete should automatically be trigger on characters not being 58* valid inside an identifier (for example `.` in JavaScript) list them in 59* `triggerCharacters`. 60*/ 61List < String > triggerCharacters ; 62 63/** 64* The list of all possible characters that commit a completion. This field 65* can be used if clients don't support individual commit characters per 66* completion item. See client capability 67* `completion.completionItem.commitCharactersSupport`. 68* 69* If a server provides both `allCommitCharacters` and commit characters on 70* an individual completion item the ones on the completion item win. 71* 72* @since 3.2.0 73*/ 74List < String > allCommitCharacters ; 75 76/** 77* The server provides support to resolve additional 78* information for a completion item. 79*/ 80bool resolveProvider = false; 81 82static const StructRttiInfo g_rttiInfo ; 83}; 84 85struct SemanticTokensLegend 86{ 87/** 88* The token types a server uses. 89*/ 90List < String > tokenTypes ; 91 92/** 93* The token modifiers a server uses. 94*/ 95List < String > tokenModifiers ; 96 97static const StructRttiInfo g_rttiInfo ; 98}; 99 100 101struct SemanticTokensOptions 102{ 103/** 104* The legend used by the server 105*/ 106SemanticTokensLegend legend ; 107 108/** 109* Server supports providing semantic tokens for a specific range 110* of a document. 111*/ 112bool range = false; 113 114/** 115* Server supports providing semantic tokens for a full document. 116*/ 117bool full = false; 118 119static const StructRttiInfo g_rttiInfo ; 120}; 121 122struct SignatureHelpOptions 123{ 124/** 125* The characters that trigger signature help 126* automatically. 127*/ 128List < String > triggerCharacters ; 129 130/** 131* List of characters that re-trigger signature help. 132* 133* These trigger characters are only active when signature help is already 134* showing. All trigger characters are also counted as re-trigger 135* characters. 136* 137* @since 3.15.0 138*/ 139List < String > retriggerCharacters ; 140 141static const StructRttiInfo g_rttiInfo ; 142}; 143 144struct TextDocumentItem 145{ 146String uri ; 147String languageId ; 148int version = 0 ; 149String text ; 150static const StructRttiInfo g_rttiInfo ; 151}; 152 153struct TextDocumentIdentifier 154{ 155String uri ; 156static const StructRttiInfo g_rttiInfo ; 157}; 158 159struct VersionedTextDocumentIdentifier 160{ 161String uri ; 162int version = 0 ; 163static const StructRttiInfo g_rttiInfo ; 164}; 165 166struct Position 167{ 168int line = -1 ; 169int character = -1 ; 170static const StructRttiInfo g_rttiInfo ; 171}; 172 173struct Range 174{ 175Position start ; 176Position end ; 177static const StructRttiInfo g_rttiInfo ; 178}; 179 180struct TextEdit 181{ 182/** 183* The range of the text document to be manipulated. To insert 184* text into a document create a range where start === end. 185*/ 186Range range ; 187 188/** 189* The string to be inserted. For delete operations use an 190* empty string. 191*/ 192String newText ; 193 194static const StructRttiInfo g_rttiInfo ; 195}; 196 197struct DidOpenTextDocumentParams 198{ 199TextDocumentItem textDocument ; 200static const StructRttiInfo g_rttiInfo ; 201static const UnownedStringSlice methodName ; 202}; 203 204struct TextDocumentContentChangeEvent 205{ 206Range range ;// optional 207String text ; 208static const StructRttiInfo g_rttiInfo ; 209}; 210 211struct DidChangeTextDocumentParams 212{ 213VersionedTextDocumentIdentifier textDocument ; 214List < TextDocumentContentChangeEvent > contentChanges ; 215static const StructRttiInfo g_rttiInfo ; 216static const UnownedStringSlice methodName ; 217}; 218 219struct DidCloseTextDocumentParams 220{ 221TextDocumentIdentifier textDocument ; 222static const StructRttiInfo g_rttiInfo ; 223static const UnownedStringSlice methodName ; 224}; 225 226struct WorkspaceFoldersServerCapabilities 227{ 228/** 229* The server has support for workspace folders 230*/ 231bool supported = false; 232 233/** 234* Whether the server wants to receive workspace folder 235* change notifications. 236* 237* If a string is provided, the string is treated as an ID 238* under which the notification is registered on the client 239* side. The ID can be used to unregister for these events 240* using the `client/unregisterCapability` request. 241*/ 242bool changeNotifications = false; 243 244static const StructRttiInfo g_rttiInfo ; 245}; 246 247struct WorkspaceCapabilities 248{ 249WorkspaceFoldersServerCapabilities workspaceFolders ; 250static const StructRttiInfo g_rttiInfo ; 251}; 252 253/** 254* Inlay hint options used during static registration. 255* 256* @since 3.17.0 257*/ 258struct InlayHintOptions 259{ 260/** 261* The server provides support to resolve additional 262* information for an inlay hint item. 263*/ 264bool resolveProvider = false; 265static const StructRttiInfo g_rttiInfo ; 266}; 267 268struct DocumentOnTypeFormattingOptions 269{ 270/** 271* A character on which formatting should be triggered, like `{`. 272*/ 273String firstTriggerCharacter ; 274 275/** 276* More trigger characters. 277*/ 278List < String > moreTriggerCharacter ; 279 280static const StructRttiInfo g_rttiInfo ; 281}; 282 283struct ServerCapabilities 284{ 285String positionEncoding ; 286TextDocumentSyncOptions textDocumentSync ; 287bool hoverProvider = false; 288bool definitionProvider = false; 289bool documentSymbolProvider = false; 290bool documentFormattingProvider = false; 291bool documentRangeFormattingProvider = false; 292DocumentOnTypeFormattingOptions documentOnTypeFormattingProvider ; 293InlayHintOptions inlayHintProvider ; 294CompletionOptions completionProvider ; 295SemanticTokensOptions semanticTokensProvider ; 296SignatureHelpOptions signatureHelpProvider ; 297WorkspaceCapabilities workspace ; 298static const StructRttiInfo g_rttiInfo ; 299}; 300 301struct VSServerCapabilities :ServerCapabilities 302{ 303bool _vs_projectContextProvider = false; 304static const StructRttiInfo g_rttiInfo ; 305}; 306 307struct WorkspaceFolder 308{ 309String uri ; 310String name ; 311static const StructRttiInfo g_rttiInfo ; 312}; 313 314struct InitializeParams 315{ 316List < WorkspaceFolder > workspaceFolders ; 317static const UnownedStringSlice methodName ; 318static const StructRttiInfo g_rttiInfo ; 319}; 320 321struct NullResponse 322{ 323static const StructRttiInfo g_rttiInfo ; 324static NullResponse * get (); 325}; 326 327struct InitializeResult 328{ 329ServerCapabilities capabilities ; 330ServerInfo serverInfo ; 331 332static const StructRttiInfo g_rttiInfo ; 333}; 334 335struct VSInitializeResult 336{ 337VSServerCapabilities capabilities ; 338ServerInfo serverInfo ; 339 340static const StructRttiInfo g_rttiInfo ; 341}; 342 343struct ShutdownParams 344{ 345static const UnownedStringSlice methodName ; 346}; 347 348struct ExitParams 349{ 350static const UnownedStringSlice methodName ; 351}; 352 353typedef uint32_t DiagnosticSeverity ; 354/** 355* Reports an error. 356*/ 357const DiagnosticSeverity kDiagnosticsSeverityError = 1 ; 358/** 359* Reports a warning. 360*/ 361const DiagnosticSeverity kDiagnosticsSeverityWarning = 2 ; 362/** 363* Reports an information. 364*/ 365const DiagnosticSeverity kDiagnosticsSeverityInformation = 3 ; 366/** 367* Reports a hint. 368*/ 369const DiagnosticSeverity kDiagnosticsSeverityHint = 4 ; 370 371 372struct Location 373{ 374String uri ; 375Range range ; 376static const StructRttiInfo g_rttiInfo ; 377}; 378 379struct DiagnosticRelatedInformation 380{ 381/** 382* The location of this related diagnostic information. 383*/ 384Location location ; 385 386/** 387* The message of this related diagnostic information. 388*/ 389String message ; 390 391static const StructRttiInfo g_rttiInfo ; 392}; 393 394struct Diagnostic 395{ 396/** 397* The range at which the message applies. 398*/ 399Range range ; 400 401/** 402* The diagnostic's severity. Can be omitted. If omitted it is up to the 403* client to interpret diagnostics as error, warning, info or hint. 404*/ 405DiagnosticSeverity severity = 1 ; 406 407/** 408* The diagnostic's code, which might appear in the user interface. 409*/ 410int32_t code = 0 ; 411 412/** 413* A human-readable string describing the source of this 414* diagnostic, e.g. 'typescript' or 'super lint'. 415*/ 416String source ; 417 418/** 419* The diagnostic's message. 420*/ 421String message ; 422 423/** 424* An array of related diagnostic information, e.g. when symbol-names within 425* a scope collide all definitions can be marked via this property. 426*/ 427List < DiagnosticRelatedInformation > relatedInformation ; 428 429bool operator == (const Diagnostic & other )const 430 { 431return code == other .code && range .start .line == other .range .start .line && 432message == other .message ; 433 } 434 435HashCode getHashCode ()const 436 { 437return combineHash (code ,combineHash (range .start .line ,message .getHashCode ())); 438 } 439 440static const StructRttiInfo g_rttiInfo ; 441}; 442 443struct PublishDiagnosticsParams 444{ 445/** 446* The URI for which diagnostic information is reported. 447*/ 448String uri ; 449 450/** 451* An array of diagnostic information items. 452*/ 453List < Diagnostic > diagnostics ; 454 455static const StructRttiInfo g_rttiInfo ; 456}; 457 458struct TextDocumentPositionParams 459{ 460/** 461* The text document. 462*/ 463TextDocumentIdentifier textDocument ; 464 465/** 466* The position inside the text document. 467*/ 468Position position ; 469 470static const StructRttiInfo g_rttiInfo ; 471}; 472 473struct HoverParams : WorkDoneProgressParams, TextDocumentPositionParams 474{ 475static const StructRttiInfo g_rttiInfo; 476static const UnownedStringSlice methodName; 477}; 478 479struct DefinitionParams : WorkDoneProgressParams, TextDocumentPositionParams 480{ 481static const StructRttiInfo g_rttiInfo; 482static const UnownedStringSlice methodName; 483}; 484 485struct MarkupContent 486{ 487/** 488* The type of the Markup 489*/ 490String kind ; 491 492/** 493* The content itself 494*/ 495String value ; 496 497static const StructRttiInfo g_rttiInfo ; 498}; 499 500struct Hover 501{ 502/** 503* The hover's content 504*/ 505MarkupContent contents ; 506 507/** 508* An optional range is a range inside a text document 509* that is used to visualize a hover, e.g. by changing the background color. 510*/ 511Range range ; 512 513static const StructRttiInfo g_rttiInfo ; 514}; 515 516typedef int CompletionTriggerKind ; 517const CompletionTriggerKind kCompletionTriggerKindInvoked = 1 ; 518 519/** 520* Completion was triggered by a trigger character specified by 521* the `triggerCharacters` properties of the 522* `CompletionRegistrationOptions`. 523*/ 524const CompletionTriggerKind kCompletionTriggerKindTriggerCharacter = 2 ; 525 526/** 527* Completion was re-triggered as the current completion list is incomplete. 528*/ 529const CompletionTriggerKind kCompletionTriggerKindTriggerForIncompleteCompletions = 3 ; 530 531/** 532* Contains additional information about the context in which a completion 533* request is triggered. 534*/ 535struct CompletionContext 536{ 537/** 538* How the completion was triggered. 539*/ 540CompletionTriggerKind triggerKind = 1 ; 541 542/** 543* The trigger character (a single character) that has trigger code 544* complete. Is undefined if 545* `triggerKind !== CompletionTriggerKind.TriggerCharacter` 546*/ 547String triggerCharacter ; 548 549static const StructRttiInfo g_rttiInfo ; 550}; 551 552struct CompletionParams : WorkDoneProgressParams, TextDocumentPositionParams 553{ 554CompletionContext context; 555 556static const StructRttiInfo g_rttiInfo; 557static const UnownedStringSlice methodName; 558}; 559 560typedef int32_t CompletionItemKind ; 561const CompletionItemKind kCompletionItemKindText = 1 ; 562const CompletionItemKind kCompletionItemKindMethod = 2 ; 563const CompletionItemKind kCompletionItemKindFunction = 3 ; 564const CompletionItemKind kCompletionItemKindConstructor = 4 ; 565const CompletionItemKind kCompletionItemKindField = 5 ; 566const CompletionItemKind kCompletionItemKindVariable = 6 ; 567const CompletionItemKind kCompletionItemKindClass = 7 ; 568const CompletionItemKind kCompletionItemKindInterface = 8 ; 569const CompletionItemKind kCompletionItemKindModule = 9 ; 570const CompletionItemKind kCompletionItemKindProperty = 10 ; 571const CompletionItemKind kCompletionItemKindUnit = 11 ; 572const CompletionItemKind kCompletionItemKindValue = 12 ; 573const CompletionItemKind kCompletionItemKindEnum = 13 ; 574const CompletionItemKind kCompletionItemKindKeyword = 14 ; 575const CompletionItemKind kCompletionItemKindSnippet = 15 ; 576const CompletionItemKind kCompletionItemKindColor = 16 ; 577const CompletionItemKind kCompletionItemKindFile = 17 ; 578const CompletionItemKind kCompletionItemKindReference = 18 ; 579const CompletionItemKind kCompletionItemKindFolder = 19 ; 580const CompletionItemKind kCompletionItemKindEnumMember = 20 ; 581const CompletionItemKind kCompletionItemKindConstant = 21 ; 582const CompletionItemKind kCompletionItemKindStruct = 22 ; 583const CompletionItemKind kCompletionItemKindEvent = 23 ; 584const CompletionItemKind kCompletionItemKindOperator = 24 ; 585const CompletionItemKind kCompletionItemKindTypeParameter = 25 ; 586 587struct CompletionItem 588{ 589/** 590* The label of this completion item. 591* 592* The label property is also by default the text that 593* is inserted when selecting this completion. 594* 595* If label details are provided the label itself should 596* be an unqualified name of the completion item. 597*/ 598String label ; 599 600/** 601* The kind of this completion item. Based of the kind 602* an icon is chosen by the editor. The standardized set 603* of available values is defined in `CompletionItemKind`. 604*/ 605CompletionItemKind kind = CompletionItemKind ( 0 ); 606 607/** 608* A human-readable string with additional information 609* about this item, like type or symbol information. 610*/ 611String detail ; 612 613/** 614* A string that should be used when comparing this item 615* with other items. When omitted the label is used 616* as the sort text for this item. 617*/ 618JSONOptional < String > sortText ; 619 620/** 621* A human-readable string that represents a doc-comment. 622*/ 623MarkupContent documentation ; 624 625/** 626* An optional set of characters that when pressed while this completion is 627* active will accept it first and then type that character. *Note* that all 628* commit characters should have `length=1` and that superfluous characters 629* will be ignored. 630*/ 631List < String > commitCharacters ; 632 633// Additional data. 634String data ; 635 636static const StructRttiInfo g_rttiInfo ; 637}; 638 639struct TextEditCompletionItem 640{ 641/** 642* The label of this completion item. 643* 644* The label property is also by default the text that 645* is inserted when selecting this completion. 646* 647* If label details are provided the label itself should 648* be an unqualified name of the completion item. 649*/ 650String label ; 651 652/** 653* The kind of this completion item. Based of the kind 654* an icon is chosen by the editor. The standardized set 655* of available values is defined in `CompletionItemKind`. 656*/ 657CompletionItemKind kind = CompletionItemKind ( 0 ); 658 659/** 660* A human-readable string with additional information 661* about this item, like type or symbol information. 662*/ 663String detail ; 664 665/** 666* A human-readable string that represents a doc-comment. 667*/ 668MarkupContent documentation ; 669 670TextEdit textEdit ; 671 672/** 673* An optional set of characters that when pressed while this completion is 674* active will accept it first and then type that character. *Note* that all 675* commit characters should have `length=1` and that superfluous characters 676* will be ignored. 677*/ 678List < String > commitCharacters ; 679 680// Additional data. 681String data ; 682 683static const StructRttiInfo g_rttiInfo ; 684}; 685 686struct SemanticTokensParams : WorkDoneProgressParams 687{ 688TextDocumentIdentifier textDocument; 689 690static const UnownedStringSlice methodName; 691 692static const StructRttiInfo g_rttiInfo; 693}; 694 695 696struct SemanticTokens 697{ 698/** 699* An optional result id. If provided and clients support delta updating 700* the client will include the result id in the next semantic token request. 701* A server can then instead of computing all semantic tokens again simply 702* send a delta. 703*/ 704String resultId ; 705 706/** 707* The actual tokens. 708*/ 709List < uint32_t > data ; 710 711static const StructRttiInfo g_rttiInfo ; 712}; 713 714struct SignatureHelpParams : WorkDoneProgressParams, TextDocumentPositionParams 715{ 716static const UnownedStringSlice methodName; 717 718static const StructRttiInfo g_rttiInfo; 719}; 720 721/** 722* Represents a parameter of a callable-signature. A parameter can 723* have a label and a doc-comment. 724*/ 725struct ParameterInformation 726{ 727/** 728* The label of this parameter information. 729* 730* Either a string or an inclusive start and exclusive end offsets within 731* its containing signature label. (see SignatureInformation.label). The 732* offsets are based on a UTF-16 string representation as `Position` and 733* `Range` does. 734* 735* *Note*: a label of type string should be a substring of its containing 736* signature label. Its intended use case is to highlight the parameter 737* label part in the `SignatureInformation.label`. 738*/ 739uint32_t label [ 2 ] = { 0 , 0 }; 740 741/** 742* The human-readable doc-comment of this parameter. Will be shown 743* in the UI but can be omitted. 744*/ 745MarkupContent documentation ; 746 747static const StructRttiInfo g_rttiInfo ; 748}; 749 750/** 751* Represents the signature of something callable. A signature 752* can have a label, like a function-name, a doc-comment, and 753* a set of parameters. 754*/ 755struct SignatureInformation 756{ 757/** 758* The label of this signature. Will be shown in 759* the UI. 760*/ 761String label ; 762 763/** 764* The human-readable doc-comment of this signature. Will be shown 765* in the UI but can be omitted. 766*/ 767MarkupContent documentation ; 768 769/** 770* The parameters of this signature. 771*/ 772List < ParameterInformation > parameters ; 773 774static const StructRttiInfo g_rttiInfo ; 775}; 776 777struct SignatureHelp 778{ 779/** 780* One or more signatures. If no signatures are available the signature help 781* request should return `null`. 782*/ 783List < SignatureInformation > signatures ; 784 785/** 786* The active signature. If omitted or the value lies outside the 787* range of `signatures` the value defaults to zero or is ignore if 788* the `SignatureHelp` as no signatures. 789* 790* Whenever possible implementors should make an active decision about 791* the active signature and shouldn't rely on a default value. 792* 793* In future version of the protocol this property might become 794* mandatory to better express this. 795*/ 796uint32_t activeSignature = 0 ; 797 798/** 799* The active parameter of the active signature. If omitted or the value 800* lies outside the range of `signatures[activeSignature].parameters` 801* defaults to 0 if the active signature has parameters. If 802* the active signature has no parameters it is ignored. 803* In future version of the protocol this property might become 804* mandatory to better express the active parameter if the 805* active signature does have any. 806*/ 807uint32_t activeParameter = 0 ; 808 809static const StructRttiInfo g_rttiInfo ; 810}; 811 812 813struct DidChangeConfigurationParams 814{ 815/** 816* The actual changed settings 817*/ 818JSONValue settings = JSONValue :: makeInvalid (); 819 820static const StructRttiInfo g_rttiInfo ; 821 822static const UnownedStringSlice methodName ; 823}; 824 825struct ConfigurationItem 826{ 827/** 828* The configuration section asked for. 829*/ 830String section ; 831 832static const StructRttiInfo g_rttiInfo ; 833}; 834 835struct ConfigurationParams 836{ 837List < ConfigurationItem > items ; 838 839static const StructRttiInfo g_rttiInfo ; 840 841static const UnownedStringSlice methodName ; 842}; 843 844struct Registration 845{ 846/** 847* The id used to register the request. The id can be used to deregister 848* the request again. 849*/ 850String id ; 851 852/** 853* The method / capability to register for. 854*/ 855String method ; 856 857static const StructRttiInfo g_rttiInfo ; 858}; 859 860struct RegistrationParams 861{ 862List < Registration > registrations ; 863 864static const StructRttiInfo g_rttiInfo ; 865}; 866 867struct CancelParams 868{ 869/** 870* The request id to cancel. 871*/ 872int64_t id = 0 ; 873 874static const StructRttiInfo g_rttiInfo ; 875}; 876 877struct LogMessageParams 878{ 879/** 880* The message type. See {@link MessageType} 881*/ 882int type = 0 ; 883 884/** 885* The actual message 886*/ 887String message ; 888 889static const StructRttiInfo g_rttiInfo ; 890static const UnownedStringSlice methodName ; 891}; 892 893struct DocumentSymbolParams : WorkDoneProgressParams 894{ 895/** 896* The text document. 897*/ 898TextDocumentIdentifier textDocument; 899 900static const StructRttiInfo g_rttiInfo; 901static const UnownedStringSlice methodName; 902}; 903 904typedef int SymbolKind ; 905const int kSymbolKindFile = 1 ; 906const int kSymbolKindModule = 2 ; 907const int kSymbolKindNamespace = 3 ; 908const int kSymbolKindPackage = 4 ; 909const int kSymbolKindClass = 5 ; 910const int kSymbolKindMethod = 6 ; 911const int kSymbolKindProperty = 7 ; 912const int kSymbolKindField = 8 ; 913const int kSymbolKindConstructor = 9 ; 914const int kSymbolKindEnum = 10 ; 915const int kSymbolKindInterface = 11 ; 916const int kSymbolKindFunction = 12 ; 917const int kSymbolKindVariable = 13 ; 918const int kSymbolKindConstant = 14 ; 919const int kSymbolKindString = 15 ; 920const int kSymbolKindNumber = 16 ; 921const int kSymbolKindBoolean = 17 ; 922const int kSymbolKindArray = 18 ; 923const int kSymbolKindObject = 19 ; 924const int kSymbolKindKey = 20 ; 925const int kSymbolKindNull = 21 ; 926const int kSymbolKindEnumMember = 22 ; 927const int kSymbolKindStruct = 23 ; 928const int kSymbolKindEvent = 24 ; 929const int kSymbolKindOperator = 25 ; 930const int kSymbolKindTypeParameter = 26 ; 931 932/** 933* Represents programming constructs like variables, classes, interfaces etc. 934* that appear in a document. Document symbols can be hierarchical and they 935* have two ranges: one that encloses its definition and one that points to its 936* most interesting range, e.g. the range of an identifier. 937*/ 938struct DocumentSymbol 939{ 940/** 941* The name of this symbol. Will be displayed in the user interface and 942* therefore must not be an empty string or a string only consisting of 943* white spaces. 944*/ 945String name ; 946 947/** 948* More detail for this symbol, e.g the signature of a function. 949*/ 950String detail ; 951 952/** 953* The kind of this symbol. 954*/ 955SymbolKind kind = 0 ; 956 957/** 958* The range enclosing this symbol not including leading/trailing whitespace 959* but everything else like comments. This information is typically used to 960* determine if the clients cursor is inside the symbol to reveal in the 961* symbol in the UI. 962*/ 963Range range ; 964 965/** 966* The range that should be selected and revealed when this symbol is being 967* picked, e.g. the name of a function. Must be contained by the `range`. 968*/ 969Range selectionRange ; 970 971/** 972* Children of this symbol, e.g. properties of a class. 973*/ 974List < DocumentSymbol > children ; 975 976static const StructRttiInfo g_rttiInfo ; 977}; 978 979/** 980* A parameter literal used in inlay hint requests. 981* 982* @since 3.17.0 983*/ 984struct InlayHintParams 985{ 986/** 987* The text document. 988*/ 989TextDocumentIdentifier textDocument ; 990 991/** 992* The visible document range for which inlay hints should be computed. 993*/ 994Range range ; 995 996static const StructRttiInfo g_rttiInfo ; 997static const UnownedStringSlice methodName ; 998}; 999 1000typedef int InlayHintKind ; 1001const int kInlayHintKindType = 1 ; 1002const int kInlayHintKindParameter = 2 ; 1003 1004/** 1005* Inlay hint information. 1006* 1007* @since 3.17.0 1008*/ 1009struct InlayHint 1010{ 1011/** 1012* The position of this hint. 1013*/ 1014Position position ; 1015 1016/** 1017* The label of this hint. A human readable string or an array of 1018* InlayHintLabelPart label parts. 1019* 1020* *Note* that neither the string nor the label part can be empty. 1021*/ 1022String label ; 1023 1024/** 1025* The kind of this hint. Can be omitted in which case the client 1026* should fall back to a reasonable default. 1027*/ 1028InlayHintKind kind = 1 ; 1029 1030List < TextEdit > textEdits ; 1031 1032/** 1033* Render padding before the hint. 1034* 1035* Note: Padding should use the editor's background color, not the 1036* background color of the hint itself. That means padding can be used 1037* to visually align/separate an inlay hint. 1038*/ 1039bool paddingLeft = false; 1040 1041/** 1042* Render padding after the hint. 1043* 1044* Note: Padding should use the editor's background color, not the 1045* background color of the hint itself. That means padding can be used 1046* to visually align/separate an inlay hint. 1047*/ 1048bool paddingRight = false; 1049 1050static const StructRttiInfo g_rttiInfo ; 1051}; 1052 1053struct DocumentOnTypeFormattingParams 1054{ 1055/** 1056* The document to format. 1057*/ 1058TextDocumentIdentifier textDocument ; 1059 1060/** 1061* The position around which the on type formatting should happen. 1062* This is not necessarily the exact position where the character denoted 1063* by the property `ch` got typed. 1064*/ 1065Position position ; 1066 1067/** 1068* The character that has been typed that triggered the formatting 1069* on type request. That is not necessarily the last character that 1070* got inserted into the document since the client could auto insert 1071* characters as well (e.g. like automatic brace completion). 1072*/ 1073String ch ; 1074 1075/** 1076* The formatting options. 1077*/ 1078// FormattingOptions options; 1079 1080static const StructRttiInfo g_rttiInfo ; 1081static const UnownedStringSlice methodName ; 1082}; 1083 1084struct DocumentRangeFormattingParams 1085{ 1086/** 1087* The document to format. 1088*/ 1089TextDocumentIdentifier textDocument ; 1090 1091/** 1092* The range to format 1093*/ 1094Range range ; 1095 1096/** 1097* The format options 1098*/ 1099// FormattingOptions options; 1100 1101static const StructRttiInfo g_rttiInfo ; 1102static const UnownedStringSlice methodName ; 1103}; 1104 1105struct DocumentFormattingParams 1106{ 1107/** 1108* The document to format. 1109*/ 1110TextDocumentIdentifier textDocument ; 1111 1112/** 1113* The format options 1114*/ 1115// FormattingOptions options; 1116 1117static const StructRttiInfo g_rttiInfo ; 1118static const UnownedStringSlice methodName ; 1119}; 1120 1121} // namespace LanguageServerProtocol 1122} // namespace Slang 1123 1124namespace Slang 1125{ 1126template < typename T > 1127struct LanguageServerResult 1128{ 1129SlangResult returnCode; 1130bool isNull = true; 1131T result; 1132LanguageServerResult () { returnCode = SLANG_OK ; } 1133LanguageServerResult( std :: nullopt_t ) { returnCode = SLANG_OK ; } 1134LanguageServerResult( const T & value) 1135{ 1136result = value; 1137isNull = false; 1138returnCode = SLANG_OK ; 1139} 1140LanguageServerResult( SlangResult code ) { returnCode = code; } 1141}; 1142} // namespace Slang