* Fix master: handle generating type name for late bound dupe message more nicely
* Make literal type casts more specific in many places to better reflect the checks performed
A custom `SourceMapSource` can optionally provide its own `skipTrivia`
function. If this is not provided then the compiler will use the default
function designed for TypeScript source files.
Previously, when calling this default function we were passing the current
`sourceMapSource` rather than the specified `source` whose trivia needs
to be skipped. This resulted in the `pos` being incorrectly calculated for
external source files that need mapping.
**Side note:**
There are actually two possible constructors available for creating
`SourceMapSource` objects. One of them defaults to an identity function
for the `skipTrivia` function if it is not provided (see
https://github.com/Microsoft/TypeScript/blob/49689894d747714d6b2b8461b9033020efec9625/src/compiler/utilities.ts#L6972-L6976)
and the other one leaves the `skipTrivia` field `undefined` (see
https://github.com/Microsoft/TypeScript/blob/5fc8f1dd801dbacfe7e2d624f80b7a6a3868d180/src/services/services.ts#L776-L797)
Unfortunately, it appears that the second of these two constructors is the
one available when importing the "typescript" module in node.js code.
* Add user preference to control renaming through exports
* Only impact renaming
* Update baselines
* Use flag to control all prefix and suffix text and imports
* [WIP] add tests
* Only skip export import specifier with flag
* [WIP] Update tests
* Update test
* Pick up preference from host and update test
* Shorten flag name
* Add missing utility function
* Update comment
* [WIP] rename flag and respond to cr
* [WIP] Add flag for forRelatedSymbol
* Use larger search symbol set for old-style rename
* Respond to CR
* Fix small error
* Fix type mismatch
* Update comment and remove unnecessary exprot
* Respond to CR
* Heavy WIP, but has good contextual typing fix
* Add arity error, refine messages and spans
* Small error message change
* Better error messages, text-specific message
As for syntax-only servers, we can't meaningfully report open-file
telemetry for projects with disabled language services.
Hopefully, a deeper fix will follow, but this solves the immediate
problem that VS disables the LS for all projects when it sees a failure
in applyChangedToOpenFiles (because it assumes the server state is
corrupt).