-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade language server version (#89)
* Upgrade language server version To go along with the changes in the language server 0.4.0: https://github.com/smithy-lang/smithy-language-server/blob/main/CHANGELOG.md#040-2024-07-30, this commit also: - updates coursier to use java 21 to run the server - adds config options diagnostics.minimumSeverity, onlyReloadOnSave - removes config option for logToFile * Fix tests relying on .smithy.lsp.log Most of the test suites read the old .smithy.lsp.log file that the language server could be configured to write out. Since that was removed, we need a different way to do test assertions. I tried to see if we could look at the trace of messages between server <-> vscode client, but wasn't able to find a way. So I simplified the assertions for these test suites, which should be ok because we probably don't want to rely on logs anyways for testing, and more robust testing is done on the server side (our extension doesn't have that much functionality to test). I also had to add `sources` to each of the smithy-build.json files used for tests, so the language server could properly load those test projects. * Make couriser download jdk 21 By default, couriser will use AdoptOpenJDK 8 to run the server, so we needed to tell it to use jdk 21. Coursier will download the JDK if necessary. It uses an index to figure out where to download it from: https://get-coursier.io/docs/2.0.6/cli-java#jvm-index. The version of coursier we are using in the extension has an old version of the index, so we needed to provide an updated index for coursier to pull from. Also, we needed to tell coursier specifically which jdk to use (not just 21), because by default it tries to use AdoptOpenJDK, when there's no AdoptOpenJDK 21 (it is under the name Adoptium) now. This is a temporary solution, meant to avoid downloading a second version of coursier which had an updated index and could properly find the right jdk to download. In the future, we will ship the language server as a standalone executable, and can remove coursier altogether. I also updated the tests to stop using timeouts, so we don't have to worry about an inconsistent download time in CI.
- Loading branch information
1 parent
cece632
commit b381d23
Showing
14 changed files
with
96 additions
and
66 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import * as assert from "assert"; | ||
import * as vscode from "vscode"; | ||
import { getDocUri, getLangServerLogs, waitForServerStartup } from "../helper"; | ||
import { getDocUri, waitForServerStartup } from "../helper"; | ||
|
||
suite("User-specific root", function () { | ||
this.timeout(0); | ||
|
||
suite("User-specific root", () => { | ||
test("Should download jars even when not in workspace root", async () => { | ||
const smithyMainUri = getDocUri("suite4/smithy/main.smithy"); | ||
const doc = await vscode.workspace.openTextDocument(smithyMainUri); | ||
await vscode.window.showTextDocument(doc); | ||
await waitForServerStartup(); | ||
const diagnostics = vscode.languages.getDiagnostics(smithyMainUri); | ||
const logText = await getLangServerLogs("suite4/smithy"); | ||
|
||
assert.match(logText, /Downloaded external jars.*smithy-aws-traits-1\.40\.0\.jar/); | ||
assert.match(logText, /Downloaded external jars.*smithy-waiters-1\.40\.0\.jar/); | ||
assert.doesNotMatch(logText, /Unable to resolve trait/); | ||
// We would have diagnostics for unknown traits if the jars weren't downloaded | ||
assert.equal(diagnostics.length, 0); | ||
}).timeout(10000); | ||
return Promise.resolve(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters