96 Commits

Author SHA1 Message Date
Sheetal Nandi
c6ca96bdcf Removing debugger statements from tests 2018-08-03 15:41:44 -07:00
Sheetal Nandi
77e29b7f0e
Merge pull request #26169 from Microsoft/largeFile
Do not read files greater than maxFileSize which is currently 4mb
2018-08-03 10:38:02 -07:00
Sheetal Nandi
46d223dc1b Fixes to ensure getDefinitionAndBoundSpan works correctly when using composite projects
Project references need to be detached from the project when closing project
In SourceMapDecoder handle when the redirected file to project reference is set as the output of the project
Keep configured project alive if project it references has open ref
Fixes #26164
2018-08-02 16:36:50 -07:00
Sheetal Nandi
135425d40b Do not read files greater than maxFileSize which is currently 4mb
Fixes #24762
2018-08-02 13:03:58 -07:00
Sheetal Nandi
924228b45b Merge branch 'master' into errorInFileWithDeepImport 2018-08-01 15:36:52 -07:00
Sheetal Nandi
a5a26ec939
Merge pull request #26109 from Microsoft/invalidTsconfig
Handle when property name turns out to be non string literal computed name because of errors in tsconfig file
2018-08-01 09:04:13 -07:00
Andy
9c9f3e3cf9
importFixes: When one file redirects to another, consider both for global import specifiers (#25834)
* importFixes: When one file redirects to another, consider both for global import specifiers

* Add test for #26044

* Avoid a symlinked package globally importing itself (fixes another case of #26044)

* Compare to node_modules with getCanonicalFileName
2018-07-31 17:28:56 -07:00
Sheetal Nandi
3c971ed685 Handle when property name turns out to be non string literal computed name because of errors in tsconfig file
Fixes #26076
2018-07-31 17:23:55 -07:00
Sheetal Nandi
7bd1c8e6aa
Merge pull request #25811 from Microsoft/subDirectoryOfRootWatches
Watch subdirectories in project root instead of watching project root…
2018-07-31 11:51:16 -07:00
Mohamed Hegazy
aaf14f47b7
Merge pull request #26065 from ajafff/createbinary-arrow-parens
createBinary: parenthesize ArrowFunction in RHS
2018-07-31 11:27:53 -07:00
Sheetal Nandi
d65cb21fcd Keep the original configured project alive created during findAllReferences 2018-07-30 14:44:21 -07:00
Sheetal Nandi
f3b0a2de06 Move the original location getter to ProjectService.
This is in anticipation of work needed to keep original projects alive
2018-07-30 14:44:21 -07:00
Sheetal Nandi
1345a35e5f
Merge pull request #26012 from Microsoft/compileOnSaveOptimization
If project name is specified in compile on save, do not update all projects to just use that project
2018-07-30 14:43:18 -07:00
Sheetal Nandi
7b405c4ad9 Test that verifies we arent updating all projects unnecessarily when called with compileOnSave and project 2018-07-30 14:10:56 -07:00
Sheetal Nandi
9196b7db33
Merge pull request #25851 from Microsoft/configFileDiag
Report compiler options errors as well as part of configFileDiag event
2018-07-30 11:07:07 -07:00
Klaus Meinhardt
4dabd650ed createBinary: parenthesize ArrowFunction in RHS
Fixes: #25964
2018-07-30 19:22:30 +02:00
Mohamed Hegazy
fd2eb4918d
Merge pull request #25604 from mprobst/fix-exported-var-comments
Retain synthetic comments on exports.
2018-07-24 17:41:44 -07:00
Wesley Wigham
59854bbd55
Inspect all possible module paths when looking for the best one to create a specifier with (#25850)
* Inspect all possible specifier paths when looking for the best one

* Add missing secondary option from test
2018-07-24 13:56:21 -07:00
Sheetal Nandi
a9d497a008 Report compiler options errors as well as part of configFileDiag event
Fixes #25741
2018-07-20 18:04:08 -07:00
Andy
93722c8942
findAllReferences/rename: Search in all open projects (#25648)
* findAllReferences/rename: Search in all open projects

* Avoid needing a dummy location when location is unused

* Remove Program#getDeclarationEmitPath

* Only iterate over enabled projects
2018-07-20 16:53:59 -07:00
Sheetal Nandi
4ee3f2b3ea Watch subdirectories in project root instead of watching project root so as to avoid watching excluded directories that are not part of config file
Fixes #25629 and Microsoft/vscode#51139
2018-07-19 17:21:50 -07:00
Andy
2701f785ed
Consistently use ScriptInfo for converting positions to Locations (#25623)
* Consistently use ScriptInfo for converting positions to Locations

* Code review
2018-07-18 13:02:38 -07:00
Martin Probst
c50a6f7389 Fix comment emit for namespaces & enums.
Keep emit flags set on the original node on a namespace or enum node.
This prevents dropping flags like NoComments, which caused duplicated
comment emits.

Additionally, TypeScript would emit synthetic comments twice, once for
the variable declaration, once for the module statement. This explicitly
clears away synthetic comments on namespaces and enums if their
synthetic comments have already been emitted on the corresponding
variable statement.
2018-07-18 17:23:28 +02:00
Martin Probst
2529b864f4 Retain synthetic comments on classes and their properties. 2018-07-18 17:23:27 +02:00
Martin Probst
1bd79af760 Reduce duplication of addSyntheticComment. 2018-07-18 16:30:32 +02:00
Martin Probst
6f114a2c9b Fix comments for import and export declarations.
Previously, TypeScript would only set the text range when transforming
import and export declarations, leading it to drop synthetic comments
and emit flags.

This commit sets the original node on the statements that contains the
generated `require()` call (or similar, depending on module system),
retaining emit flags and synthetic comments.
2018-07-18 16:30:32 +02:00
Martin Probst
db888b8670 Retain synthetic comments on exported variables.
Variables that do not have a local variable created get transformed into
a single exports assignment expression. TypeScript previously just
created a new expression and set the text range to retain original
comments, but for synthetic comments, merging the emit nodes by setting
the original node is required.
2018-07-18 16:30:32 +02:00
Daniel Rosenwasser
60986adee5
Merge pull request #25507 from ajafff/leftmost-expr-tagged-template
getLeftmostExpression: handle TaggedTemplateExpression
2018-07-13 23:56:32 -07:00
Andy
e25a23bb3c
Fix Buffer.from uses to handle node 5.4.1 bug (#25659) 2018-07-13 17:08:25 -07:00
Sheetal Nandi
49ac60f286 Support resolveJsonModule option when files contain the json file
Fixes #25636
2018-07-13 12:21:51 -07:00
Sheetal Nandi
ca083809a4 Fix incorrect handling of preserveWatchOutput flag is in config file
Fixes #25620
2018-07-12 18:29:02 -07:00
Andy
af412e39cf
mapTextChangesToCodeEditsUsingScriptInfo: Handle tsconfig.json text change (#25586)
*  mapTextChangesToCodeEditsUsingScriptInfo: Handle tsconfig.json text change

* Can't use `program.getSourceFile()` to determine file existence when multiple projects exist

* Use direct union instead of discriminated union
2018-07-12 12:09:04 -07:00
Sheetal Nandi
585acb1990 Use exported modules through declaration emit to invalidate the semantic diagnostics
Fixes #24986
2018-07-11 16:43:02 -07:00
Sheetal Nandi
d93e0d4096 Add test for reporting errors from deep import.
Test case for #24986
2018-07-10 15:43:31 -07:00
Sheetal Nandi
821ebcb529 Merge branch 'master' into cacheRecursiveDirectoryWatchers 2018-07-10 15:08:14 -07:00
Andy
e9e5ebee73
getEditsForFileRename: Handle all projects and source-mapped files (#25522)
* getEditsForFileRename: Handle all projects and source-mapped files

* Update API (#24966)

* Use areEqual
2018-07-09 17:58:02 -07:00
Ryan Cavanaugh
e532f53189
Merge pull request #25531 from RyanCavanaugh/fix25527
Don't crash when an implicit rootDir constraint is violated under composite: true
2018-07-09 17:51:17 -07:00
Ryan Cavanaugh
72f0789908 Don't crash when an implicit rootDir constraint is violated under composite:true
Fixes #25527
2018-07-09 15:41:15 -07:00
Sheetal Nandi
f941226011 Do not watch modules that get resolved by ambient modules 2018-07-09 12:05:29 -07:00
Klaus Meinhardt
165a87affa getLeftmostExpression: handle TaggedTemplateExpression 2018-07-08 21:25:09 +02:00
Nathan Shively-Sanders
10b174abc1
Fix lineText in references command (#25494)
Previously it was just the identifier text. Now it is back to the full
text of the line.
2018-07-06 16:23:11 -07:00
Klaus Meinhardt
25610de38a Merge branch 'master' into factory-export-default 2018-07-06 08:40:12 +02:00
Sheetal Nandi
9c6c333b67 Caches the recursive directory watchers so we do not have to traverse and recreate more children watches
Helps with #25018
2018-07-05 16:06:17 -07:00
Andy
64555aa6a9
navigateTo: Collect results from all referenced projects. (#25283)
* navigateTo: Collect results from all referenced projects.

* Don't use project references, just source maps

* Move more code to session

* Test when implementation file is deleted

* Use tsserver tests instead of fourslash tests to ensure session is used

* Support find-all-references

* Restore fourslash tests

* Update emit baselines (added missing newline)

* Support rename

* @weswigham code review

* Don't open/close files

* Avoid growing `toDo` too eagerly

* @sheetalkamat code review

* Also get symlinked projects for originalLocation

* Update API (#24966)

* More @sheetalkamat code review

* Remove unnecessary test

* Update API (#24966)
2018-07-05 15:39:03 -07:00
Wesley Wigham
5b92678285
Optimize sourcemap application more (#25425)
* Optimize sourcemap application more

* Remove test-only memory hog sourceMapDecodedMappings field

* Update for style, remove unused function that triggers warnings in node 10

* Avoid all raw buffer constructor calls

* Small TDZ fix
2018-07-05 15:12:10 -07:00
Klaus Meinhardt
f4470cd342 createArrowFunction: parenthesize comma sequence
Fixes: #25366
2018-07-04 20:47:06 +02:00
Klaus Meinhardt
755dc83880 Merge branch 'master' of github.com:Microsoft/TypeScript into factory-export-default 2018-07-04 20:34:04 +02:00
Daniel Rosenwasser
e4145e3017
Merge pull request #25342 from ajafff/factory-leftmost-expression
getLeftmostExpression: handle AsExpression and NonNullExpression
2018-07-03 18:02:04 -07:00
Sheetal Nandi
4175773637 Fix typo to fix logging when built with --watch --diagnostics 2018-07-03 13:06:06 -07:00
Daniel Rosenwasser
e13fd0c568
Merge pull request #24915 from Microsoft/triggerSignatureHelpIArdlyKnowSignatureHelp
Trigger characters in signature help
2018-07-02 23:36:57 -07:00