Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sourcekit-lsp initialization smoke test #706

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/swift-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 11 additions & 0 deletions tests/sourcekit-lsp-initialization-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Content-Length: 152

{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"capabilities": {},
"trace": "verbose",
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at the end of the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to test if including one breaks the test. There's not supposed to be a newline at the end of the RPC message