Commit Graph

402 Commits

Author SHA1 Message Date
Ryan Cavanaugh
2f7627b363 Merge pull request #28190 from ispedals/bug/24709
Support synthesized SourceFile parent in getOrCreateEmitNode (#24709)
2019-01-30 19:12:11 -08:00
Benjamin Lichtman
62cf44cb9b Allow per-file setting for rename default behavior preferences (#29593)
<!--
Thank you for submitting a pull request!

Here's a checklist you might find useful.
* [ ] There is an associated issue that is labeled
  'Bug' or 'help wanted' or is in the Community milestone
* [ ] Code is up-to-date with the `master` branch
* [ ] You've successfully run `jake runtests` locally
* [ ] You've signed the CLA
* [ ] There are new or updated unit tests validating the change

Refer to CONTRIBUTING.MD for more details.
  https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
-->

Fixes #29585.
#29314 and #29385 made it so their respective settings are only recognized when provided to the host as a whole.
This PR makes it so that the relevant settings for the preferences on the file override those of the preferences on the host.
2019-01-30 19:08:30 -08:00
Sheetal Nandi
26e546aeaa Merge pull request #29626 from Microsoft/toLowerCase
Handle get from readFileCache correctly.
2019-01-30 13:10:40 -08:00
Sheetal Nandi
604af5c621 Handle get from readFileCache correctly.
Fixes #29623
2019-01-28 12:30:05 -08:00
Klaus Meinhardt
451ff29263 revert change of trailing comment parsing 2019-01-27 17:41:20 +01:00
Klaus Meinhardt
68133e5fad Merge branch 'master' into shebang-comments 2019-01-27 17:37:10 +01:00
Sheetal Nandi
e51a2fe80d Skip declaration emit for files that are just executables 2019-01-25 14:24:35 -08:00
Sheetal Nandi
1b12a855e8 Merge branch 'master' into inputFiles 2019-01-24 15:44:45 -08:00
Sheetal Nandi
216ed1b385 Get dts content from sourceFile if present 2019-01-24 13:47:27 -08:00
Sheetal Nandi
50d98aee0e Create getters for js sourcemap, dts and dts map text getters in prepend nodes 2019-01-24 13:38:25 -08:00
Sheetal Nandi
9acff37947 Add test to test the readFile called on prepend input file for emitting and verifying emit 2019-01-24 12:17:45 -08:00
Pete Bacon Darwin
331b9bcfde Use the correct source when skipping trivia
A custom `SourceMapSource` can optionally provide its own `skipTrivia`
function. If this is not provided then the compiler will use the default
function designed for TypeScript source files.

Previously, when calling this default function we were passing the current
`sourceMapSource` rather than the specified `source` whose trivia needs
to be skipped. This resulted in the `pos` being incorrectly calculated for
external source files that need mapping.

**Side note:**

There are actually two possible constructors available for creating
`SourceMapSource` objects. One of them defaults to an identity function
for the `skipTrivia` function if it is not provided (see
49689894d7/src/compiler/utilities.ts (L6972-L6976))
and the other one leaves the `skipTrivia` field `undefined` (see
5fc8f1dd80/src/services/services.ts (L776-L797))

Unfortunately, it appears that the second of these two constructors is the
one available when importing the "typescript" module in node.js code.
2019-01-24 10:28:10 +00:00
Sheetal Nandi
9bd23652ef Merge pull request #29161 from Microsoft/incrementalBuild
Supports incremental build in tsc --b --w mode
2019-01-17 13:44:48 -08:00
Benjamin Lichtman
5fc8f1dd80 Add opt-in user preference for prefix and suffix text on renames (#29314)
* Add user preference to control renaming through exports

* Only impact renaming

* Update baselines

* Use flag to control all prefix and suffix text and imports

* [WIP] add tests

* Only skip export import specifier with flag

* [WIP] Update tests

* Update test

* Pick up preference from host and update test

* Shorten flag name

* Add missing utility function

* Update comment

* [WIP] rename flag and respond to cr

* [WIP] Add flag for forRelatedSymbol

* Use larger search symbol set for old-style rename

* Respond to CR

* Fix small error

* Fix type mismatch

* Update comment and remove unnecessary exprot

* Respond to CR
2019-01-16 10:58:07 -08:00
Andrew Casey
35f64fa894 Merge pull request #29421 from amcasey/DisabledLSHardening
Harden telemetryOnOpenFile against disabled projects
2019-01-15 11:23:05 -08:00
Andrew Casey
3fb09630a8 Add regression test 2019-01-15 10:55:15 -08:00
Benjamin Lichtman
c5948bf068 Merge pull request #29385 from uniqueiniquity/renameImportPref
Add user preference to opt-in to renaming import paths
2019-01-15 10:29:57 -08:00
Benjamin Lichtman
d029fae35c Add user preference to opt-in to renaming import paths 2019-01-11 14:45:08 -08:00
Sheetal Nandi
b23664adf7 Test to verify external source map range addition 2019-01-11 12:23:24 -08:00
Sheetal Nandi
1b37830615 Merge branch 'master' into incrementalBuild 2019-01-09 10:40:01 -08:00
Sheetal Nandi
76c9d9f717 Fix the failing test case 2019-01-08 16:08:43 -08:00
Sheetal Nandi
1870ee4099 Merge branch 'master' into tsconfig_canonicalpath 2019-01-08 16:04:22 -08:00
Sheetal Nandi
93249db692 Use the sourceFile to determine the jsxNamespace at the location for organizingImports
Fixes #28827
2019-01-04 14:12:04 -08:00
Sheetal Nandi
a633f95da7 Do not cache semantic diagnostics with --isolated modules
Fixes #28332
2019-01-03 14:07:25 -08:00
Klaus Meinhardt
2a2b573fa2 Merge branch 'master' of github.com:Microsoft/TypeScript into shebang-comments 2019-01-03 22:44:57 +01:00
Sheetal Nandi
c426fc6868 Merge branch 'master' into tscWatchExportUpdate 2019-01-03 11:35:54 -08:00
Sheetal Nandi
d35ea02cc6 Merge pull request #29247 from ajafff/organizeimports-crash
Fix crash in organizeImports
2019-01-03 08:54:34 -08:00
Klaus Meinhardt
6eb9165553 Merge branch 'master' into shebang-comments 2019-01-03 17:38:25 +01:00
Klaus Meinhardt
6a9ad0e2eb Fix crash in organizeImports
Fixes: #29236
2019-01-03 16:20:46 +01:00
Sheetal Nandi
24cc284d19 The assert that cached value of config file existance is always correct, might not be true if file watcher is not invoked before creating configured project
Fixes #29191
2019-01-02 15:42:12 -08:00
Benjamin Lichtman
2dd6e20ef9 Only provide suggestion for outermost async fix 2018-12-31 11:50:40 -08:00
Sheetal Nandi
b360ff770a Write the tests for incremental build and declaration emit errors handling
These will fail since its still TODO
2018-12-26 12:07:12 -08:00
Sheetal Nandi
7b290fdbd4 Update the timestamps of outputs that dont need to be written because of incremental build
This ensures that after `tsbuild` after incremental build of `tsbuild -w` doesnt result in unnecessary rebuilds
2018-12-21 12:56:03 -08:00
Sheetal Nandi
48baa42d65 Make SolutionBuilder handle BuilderProgram in preparation to handle incremental builds 2018-12-21 12:53:25 -08:00
Sheetal Nandi
efc71602cd Refactor tsc-watch tests 2018-12-20 14:17:43 -08:00
Sheetal Nandi
f117184562 More tsserver tests refactoring 2018-12-20 14:00:45 -08:00
Sheetal Nandi
db4d9b3050 Add unittests:: on all unittests describe blocks for easy run 2018-12-20 13:20:53 -08:00
Sheetal Nandi
53e2507f60 More scenarios in their own test 2018-12-20 12:55:18 -08:00
Sheetal Nandi
5c8ef3934d Move the tests into their own folder for easy scenario search 2018-12-20 12:19:18 -08:00
Sheetal Nandi
9e17a66151 Sym links into single test 2018-12-20 12:18:43 -08:00
Sheetal Nandi
5234b8b18e Move more tests into resolutionCache and project errors 2018-12-20 12:17:02 -08:00
Sheetal Nandi
160c73f942 Separate out caching file system test 2018-12-20 12:16:47 -08:00
Sheetal Nandi
96c73701c1 More refactoring for resloutionCache and project errors 2018-12-20 12:16:23 -08:00
Sheetal Nandi
f6ac949596 Separate out LargeFileReferencedEvent test 2018-12-20 12:15:58 -08:00
Sheetal Nandi
04e190abb7 ProjectUpdatedInBackground in a separate unittest 2018-12-20 12:15:43 -08:00
Sheetal Nandi
39ec69e26e Separate out tests for project loading events into their own unittest file 2018-12-20 12:15:25 -08:00
Sheetal Nandi
03d66dd2ef Emit error tsserver tests into projectErrors 2018-12-20 12:12:54 -08:00
Sheetal Nandi
37a080bca9 tsserver's typingInstaller test into typingsInstaller unittest 2018-12-20 12:12:37 -08:00
Sheetal Nandi
1b6db32ecd Move error tests from tsserver project system to projectErrors 2018-12-20 12:12:19 -08:00
Sheetal Nandi
53a6968f06 More refactoring for compile on save 2018-12-20 12:11:59 -08:00