From 26235e94182a39525c500482c2ba6b5334595459 Mon Sep 17 00:00:00 2001 From: Jeremy Day Date: Thu, 18 Jan 2024 12:22:31 -0800 Subject: [PATCH] Add sourcekit-lsp initialization smoke test --- .github/workflows/swift-toolchain.yml | 10 ++++++++++ tests/sourcekit-lsp-initialization-message | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/sourcekit-lsp-initialization-message diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index e1b22d2cc..8ec68d2eb 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -2306,6 +2306,16 @@ jobs: - run: swift test -Xswiftc -DENABLE_TESTING working-directory: ${{ github.workspace }}/SourceCache/swift-win32 + - name: Test that sourcekit-lsp initializes + working-directory: ${{ github.workspace }}/SourceCache/swift-win32 + run: | + $diagnosticOutput = $( $output = & ${{ github.workspace }}/tests/sourcekit-lsp-initialization-message | sourcekit-lsp.exe ) 2>&1 + if (-not ($diagnosticOutput -Match "Succeeded") -or -not ($diagnosticOutput -Match "InitializeResult")) { + Write-Host "sourcekit-lsp failed to initialize" + Write-Host $diagnosticOutput + exit 1 + } + snapshot: runs-on: ubuntu-latest needs: [context, smoke_test] diff --git a/tests/sourcekit-lsp-initialization-message b/tests/sourcekit-lsp-initialization-message new file mode 100644 index 000000000..bef2779e5 --- /dev/null +++ b/tests/sourcekit-lsp-initialization-message @@ -0,0 +1,11 @@ +Content-Length: 152 + +{ + "jsonrpc": "2.0", + "id": 0, + "method": "initialize", + "params": { + "capabilities": {}, + "trace": "verbose", + } +} \ No newline at end of file