* Simplify or optimize regexes with polynomial time worst cases
* PR feedback & cleanup
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
* Use builtin scanner function for checking whitespace in fallback method (its faster)
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
* Ensure static index signatures have an errorNode available
* Lookup static index signature declarations in the right symbol table, stop checking prototype props
Previously, changes to the wiki would get merged to the public repo in a
once-a-week action. This significantly revises this, making the two
sides be mirrors (up to the few seconds it takes to do a merge).
This is driven by a minimal-ish yaml file in both sides (`TypeScript`
and `TypeScript-wiki`) that *always* works from the script in the public
repo.
The two action specs are nearly identical, but there are some differences:
- On the main repo, trigger on a `gollum` event, and in the wiki repo
the usual (pushes, schedule, manual). (The schedule run is kept as
a just-in-case, and it's now running twice a week.)
- The filename is `sync-wiki` on the TS side and just `sync` in the
wiki. (Good to avoid confusion if both files somehow find
themselves in the same neighborhood.)
- The secret names are different since I used the name that already
exists in each side.
The script does *not* start with a checkout of its repository. Doing
this in the TS side would be redundant (it would get the TS tree) and
slow. Instead, it's always cloning the public wiki repo (`DASHREMOTE`,
since its url is `.../TypeScript-wiki`) and then fetching into it the
repo of the rendered wiki (`DOTREMOTE`, with a `.../TypeScript.wiki`)
url.
Also revised the README, since they should always be mirrored with this
change, and therefore there is no "source of truth".
* Add @linkcode and @linkplain tags
They are just like @link tags but request fixed-width and normal
presentation, respectively.
Fixes#43935
* revert JSDocComment -> JSDoc SyntaxKind rename
* update API baselines
* fix lint
* Kick out of normalizePath if there's nothing to do
...using `relativePathSegmentRegExp`.
Bonus: use a regex to handle "/./" to avoid splitting and joining in a
common case.
When building the compiler, for example, it looks like ~95% of arguments
to `normalizePath` do not require any normalization.
* Check normalization before and after . cleanup
* Also cleanup leading ./
* support QualifiedName when narrowing inside loops
* add test
* narrow more qualified names
* handle `undefined` of `getFlowCacheKey `
* update comments in test
* Make normalizeSlashes a no-op there are no bad slashes
On Windows, there will probably be a negligible slowdown, iterating over
the pre-slash prefix of each unnormalized path (though we might come out
ahead if paths are normalized more than once).
On *nix, this saves work - 1.8s -> 0.4s in the project I'm
investigating.
* Reuse already-computed index
* Everything mostly works
A couple of mixed, nested references don't work yet.
The scanner+parser interaction is wrong, the parser consumes one too
many spaces, and the checker+services code needs a little cleanup.
* Cleanup
1. I decided that correctly parsing a#b.c, an entity name containing an
instance reference, is not worth the work.
2. I made the scanner, at least the jsdoc part, emit a # token, and
provided a reScanPrivateIdentifier in order to convert #a to # a.
3. I cleaned up the code in the checker.
2. Unrelated: I added a missing space in linkPart display.
* Cleanup lint + var naming
* investigate+clean up a couple of TODOs
* Fix lint in utilities.ts
* change name to JSDocMemberName
* address PR comments
* Private identifiers use standard identifer scanning
Previously they used an old copy of the identifier scanning code that
didn't handle extended unicode yet.
* gotta fix that const lint
* First draft
Everything works, the error messages for unmatched opening elements
could still use improvement, plus there is tonnes of unused and ugly
code.
1. Make sure the parser can recover from all kinds of unclosed tags.
2. Improve the parse tree for unmatched opening tags.
3. Better errors at some point.
* Lots of cleanup
* Improve readability of construction/fix lint
* improve line-length formatting
like `MapConstructor`, `WeakMapConstructor` should support receiving `Iterable<readonly [K, V]>` instead of `Iterable<[K, V]>`; otherwise tuples creates with `as const`, etc. cannot be safely passed in without casts, etc.
This code looks strange, like there's a typo in it (eg, using `lists` in
the `parameterList` loop, etc) -- so I also refactored it a bit to look
more intentional. The new format makes it clearer that `lists` is
checked once *outside* the loop, as well as the role of
`hasEffectiveRestParameter`.
The actual bug fix is checking `pList.length` in the new `isVariadic()`.
Fixes 41059.
* Test normal char code array for source mappings
* Limit buffer size, minor performance tweaks
* Always commit at exactly chunk size
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
* Cache accessibe symbol chains, type parameter name generation
* Move signature declaration helper length approximation to start of function
* Add node result caching internal to `typeToTypeNodeHelper`
* Suggestion from PR
The [String.raw spec](https://tc39.es/ecma262/#sec-string.raw) uses just
the `raw` property of its first argument, which is a useful way of using
it in user-defined tag functions to do the work of interleaving strings
and values as well as converting the values to strings.
Fixes#43609.