* Prefer a likely literal over anonymous type in --noImplicitAny codefixes
Before trying to make an anonymous type for a type's usage, we'll first check if there is exactly one builtin primitive the usage is assignable to, and use it if so. Right now that's only `number` and `string` because `boolean` has no distinguishable members.
A couple of implementation details:
* `tryInsertTypeAnnotation` needed to know to insert a type _after_ a node's `exclamationToken` if it exists
* This code area was written before `??` 😉
* Used unknown/any instead of void when applicable
* Fix little whitespace change in tests/cases/fourslash/codeFixInferFromUsagePropertyAccessJS.ts
* Undid some now-unnecessary unknown additions
* Took advice on restricting void to just call expressions
* Fix prepending unused TypeScript variables with underscore doesn't rename JSDoc @param.
Fix test for quick fix "Prefix all unused declarations with '_' where possible".
Fixes#33021.
* Replace FindAllReferences.Core.eachSymbolReferenceInFile function call to more ligher call of getJSDocParameterTags when searching for a parameter in jsdoc.
* Remove redundant constant declaration.
* Add test for prefix single unused parameter in jsdoc.
* add two tests: Refactor: Remove braces from arrow function
* refactor: simplify test and add another test
* fix: copyTrailingAsLeadingComments in addOrRemoveBracesToArrowFunction
* test: add additional test
* fix: clean up changes
* fix: add check for newEdit
* fix: add function for semi colon modifier
* feat: grab all comments during refactor
* refactor: update addOrRemoveBraces logic
* fix: remove duplicate function call
* Update src/services/refactors/addOrRemoveBracesToArrowFunction.ts
* remove blank line
remove blank line
Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>
This fixes two bugs in the parseJSDocCommentWorker().
1. The initial indent was calculated wrongly. It was set to the
difference between the index of the last newline or beginning of file
and the current start marker (position of /**). By calculating it
this way, the newline character itself is counted as indentation
character as well. The initial indent is used as margin for the
whole comment. The margin contains the amount of characters to skip
before the actual content or payload of a comment line. The algorithm
does not skip non-whitespace characters at the beginning of the
content, but it would strip away one whitespace character for
indented content (which does matter, if there is e.g. a Markdown
code block with indentation in the comment).
2. When reducing initial whitespace sequences of comment lines by the
remaining margin the algorithm cut off one character too much. This
might have been introduced to fix 1. It had a similar effect as 1.
* stash
* add surmise for return type
* add support for more case
* add more test case
* add more testcase and fix all test
* fix changed diagnosis
* fix broken test case
* add more case
* rename quickfix
* fix conflict
* fix fix desc
* fix semi
* Avoid replace brace with paren
* Split fix all action
* Add return work in same line
* fix test cases
* rename baseline
* refactor and handle comment
* Support semi
* make helper internal
* Accept change
* Accept the huge set of ever so slightly changed baselines
* Update return type logic to only reuse nodes if original nodes share scope with current node, like property types, only reuse nodes if symbols referened are acessible, reuse nodes for property signatures, too
* Only reuse nodes when a context is provided (otherwise identifier printback may fail)
* Only track symbol if symbol is found and no error is recorded
* Fix type parameter reuse lookup
* Forbid cjs module.exports references in retained nodes
* Adjust check for cjs export references to not include bad module type in output
* Add symbol to all identifiers we see in existing nodes for quickinfo
* Accept fourslash baseline updates
* Accept slightly updated baseline post-merge
* Do not copy original nodes for error types, replace empty type references with any
* Special-case window, self, global, globalThis methods
* Disambiguate global and this property completions in details requests
* Hide the Map<boolean> implementation
* Update old tests
* Replace SymbolOriginKind stringification with dedicated enum
* Support completions for local named exports
* Add JSDoc
* Use sort text instead of filtering
* Revert new CompletionKind
* Return valid completions even when export declaration is in an invalid place
* fix: hyphened name not auto-completed by the ls
* fix: accept new baseline
* Adds a test to validate the hypened identifiers in JSX
Co-authored-by: Orta Therox <orta.therox@gmail.com>
* Allow emitter to write multiple newlines in node lists
* Progress
* Progress
* Fix recomputeIndentation
* Add tests, fix leading line terminator count
* Do a bit less work when `preserveNewlines` is off
* Fix accidental find/replace rename
* Restore some monomorphism
* Fix single line writer
* Fix other writers
* Revert "Fix other writers"
This reverts commit 21b0cb8f3b.
* Revert "Fix single line writer"
This reverts commit e535e279f9.
* Revert "Restore some monomorphism"
This reverts commit e3ef42743a.
* Add equal position optimization to getLinesBetweenRangeEndAndRangeStart
* Add one more test
* Actually save the test file
* Rename preserveNewlines to preserveSourceNewlines
* Make ignoreSourceNewlines internal
* Optimize lines-between functions
* Add comment;
* Fix trailing line terminator count bug for function parameters
* Preserve newlines around parenthesized expressions
* Back to speculative microoptimizations, yay
* Don’t call getEffectiveLines during tsc emit at all
* Add codefix for --noImplicitThis
* Code review
* Back to building post-merge
* Remove redundant functions + update tests
Infer-from-usage also inserts `this: any` parameters when needed, so I
removed that from fixImplicitThis.
Otherwise, fixImplicitThis has better suggestions than inferFromUsage,
so I moved inferFromUsage later in the suggestion order.
* More redundancy removal
Don't need to add `@this` anymore either since inferFromUsage will do
that.
* More baseline updates
From moving inferFromUsage down in priority I think?
* remove now-redundant ad-hoc jsdoc emit
* fix more bad merge
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Add tests that fail because of symlink to non common directory node_modules
* When the imported module is through node_modules and symlink to folder that isnt node_modules
Most of the monorepo like scenarios are like this so looking at symlink to decide if file can be imported is essential
Fixes#28689
* getPropertiesOfUnionOrIntersectionType: handle types with index signature
Fixes: #31565
* fix test
* more testing
* fix typo in checker.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* add trim trailing whitespace option
* set default trimTrailingWhiteSpace to true
* add fourslash tests
* accept new baselines
* only preserce whitespace when setting is explicitly false
* format whitespace
Signed-off-by: Andrew Deniszczyc <adeniszczyc@bloomberg.net>
Cleanup of implementation
Move check node container check
Add test cases for fixExpectedCommaError
Renaming and add test case
Co-authored-by: Andrew Deniszczyc <adeniszczyc@bloomberg.net>
Resolves issue #28031 by overriding default value of
`useNonAdjustedStartPosition` option to replaceNode. Test case included
that confirms intended behaviour.
Use `emit()` for writing `questionDotToken`, leading to properly calling
the emit hooks (which `emitTokenWithComment` doesn't) and printing the
comments. This fixes#35372 by calling its hooks to set the `.__pos`
and `.__end` fields.
Also, remove `getDotOrQuestionDotToken` which was used only here --
mainly because it seems likely to encourage misusing the
`questionDotToken` again.
Also, fix a bunch of `visitor` -> `tokenVisiton` calls in
`visitorPublic.ts`.
* Treat never-like intersections as never
* Accept new baselines
* Fix compiler issues revealed by increased intersection correctness
* Delete fourslash tests that are no longer applicable
* Include isNeverLikeIntersection check in getNormalizedType
* Erase never-like types in several more places
* Check that base types are not never-like
* Add comments
* Revert isNeverLikeType check in getIndexType (keyof shouldn't resolve member types)
* Introduce getReducedType for union and intersection types
* Don't reduce in getApparentType
* Avoid relationship check in resolveMappedTypeMembers
* Accept new baselines
* Don't call getReducedType in getIndexType
* Ensure reduced and unreduced forms of a type can compare identical
* Reduce types before converting them to string representation
* Accept new baselines
* Reduce intersections before obtaining keyof X
* Add tests
* Accept new baselines
* Fix comment in tests
* Don't infer from empty intersection types
* Add tests
* Accept new baselines
* Defer instantiation of mapped type property types
* Accept new baselines
* Include more precise type in diagnostic
* Accept new baselines
* Minor optimization
* Improve error message
* Optional properties in intersections are never discriminants
* Hoist initial assignment to exported names in cjs to they are not blocked by bindings made by __exportStar
* Copy hoisted identifiers so they do not create sourcemaps
* Accept updated baselines
* Exempt ambient [#]private from unused error
These declarations exist to create nominality so they _must_ be unused.
There should be no error for them.
* Switch to fourslash test
I don't know how to baseline suggestion diagnostics in the compiler
tests.
* Fix tests when there are project references but has disableSourceOfProjectReferenceRedirect
* Handle getScriptVersion correctly to ensure program structure is checked correctly
Fixes#36748
* Harness's language service host doesnt have getProjectVersion.
This means earlier we were creating fresh program everytime we did LS operation
Now we reuse same program, so quick info depends on order of quickinfo demands
* Because same program is used, it unvails a bug that if `export=` is evaluated before finding references, it cant find all definitions from the merge
* Update src/server/project.ts
Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Make clearSourceMapperCache required
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Adds floating block comments to the outlining spans response
* Only use one route for grabbing outline nodes, which now includes special casing the EOF token
JSDocNamepaths span a lot of identifiers that we don't actually care
about, so it's incorrect for createChildren to add its children as
synthetic nodes.
* Add/convert to failing tests.
* Stop offering to convert single string literals to template expressions.
* Ensure we're actually testing for single quotes.
* Refactor fix-all-missing-imports to be reusable by other codefixes
* Migrate infer-from-usage to use ImportAdder
* Add infer from usage test importing more than one thing in a single fix
* Migrate implement interface / abstract members fixes to use ImportAdder
* Update old tests
* Use type-only imports when it would be an error not to
* Add another test
* Rename stuff
* Fix jsdoc comment parsing initial state
Jsdoc comment parsing can be invoked in two modes:
1. top-level parsing, for comments not inside a tag.
2. tag parsing, for comment that occur after the semantic parts of a
tag.
Top-level parsing skips an initial * because it assumes that it is starting
at the very beginning of a JSDoc comment. Tag parsing does not.
The two modes are distinguished by an optional second parameter named
`margin`. When `margin` is provided, it provides an initial indent used
for comment alignment.
Previously, the check for `margin` was a truthy check `if (margin)`.
This check incorrectly treats `margin=""` the same as
`margin=undefined`.
This PR changes the check to `if (margin !== undefined)`, which
correctly treats `margin=""` the same as `margin=" "`.
* Fixes for broken tests
1. Use SawAsterisk start state.
2. @template needs to skip asterisk in addition to whitespace while
parsing type parameter names.
* undo code move
* WIP on making the JSX text node not include whitespace
* Scans to the last newline for JSX correctly
* Handle JSX closing element wrapping
* Offload all jsx text indentation handling to indentMultilineCommentOrJsxText
* Switch from find node -> find inde in formatting
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
* Conditionally elide a parameter from contextual type signature calculation
* Slightly different approach to forbid inference to specific expressions
* Handle nested literals and mapped types correctly
* Delete unused cache
* Rename ContextFlags.BaseConstraint and related usage
* Add tests from my PR
* Update ContextFlags comment
Co-Authored-By: Wesley Wigham <wwigham@gmail.com>
* Update comments and fourslash triple slash refs
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
* Allow 'find references' to work on most declaration keywords
* Add support for rename
* Add more keywords, move logic out of checker and into services
* Add additional type and expression keywords
Handle private identifiers little better by creating token for private identifier when its just #
Report same error as invalid character but from language service we can now provide completions for this.#
Fixes#36367, #36250
* Adds support for showing default exports in the navtree - Fixes#34601
* Handle the feedback in #35477
* Navigation items using default export or export = will get noted if they are a const vs function
* fix meta property from appearing twice
* handle case where ImportMeta has props defined
* rename file
* use exclude instead of exact
* undo comment
* this file should have no change
* change file name back
* add more test cases
* remove comment and text validation
* fix formatting
* Correctly resolve tags for function overloads. Fixes#30181
* Better fix for #30181. Added more unit tests
* Fix commentsOverloads tests
* Fallback to first signature when doc and tags are empty
* Fix crash in codefixes re: braces of class body
Previously, the code that finds braces of a class body assumed they were
always there. This is not always the case, so this code checks for
that.
* fix semicolon lint
* Add type-only support for export declarations
* Use a synthetic type alias instead of binding type-only exports as a type alias
* Works for re-exports!
* isolatedModules works fine
* Diagnostic for type-only exporting a value
* Start isolated modules codefix
* Update for LKG control flow changes
* Type-only import clause parsing
* Type-only default import checking
* Type-only named imports
* Fix isolated modules error
* Filter namespaces down to type-only
* Fix class references
* Test nested namespaces
* Test circular type-only imports/exports
* Fix getTypeAtLocation for type-only import/export specifiers
* Fix type-only generic imports
* Update public APIs
* Remove unused WIP comment
* Type-only namespace imports
* Fix factory update calls
* Add grammar errors for JS usage and mixing default and named bindings
* Update updateExportDeclaration API baseline
* Fix grammar checking import clauses
* Enums, sort of
* Dedicated error for type-only enum
* Skip past type-only alias symbols in quick info
* Update error code in baseline
* WIP: convertToTypeOnlyExport
* isolatedModules codefix (single export declaration)
* isolatedModules code fix (all)
* Stop eliding non-type-only imports by default, add compiler flag
* Update to match updated diagnostic messages
* Update more baselines
* Update more tests
* Auto-import as type-only
* Add codefix for splitting type-only import with default and named bindings
* Add more services tests
* Add targeted error message for "export type T;" when T exists
* Add targeted error for "import type T = require(...)"
* Flip emit flag
* Add test for preserveUnusedImports option
* Fix flag flip on import =
* Make compiler option string-valued
* Fix merge conflicts
* Add --importsNotUsedAsValue=error
* Phrasing of messages.
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Fix display of private names in language server
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* Parse private names
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* update parser error recovery tests to use ¬ not #
The intent of the tests seemed to be to
regiment the behavior of the parser
when a weird symbol is encountered.
The `#` is now taken by private identifiers,
so `¬` seems like a good new choice for
keeping the diff small, since it also fits in
16 bits (wide emojis would be treated
as multiple characters, since the scanner
uses ++).
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* Private Name Support in the Checker (#5)
- [x] treat private names as unique:
- case 1: cannot say that a variable is of a class type unless the variable points to an instance of the class
- see [test](https://github.com/mheiber/TypeScript/tree/checker/tests/cases/conformance/classes/members/privateNames/privateNamesUnique.ts)
- case 2: private names in class hierarchies do not conflict
- see [test](https://github.com/mheiber/TypeScript/tree/checker/tests/cases/conformance/classes/members/privateNames/privateNamesNoConflictWhenInheriting.ts)
- [x] `#constructor` is reserved
- see [test](https://github.com/mheiber/TypeScript/tree/checker/tests/cases/conformance/classes/members/privateNames/privateNameConstructorReserved.ts)
- check in `bindWorker`, where every node is visited
- [x] Accessibility modifiers can't be used with private names
- see [test](https://github.com/mheiber/TypeScript/tree/checker/tests/cases/conformance/classes/members/privateNames/privateNamesNoAccessibilityModifiers.ts)
- implemented in `checkAccessibilityModifiers`, using `ModifierFlags.AccessibilityModifier`
- [x] `delete #foo` not allowed
- [x] Private name accesses not allowed outside of the defining class
- see test: https://github.com/mheiber/TypeScript/tree/checker/tests/cases/conformance/classes/members/privateNames/privateNameNotAccessibleOutsideDefiningClass.ts
- see [test](https://github.com/mheiber/TypeScript/tree/checker/tests/cases/conformance/classes/members/privateNames/privateNamesNoDelete.ts)
- implemented in `checkDeleteExpression`
- [x] Do [the right thing](https://gist.github.com/mheiber/b6fc7adb426c2e1cdaceb5d7786fc630) for nested classes
mv private name tests together
more checker tests for private names
update naming and cleanup for check private names
for private name support in the checker:
- make names more consistent
- remove unnecessary checks
- add utility function to public API
- other small cleanup
Move getPropertyNameForUniqueESSymbol to utility
for consistency with other calculation of
special property names (starting with __),
move the calculation of property names for
unique es symbols to `utilities.ts`.
private name tests strict+es6
Update private name tests to use 'strict'
type checking and to target es6 instead of
default. Makes the js output easier to read
and tests more surface area with other
checker features.
error message for private names in obj literals
Disallow decorating private-named properties
because the spec is still in flux.
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* Add private instance field transformation, pr feedback
Implements private instance fields on top of the class properties refactor.
This commit also includes incorporation of PR feedback on the
checker, parser, and transformer in order to make the rebase
manageable.
Co-Authored-By: Max Heiber <max.heiber@gmail.com>
Co-Authored-By: Ron Buckton <ron.buckton@microsoft.com>
Signed-off-by: Joey Watts <jwatts43@bloomberg.net>
Signed-off-by: Max Heiber <max.heiber@gmail.com>
Incorporate PR feedback
Fix checker crash with new block scoped bindings
Add classExpressionInLoop test
Update baselines for private name errors
Apply suggestions from code review
Fix privateNameFieldCallExpression test
Remove unnecessary comment
Fix PropertyAccessEntityNameExpression type
Remove PrivateName from PropertyNameLiteral
Add createPrivateName
Remove PrivateName type from textSourceNode
Add Debug asserts for invalid syntax kinds
Don't output private name syntax when undeclared
Make PrivateName extend Node
Update baselines for public API
Fix completions in language server
Fix fourslash test crash
intern private name descriptions
undo expensive node.name.parent assignment
Back the way things were on `master`: only
assign node.name.parent when we need to
Add tests for private names and JSDoc
Patch hoverOverPrivateName fourslash test
Fix goToDefinition for private-named fields
remove Debug.fail for private name outside class
Remove Debug.fail in binder.ts::`getDeclarationName`.
It turns out this code path *does* get hit (intentionally).
For best error messages, return `undefined` and rely
on the parser generating a good error message
"Private names are not allowed outside class bodies"
Add rbuckton test cases for private names
These test cases specifically exercise where
we needed to use name-mangling. They are
cases where private names have the same
description.
- private names no conflict when inheriting
- private names distinct even when
the two classes have the same name
check dup instance+static private identifiers
class A {
#foo;
static #foo;
}
not allowed because static and private names
share the same lexical scope
https://tc39.es/proposal-class-fields/#prod-ClassBody
refactor getPropertyForPrivateName, rel spans
refactor getPropertyForPrivateName so
it is easier to read (use findAncestor instead
of loop).
Fix bugs in getPropertyForPrivateName:
- make it work with deeply-nested classes with
and without shadowing
- make it catch shadowing when the conflict is
between static and instance
private name descriptions (these can actually
clash)
And add related spans to diagnostics
for getPropertyForPrivateName
catch conflicts between static and instance
private identifiers:
- cannot have an instance and static private identifier
with the same spelling, as there is only one namespace
for private names
rename 'PrivateName' to 'PrivateIdentifier'
to match the change of wording in the spec
prposal:
https://tc39.es/proposal-class-fields/#sec-syntax
The rename in the spec was to avoid confusion
between the AST Node PrivateIdentifier
and the internal spec type PrivateName.
So one uses the [[Description]] of a
PrivateIdentifier to look up the PrivateName
for a given scope.
This corresponds closely to our implementation
in the binder and checker:
- we mangle PrivateIdentifier.escapedText to
get a `key` which we use to get the symbol
for a property
f
getLiteralTypeFromProperty-check privateIdentifier
rename and simplify privateNameAndAny test case
make it clearer that all this test is showing is
that we allow accessing arbitrary private identifiers
on `any`.
Note: we could have something more sound here by
checking that there is a private-named field declaration
in a class scope above the property access.
Discussion:
https://github.com/microsoft/TypeScript/pull/30829/files#r302760015
Fix typo in checker
s/identifer/identifier
remove accidental change
patch fourslash test broken by isPrivateIdentifier
just needed to add a check to see if the symbol
.name is defined
extract reportUnmatchedProperty
per @nsandersn feedback
propertiesRelatedTo was getting to long
pull out the unmatchedProperty reporting into
a seprate function
fix typo in private names test
Fix type soundness with private names
Remove PrivateIdentifier from emit with Expr hint
Fixup helpers and set function name for privates
remove accidentally-committed baselines
These baselines somehow ended up in this pr,
though they have nothing to do with the changes
Revert "getLiteralTypeFromProperty-check privateIdentifier"
This reverts commit bd1155c300bc3517a0543580f4790268f86e473f.
reason: the check for isIdentifier in
getLiteralTypeFromProperty is superfluous because
we do this check in getLiteralTypeFromPropertyName
Update comment in private name uniqueness test 3
I think the comments were not accurate and that we
export the error on `this.#x = child.#x` because:
- private names are lexically scoped: the code in question is not in a
lexical scope under the definition of Child's #x.
- private names are private to their containing class: never inherited
This expected behavior matches that of Chrome Canary and
my understanding of the spec
test private names use before def, circular ref
test private names use before def, circular ref
update diagnosticMessages s/delete/'delete'
per @DanielRosenwasser and @sandersn guidance,
use this style in diagnostic messages:
"operand of a 'delete' operator" (single quotes)
rather than old style:
"operand of a delete operator" (single quotes)
This is for consistency, as we use the new
style in the privateIdentifiers error messages
and it is consistent with our messages about
other operators
incorporate private names early exit feedback
and code style change to use a ternary
instead of if so we can 'const'
require private-named fields to be declared in JS
All fields must be declared in TS files.
In JS files, we typically do not have this requirement.
So special-case private fields, which must always
be declared (even in JS files, per spec)
update debug failure for es2015 private identifier
Co-Authored-By: Ron Buckton <ron.buckton@microsoft.com>
fix checker handling of private name in subclasse
update checker and tests to account for the
following ts features:
- private names do not participate in
the prototype chain, but *are* assigned
in the parent class' constructor. So
parent can access its *own* private fields
on instances of the subclass
Add more tests for private-named fields in JS
add test to hit symbolToExpression w private names
symbolToExpression knows about private names
add a test to exercise this code path
ban private-named static methods (not supported yet)
ban private-named methods (not supported yet)
ban private-named accessors (not supported yet)
fix privateIdentifier fourslash test
change assertion throw to return
Co-Authored-By: Ron Buckton <ron.buckton@microsoft.com>
Update comment in checker.ts re reserved members
Remove case for privateIdentifier in EntityNameExpr
Remove case for privateIdentifier in
EntityNameExpr. That code path is never hit,
and privateIdnetifiers cannot be entity names.
remove unnecessary parentheses
Ban private identifier in enum
As the new test, 'privateNameEnumNoEmit',
shows, the checker now correctly makes
a diagnostic for private identifiers in enums.
However, when noEmit is false we
hit this assertion in the transformer.
This assertion will have to be removed
so that we have a diagnostic here instead
of an assertion error.
When the assertion is removed,
the 'privateNameEnum' baseline
will have to be updated
Fix destructuring assignment, use createCallBinding, remove unneeded helper
Add class private field helpers to external helpers
Remove private identifier enum assertion, use missing identifiers
Fix hash map inefficiency by only using get
Update baselines with empty identifier change
Add privateNameEnum test baselines
Fix private identifier destructuring (array assignment defaults, unique names)
Use createPrivateIdentifierAssignment in destructuring transform
Fix lint error
Separate destructuring target visitor from regular visitor
Fix destructuring assignment with this bindings
Fix destructuring assignment with this bindings
Fix syntax error with destructuring assignment output
Disallow private identifiers in property signatures
remove duplicate test baselines
Add tests for undeclarated private identifiers
remove unnecessary cast
Nicer error message for mis-placed hashbang
Workaround v8 bug with destructured assignments
Optimize private identifier stack lookup
Avoid the cost of performing an array lookup to look at the top of the
private identifier environment stack.
Change function name to be more specific
Changes "getOperatorForCompoundAssignment" to
"getNonAssignmentOperatorForCompoundAssignment" now that this
function is accessible to the entire compiler.
Improve test case for private name assignment
Adds a compound assignment test case for a class with private names
being declared on the left-hand-side of the assignment expression.
Remove extra non-private-field test
Remove isPrivateIdentifierAssignmentExpression helper
Don't transform private names in ESNext target
Preserve private fields initialized to functions
Move function expressions to outer scope for efficiency
Add WeakMap collision check
Modify potential WeakMap collision condition
Fix this property assignment binding with private names
Add correct error message for WeakMap collision
Add error for statements before super with private identifiers
Refactor getPropertyForPrivateIdentifier
Add test for private identifier fields initialized to class exprs
Fix shebang errors
Fix private errors on index signatures
Add codefix for missing private property
Update error messages for unsupported private features
Fix inheritance-related errors
Fixes inheritance-related errors with private identifiers by resolving
properties from base classes. Private identifiers do not show up as
properties on a union type, so those do not type-check.
Add test for interface extending class with private access
Remove debugging log
Remove name assignment from private named functions
Rename to getPrivateIdentifierPropertyOfType
Fix index signature test comment
Fix test target syntax error
Change error messages
patch private identifiers outside class bodies
Add test for private identifier with ooo super
Add test for a class with a private identifier
with a non-preambly (for example, not a comment)
statement before 'super':
should error, saying 'super' must come first
Fix nits
incorporate PR feedback
Incorporate checker feedback
- reorganize if statements in checkFunctionOrConstructorSymbol
- remove overload for getPrivateIdentifierPropertyOfType
reorganize if statements in checkFunctionOrConstructorSymbol
test for private names with JSX
use getPropertyOftype in getPropertyForPrivateIdentifier
getPrivateIdentifierPropertyOfType error on synthetic
make getPrivateIdentifierPropertyOfType error
if given a node that is not from the parse tree
Simplify checkPrivateIdentifierPropertyAccess
use getPropertiesOfType instead of
rehashing that logic
test for private identifiers w decl merging
fix test target for privateNameDeclarationMerging
update baselines
Fix private identifier ++/-- numeric coercion
Remove 'downleveled' from super error
Fix bad comments in helper call emit
Error on private identifiers in JSX tag names
Add more private identifier tests
Add es2015 target for private name destructured binding test
Add privateNameConstructorSignature test
Add test for navigation bar w private identifier
Remove spurious line from test
// in js file
class A {
exports.#foo = 3; // should error
}
The above line failed to produce an error
when run using the test harness.
When using tsc or the language server,
we got the expected error message.
Removing the troublesome line, as it
seems to say more about the test runner
than about the code it is testing.
Fix inefficient constructor generation
dts: don't emit type for private-identified field
Do not emit types for private-identified fields
when generating declaration files.
// example.ts
export class A {
#foo: number;
}
// example.d.ts
export declare class A {
#foo;
}
**This is not ideal!**
The following would be better:
// example.d.ts
export declare unique class A {
#foo;
}
See discussion:
https://github.com/microsoft/TypeScript/pull/33038#issuecomment-530321165
notice when private-identified field unused
Notice when private-identified fields are unused,
and implement the same behavior as for unused
private-modified fields.
This is used in the language server to make things
grayed out.
This case generates an error when --noUnusedLocals
flag is passed to tsc:
- "<name> is declared but never used"
accept baselines
Revert "dts: don't emit type for private-identified field"
This reverts commit e50305df5fb88121486291abad14478f5339a455.
Instead of just excluding the type from private identifier
emit, only emit a single private identifier
per class.
This accomplishes nominality while
hiding implementation detail that
is irrelevant to .d.ts consumers
only emit a single private identifier in dts
In dts emit, emit at most one private identifier,
and rename it to `#private`.
refactor getPrivateIdentifierPropertyOfType
- safer check for wehther is parse tree node
- return undefined when not found (instead of
a Debug.fail)
Incorporate PR feedback
Don't rely on parent pointers in transform
Passes context about whether the postfix unary expression value is
discarded down the tree into the visitPostfixUnaryExpression function.
Remove orphaned test baseline files
remove unreachable if
Check `any`-typed private identified fields
Update private identifier incompatible modifier checks
- disallow 'abstract' with private identifiers
- s/private-named-property/private identifier
Add additional call expression test cases
Fix disallow 'abstract' with private identifier
Static private identifiers not inherited
Including this in the PR for private
instance fields even though static
private identifiers are banned.
Reason: this change
improves quality of error messages,
see test case.
Thanks Ron!
Simplifiy private identifier 'any' type handling
Error on private identifier declarations for ES5/ES3
Bind `this` for private identifier property tagged template literals
Fix target for jsdocPrivateName1 test
Update getPrivateIdentifierPropertyOfType API
Make it easier to use by accepting a string
and location, rather than a PrivateIdentifier.
Thanks Ron!
remove orphaned tests
rename test
remove duplicate tests
Remove unrelated error from test
update diagnostic message 'private identifier'
The nodes for hash private fields are now
called 'private identifier'. Update one last
diagnostic message to use the new terminology.
refine solution for static private identifier fields
- use `continue` instead of `filter` for perf
- better naming
- make it clear the current solution will
need to be altered when we lift the ban on
static private identifier fields, including
a test case that should change in the future
Fix display of private identifiers in lang server
Fix bug where private identifiers in completion
tooltips in the playground were showing up
as the symbol table entries (with underscores and such).
https://github.com/microsoft/TypeScript/pull/30829#issuecomment-534157560
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* fix privateIdentifier w !useDefineForClassFields
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* Disallow PrivateIdentifier in Optional Chains
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* restrict privateIdentifier completions correctly
Don't autocomplete privateIdentifiers in
places where they are not allowed.
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* make PrivateIdentifier not a PropertyNameLiteral
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* Added test.
* Accepted baselines.
* Update symbol serializer to understand private fields in JS `.d.ts` emit.
* Accepted baselines.
* fix for private field no initializer esnext
Signed-off-by: Max Heiber <max.heiber@gmail.com>
* fix private fields .d.ts emit for JS w expando
fix bug where the following in a JS file
would lead to a `#private` in the .d.ts:
```js
class C {
constructor () {
this.a = 3
}
}
```
Co-authored-by: Joey Watts <joey.watts.96@gmail.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Add support for Call Hierarchies in language server
* Use baselines for callHierarchy tests
* Clean up commented code
* Support multiple hierarchy items when an implementation can't be found
* Use optional chaining in a few places
* Use getFileAndProject
* Add ignoreInterpolations util to fourslash for fuzzy diagnostic matching
* Simplify
* It’s not Swift
* Fix regexp
* Remove unnecessary type assertion
* Test
* Handle import type node when handling the namespace import and reexport
Fixes#33017
* Handle qualifier of the importTypeNode
* Handle export specifier
* Fix rename prefix when search for rename starts at qualifier in import type ndoe
* Fix rename of qualifier with importType node when invoked without provideSuffixAndPrefix option
* Fix up quotation marks in error messages in JavaScript files.
* Accepted baselines.
* Typescript -> TypeScript
* Accepted baselines.
* Migrate syntactic diagnostics tests to baselining tests.
* Accepted baselines.
* Update diagnosticMessages.json
* Removed markers.
* Add ability to baseline both semantic and syntactic diagnostics.
* Fix up broken diagnostics when using a server LS.
* Accepted baselines.
* Lints.
* Fake up sourcefile objects in the tsserver session client instead.
* Fewer allocations.
* Add preceding semicolon on await insertion when parentheses are included
* Just start with precedingToken
* Fix semicolon formatter regression
* Delete test with debatable expected behavior
* Lint after control flow changes
* Use empty object for invalid package json contents instead of undefined
Fixes#34726
* Behave as if package json doesnt exist in case of invalid json in package json
* Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments
Fixes#32487
* Update src/services/formatting/smartIndenter.ts
Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* global module:Fix crash when exporting+aliasing globalThis
* Fix another globalThis crash
find-all-refs assumed that an export inside a `declare x` was always an
ambient module, but it is not -- `declare global` does not allow
`export`, so find-all-refs shouldn't return any refs for this error case.
* Add test
* Auto-import instead of using ImportTypeNodes
* Write more tests and fix namespace case
* Remove unused enum memmber
* Update API baselines
* Lint
* Style nits and util consolidation
* Fix binding well-known symbols by element access
* Add navigationBar test
* Revert settings.json change
* Accept baselines
* Actually make it bind
* Accept API baselines
* Dont use internal name in API
* migrate nullish coalescing commit
* add more test case
* add branch type check test
* add more tests
* fix nullish precedence
* update public api
* add rescan question question token to fix regression
* update public api baseline
* Added tests that emit for nullish coalescing operator conforming with grammar restrictions when assertions are used.
* Fixed emit to hoist temporary variables (they previously went undeclared).
Added tests to ensure calls and property accesses are only called once.
* use not equal to null
* rename factory
* add grammar check
* fix more cases
* Fix handling of nullish coalescing oprator in expando objects.
* Fixed classifier to support ?? operator.
* update baseline
* accept baseline
* fix review
* update emitter and more testcase
* update control flow
* make linter happy
* update libs
* avoid unnecessary assert
* fix typooo
* Fixes for control-flow analysis
* Start enabling element access special assignment
* Treat element access assignment as special assignment in JS
* Make declarations for bindable element access expressions
* Fix navigationBar crash
* Add multi-level test for JS
* Propagate element access expressions to more code paths
* Fix property access on `this`
* Add quick info test
* Uhhh I guess this is fine
* Fix module["exports"] and property access chained off element access
* Add test for this property assignment
* Add test for and fix prototype property assignment
* Fix teeeest???
* Update APIs
* Fix element access declarations on `this`
* Fix go-to-definition
* Add declaration emit to tests
* Reconcile with late-bound symbol element access assignment
* Fix baselines
* Add JS declaration back to tests
* Fix JS declaration emit of non-late-bound string literal property names
* Revert accidental auto-format
* Use `isAccessExpression`
* Add underscore escaping member to test
* Fix and test navBar changes
* Add support for Optional Chaining
* Add grammar error for invalid tagged template, more tests
* Prototype
* PR feedback
* Add errors for invalid assignments and a trailing '?.'
* Add additional signature help test, fix lint warnings
* Fix to insert text for completions
* Add initial control-flow analysis for optional chains
* PR Feedback and more tests
* Update to control flow
* Remove mangled smart quotes in comments
* Fix lint, PR feedback
* Updates to control flow
* Switch to FlowCondition for CFA of optional chains
* Fix ?. insertion for completions on type variables
* Accept API baseline change
* Clean up types
* improve control-flow debug output
* Revert Debug.formatControlFlowGraph helper
* Support some late-bound special property assignments
* Integrate PR feedback
* PR feedback
* Enable declaration on core tests
* Specialize type of binary expression used for late binding, speculative fix to navigation bar, merge check and type for elem/property accesses
* Add test showing current nav bar behavior (specifically the lack thereof)
* Move package.json related utils to utilities
* Add failing test
* Make first test pass
* Don’t filter when there’s no package.json, fix scoped package imports
* Use type acquisition as a heuristic for whether a JS project is using node core
* Make same fix in getCompletionDetails
* Fix re-exporting
* Change JS node core module heuristic to same-file utilization
* Remove unused method
* Remove other unused method
* Remove unused triple-slash ref
* Update comment
* Refactor findAlias to forEachAlias to reduce iterations
* Really fix re-exporting
* Use getModuleSpecifier instead of custom hack
* Fix offering auto imports to paths within node modules
* Rename things and make comments better
* Add another reexport test
* Inline `symbolHasBeenSeen`
* Simplify forEachAlias to findAlias
* Add note that symbols is mutated
* Symbol order doesn’t matter here
* Style nits
* Add test with nested package.jsons
* Fix and add tests for export * re-exports
* Don’t fail when alias isn’t found
* Make some easy optimizations
* Clean up memoization when done
* Remove unnecessary semicolon
* Make getSymbolsFromOtherSourceFileExports pure
* Cache auto imports
* Revert "Cache auto imports"
This reverts commit 8ea4829587.
* Handle merged symbols through cache
* Be safer with symbol declarations, add logging
* Improve cache invalidation for imports and exports
* Check symbol presence first
* Only run cache invalidation logic if there’s something to clear
* Consolidate cache invalidation logic
* Fix reuseProgramStructure test
* Add more logging
* Only clear cache if symbols are different
* Refactor ambient module handling
* Start caching package.json stuff
* Support package.json searching in fourslash
* Move import suggestions cache to Project
* Start making more module specifier work available without having the importing file
* Going to backtrack some from here
* Get rid of dumb cache, fix node core modules stuff
* Start determining changes to a file have invalidated its own auto imports
* Move package.json related utils to utilities
* Add failing test
* Make first test pass
* Don’t filter when there’s no package.json, fix scoped package imports
* Use type acquisition as a heuristic for whether a JS project is using node core
* Make same fix in getCompletionDetails
* Fix re-exporting
* Change JS node core module heuristic to same-file utilization
* Remove unused method
* Remove other unused method
* Remove unused triple-slash ref
* Update comment
* Refactor findAlias to forEachAlias to reduce iterations
* Really fix re-exporting
* Use getModuleSpecifier instead of custom hack
* Fix offering auto imports to paths within node modules
* Rename things and make comments better
* Add another reexport test
* Inline `symbolHasBeenSeen`
* Simplify forEachAlias to findAlias
* Add note that symbols is mutated
* Symbol order doesn’t matter here
* Style nits
* Add test with nested package.jsons
* Fix and add tests for export * re-exports
* Don’t fail when alias isn’t found
* Make some easy optimizations
* Clean up memoization when done
* Remove unnecessary semicolon
* Make getSymbolsFromOtherSourceFileExports pure
* Cache auto imports
* Revert "Cache auto imports"
This reverts commit 8ea4829587.
* Handle merged symbols through cache
* Be safer with symbol declarations, add logging
* Improve cache invalidation for imports and exports
* Check symbol presence first
* Only run cache invalidation logic if there’s something to clear
* Consolidate cache invalidation logic
* Fix reuseProgramStructure test
* Add more logging
* Only clear cache if symbols are different
* Refactor ambient module handling
* Finish(?) sourceFileHasChangedOwnImportSuggestions
* Make package.json info model better
* Fix misplaced paren
* Use file structure cache for package.json detection when possible
* Revert unnecessary changes in moduleSpecifiers
* Revert more unnecessary changes
* Don’t watch package.jsons inside node_modules, fix tests
* Work around declaration emit bug
* Sync submodules?
* Delete unused type
* Add server cache tests
* Fix server fourslash editing
* Fix packageJsonInfo tests
* Add node core modules cache test and fix more fourslash
* Clean up symlink caching
* Improve logging
* Function name doesn’t make any sense anymore
* Move symlinks cache to host
* Fix markFileAsDirty from ScriptInfo
* Mark new Project members internal
* Use Path instead of fileName
* Rename AutoImportSuggestionsCache
* Improve WatchType description
* Remove entries() from packageJsonCache
* Fix path/fileName bug
* Also cache symlinks on Program for benefit of d.ts emit
* Let language service use Program’s symlink cache
* Support template literals in enum declarations
* Support template literals in const enum access
* Support template literals in swith with typeof narrowing
* Support template literals in element access discriminant
* Support template literals in ambient module declaration
* Unify symbols for template literals in computed properties
* Unify expression position checks for template literals
* Support template literals in rename and find all references
* Mark computed properties with template literals as write access
* Inline startsWithQuote
* Allow allowJs and declaration to be used together
This intorduces a new symbol-based declaration emitter - currently this
is only used for JSON and JavaScript, as the output is likely worse than
what the other declaration emitter is capable of. In addition, it is
still incomplete - it does not yet support serializaing namespaces.
* Add tests for various import/export forms, add notes on export as namespace and fix export * from
* Tests & fixes for computed names
* Add test with current @enum tag behavior
* fix declaration emit for jsdoc @enum tags
* Small adjustments to base class serialization to fix bugs in it
* Guard against type/type parameter confusion when using typeParameterToName a bit
* Integrate feedback from PR
* Fix issue with export= declarations visibility calculation and type declaration emit that impacted all forms of declaration emit
* Only make one merged getCommonJsExportEquals symbol for a symbol
* Support preserving type reference directives in js declarations
* Skip declare mdoifiers for namespace members in ambient contexts
* FAKE ALIASES AND NAMESPACES EVERYWHERE
* Dont do namespace sugar when type members contain keyword names
* Fix json source file export modifier under new output
* Such clean nested aliasing, very wow
* Fix lint
* Add visibility errors, reuse type nodes where possible
* Suppoer having correctly named import types in bundled js declaration emit & adjust binding to allow namespaces with aliases to merge when the aliases look to be type-only
* Better support for module.exports = class expression
* Fix discovered crash bug
* Allow export assigned class expressions to be reachable symbols from external declarations
* Add missing semicolon
* Support @enum tag post-merge
* preserve comments on signatures and declarations where possible
* Basic support for js classy functions
* Add example we should do better with
* Prototype assignments make things a bit wonky, but the example from the PR seems OK
* Make a ton of changes to support the new way js classes are bound
* Remove some old comments, fix import and export default names
* Fix bug in object define handling and add tests for object define property declaration emit
* Fix organization nits from PR comments
* Preserve comments from jsdoc declarations on properties and js declaration type aliases
* Merge export declarations with identical specifiers
* Remove completed TODO comment
* Split lint
* Remove now-unused function
* PR feedback
* Add some project references tests, remove some checks from project refs codepaths that are now invalid
* Update project references tests again
* Merge and update project references tests
* Rename case
* Update test to include declaration output
* Remove yet another project refernces redirect extension check
* Update comment
* Add additional import ref to test
* Add shorthand prop to test
* Fix comment text
* Extract var to temp
* Simplify function and add whitespace
* Update project refs test to use incremental edit entry
* Stylistic refactors in the symbol serializer
* Another round of PR feedback, mostly style, small bugfix with constructors, and test showing bug in export assigned class expression name shadowing
* Use x instead of index
* Disallow property/accessor overrides
Unless the base property or accessor is abstract
* Disallow uninitialised property overrides
This causes quite a few test breaks. We'll probably want to revert many
of them by switching to the upcoming `declare x: number` syntax.
* Updates from design review + fix ancient bug
1. Don't error when overriding properties from interfaces.
2. Fix error when overriding methods with other things. This had no
tests so I assume that the code was always dead and never worked.
* Need to add a couple of errors and squash one
Will update after checking out other branch for a minute
* Everything works so far
Need to test properties initialised in constructor
* Check for constructor initialisation
* change error wording
* Improve error wording
* Add codefix to add missing 'declare'
* Always emit accessors in .d.ts files
* Allow 'declare' on any uninitialised property decl
* Undo code moves
* Let sleeping dogs lie
* Correctly set NodeFlags.Ambient
And simplify redundant parts of check.
* Remove more unneeded code
* Update baselines
* Update baselines
* Update baselines
* Ignore this-property assignments
* Fix base-in-interface check
* Do not error when base parent is interface
* Fix base interface check
* Add missed baselines
* Fix check
* Fix new errors in services
* Fix new errors in services
* Fix errors in testRunner
* Add flag and turn off errors when on
* Structure of new emit is correct, fake content
It is 'hi'.
* Basically right emit
* Fix one last unitialised property declaration
* Haha no I missed another one
* Fix whitespace back to CRLF
* Minor fix and code cleanup
* New test case
* Fix bug in isInitializedProperty
* Updates from design meeting.
1. Change flag name to useDefineForClassFields (and flip polarity).
2. Forbid ES3 + useDefineForClassFields (since there is no
defineProperty).
3. Forbid overriding an abstract property-with-initializer with an
accessor.
* Update baselines
* Object.defineProperty for methods too
Using code from Ron from his upcoming refactor of the factory functions.
* Update slow baselines
* Improve error message
* Update src/compiler/transformers/utilities.ts
Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>
* Add test of computed properties
* Remove done TODO
* Add UserPreferences for semicolons
* Prototype formatter semicolon removal
* Implement semicolon insertion
* Fix existing tests
* Start adding tests
* Fix some edge cases of semicolon deletion
* Fix semicolon removal before comments
* Fix indentation
* Test on checker
* Replace semicolon-omitting writer with formatter preference
* Fix writing new nodes, update protocol
* Rename option
* Really fix formatting synthetic nodes
* Fix refactoring misses
* Un-update submodules gahhhh
* Update APIs
* Update for ESLint
* Revert accidental test change
* De-kludge deduplication of EOF processing
* Omit last element semicolon from single-line object-like types
* Revert "Omit last element semicolon from single-line object-like types"
This reverts commit 5625cb0237.
* Fix straggler test
* Add test for leading semicolon class members
* Rename a lot of stuff for clarity
* Invert some boolean logic
* show more items in navbar
* fixed missing node kind for property assignments
* updated navBarNestedCommonJsExports test
* updated navigationBarMerging_grandchildren test
* updated navigationBarItemsFunctions test
* updated navigationBarAnonymousClassAndFunctionExpressions test
* updated navigationBarFunctionIndirectlyInVariableDeclaration test
* updated navigationBarInitializerSpans test
* updated navigationBarItemsPropertiesDefinedInConstructors test
* updated tests
* change nav icon for properties with function-like initializers
* add test case for binding element with function-like initializer
* add navigationBarNestedObjectLiterals test
* add navigationBarFunctionLikePropertyAssignments test
* made some silly names less silly (?)
* added SpreadAssignments and ShorthandPropertyAssignments
* new wording for primary menu items
`Number.MAX_SAFE_INTEGER` is `2 ** 53 - 1`, so anything greater than that is a 'dangerous' integer to store as a traditional number. This adds a codefix to suggest converting them to a `bigint` literal.
* Changed outlining to better outline ES5 classes (functions assigned to prototype)
* Changed outlining to better outline ES5 classes (properties assigned to functions)
* Fixed some small bugs when merging es5 class nodes. Added tests for new es5 class outline.
* Added support for interlaced ES5 classes (where an ES5 class's members are mixed with other declarations).
* Fixed crash in outline when assigning {} to the prototype.
* Added support for nested es5 declarations.
* Added support for prototype assignment for es5 classes.
* Add test case
* Fix infer from usage property assignment
Property assignment and shorthand property assignment were incorrectly
treated differently; both have ObjectLiteralExpression as a parent, but
the code previously assumed that property assignments had
ObjectLiteralExpression as parent.parent.
Also make fourslash directives case insensitive and less whitespace
sensitive.
* Add "incorrect 3-slash" error to fourslash parsing.
It was overly permissive and ended up making a mess of C#-style
comments:
`/// <summary>Text</summary>`
Now it checks the element name. Attribute names remain unchecked.
* Improve codeFixAll for add missing await
* Improve add missing await for initializers and fix-all
* Fix when only one side of a binary expression can have its initializer fixed
* Initial implementation
The original test passes but I haven't run any other tests yet, so I
assume the world is now broken.
* Append constructor function construct sigs
Instead of overwriting them
* Grab bag of improvements.
1. Mark @class-tagged functions with Class too.
2. Only gather local type parameters of constructor functions.
3. Remove getJSClassType calls with getDeclaredTypeOfSymbol.
4. Add a couple more failing tests.
getDeclaredTypeOfClassOrInterface now needs to understand prototype
assignment. That's next, I think.
* Prototype assignments work now
1. Binder marks prototype assignments as Class now.
2. Checker merges prototype assignments using the same merge code as for
functions and their declarations. No more intersections.
Many fewer failing tests now.
* Mark prototype-property assignments as Class
Even if there are no this-property assignments in them. (Then why are
you using a class?).
* Simplify getJSClassType, remove calls to its guts
It's probably not needed because now it's just a conditional call to
getDeclaredTypeOfSymbol, and I think most callers already know whether
they have a JS constructor function beforehand.
* isJSDocConstructor doesn't need to check prototype anymore
Because all the properties are merged during getDeclaredTypeOfSymbol.
* outer type parameter lookup follow prototype assignment
* this-type and -expression support in ctor funcs
Pretty cool!
* Fix remaining tests
* Fix minor lint
* Delete now-unused code
* Add class flag to nested class declarations
Also remove old TODOs
* Add failing tests
* Use default import or namespace import for import fixes when compiler options allow
* Don’t do import * for export=, ever
* Only do import default for export equals if nothing else will work
* Never do import/require in a JavaScript file
* Update tests for changes in master
* Add const/require fix for JS and select based on usage heuristic
* Fix JS UMD import
* Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum
* Actually include an @enum tag as a declaration
* Add enum tag refs into a couple more syntax kind lists
* accept symbol baseline update