Commit Graph

33425 Commits

Author SHA1 Message Date
Nathan Shively-Sanders fdd44be514 Try to improve diff further 2022-05-25 10:39:24 -07:00
Nathan Shively-Sanders c927b48dbf Improve diff of virtualFileSystemWithWatch.ts
Undo mistaken move of changeToHostTrackingWrittenFiles and
getTsBuildProjectFile, which might still not be enough.
2022-05-25 10:28:09 -07:00
Nathan Shively-Sanders c2d45f9ad4 Get rid of separate init call for VirtualServerHost
Also move vfs -> Semantic mode parsing.
2022-05-25 10:18:12 -07:00
Nathan Shively-Sanders d5a9736607 Merge branch 'main' into server-vfs-support 2022-05-25 09:07:15 -07:00
Oleksandr T b57d6e1df4 fix(49131): allow type keyword inside functions (#49134) 2022-05-24 15:16:48 -07:00
Andrew Branch a2b785b6cb Limit type argument inference from binding patterns (#49086)
* WIP

* Don’t widen literals based on bogus contextual type instantiation

* Split tests

* Skip unnecessary inference pass

* Accept test baselines

* Fix stray edit

* Fix type mapper combination

* Revert src/ of 7dc1952a82

* Make empty binding pattern provide no contextual type

* Add missed baseline
2022-05-24 09:05:34 -07:00
Wesley Wigham 194a2aea0d Key validity of import=require in module: node off of module and not target (#49222) 2022-05-24 03:33:23 -07:00
Sheetal Nandi 7c6521e8fb When building projects in watch mode, only schedule projects that need build or need update to bundle (#48865)
* Handle timesouts to reflect the time it was set with

* Remove unused internal calls from solution builder

* If the project doesnt need building or updating bundle, dont schedule it but do it right away

* Reduce the time between project builds to 100ms

* Some tests for projects building

* Schedule builds such that when change is not detected 5 projects are built at a time

* Fix tests in main
2022-05-23 11:40:57 -07:00
Anders Hejlsberg c592ee781d Instantiate original target type in substituteIndexedMappedType (#49205) 2022-05-23 11:07:33 -07:00
Nathan Shively-Sanders 006ae339bf Add es2018.intl ref to es2020.intl (#49152)
* Add es2018.intl ref to es2020.intl

es2020.intl refers to NumberFormatPartTypes declared in es2018.intl
as of #46508.

I'm not sure how to test this; it repros on Definitely Typed in
types/ndarray, but when I copy the same files into a compiler test it
passes without a problem.

* Add a test that shows the change works

It doesn't actually show that the original bug has been fixed,
though.
2022-05-20 11:04:34 -07:00
TypeScript Bot 408c760fae Update package-lock.json 2022-05-20 06:06:36 +00:00
Andrew Branch 0921eac6dc Fix path completions for typesVersions (#49154)
* Fix path completions for typesVersions

* Add more tests

* Fix case when * is a fragment of a path component

* Once a path pattern matches, only return completions from that pattern and higher priority ones

* Fix iteration order issue

* Aesthetics
2022-05-19 14:33:46 -07:00
Jake Bailey f6a171309e Update CONTRIBUTING.md to mention issue claiming and force pushing (#49090)
* Update contributing to mention issue claiming and force pushing

* Update cookie licking section to draft

* Update CONTRIBUTING.md
2022-05-19 13:46:37 -07:00
Andrew Casey 5aa0053c74 Use changeCompilerHostLikeToUseCache in synchronizeHostData (#48980)
* Remove unnecessary members of HostCache

* Standardize on calling compiler host members in preparation for adding caching at that layer

* Call changeCompilerHostLikeToUseCache to cache existence checks

* Drop now-redundant HostCache

* Don't make directoryExists caching contingent on createDirectory

* Clear compilerHost rather than tracking state
2022-05-18 17:26:55 -07:00
Andrew Casey 12ed01203c Clean up FAR aggregation (#48619)
* Clean up FAR and RenameLocations

This change had two goals:

1. Make the code easier to understand, primarily by simplifying the callback structure and minimizing side-effects
2. Improve performance by reducing repeated work, both FAR searches of individual projects and default tsconfig searches

This implementation attempts to preserve the merging order found in the original code (someone less relevant in the present state of using syntactic isDefinition).

* Stop enforcing search and aggregation order

...in preparation for implementing isDefinition explicitly.

Also restore convention of referring to `DocumentPosition`s as "locations".

* Introduce LanguageService.updateIsDefinitionOfReferencedSymbols

...to allow use of the checker when computing isDefinition across projects.

* Update baselines

* Tidy diff

* De-dup simplified results

* Baseline cross-project isDefinition results

* Move de-duping upstream to fix Full output

* Add server baseline test to confirm searches are not repeated

* Manually merge #48758

* Update baseline for newer fix to #48963
2022-05-18 17:26:17 -07:00
Andrew Branch e56a067801 Fix uncalled function check usage detection for && expressions (#49157) 2022-05-18 13:58:06 -07:00
csigs ce85d647ef LEGO: Merge pull request 49148
LEGO: Merge pull request 49148
2022-05-17 03:46:13 -07:00
TypeScript Bot 49145b8616 Update package-lock.json 2022-05-17 06:07:09 +00:00
Oleksandr T 755d5ccad6 fix confused comment (#49094) 2022-05-16 15:26:26 -07:00
Oleksandr T 0df9462a96 fix(49058): Language service crashes for static member in class with unresolved base members (#49059)
* fix(49058): skip unresolved base members

* use getTypeOfSymbol instead of getExportsOfModule
2022-05-16 14:29:40 -07:00
Nathan Shively-Sanders 2c5cabc20b use eslint-disable not tslint:disable 2022-05-16 11:42:02 -07:00
Nathan Shively-Sanders 050d5c1396 fix most lint 2022-05-16 11:33:16 -07:00
Nathan Shively-Sanders ab928dd424 Restore setModifiedTime
It got deleted in the code move; executeCommandLine checks that it's
required and asserts if it's not there.
2022-05-16 11:26:34 -07:00
Nathan Shively-Sanders 71d038ae8a undo diff logging to minimise baseline churn 2022-05-16 10:48:13 -07:00
Nathan Shively-Sanders 68cb6bafce Merge branch 'main' into server-vfs-support 2022-05-16 09:57:38 -07:00
Nathan Shively-Sanders 95731f0397 No errors on apparent type of bigint or symbol, even for recent targets (#49104)
* Remove bigint from Object.freeze in es5.d.ts

`BigInt` isn't resolved whenever `lib < es2020`, but it's not an error
when `target < es2020`. I have a few ideas for improving this situation
but for the RC I'm going to remove `bigint` from Object.freeze's
signature.

* Update other baselines

* No errors for missing apparent type of bigint,symbol for any target

* Update test text
2022-05-16 09:14:00 -07:00
csigs 528f708ab8 LEGO: Merge pull request 49130
LEGO: Merge pull request 49130
2022-05-16 08:16:23 -07:00
TypeScript Bot e5e4e68471 Update package-lock.json 2022-05-16 06:06:50 +00:00
csigs 9e70b69a97 LEGO: Merge pull request 49117
LEGO: Merge pull request 49117
2022-05-15 09:00:13 -07:00
csigs fba6eeaf6e LEGO: Merge pull request 49108
LEGO: Merge pull request 49108
2022-05-14 05:10:05 -07:00
TypeScript Bot 85bd9d97b8 Update package-lock.json 2022-05-14 06:19:38 +00:00
Daniel Rosenwasser 0414deeaaf Merge pull request #48954 from a-tarasyuk/fix/48948
fix(48948): constructor can't be the name of class accessors and generators
2022-05-13 12:20:45 -07:00
Nathan Shively-Sanders 5284804610 Move new test to its own file 2022-05-13 10:38:10 -07:00
Nathan Shively-Sanders b0edfb1321 Switch tests to baselines
This moves diff/snap back into VirtualServerHost to make the switch
easier.
2022-05-13 10:35:35 -07:00
csigs 90b1321baa LEGO: Merge pull request 49098
LEGO: Merge pull request 49098
2022-05-13 03:59:47 -07:00
Oleksandr T d8ebeebc59 move tests to conformance/salsa from compiler 2022-05-13 09:24:33 +03:00
Oleksandr T 9607a5310f add messages to plainJSErrors 2022-05-13 09:24:08 +03:00
TypeScript Bot d53b16ba0a Update package-lock.json 2022-05-13 06:09:16 +00:00
Jake Bailey 92894d36af Make watch/FS testing code friendlier for project loading in module transformation (#49087) 2022-05-12 16:43:44 -07:00
Jack Works b689cd0aa9 feat: support error when comparing with object/array literals (#45978)
* feat: support error when comparing with object/array literals

* chore: include regexp, function and class literal

* chore: include regexp, function and class literal

* test: update baseline

* fix: baseline
2022-05-12 15:45:22 -07:00
Anton Gilgur da00ba67ed fix: getDefaultLibFilePath should normalize __dirname (#49051)
- this currently causes a bug on Windows with mixed path separators
  - it returns a POSIX backslash path for __dirname, and then adds a
    forward slash from the directorySeparator, causing mixed separators
    - TS uses `/` internally and lets the host convert if needed, so
      I assume this should be normalized to all forward slashses instead
  - example of the bug from my tests:
    ```
    Expected: "D:\\a\\rollup-plugin-typescript2\\rollup-plugin-typescript2\\node_modules\\typescript\\lib\\lib.d.ts"
    Received: "D:\\a\\rollup-plugin-typescript2\\rollup-plugin-typescript2\\node_modules\\typescript\\lib/lib.d.ts"
    ```

- every other use of __dirname in the codebase seems to be normalized
  except for this one
  - could use normalizeSlashes for this, but I figure combinePaths is
    more appropriate since that will handle it and combine properly as
    well without any `+ directorySeparator +` stuff
2022-05-12 13:21:56 -07:00
Nathan Shively-Sanders 77b3e5a00e Rest of non-test suggestions
Except for
1. Writing a new ATA installer.
2. Deciding whether to change the Plugin API to include a separate
fshost.
3. Figuring out the correct executingFilePath.
2022-05-12 10:33:49 -07:00
csigs 1ba609660b LEGO: Merge pull request 49081
LEGO: Merge pull request 49081
2022-05-12 04:28:47 -07:00
Oleksandr T c300fea325 fix(7410): allow using JSXElement as JSXAttributeValue (#47994) 2022-05-11 14:47:35 -07:00
Andrew Branch 5c2febfe02 Allow referencing type-only exports as namespace members in ImportTypes and TypeQueries (#49056)
* Allow referencing type-only exports as namespace members in ImportTypes and TypeQueries

* Add extra test case

* ;; -> ;

* undefined -> false

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-05-11 11:44:59 -07:00
Nathan Shively-Sanders 56887d9e12 Merge branch 'main' into server-vfs-support 2022-05-11 09:03:19 -07:00
csigs 3c87170604 LEGO: Merge pull request 49069
LEGO: Merge pull request 49069
2022-05-11 08:29:06 -07:00
Nathan Shively-Sanders 3c8ab33413 Construct VirtualServerHost directly in tsserver 2022-05-11 08:24:18 -07:00
TypeScript Bot cfbb517f35 Update package-lock.json 2022-05-11 06:07:52 +00:00
Daniel Rosenwasser 7a3c31f9f9 Accepted es2020Intl baseline. 2022-05-11 00:07:29 +00:00