File tree Expand file tree Collapse file tree
extensions/typescript-language-features/src/tsServer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,16 @@ export class TypeScriptServerError extends Error {
4040 if ( errorText ) {
4141 const errorPrefix = 'Error processing request. ' ;
4242 if ( errorText . startsWith ( errorPrefix ) ) {
43- const prefixFreeErrorText = errorText . substr ( errorPrefix . length ) ;
43+ let prefixFreeErrorText = errorText . substr ( errorPrefix . length ) ;
44+
45+ // Prior to https://github.com/microsoft/TypeScript/pull/32785, this error
46+ // returned and excessively long and detailed list of paths. Since server-side
47+ // filtering doesn't have sufficient granularity to drop these specific
48+ // messages, we sanitize them here.
49+ if ( prefixFreeErrorText . indexOf ( 'Could not find sourceFile' ) >= 0 ) {
50+ prefixFreeErrorText = prefixFreeErrorText . replace ( / i n \[ [ ^ \] ] * \] / g, '' ) ;
51+ }
52+
4453 const newlineIndex = prefixFreeErrorText . indexOf ( '\n' ) ;
4554 if ( newlineIndex >= 0 ) {
4655 // Newline expected between message and stack.
You can’t perform that action at this time.
0 commit comments