Commit graph

1209 commits

Author SHA1 Message Date
Andrew Branch 2d6a490363
Import statement completions (#43149)
* WIP

* WIP

* Get completion details working

* Start unifying eager and lazy auto imports

* Fix export=

* Fix completion details for totally misspelled names

* Almost fixed duplication...

* Fix remaining completion tests

* Refactor to support multiple origins for same symbol

* Make import fixes make slightly more sense

* Add cache back in

* Set insertText based on import kind

* Update API baselines

* Add semicolons, snippet support, and sourceDisplay

* Add some tests

* Update baselines

* Fix pattern ambient modules appearing in auto imports

* Fix tests

* Remove commented code

* Switch to valueDeclaration for getting module source file

* Small optimizations

* Cache module specifiers / importableness and export map separately

* Fix and test cache invalidation logic

* Update API baselines

* Add separate user preference for snippet-formatted completions

* Require first character to match when resolving module specifiers

* Fix AutoImportProvider export map cache invalidation

* Really fix auto import provider export map invalidation

* Update test added in master

* Use logical or assignment

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Simply conditional by reversing

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* When file is deleted need to marked correctly in the project as removed file

* Simplify hasAddedOrRemovedSymlinks with cherry-picked fix

* Ensure replacement range is on one line

* Update baselines

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2021-03-26 14:47:07 -07:00
Sheetal Nandi a545ab1ac2
Cache resolved project references and watch wild card directories from them to update them (#42929)
* Test for not watchiong referenced projects fileNames and invalidating it

* Add watching wild card directories and caching parsed command line for projects so that its shared

* Handle config file watching and commandline cache together

* Watch extended files for commndline cache instead of project

* Use extended config cache now that we are watching extended config files

* Structure for getParsedCommandLine from the LS

* Adding some more skeleton with todos

* getParsedCommandLine on WatchCompilerHost

* Tests for Watch, LS scenarios

* Handle getParsedCommandLine so we are looking at all things for referenced

* Cleanup and commenting

* Test for transitive references with tsc-watch

* Cache parsed command line even if host implements getParsedCommandLine

* Cleanup

* Cleanup

* Some tests to verify exclude from referenced project doesnt trigger the update

* Baseline when program is same

* Test for incremental scenario

* Tests for output from referenced project

* Comments
2021-03-26 13:23:03 -07:00
Sheetal Nandi 04205ca32c
Do not calculate signatures if old state is not used (#43314)
* Extra tests in preparation for lazy signature making sure the original intent of test is maintained

* Whenver we cant use state delay signature calculation and use source file version as signature

* Incremental correctness checks

* Retain old behavior in compile on save by disabling use of file version as signature in when state is not reused
2021-03-23 13:43:43 -07:00
Nathan Shively-Sanders dcc27ebaf2
@link support, second try (#43312)
* Revert "Revert "Editor support for link tag (#41877)" (#43302)"

This reverts commit 451d4354b9.

* Fix parsing @link at end of comment

* Parse comments as string when no @link occurs

* fix lint
2021-03-22 16:39:35 -07:00
Josh Goldberg 5813907abf
Made TS6059 rootDir validation consistent for programmatic usage (#43145)
* Made TS6059 rootDir validation consistent for programmatic usage

* Corrected other baselines
2021-03-19 15:52:04 -07:00
Nathan Shively-Sanders 451d4354b9
Revert "Editor support for link tag (#41877)" (#43302)
This reverts commit ec77bff332.
2021-03-18 14:42:25 -07:00
Nathan Shively-Sanders ec77bff332
Editor support for link tag (#41877)
* 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
2021-03-16 16:26:01 -07:00
Sheetal Nandi 53cbc046d2
Refactor the test for easy maintainability (#43262) 2021-03-15 18:04:30 -07:00
Sheetal Nandi d2cb05a6b5
Emit readable BuilderFileEmit kind (#43221) 2021-03-12 14:32:50 -08:00
Sheetal Nandi 82bfe5ad93
Fix issue with some baselines for tsbuildinfo not getting generated (#43218) 2021-03-12 12:28:20 -08:00
Sheetal Nandi 496a1d3caa
Improvements to dts emit for tsbuildinfo (#43205)
* 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
2021-03-12 09:44:22 -08:00
Sheetal Nandi 9933c8ac7d
Build info baseline improvements (#43200)
* 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
2021-03-11 13:30:06 -08:00
Kagami Sascha Rosylight f4d0ea6539
Add target: ES2021 (#41239)
* Support `target: es2020`

* use CRLF

* update symbols

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-10 13:31:25 -08:00
Sheetal Nandi acc8f2fb05
Ensure that when new file affecting global scope is added, the signatures are updated (#43084)
* Ensure that when new file affecting global scope is added, the signatures are updated

* Update src/compiler/builder.ts

* Better comment
2021-03-09 17:40:02 -08:00
Sheetal Nandi 6e4456b3b4
Optimize the size for tsbuildinfo (#43155)
* 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>
2021-03-09 16:15:26 -08:00
Klaus Meinhardt 15e69acc20
capture thisArg of optionalChaining in parens (#35494)
Fixes: #35476
2021-03-03 19:35:17 -08:00
Klaus Meinhardt 7751ecb544
fix receiver on calls of imported and exported functions (#35877)
* fix receiver of imported and exported functions

fixes: #35420

* Rebase against master and clean up substitution flow

* Add evaluator tests

* Fix evaluator tests

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-03-03 10:38:32 -08:00
Sheetal Nandi 0cf834ceec
Move fixed chunk size polling as a watch option and move it out of server (#42542)
* Move fixed chunk size polling as a watch option and move it out of server
Fixes #41549

* Feedback
2021-03-02 16:45:53 -08:00
Andrew Branch 4b67b4a7bc
Support go-to-definition for imports of arbitrary files (#42539)
* Support go-to-definition for imports of scripts and arbitrary files

* Support go-to-definition for non-existent files

* Add missing file property

* Use `isExternalModuleNameRelative` instead of `!pathIsBareSpecifier`

* Add partial semantic test

* Combine with symbol search for non-source-file file references

* Fix and accept API baselines

* Fix useless or

* A definition is unverified if the file path was a guess, even if a source file has that path
2021-03-01 15:15:09 -08:00
Andrew Branch 993c503c84
Add 'data' property to completion entry for better coordination between completions and completion details (#42890)
* Add 'data' property to completion entry for better cooperation between completions and completion details

* Add doc comment

* Update API baselines

* Add server test

* Test session’s Full result

* Fix tests

* stableSort to fix server fourslash test

* Explicit verification of data parameter
2021-03-01 12:09:45 -08:00
Sheetal Nandi 5f5437af66
Do not cache directory structure for symlinked directories (#42868)
Fixes #42839
2021-02-24 09:51:19 -08:00
Sheetal Nandi c117c266e0
Refactor to simplify project references tsc-watch and tsserver tests (#42926) 2021-02-23 11:27:16 -08:00
Andrew Branch 2a01f923ca
Improve JSON parser error recovery (#42657)
* Improve JSON parser error recovery

* Add error baselines

* Move tsconfig root checking out of common JSON checking function

* Use new function in parseConfigFileTextToJson

* Fix test

* Replace non-null assertion with explicit debug assertion
2021-02-23 09:31:09 -08:00
Ryan Cavanaugh f5618562ab
Check for missing type parameter names in JSDoc template tags (#42017)
* Check for missing type parameter names in JSDoc template tags

Fixes #36692

* Update baselines
2021-02-17 16:54:56 -08:00
Jesse Trinity d640313ff2
Expand extractSymbol ranges (#42770)
* allow partial selections of node ranges

* separate tests for better failure investigation

* gate span expansion behind invoked command

* add invoked test

* comment wording

* for test
2021-02-17 12:55:12 -08:00
Sheetal Nandi e98f6b07ab
Refactor project references and source map tsserver tests so they are inline for easy editing (#42782) 2021-02-12 14:32:23 -08:00
Sheetal Nandi 5280ba400c
Handle if plugin doesnt specify name (#42717)
Fixes microsoft/vscode#116219
2021-02-09 15:23:29 -08:00
Daniel Rosenwasser 664ed17ebd
Allow only package names as plugin names (#42713)
* Allow only package names as plugin names

* Remove extra argument following merge from master branch.

* kipped -> Skipped

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2021-02-09 11:30:09 -08:00
Sheetal Nandi c3e132da59
Keep extended config's raw file, include, exclude relative to itself and correct it when setting extending options (#42544)
* Test when config file extends is incorrectly computed
Test for #40720

* Keep extended config's raw file, include, exclude relative to itself and correct it when setting extending options
Fixes #40720
2021-02-03 11:09:06 -08:00
Andrew Branch d7d7b888b6
Remove Travis CI (#42507)
* Remove Travis CI

* Revert deletion of cron stuff

* Fix formatting
2021-01-29 12:38:26 -08:00
Sheetal Nandi b8faaea90c
Only look for file exists and read file on supported locale directories that we build (#42505)
Fixes #42263
2021-01-26 17:43:37 -08:00
Sheetal Nandi 1b57a0395e
Fix incorrectly logging ts files instead of .js files as top files (#42463)
Fixes #41071
2021-01-25 10:04:39 -08:00
Nathan Shively-Sanders ca380af99b
At starts jsdoc tag only after whitespace (#42364)
* Update tests

* @ begins JSDoc tag only after whitespace

Previously, inside a JSDoc tag's comment, @ would start a tag unless it
was surrounded by backticks. However, looking at real code showed that
only whitespace-preceded uses of @ were intended to start tags.
2021-01-25 09:42:24 -08:00
Ron Buckton ee3fe472d7
Fix broken user and docker tests (#42431)
* Add --force to npm install script for user tests

* Migrate prettier to docker

* Fix vscode Dockerfile

* Fix stack space issue in isJSLiteralType

* Use --legacy-peer-deps based on npm version

* Fix xterm.js Dockerfile
2021-01-22 13:23:41 -08:00
Sheetal Nandi 80dfc6a45b
Only when typings file change for the project, schedule the update for the project (#42428)
* Update and add test when typings dont change because of import name

* Update project scheduling only when typings are set

* Schedule update graph only if typings change
Fixes #39326
2021-01-22 11:16:07 -08:00
Oleksandr T c83f769850
fix(41405): allow using property access as reference to function (#41429) 2021-01-14 17:02:48 -08:00
Sheetal Nandi 66ba15a3fd
If import is used in the file, prefer that import specifier over calculating new one (#42224)
* Test case where the wrong path is emitted

* If import is used in the file, prefer that import specifier over calculating new one
Fixes #39117

* Update Baselines and/or Applied Lint Fixes

* When non-relative path is used as user preference, ignore relative paths even if they are from the existing file

* Fix test

* Add comment

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-01-08 15:20:29 -08:00
Orta Therox 055f363fba
Reverts #39277 removing bundledPackageName (#41499)
* Reverts #39277

* Bring back modeyule resolution for the test runner
2021-01-08 10:55:34 +00:00
Ron Buckton 44ec8ddaee
Fix array spread with sideeffects (#41523)
* Fix array spread with sideeffects

* Minor cleanup, ensure multiple emit helpers for outfile tests
2021-01-05 17:24:21 -08:00
Oleksandr T fe297df9df
fix(42034): allow convert async function with empty catch (#42123) 2020-12-28 09:34:28 -08:00
Andrew Casey 902fcb0cc7
Use fs.realpathSync.native when available (#41292)
* Test that forceConsistentCasingInFileNames does not apply to Windows drive roots

* Add file symlink baselines

* Add directory symlink baselines

* Update test to retain its meaning

Its purpose is (apparently) to demonstrate that
forceConsistenCasingInFileNames can interact badly with synthesized
react imports.  Since the casing of the synthesized import has changed,
also modify the casing of the explicit reference to still conflict.

* Make VFSWithWatch.realpath use the path on disk

* Update VFS realpathSync to behave like realpathSync.native

* Use fs.realpathSync.native when available

In local measurements of an Office project, we saw initial project
loading get 5% faster on Windows and 13% faster on Linux.  The only
identified behavioral change is that it restores the case used on disk,
whereas realpathSync retains the input lowercase.

* Rename SortedMap.getKeyAndValue to getEntry
2020-12-18 09:23:42 -08:00
Wesley Wigham 6bcb6bb369
Simplify expression type to fix build break (#41942) 2020-12-12 13:51:10 -08:00
Andrew Branch 9dfbf07d8a
Find references of a module by filename (#41805)
* Naive implementation enough to build and write a test

* Add simple test

* Add project references test

* Add deduplication test, accept baselines

* Add test for referencing a script (doesn’t do anything)

* Update API baselines

* Use refFileMap for non-module references

* Fix find-all-refs on module specifier

* Remove unused util

* Don’t store text range on ts.RefFile

* Ensure string literal could itself be a file reference

* Remove unused utilities

* Improve baseline format

* Preserve old behavior of falling back to string literal references

* Update baselines from master

* Fix old RefFileMap code after merge

* Add test for additional response info

* Undo test change
2020-12-11 12:37:02 -08:00
Michael Molisani 716b167f2b
Watch extended configs if present (#41493)
* Watch extended configs if present

* Address code review comments

Added new `WatchType` for extended config files. Refactored watch map
update to separate function, relocated call sites. Removed unnecessary
test cases and relocated with new tests in programUpdates.

* Unify extended config file watching between tsc/tsserver

Update `updateExtendedConfigFilesWatch` to read from a
`TsConfigSourceFile` to get `extendedSourceFiles`. Add watcher map to
`ConfiguredProject` in the server. New test cases to verify correct
events triggered and extended files are being watched properly.

* Simplify watcher callback, fix tests

Removes unnecessary actions in extended config watcher callback
function. Updates tests to match.

* Share extended config watchers across projects in server

New shared watcher map in ProjectService that stores callbacks per
project to be invoked when the file watcher is triggered. The
FileWatcher is created with the watch options of the first Project to
watch the extended config.

* Refactor shared extended config map and watchers

Remove all server-related utility functions/types from
watchUtilities. Store config-project mapping and config file watchers
inside ProjectService with new private methods to add or remove
projects.

* Store projects in extended config file watcher

Creates SharedExtendedConfigFileWatcher in both editorServices
(tsserver) and tsbuildPublic. The file watcher is responsible for
triggering a full project reload for the contained projects. Upon
reload, any configs that are no longer related to a project have their
watchers updated to match. New test cases to confirm that the file
watchers for extended configs are closed when the project is closed.

* Apply suggestions from code review

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>

* Map extended config files by path

* Move shared watcher into utilities and add more tests

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-12-10 17:20:02 -08:00
Sheetal Nandi 2eca17d7c1
Keep track of why files are in the program (#40011)
* --explainFiles currently hardcoded

* Move configFileSpecs to configFile so it can be used in program later

* Explain root file inclusion reason and explain include files in the log

* Baseline explainFiles

* Fix incorrectly reporting of file list two times in --b mode

* Fix unnecessary new lines in output represented incorretly in the baseline

* More tests

* More cleaning up

* Keep listing files in same order as list files, just add explaination

* Fix double listing of file names when the program has errors

* Make diagnostic chains for file include reason

* Add explaination for the file include to diagnostics for program

* Harness ls incorrectly adding tsconfig as the root file

* Fix incorrect use of path for calculating absolute path

* Fix the root file in fourslash

* Test project service options merge

* Add config file name to matched by include explaination

* Add test for when the file changes and program is reused completely but related file information is reattached to correct location

* Handle file preprocessing diagnostics updates when program is reused and related information location changes

* Moved types to types.ts

* Refactoring and cleanup

* More cleanup

* More refatoring

* Handle synthetic imports

* Baselines after merge
2020-12-08 16:10:05 -08:00
Matt Bierner 49d7de17d6
Adds experimental support for running TS Server in a web worker (#39656)
* Adds experimental support for running TS Server in a web worker

This change makes it possible to run a syntax old TS server in a webworker. This is will let serverless versions of VS Code web run the TypeScript extension with minimal changes.

As the diff on `server.ts` is difficult to parse, here's an overview of the changes:

- Introduce the concept of a `Runtime`. Valid values are `Node` and `Web`.
- Move calls to `require` into the functions that use these modules
- Wrap existing server logic into `startNodeServer`
- Introduce web server with `startWebServer`. This uses a `WorkerSession`
- Add a custom version of `ts.sys` for web
- Have the worker server start when it is passed an array of arguments in a message

In order to make the server logic more clear, this change also tries to reduce the reliance on closures and better group function declarations vs the server spawning logic.

**Next Steps**
I'd like someone from the TS team to help get these changes into a shippable state. This will involve:

- Adddress todo comments
- Code cleanup
- Make sure these changes do not regress node servers
- Determine if we should add a new `tsserver.web.js` file instead of having the web worker logic all live in `tsserver.js`

* Shim out directoryExists

* Add some regions

* Remove some inlined note types

Use import types instead

* Use switch case for runtime

* Review and updates

* Enable loading std library d.ts files

This implements enough of `ServerHost` that we can load the standard d.ts files using synchronous XMLHttpRequests.

I also had to patch some code in `editorServices`. I don't know if these changes are correct and need someone on the TS team to review

* Update src/tsserver/webServer.ts

* Update src/tsserver/webServer.ts

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>

* Addressing feedback

* Allow passing in explicit executingFilePath

This is required for cases where `self.location` does not point to the directory where all the typings are stored

* Adding logging support

* Do not create auto import provider in partial semantic mode

* Handle lib files by doing path mapping instead

* TODO

* Add log message

This replaces the console based logger with a logger that post log messages back to the host. VS Code will write these messages to its output window

* Move code around so that exported functions are set on namespace

* Log response

* Map the paths back to https:
// TODO: is this really needed or can vscode take care of this
How do we handle when opening lib.d.ts as response to goto def in open files

* If files are not open dont schedule open file project ensure

* Should also check if there are no external projects before skipping scheduling
Fixes failing tests

* Revert "Map the paths back to https:"

This reverts commit 0edf650622.

* Revert "TODO"

This reverts commit 04a4fe7556.

* Revert "Should also check if there are no external projects before skipping scheduling"

This reverts commit 7e4939014a.

* Refactoring so we can test the changes out

* Feedback

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-12-08 16:09:43 -08:00
Nathan Shively-Sanders d8c8e4ff06
Loosen author tag parsing (#41820)
* Loosen author tag parsing

Also make the code more efficient and easier to read.

1. Arbitrary text, except for newline and @, is allowed for the author name.
2. Arbirtrary text, except for newline, is allowed for the email
address.
3. Newline is treated as a match for an open <

I tried to allow newlines in the author and email, but it was ambiguous
with the end of the tag.

I also got rid of the two lookaheads and unified the trailing comment
handling.

Fixes #41804

* remove hardmode test since it did not reveal anything new
2020-12-08 13:25:03 -08:00
Sheetal Nandi bfb259128b
Handle output file names descripency between tsc --b and actual program emit file path calculation (#41811)
* Baseline showing #41801 and other issues with output path calculation

* Add a way to note descripencies between clean and incremental build

* Add descripency when no rootDir is specified but project is composite

* if rootDir is specified, irrespective of whether all files belong to rootDir, the paths should be calculated from rootDir

* Fix the output file names api to use the correct common source directory

* Tests for #41780

* Spelling
2020-12-07 11:53:22 -08:00
Keen Yee Liau cf4df4e472
fix(41736): tsserver should not crash if external file does not exist (#41737)
If a file does not exist, `projectService.getOrCreateScriptInfoNotOpenedByClient()`
will return `undefined`, but tsserver does not handle this case.

Fix https://github.com/microsoft/TypeScript/issues/41736
2020-11-30 16:37:40 -08:00
Oleksandr T 03877260f8
fix(41194): ignore jsxFrag identifier in import declarations (#41441) 2020-11-24 14:29:47 -08:00
Sheetal Nandi 2cc67ec0a6
If there are no open files, do not schedule ensureProjectForOpenFiles (#41537) 2020-11-18 16:10:11 -08:00
Ron Buckton 54e54f4f19 Fix definition of ts.Iterator 2020-11-11 18:42:12 -08:00
Wesley Wigham 2c7c62d7fa
Merge branch 'master' into fix-incremental-jsx-crash 2020-11-11 13:00:47 -08:00
Christopher Hiller 40adb27799
dispose Mocha Runner after use to avoid MaxlistenersExceededWarning (#41403)
* dispose Mocha Runner after use to avoid MaxlistenersExceededWarning

- removed manual `unhandledRejection` listener as Mocha v8.2.0 now has one

* Remove ts-ignore comment and commented out line.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-11-11 10:38:43 -08:00
Wesley Wigham dc7d997e4a
Fix crash on attempting to suggest a ts import for a synthetic js resolution 2020-11-09 14:05:17 -08:00
Sheetal Nandi 76cf8fd78b
Add way to exclude files and directories to watch (#39243)
* Parse excludeDirectories and excludeFiles

* Use watch factory in typings installer

* Some refactoring for watchFactory

* Create Noop watcher if file or directory being watched is excluded

* Baselines without using exclude watch options

* Baselines including exclude option

* Handle exclude options in the system watches

* Add test without exclude option for recursive directory watching

* Test baselines with exclude option

* Always set sysLog

* Test for exclude option in server

* Add exclude options in the config file and fix the test

* Fix host configuration for server

* Handle host configuration for watch options

* Fix sysLog time log so baselines can be clean

* Handle reloadProjects to reload the project from scratch

* Ensure that file updates are reflected

* Feedback

* Feedback
2020-11-04 13:30:06 -08:00
Oleksandr T ad70313141
fix(39858): generate valid async/await code for imported functions (#40154) 2020-11-02 16:12:08 -08:00
Oleksandr T 5d81b17d02
fix(40042): add modifiers in correct position for decorated methods (#40050) 2020-11-02 15:52:57 -08:00
Wesley Wigham 816af71d58
Fix incremental emit issue where dependency relations implied by synthesized imports would not be detected (#41346)
* Fix incremental emit issue where dependency relations implies by synthesized imports would not be detected

* Update src/compiler/program.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-11-01 16:05:49 -08:00
Wesley Wigham 479105090d
Merge pull request #41330 from weswigham/jsx-import-source-as-auto-import
Auto-include types for the jsx import source in the new jsx transforms
2020-10-30 16:51:04 -07:00
Wesley Wigham 8493ee8824
Add mroe incremental-affecting affixes to compiler options, add incremental test for changing jsxImportSource 2020-10-30 16:01:27 -07:00
Ron Buckton bcbe1d7638
Merge pull request #41094 from microsoft/destructuringEvaluationOrder
Fix destructuring evaluation order for initializers
2020-10-29 17:12:18 -07:00
Jesse Trinity b27d4bf3f6
noop in setTypeAcquisiton for undefined (#41291)
* noop in setTypeAcquisiton for undefined

* accept new baseline

* add regression test
2020-10-29 13:30:42 -07:00
Sheetal Nandi 6bde4b5c02
Fix missing file name of extended source file in synchronizeProjectList when it is missing on disk (#41222)
Fixes #40136
2020-10-29 12:18:43 -07:00
Ron Buckton db6f66cc4e
Merge pull request #40593 from microsoft/nativePerformanceHooks
Migrate 'ts.performance' to use native performance hooks when available
2020-10-23 17:32:55 -07:00
Ron Buckton 8ed645ae1a
Don't emit duplicate triple-slash directives when using API to print a .d.ts (#40968) 2020-10-23 16:31:58 -07:00
Ron Buckton 0b303ff08a Fix some rest cases and handling of unused results 2020-10-22 18:58:21 -07:00
Ron Buckton 28c4f32ddf Merge branch 'master' into destructuringEvaluationOrder 2020-10-22 17:14:23 -07:00
Ron Buckton c5800d1928 Remove shims, workaround for bug in peformance.measure 2020-10-22 13:52:10 -07:00
Sheetal Nandi 15cec9d1f7
Optimizes project loading in few scenarios (#41126)
* Some refactoring of forEachResolvedProjectReference

* More refactoring

* Test before the change

* When loading project tree, load projects that directly or indirectly reference the projects we are looking for

* Optimize finding project in solution scenario by directly finding possible default project through projectReferenceRedirect
This helps in avoiding loading indirect projects when solution indirectly referenced default project
2020-10-19 12:59:59 -07:00
Jesse Trinity 08e4f369fb
Add editor configurable filename-based ATA (#40952)
* add typeAcquisition:inferTypings

* remove unused property

* handle inferred and external projects separately

* update missed rename

* fix tests

* pass as external compilerOption

* update test

* remove hostConfig reference

* change option name

* remove extraneous property

* add inferredProjectCompilerOptions
2020-10-19 09:53:58 -07:00
Ron Buckton c52e3b29e7 Add unit tests for PerformanceHooks shim 2020-10-15 19:10:51 -04:00
Ron Buckton a197beef6d Migrate 'ts.performance' to use native performance hooks when available 2020-10-15 19:10:50 -04:00
Ron Buckton 7393dba6bd Fix destructuring evaluation order for initializers 2020-10-13 17:14:35 -07:00
Sheetal Nandi a4b9bbae90
Handle noEmit and noEmitOnError with SemanticDiagnosticsBuilder (#40880)
* Add test that fails

* Handle noEmit on semantic builder's emit as well

* Add test for tsbuildinfo text verification

* Fix noEmit handling for tsbuildinfo emit with SemanticDiagnosticBuilder

* Add test for noEmitOnError with SemanticDiagnosticsBuilder

* Fix tsbuildinfo emit with SemanticDiagnosticsBuilder on noEmitOnError

* Update src/compiler/builder.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Update src/compiler/builder.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-10-09 17:25:04 -07:00
Sheetal Nandi e6d525c5cb
Structure is reused should be on new program instead of old program (#41005) 2020-10-09 15:56:51 -07:00
Sheetal Nandi 876e44bbc6
Handle extra file extensions when wild card directory watch is invoked (#41018)
Fixes #40495
2020-10-09 14:07:55 -07:00
Ron Buckton 14714bbace Don't emit duplicate triple-slash directives when using API to print a .d.ts 2020-10-06 15:02:41 -07:00
Sheetal Nandi d94b8e42a6
Fixes calculating resolved project reference to redirect for module resolution (#40954)
* Add test for #38711

* Fixes calculating resolved project reference to redirect for module resolution
Fixes #38711

* Update src/compiler/program.ts
2020-10-06 11:23:05 -07:00
Sheetal Nandi fb2f3d4fd4
Do not create packagejson imports and auto import provider in partial semantic server mode (#40890) 2020-10-02 10:59:04 -07:00
Andrew Branch dc8952d308
jsx option affects emit (#40775) 2020-09-25 12:20:29 -07:00
Andrew Branch 3b9eb1ebe9
Fix premature closing of AutoImportProviderProject for unbuilt monorepos (#40620)
* Fix premature closing of AutoImportProviderProject for unbuilt monorepos

* Update src/server/project.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Update API baseline

* Don’t override hasRoots

* Update API baselines

* Really actually update baselines

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-09-24 10:05:07 -07:00
Alex T c5a28fcdec
fix(39589): add await before return promise expression (#39649) 2020-09-22 15:34:56 -07:00
Alex T d7cd405bb2
feat(14751): show static members at the top of the list for a class like completion (#40428) 2020-09-11 14:48:24 -07:00
Andrew Branch 9c8d11b5ed
Allow 'paths' without 'baseUrl' (#40101)
* Allow paths without baseUrl

* Remove exception for leading * paths

* Add comment, remove commented code

* Update baselines

* Remove unnecessary default

* Fix test harness

* Fix baseline

* Resolve relative to host.getCurrentDirectory() with createProgram API
2020-09-11 12:58:40 -07:00
Orta Therox aa2756a5d7
Updates Dom lib with TSJS changes, adding a new library for webworker iterable (#40500)
* Updates Dom lib with TSJS changes, adding a new library for webworker iterable

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>

* Fixes tests

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
2020-09-11 15:36:00 -04:00
Wesley Wigham a36f17c1f8
Add emit support for jsx/jsxs experimental jsx runtime api (#39199) 2020-09-11 10:44:52 -07:00
Jack Moore 4a3b195772
Add lib es2020.sharedmemory (#39541) 2020-09-11 11:34:01 -04:00
Orta Therox cdafb7157b
Replaces the default module index resolver with '/index' instead of '' when handling internal routing for dts bundles (#39277)
* Adds support for declaring the bundled name of a dts module export

Co-authored-by: Wesley Wigham <wwigham@gmail.com>

* Adds baselines

* Update the tests

* Try to reduce the scope of the bundledPackageName error

* Use the flag in more baselines

* Get it green

* More tests

* Handle more feedback

* More test cleanup

* Set the moduleResolution for the tsconfigs

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-09-11 08:12:07 -04:00
Wenlu Wang ee5f51bc0f
Add see tag support (#39760)
* Add see tag parser

* add baseline

* fix symbol resolve

* add more case

* fix unittests

* improve tests and parser

* accept baseline

* Adopt package-lock.json and npm ci

* Add a workflow to update package-lock.json daily

* Git ignore package-lock.json and forcibly update in workflow

* Update bot email address

* Delete extra npm update

* Update package-lock.json

* Add compactDisplay and signDisplay to NumberFormatOptions (#40039)

* Fix typo in (Readonly)Set.keys comment (fixes #40164) (#40176)

* fix(26325): use a unique name for reserved words in 'constructor like' function name (#39684)

* fix(25770): add diagnostic message for the possible mapped type used as an index (#39973)

* fix(31046): add new diagnostic message for incompatible constructor signature (#40073)

* Update package-lock.json

* Update package-lock.json

* Add rename support

* Accpet baseline

* wip

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Fix call hierarchy item serialization and server tests (#40348)

* Avoid error

* accept baseline

* Add more tests

* Add signature name resolve

Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Neil Kistner <neil.kistner@gmail.com>
Co-authored-by: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com>
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: Erich Gamma <egamma@microsoft.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-09-09 10:45:09 -07:00
Alex T 6101fbca39
fix(40150): use parameter name for a Promise callback function (#40191) 2020-09-08 13:44:38 -07:00
Andrew Branch f6f2d36ee3
Add optionalReplacementSpan to completions response (#40347)
* Add optionalReplacementRange to completions response

* Get the name right

* Fix unit tests

* Fix comment typo

* Fix comment typo

* Baseline
2020-09-04 13:09:52 -07:00
Andrew Branch 8ffb7f083d
Reprioritize cross-project module specifier suggestions for auto-import (#40253)
* Add test

* Suggest `paths` module specifiers even when a node_modules path was available

* Fix some tests

* Fix remaining tests

* Add comments
2020-09-03 14:00:06 -07:00
Nathan Shively-Sanders 6fea7ff536
Add unit tests for VersionRange (#40114)
* Add unit tests for VersionRange

Make it easier to understand the intended semantics next time I have to
read this code.

* I miss prettier
2020-08-18 13:06:17 -07:00
Daniel Rosenwasser 97a072926f
Revert "Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)" (#40072)
This reverts commit 2426eb4980.
2020-08-17 11:45:39 -07:00
Daniel Rosenwasser 2426eb4980
Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)
* Add '(approximate)' to the beginning of quick info requests.

* Use 'approximation' instead of 'approximate'.
2020-08-14 17:54:10 -07:00
Sheetal Nandi c95cffe111
Ensure file, include and exclude specs used are strings (#40041)
* Test displaying failure when specs used are not strings

* Ensure specs used are strings
Fixes #38164, #39856

* Feedback
2020-08-13 17:08:20 -07:00
Sheetal Nandi 03d946d145
Revert to including only open files in partial semantic server mode (#40026) 2020-08-12 20:45:59 -07:00
Alexander T 1f5caf554c
fix(13503): fix crash on calling getTypeAtLocation with the SourceFile nodes (#39994) 2020-08-12 00:11:25 -07:00
Andrew Branch 87a3b42d72
Handle empty package.json files (#39937) 2020-08-06 11:04:21 -07:00