* Initial scribbles
* Compiles but provides spans instead of location pairs
Probably need to fork the services/server types and provide a conversion
with Session.toFileSpan. Not sure where to put the conversion.
* Switch to DocumentSpan
In theory this is already better supported, but not sure practise bears
that out.
* Builds w/protocol types + conversions
* cleanup:better names and scrub TODOs
* fix test harness too
* Misc
1. Simplify protocol after talking to @mjbvz.
2. Add more tests.
3. Initial notes about where to add parsing.
* Parse and store links in the compiler
The text of the link is still stored in the comment text, but that's now
kept in an object instead of just a string. Each link has the parse for
the entity reference, if there is one.
Needs lots more tests -- this just makes all the existing jsdoc tests
pass.
* more tests and some fixes
* Fix other failing tests
* fix bad merge
* polish parser
* improve names and array types
* slight tweaks
* remove some done TODOs
* more tests + resulting fixes
* add+fix cross-module tests
* Support `@see {@link`
Plus find-all-refs support equivalent to @see's.
* add server test
* Make comments actually part of the AST
* Add span for link.name in language service/protocol
* Make checker optional in getJSDocTags
Also change to JSDocCommentText from JSDocCommentComment
* Use getTokenValue instead of getTokenText
Measure twice, slice once
* Add missing support for top-level links
The language service and protocol were missing support for top-level
links. This commit adds that plumbing.
* add string back to comment type in node constructors
* Full parse of link tags and jsdoc comment text
- Doesn't pass fourslash yet, I'm going to switch to baselines for
failures there.
- Still needs some work on the protocol to convert file+offset to
file+line+offset.
* fix lint
* Fix missing newlines in inferFromUsage codefix
* Parse jsdoc comments as text node/link array
And switch to line+character offsets in the protocol
* Fix fourslash tests
Mostly ones that can't be baselined, but I switched a couple more over
to baselines
* Improve types and documentation
* Test+fix @link emit, scrub other TODOs
* update API baselines
* test that goto-def works with @link
* Split link displaypart into 3
One for link prefix and suffix, one for link name, and one for link
text.
* update baselines
* Provide JSDocTagInfo.text: string to full clients by default
Instead of upgrading them to displayparts.
* Real server tests
* Disambiguate {@link} and @param x {type}
They are ambiguous; previously the parser preferred the type
interpretation, but will now look ahead and parse links instead when the
prefix is `{@link`.
* Add explanatory comment in test
* fix location in richResponse in protocol
* update API baseline
* Address PR comments
1. Add a cross-file goto-def test.
2. Switch from per-message args to UserPreference.
* use arraysEqual from core
* Test update
* Use source file version as default signature for the file whenever there is no dts emit for the file
* json source files from project reference should be able to calculate the signature
* Dont emit declaration map when emitting dts files for force emit for signature
* Use ids as 1 based so we can specialize `0` to be some special meaning
* Baseline tsbuildinfo size in the readable baseline
* Baseline fileName and fileNames list as well in readable tsbuildinfo so that new additions are easy to recognize
* Finally add that missing relationship allowing a type to be assignable to both branches of a conditional
* Explicitly write out Ternary.Maybe
* Add slightly modified example from #25413
* fix sick sentence
* Loosen check to skip false branch constraint check to consider `infer` parameters as always satisfied in the extends clause
* Simplify things a bit, only instantiate once
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Fix property name bindings for class expr in loops
* Fix block-scope capturing with prop initializers
Co-authored-by: Joey Watts <joey.watts.96@gmail.com>
* Add a test for JSX namespace lookup with `jsx: preserve, jsxImportSource`
* updated baselines
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Accept generics for defineProperty
Both `Object.defineProperty()` and `Object.defineProperties()` return their
first argument. Use a generic so that typings can be passed through.
* Update baselines
* update missed baseline
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This was caused by the fact that getTypeWithFacts(resultType, TypeFacts.NEUndefinedOrNull) will return never both if resultType was already never and if resultType does not contain undefined or null. In the latter case returning the declaring type is correct, in the former case this causes something narrowed to never to still be typed as the original declared type.
Fixes#38070
When the originating definition was of the form
```js
module.exports.foo = expr
```
we were incorrectly trying to call `resolveName` on just the `foo` portion to get the "local" symbol, which simply failed to resolve (or would have resolved to the wrong thing), but for this form, the local symbol is just the containing property access expression
* Baseline readable buildinfo
* Use file names as index in file name list
This is extension of the idea given by @sokra to optimize size of tsbuildinfo
* Deduplicate reference map lists and use file name index to sort them
Different implementation of #43079 based on idea suggested by @sokra
* Minimal json.stringify for the tsbuildinfo
Again implementaion of suggestion by @sokra
* Update src/testRunner/unittests/tsbuild/helpers.ts
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
* Readable version of buildinfo all the time
* Some renames for readability as per feedback
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Previously, when getting jsdoc for signatures, the services layer would
get the jsdoc tags for the base symbol of a signature if it was
present. This is fine except when the base was overloaded. In that case,
the multiple signatures of the overload would all contribute jsdoc,
which is not correct.
A more correct fix would be to resolve overloads to the base, but
the compiler doesn't have this capability and adding it or jury-rigging
it seems like it would be complex, inappropriate for a fix to ship in a
patch version.
Co-authored-by: Orta Therox <git@orta.io>
Co-authored-by: Orta Therox <git@orta.io>