Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another try to not use namespace #39344

Closed
wants to merge 9 commits into from

Conversation

ShuiRuTian
Copy link
Contributor

Fixes #

@ShuiRuTian
Copy link
Contributor Author

ShuiRuTian commented Jul 1, 2020

Question1:

namespace ts{
        export const enum SyntaxKind {
        Unknown,
        EndOfFileToken,
        SingleLineCommentTrivia,
        MultiLineCommentTrivia,
        NewLineTrivia,
        }
}

var q = (ts as any).SyntaxKind;

const enum SyntaxKind {
    Unknown,
    EndOfFileToken,
    SingleLineCommentTrivia,
    MultiLineCommentTrivia,
    NewLineTrivia,
}

// How to get SyntaxKind like under namespace?

For now I generate a new file and copy everything in need expect the "const" keyword.

@ShuiRuTian
Copy link
Contributor Author

ShuiRuTian commented Jul 1, 2020

Some aim:

  1. remove all "ts" namespace, keep others for temp. (ts.XX keeps too)
  2. NOT change indent, so review could be possible.
  3. use script to do heavy work, but manually check all again and fix error.

Some sequelae caused by this branch:

  1. some variable are renamed, they are usually added "NameSpaceLocal" suffix.
  2. indent in some test files and their baseline are changed.

How to deal with namespace:

  1. for those which only have one (in another word, not merged)
    1. if it is used in multi projects, keep namespace and export it.
    2. if it is only used in one project, just delete the namespace and remove the namespace name in used place
  2. for those which have multi parts (merged)
    How to do with it?

why importTracker.ts is not in findAllReference.ts?

@weswigham
Copy link
Member

@ShuiRuTian FYI, #35561 already does this and is (re)generated by script. We're mostly just blocked on an API Extractor feature so we can preserve the same file layout in our API as today.

@ShuiRuTian
Copy link
Contributor Author

whoops, glad to know that!

@ShuiRuTian ShuiRuTian closed this Jul 2, 2020
@ShuiRuTian ShuiRuTian deleted the try-not-use-namespace branch July 6, 2020 13:44
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.

2 participants