diff --git a/regression_tests/baselines/document_symbol_functions/input.txt b/regression_tests/baselines/document_symbol_functions/input.txt new file mode 100644 index 0000000..239a19d --- /dev/null +++ b/regression_tests/baselines/document_symbol_functions/input.txt @@ -0,0 +1,13 @@ +Content-Length: 4690 + +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":48312,"clientInfo":{"name":"Visual Studio Code","version":"1.84.0"},"locale":"en","rootPath":"/home/cwells/Code/quickbms-lsp","rootUri":"file:///home/cwells/Code/quickbms-lsp","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"linkedEditingRange":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/cwells/Code/quickbms-lsp","name":"quickbms-lsp"}]}}Content-Length: 52 + +{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 944 + +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/cwells/Code/quickbms-lsp/tree-sitter-quickbms/test/corpus/functions%20copy.bms","languageId":"quickbms","version":1,"text":"StartFunction GreetWorld\n print \"Hello, World!\"\nEndFunction\n\n// When multiple function definitions with the same name exist, the first one in the file is used. No error is emitted.\n/*StartFunction GreetWorld\n print \"Hello, World! 2\"\nEndFunction\n\nCallFunction GreetWorld*/\n\nCallFunction GreetWorld\nCallFunction greetworld\n\n/*CallFunction GreetWorld\nCallFunction GreetWorld\n\nStartFunction PrintValue\n print \"%PrintValue_ARG1%\"\nEndFunction\n\nCallFunction PrintValue 0 \"Hi, there!\"\n\nStartFunction NestingFunc\nEndFunction*/\n\n#CallFunction NestingFunc\n#CallFunction NestedFunc\n\nstartfunction POLYNOMIAL_DB\n math POLYNOMIAL_DB_IDX = 0\nendfunction\n\ncallfunction POLYNOMIAL_DB 1"}}}Content-Length: 191 + +{"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/cwells/Code/quickbms-lsp/tree-sitter-quickbms/test/corpus/functions%20copy.bms"}}}Content-Length: 56 + +{"jsonrpc":"2.0","id":2,"method":"shutdown","params":{}}Content-Length: 45 + +{"jsonrpc":"2.0","method":"exit","params":{}} \ No newline at end of file diff --git a/regression_tests/baselines/document_symbol_functions/output.txt b/regression_tests/baselines/document_symbol_functions/output.txt new file mode 100644 index 0000000..ff68842 --- /dev/null +++ b/regression_tests/baselines/document_symbol_functions/output.txt @@ -0,0 +1,7 @@ +Content-Length: 202 + +{"jsonrpc":"2.0","result":{"capabilities":{"definitionProvider":true,"documentSymbolProvider":true,"foldingRangeProvider":{},"hoverProvider":true,"referencesProvider":true,"textDocumentSync":1}},"id":0}Content-Length: 480 + +{"jsonrpc":"2.0","result":[{"kind":12,"location":{"range":{"end":{"character":11,"line":2},"start":{"character":0,"line":0}},"uri":"file:///home/cwells/Code/quickbms-lsp/tree-sitter-quickbms/test/corpus/functions%20copy.bms"},"name":"GreetWorld"},{"kind":12,"location":{"range":{"end":{"character":11,"line":31},"start":{"character":0,"line":29}},"uri":"file:///home/cwells/Code/quickbms-lsp/tree-sitter-quickbms/test/corpus/functions%20copy.bms"},"name":"POLYNOMIAL_DB"}],"id":1}Content-Length: 38 + +{"jsonrpc":"2.0","result":null,"id":2} \ No newline at end of file diff --git a/regression_tests/test.py b/regression_tests/test.py index 7fcec1d..6433a11 100644 --- a/regression_tests/test.py +++ b/regression_tests/test.py @@ -108,6 +108,10 @@ class TestOpenDocument(Util.TestRegression): name = "open_document" +class TestDocumentSymbolFunctions(Util.TestRegression): + name = "document_symbol_functions" + + def update_baselines(tests: List[type[Util.TestRegression]]) -> None: for test in tests: print(f"Updating baseline: {test.name}")