File tree 3 files changed +23
-1
lines changed
tests/cases/fourslash/server
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1577,6 +1577,7 @@ namespace ts {
1577
1577
newSourceFile . originalFileName = oldSourceFile . originalFileName ;
1578
1578
newSourceFile . resolvedPath = oldSourceFile . resolvedPath ;
1579
1579
newSourceFile . fileName = oldSourceFile . fileName ;
1580
+ newSourceFile . impliedNodeFormat = oldSourceFile . impliedNodeFormat ;
1580
1581
1581
1582
const packageName = oldProgram . sourceFileToPackageName . get ( oldSourceFile . path ) ;
1582
1583
if ( packageName !== undefined ) {
Original file line number Diff line number Diff line change @@ -637,7 +637,8 @@ namespace FourSlash {
637
637
ts . forEachKey ( this . inputFiles , fileName => {
638
638
if ( ! ts . isAnySupportedFileExtension ( fileName )
639
639
|| Harness . getConfigNameFromFileName ( fileName )
640
- || ! ts . getAllowJSCompilerOption ( this . getProgram ( ) . getCompilerOptions ( ) ) && ! ts . resolutionExtensionIsTSOrJson ( ts . extensionFromPath ( fileName ) )
640
+ // Can't get a Program in Server tests
641
+ || this . testType !== FourSlashTestType . Server && ! ts . getAllowJSCompilerOption ( this . getProgram ( ) . getCompilerOptions ( ) ) && ! ts . resolutionExtensionIsTSOrJson ( ts . extensionFromPath ( fileName ) )
641
642
|| ts . getBaseFileName ( fileName ) === "package.json" ) return ;
642
643
const errors = this . getDiagnostics ( fileName ) . filter ( e => e . category !== ts . DiagnosticCategory . Suggestion ) ;
643
644
if ( errors . length ) {
Original file line number Diff line number Diff line change
1
+ /// <reference path="../fourslash.ts" />
2
+
3
+ // @Filename : /tsconfig.json
4
+ //// { "compilerOptions": { "module": "nodenext" } }
5
+
6
+ // @Filename : /package.json
7
+ //// { "name": "foo", "type": "module", "exports": { ".": "./main.js" } }
8
+
9
+ // @Filename : /main.ts
10
+ //// export {};
11
+
12
+ // @Filename : /index.ts
13
+ //// import {} from "foo";
14
+
15
+ goTo . file ( "/index.ts" ) ;
16
+ verify . noErrors ( ) ;
17
+
18
+ edit . paste ( `\n"${ "a" . repeat ( 256 ) } ";` ) ;
19
+
20
+ verify . noErrors ( ) ;
You can’t perform that action at this time.
0 commit comments