Skip to content

services tsconfig.json added missing file references and fixed the order - #2917

Merged
Mohamed Hegazy (mhegazy) merged 1 commit into
microsoft:masterfrom
basarat:patch-1
Apr 27, 2015
Merged

Mohamed Hegazy (mhegazy) merged 1 commit into
microsoft:masterfrom
basarat:patch-1

Conversation

@basarat

Copy link
Copy Markdown
Contributor

This order is significant:

        "../compiler/diagnosticInformationMap.generated.ts",
        "../compiler/commandLineParser.ts",

Also not having these extra files referenced caused TypeStrong/atom-typescript#304

Really wish we moved to external modules, but that's a seperate issue 🌹

This order is significant:

```ts
        "../compiler/diagnosticInformationMap.generated.ts",
        "../compiler/commandLineParser.ts",
```

Also not having these extra files referenced caused TypeStrong/atom-typescript#304 
Really wish we moved to external modules.
@msftclas

Hi Basarat Ali Syed (@basarat), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@DanielRosenwasser

Copy link
Copy Markdown
Member

Actually I think that in general diagnosticInformationMap.generated.ts should go before anything that actually reports diagnostics (i.e. scanner.ts as well).

Also maybe declarationEmitter.ts should also go before emitter.ts as well. Not that these matter in practice, but it's better to order these to make the dependencies more explicit.

@basarat

Copy link
Copy Markdown
Contributor Author

Not that these matter in practice

True in general but in this case they do matter. Consider the code staight out of repo : types,commandLineParser,diagnostic:

// Types.ts
module ts {
    export enum DiagnosticCategory {
        Warning,
        Error,
        Message,
    }
}

// commandLineParser.ts
module ts {
    /* @internal */
    export var optionDeclarations = [
        {
            name: "declaration",
            shortName: "d",
            type: "boolean",
            description: Diagnostics.Generates_corresponding_d_ts_file,
        }
    ]
}

// diagnostic generated
module ts {
    export var Diagnostics = {
        Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." },
    }
}

If you run this on the playground it will fail with Uncaught TypeError: Cannot read property 'Generates_corresponding_d_ts_file' of undefined . Fix is to reorder the diagnostics to come before commandLineParser, hence this PR.

It matters if the stuff is used during initial module body evaluation / execution (e.g. the var optionDeclarations).

This is exactly why I have come to hate out : https://github.com/TypeStrong/atom-typescript/blob/master/docs/out.md 🌹

Mohamed Hegazy (mhegazy) added a commit that referenced this pull request Apr 27, 2015
services tsconfig.json added missing file references and fixed the order
@mhegazy
Mohamed Hegazy (mhegazy) merged commit 2349a27 into microsoft:master Apr 27, 2015
@mhegazy

Copy link
Copy Markdown
Contributor

thanks!

@basarat

Copy link
Copy Markdown
Contributor Author

🌹

@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants