* prototype creation for method override completion snippet
* WIP: start using codefix `addNewNodeForMemberSymbol` to create method decl node
* update type of addNewNodeForMemberSymbol
* add more tests and support more cases
* add more tests and fix some details
* wip: more fixes and tests
* expose check override modifier in checker
* fix test
* WIP: add snippet support
* WIP: snippet support on emitter, adding snippets in completions
* make add snippets work with overloads (not synced)
* fix snippet adding
* rebase
* WIP: try to add snippet escaping in emitter
* support escaping in snippets
* small fixes; fixed tests
* more tests and fixes
* fix new tests
* fix modifier inheritance for overloads
* merge conflict fixes; remove comments
* throw error if setOptions is called but not implemented
* fix newline handling
* fix weird stuff
* fix tests
* fix more tests
* Fix unbound host.getNewLine
* fix isParameterDeclaration changes
* rename diagnostic to status and remove snippets from public api
* rename emitter functions + fix indentation
* check completion kind before calling isclasslikemembercompletion
* fix missing type parameters
* Revert "fix missing type parameters"
This reverts commit 7bdeaa86da.
* add isAmbient flag to addNewNodeForMemberSymbol
* add test for abstract overloads
* refactor snippet escaping support
* add user preference flag for enabling class member snippets
* update API baseline
* update tabstop order
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* Added/updated tests.
* Accepted baselines.
* Update test.
* Update instantiateMappedType to work specially when 'any' replaced an array.
* Accepted baselines.
* Ensure check works when constraint is a union of arrayish types, just like in `Promise.all`.
* Accepted baselines.
* Update test for indirect instantiation of a mapped type.
* Accepted baselines.
* Update test comment.
* Accepted baselines.
* Added tuple test case.
* Accepted baselines.
* Don't add special behavior for tuples.
* Accepted baselines.
* Revert "Don't add special behavior for tuples."
This reverts commit f01ae16e65.
* Accepted baselines.
* Simplify relationship check for conditional type on target side
* Accept new baselines
* Better support for non-distribution-dependent types
* Accept new API baselines
* Accept new baselines
* Pass absolute path to directoryExists
As pointed out by @gretzkiy, the `directoryExists` call added to
`matchFiles` in #44710 should have been passing the absolute path (since
the current directory might not match `currentDirectory`).
* Add test, simplify/clarify/fix matchFiles and friends
Co-authored-by: Andrew Branch <andrew@wheream.io>
Parsing separates the identifier part of the link tag from its text, but
the editor should present an identifier followed by `()` as a single
identifier since people use that syntax as a function sigil.
I prefer `#'` personally, you know, xkcd 297, nudge nudge.
Instead, search for stuff up the directory tree, with the main
functionality being to look for `Gulpfile.js` and assume the resulting
directory is the root.
(Unfortunatley, this is implemented twice, one in `scripts` and another
in `src`. It's not possible to use a single implementation for both
since that would require assuming a directory structure which this is
intended to avoid.)
Also, in `scripts/build/projects.js`, abstracdt common exec
functionality into a local helper, and use full paths based on the above
search instead of assuming relative paths assuming CWD being in the
project root.
Using shell-based execution is always a bad idea; this thing didn't do
that via an option, but instead did it manually by constructing a shell
command so it suffers from the same diseases.
Perhaps there was need for this at some point in the past, but things
are pretty robust now, so there's no need to avoid running the command
normally. The only thing that is needed is to add `which` which also
handles windows executable suffixes.
I tried this with a fresh clone on windows, where the tree and TS are
installed in paths that have spaces, and everything works as it should.
* Error on mapped types with properties
1. Error on properties of type literals with computed properties whose name is a
binary expression with `in`, because that's a good sign of a mapped
type.
2. Parse following properties on mapped types, and error on them.
3. Stop checking computed property names in (1) to avoid producing
errors based on misinterpreting mapped type syntax as an expression.
* add comment in types.ts
* Update API again
* Check interfaces and classes too
* Add missed check in updateMappedTypeNode
* shorthand -> long for `factory` since the typeformer script doesn't
know how to handle it.
* Use setter to change `ts.sys` (similar to #35399).
* Fix `loggedIO` with empty namespaces to indicate dependency
(similar to 50603eda).
* Move `Map` / `Set` stuff from `core.ts` to `corePublic.ts` since the
types are there.
Previously, import assertion parsing would try to parse both { and },
even if both were missing. If both were missing, the error for } could
occur past the end of the file, causing an assertion.
Fixes#46364