Skip to content

Commit 1259bfe

Browse files
authored
Include globally enabled TS Server plugins when reporting issues (microsoft#156510) (microsoft#156821)
We're seeing a lot of crashes caused by TS Server plugins (usually those that come from extension). This will be easier to track down if we also include the enabled plugins when reporting issues
1 parent b96204a commit 1259bfe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

extensions/typescript-language-features/src/typescriptServiceClient.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import * as fileSchemes from './utils/fileSchemes';
2525
import { Logger } from './utils/logger';
2626
import { isWeb } from './utils/platform';
2727
import { TypeScriptPluginPathsProvider } from './utils/pluginPathsProvider';
28-
import { PluginManager } from './utils/plugins';
28+
import { PluginManager, TypeScriptServerPlugin } from './utils/plugins';
2929
import { TelemetryProperties, TelemetryReporter, VSCodeTelemetryReporter } from './utils/telemetry';
3030
import Tracer from './utils/tracer';
3131
import { inferredProjectCompilerOptions, ProjectType } from './utils/tsconfig';
@@ -644,7 +644,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
644644
});
645645
} else {
646646
const args = previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError
647-
? getReportIssueArgsForError(previousState.error, previousState.tsServerLogFile)
647+
? getReportIssueArgsForError(previousState.error, previousState.tsServerLogFile, this.pluginManager.plugins)
648648
: undefined;
649649
vscode.commands.executeCommand('workbench.action.openIssueReporter', args);
650650
}
@@ -1002,6 +1002,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
10021002
function getReportIssueArgsForError(
10031003
error: TypeScriptServerError,
10041004
logPath: string | undefined,
1005+
globalPlugins: readonly TypeScriptServerPlugin[],
10051006
): { extensionId: string; issueTitle: string; issueBody: string } | undefined {
10061007
if (!error.serverStack || !error.serverMessage) {
10071008
return undefined;
@@ -1020,6 +1021,10 @@ function getReportIssueArgsForError(
10201021
3.`,
10211022
];
10221023

1024+
if (globalPlugins.length) {
1025+
sections.push(`**Global TS Server Plugins**\n\n` + globalPlugins.map(plugin => `- \`${plugin.name}\``).join('\n'));
1026+
}
1027+
10231028
if (logPath) {
10241029
sections.push(`**TS Server Log**
10251030
@@ -1033,7 +1038,7 @@ The log file may contain personal data, including full paths and source code fro
10331038

10341039
sections.push(`**TS Server Log**
10351040
1036-
️Server logging disabled. To help us fix crashes like this, please enable logging by setting:
1041+
️ Server logging disabled. To help us fix crashes like this, please enable logging by setting:
10371042
10381043
\`\`\`json
10391044
"typescript.tsserver.log": "verbose"

0 commit comments

Comments
 (0)