* Minor fixes to convertToAsync
* Back out on nested return in inner continuation
* Baseline update
* Verify type argument for call can be used, add a few more early exit shortcuts
* don't include literals from enum members in completions
* add enum symbol to completions test
* use symbol flags for detecting enum member
* use type flags to check for enum member
* fix test
* Simple first version
Doesn't cover or test any complicated variations.
* Lots of cases work
Destructuring does not. But
- skipping node_modules and lib.* does.
- call expressions does
- property access, including with private identifiers, does
* Support variable declarations, property assignments, destructuring
As long as it's not nested
* More cleanup
* skip all d.ts, not just node_modules/lib
* Offer a codefix for a lot more cases
* remove incorrect tuple check
* Use getSymbolId instead of converting to string
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* add test + switch to tracking number symbol ids
* Address PR comments
* Exclude tuples from suggestion
* Better way to get error node
Plus add a check that errorNode is an argument to the call, not the
call's expression.
* fix semicolon lint
* fix another crash
* Simplify: add undefined to all optional propertie
whether or not somebody tried to assign undefined to them in the
erroneous assignment
* remove fix-all
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
When a class declaration lacks a name, don't throw an exception when
producing the display parts (e.g. for QuickInfo).
Remaining issues:
1. The name shows as "__missing", the name of the underlying symbol,
rather than "(Missing)", as it is for the corresponding function
declaration case (because the parse constructs a missing identifier
node for the function declaration).
2. "(Missing)" is hard-coded, rather than being a localizable resource
string.
3. When an anonymous class declaration is a default export, the
corresponding symbol is named "default", resulting in the confusing
display string "class default".
Since display parts are built using existing `symbolToString`
functionality, it wasn't clear whether detecting special symbol names
and replacing them with user-friendly strings could be done without
breaking other functionality.
Similarly, changing the shape of the parse tree seemed riskier than the
problem justified (the user experience is just not getting QuickInfo for
the incomplete declaration, which seems acceptable).
Make it backslash-escape backticks too. While I was there, remove the
use of this function for the text (which was the earlier confused
version that used only `text`), and rename it as
`escapeRawStringForTemplate` to clarify.
Added a test to the preivious pile of tests.
Fixes#45278.
* Fix getting completion details for meta properties.
* Move inside the worker.
* Move ImportMeta handling to completions.ts
* Fix property type name for new.target.
* Use symbols for ImportMeta completions.
* Accept baselines.
* Revert lib change.
* Revert needless parser change.
* Missed these reverts.
* Remove now unused `isMetaPropertyExpression`
* Move up meta property keyword check to be done in `getSymbolAtLocation` and `getTypeOfNode`
* Call `checkNewTargetMetaProperty` directly and handle when it's an error type.
* Make meta property expression types synthetic.
* Make event.target and import.meta properties readonly
* Add a test for go to definition (I think?)
* Copy built-in types/values test for go to definition.
* Add tests for go to definition when not a module.
* Fix "go to definition" for new.target
* Do not classify Infinity and NaN. Fixes#42022
* Internally expose so that the classifier can use it
* Increase the test complexity, and revert the type-checker
* Drop the -Infinity
Co-authored-by: Orta <git@orta.io>
* Ensure all `SortText` entries have the same length.
* Update Baselines and/or Applied Lint Fixes
* Update the exact same enum to the exact same values in fourslash. 🙄
* Make `SortTextId` a const enum, switch to use an explicit offset in `SortTextId`.
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Fix getChildCount/At methods in EndOfFileTokens
Before, they were hardcoded to return `0` and `undefined!`, respectively, but that is inaccurate for `EndOfFileToken`s with attached jsdoc.
* Add tests for getChild* methods on EndOfFileTokens
Instead of letting `createTemplate*` generate a broken raw string from
the cooked one, grab the source code for it.
Also, add a missing bit to `\`-quote `$`s. As the comment in the code
says, it could just `\`-quote `${` since other `$`s are valid, but I
think that it's less confusing to always quote $s (but the change is in
the comment if minimalism is preferred).
Also, a small-but-confusing bug in `getCookedText()`.
Many tests for all of this.
Fixes#40625