Skip to content

Make tsserver entrypoint work for ts-go + refactor#210

Merged
gabritto merged 8 commits intomainfrom
gabritto/tsserver-go
Mar 30, 2026
Merged

Make tsserver entrypoint work for ts-go + refactor#210
gabritto merged 8 commits intomainfrom
gabritto/tsserver-go

Conversation

@gabritto
Copy link
Copy Markdown
Member

This PR makes ts-error-deltas work with entry point tsserver and repo typescript-go.

  • I added the replay code that is basically a copy of exerciseLspServer, except we follow the provided replay script.
  • I added a isGo parameter that is not really needed but makes it easier to track where the code changed to support tsgo. I think this will make it easier to delete the old Strada-supporting code once we have finished porting everything here.

I also renamed a few things:

  • Entry point lsp is now fuzzer to avoid confusion with tsserver. We still need to have a separate entry point for fuzzing for now because it indicates we're not comparing two versions, just testing the most current one.
  • Renamed github and user scripts/params to scheduled and triggered. The old names were extremely confusing for me, because the names were not really meaningful, and both of those scripts could either test the "user tests" (a.k.a the repos in the userTests directory), or the "top N" github repos, depending on what's passed as repo list to the tests. The real distinction is that one script runs triggered by the bot for comparing a PR with main, and the other runs scheduled to compare two released versions.

There's also a few fixes to exerciseLspServer/lspHarness, and to tests' tsconfig.

@gabritto gabritto requested review from iisaduan and jakebailey March 26, 2026 17:40
@gabritto gabritto marked this pull request as draft March 26, 2026 18:03
@gabritto
Copy link
Copy Markdown
Member Author

Forgot to update the reporting logic, will fix that.

@gabritto gabritto marked this pull request as ready for review March 26, 2026 19:17
@gabritto
Copy link
Copy Markdown
Member Author

PR seems to work, at least when triggered manually: https://typescript.visualstudio.com/TypeScript/_build/results?buildId=167572&view=results

@jakebailey
Copy link
Copy Markdown
Member

This is what you get when you run the bot command, right? Do you have triggerer update to allow us to start triggering it on PRs?

@gabritto
Copy link
Copy Markdown
Member Author

gabritto commented Mar 26, 2026

This is what you get when you run the bot command, right? Do you have triggerer update to allow us to start triggering it on PRs?

It's what you get from the bot, yes.
@iisaduan I think you mentioned the bot wasn't able to trigger pipelines for some reason. Do you know why/what's missing?

@jakebailey
Copy link
Copy Markdown
Member

This one it should be able to do, if the code is sent to enable it.

@gabritto gabritto marked this pull request as draft March 27, 2026 00:11
if (method === "window/logMessage" && params?.type === 1) {
lastErrorLogMessage = params.message;
}
if (method !== "window/logMessage") {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was making the logs too large to load.

console.log(JSON.stringify({ method: "unknown", message: errorMessage }));
console.error("Server connection closed prematurely:", e);
const stderrOutput = stderrChunks.join("");
const panicMsg = getPanicMessageFromStderr(stderrOutput);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is needed to detect unrecovered panics.


function sendRequestUntyped(method: string, params: object): Promise<unknown> {
function sendRequestUntyped(method: string, params: unknown): Promise<unknown> {
if (params === undefined) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fix needed otherwise the vscode library would send [null] as parameter if params is undefined, causing a server deserialization error.

Raw error text: <code>${summary.rawErrorArtifactPath}</code> in the <a href="${artifactFolderUrlPlaceholder}">artifact folder</a> <br />
Replay commands: <code>${summary.replayScriptArtifactPath}</code> in the <a href="${artifactFolderUrlPlaceholder}">artifact folder</a>
<h4>Last few requests</h4>
`;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When we report an error on the new server, we now say what happened with the old server too, to make it easier to reason about possibly flaky results.

@gabritto gabritto marked this pull request as ready for review March 30, 2026 18:25
Copy link
Copy Markdown
Member

@iisaduan iisaduan left a comment

Choose a reason for hiding this comment

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

To be clear, we have

  • scheduled
    • tsc (diffs latest and latest stable)
    • fuzzer (runs fuzzer on latest)
  • manual
    • tsc (diffs main and branch)
    • tsserver (diffs main and branch)

(is that correct?)

@gabritto
Copy link
Copy Markdown
Member Author

To be clear, we have

  • scheduled

    • tsc (diffs latest and latest stable)
    • fuzzer (runs fuzzer on latest)
  • manual

    • tsc (diffs main and branch)
    • tsserver (diffs main and branch)

(is that correct?)

Yeah, that's what we should have for now modulo possible bugs.

@gabritto gabritto merged commit ae2e07e into main Mar 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants