Commit Graph

2734 Commits

Author SHA1 Message Date
Andy
5725428f2d fixUnusedIdentifier: Handle destructure with all bindings unused (#23805)
* fixUnusedIdentifier: Handle destructure with all bindings unused

* Add parameters test

* Add test for 'for' loop
2018-05-08 13:33:55 -07:00
Andy
ccfd3bf603 Handle BindingElement in fixUnusedIdentifier (#23819)
* Handle BindingElement in fixUnusedIdentifier

* Add array destructure tests
2018-05-08 11:23:01 -07:00
Andy
123ae530a7 convertToEs6Module: Replace 'module.exports =' with 'export default' without replacing nodes (#23948) 2018-05-07 15:45:43 -07:00
Andy
a50001c9da Treat 'import("")' as a module reference (#23949) 2018-05-07 15:42:36 -07:00
Sheetal Nandi
8fc4242097 Merge pull request #23915 from Microsoft/jsonCompletions
Suggest json files in completion when resolveJsonModule is set and module resolution is node
2018-05-07 12:53:09 -07:00
Andy
004a558125 Avoid unnecessary newline when inserting node at start of class (#23935) 2018-05-07 12:40:33 -07:00
Andy
2604bb4dd3 Add 'string' ScriptElementKind (#23821) 2018-05-07 12:39:00 -07:00
Mohamed Hegazy
e39e6fc780 Merge pull request #23894 from Microsoft/importOutlining
Add outlining spans for Import declarations
2018-05-07 12:08:11 -07:00
Andy
a05feed839 generateGetAccessorAndSetAccessor: Preserve a parameter property declaration (#23318) 2018-05-07 11:33:00 -07:00
Andy
d6701d3987 Replace verify.rangesReferenceEachOther with verify.singleReferenceGroup (#23933) 2018-05-07 11:06:21 -07:00
Andy
7fa5f70b9a Remove verify.referencesAre, verify.referencesOf, verify.rangesReferenceEachOther (#23900) 2018-05-07 10:08:38 -07:00
Mohamed Hegazy
64d6b24c87 Code review comments 2018-05-05 13:22:48 -07:00
Mohamed Hegazy
12ed49bada Revert adding named import binding list outlining spans 2018-05-05 12:04:12 -07:00
Sheetal Nandi
e8cd6b1111 Suggest json files in completion when resolveJsonModule is set and module resolution is node
Fixes #23899
2018-05-04 17:10:48 -07:00
Andy
cecad27662 findAllReferences: Treat a nested property in a jsdoc type literal as a definition (#23901)
* findAllReferences: Treat a nested property in a jsdoc type literal as a definition

* Fix lint
2018-05-04 16:58:07 -07:00
Mohamed Hegazy
82381280cf Merge branch 'master' into importOutlining 2018-05-04 15:58:56 -07:00
Andy
df9e2621d2 Fix find-all-refs for import("mod").Foo where Foo is a typedef (#23881)
* Fix find-all-refs for import("mod").Foo where Foo is a typedef

* Add Debug.assertNever message

* Ensure SemanticMeaning is matched
2018-05-04 13:32:40 -07:00
Mohamed Hegazy
a59ac8fd33 Update test 2018-05-04 11:29:54 -07:00
Mohamed Hegazy
2d725feb51 Add outlining span for named bindings in import declarations 2018-05-04 11:26:03 -07:00
Mohamed Hegazy
de13cc4692 Merge remote-tracking branch 'origin/master' into importOutlining 2018-05-04 10:40:58 -07:00
Mohamed Hegazy
f1713c92d3 Add outlining spans for import declarations 2018-05-04 10:39:47 -07:00
Mohamed Hegazy
1a320fcd5e Merge pull request #23883 from Microsoft/outliningSpanKind
Fix #22419: Add `kind` field to `OutliningSpan`
2018-05-04 09:16:01 -07:00
Mohamed Hegazy
e52efb04f3 Fix #22419: Add kind field to OutliningSpan 2018-05-03 16:28:55 -07:00
Wesley Wigham
0d7d75ec64 Add formatting rule for import type import keyword and open paren (#23872) 2018-05-03 14:57:01 -07:00
Andy
406ca06e8e Fix bug: JSDocPropertyTag is a declaration (#23876) 2018-05-03 14:19:15 -07:00
Andy
38016f9300 Implement feedback on "Improve completions testing" (#23842) 2018-05-03 13:04:08 -07:00
Andy
bad3a44bb2 In insertNodeAfter, handle file with no trailing newline (#23814) 2018-05-03 12:58:42 -07:00
Ron Buckton
56648ad0f1 Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00
Andy
724e656acb Don't show a definition at a 'require' call (#23822) 2018-05-03 08:02:56 -07:00
Andy
306418e171 fixAddMissingMember: Add a new PropertyDeclaration at the end of the first set (#23837) 2018-05-02 15:42:05 -07:00
Ron Buckton
66c11c527a Update completion order in test 2018-05-02 10:51:09 -07:00
Ron Buckton
d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Andy
333b8ff028 Fix typo: || should be parenthesized (#23811) 2018-05-01 14:59:58 -07:00
Andy
a1f9a4fb24 fixCannotFindModule: Special handling for node core modules like "fs" (#23807)
* fixCannotFindModule: Special handling for node core modules like "fs"

* Hardcode @types/node
2018-05-01 14:33:42 -07:00
Andy
9f4abe2d79 Improve completions testing (#23591) 2018-05-01 13:00:13 -07:00
Andy
cee4289f58 Add code fix to convert 'require' in a '.ts' file to an 'import' (#23711)
* Add code fix to convert 'require' in a '.ts' file to an 'import'

* Only add suggestion for modules

* Revert "Only add suggestion for modules"

This reverts commit b1a728fdac.
2018-05-01 09:24:02 -07:00
Nathan Shively-Sanders
7cda045d52 Always export typedefs (#23723)
* Always export typedefs

This actually just required deleting a check in declareModuleMembers
and checking for external AND commonjs modules in a couple of places.

However, while experimenting with this feature, I discovered that even
previously-exported typedefs would only be exported if they came after a
commonjs export node. So I added a commonjs check to the pass in the
parser. It will not catch nested module.exports, but it will catch
top-level assignments.

The new test tests both changes.

* Post-bind typedef instead of pre-checking for commonjs

* Duplicate identifier errors

* Fix class type reference resolution+update baselines

* Move to a type-based check for duplicate identifiers
2018-04-30 14:55:26 -07:00
Mohamed Hegazy
8793b8c56b Merge pull request #23697 from Ken703/bug/23047
Formatting: fix unwanted space between closing parenthesis and string template
2018-04-30 10:19:17 -07:00
Ken703
4e401ca361 update string template rule and test 2018-04-28 19:59:41 -04:00
Ron Buckton
4863d55d01 Merge branch 'master' into vfs 2018-04-27 14:03:42 -07:00
Andy
aa102435b3 Fix insertNodeAtClassStart for empty class with comment (#23342) 2018-04-26 08:00:38 -07:00
Ken703
d9bc436788 Auto format: no space between closing parenthesis and string template 2018-04-25 21:10:35 -04:00
Andy
cdfd92b90d Don't add import completion from a re-export in "./index" (#23623)
* Don't add import completion from a re-export in "./index"

* Simpler heuristic
2018-04-25 16:15:49 -07:00
Andy
5280d23b63 importNameCodeFix: consistently put fixes to use existing imports before fixes for existing imports (#23663) 2018-04-25 08:04:20 -07:00
Andy
59765e2d86 goToDefinition: Also add definitions for symbol if it does not match the signature symbol (#23657) 2018-04-24 09:41:47 -07:00
Andy
eca17ac243 Support import fix even when the error is that a type is used as a value (#23655) 2018-04-24 08:54:14 -07:00
Ron Buckton
bb26ab5556 Merge branch 'master' into vfs 2018-04-23 22:48:48 -07:00
Andy
fc30bd10e3 Suggestion to convert to ES6 module should only trigger in projects which express some intent to use ES6 (#23576) 2018-04-23 16:05:37 -07:00
Nathan Shively-Sanders
905f9a02ad module.exports = Entity is an alias, just like export = Entity (#23570)
* Make `module.export =` an alias like `export=` is

This breaks a couple of tests for previous workarounds. Fix in upcoming
commits.

* Basically fixes all the breaks, but needs cleanup

* More notes to myself

* Clean up TODOs

* Call mergeSymbolTable and delete export= afterward

instead of basically copying the code myself.

* More cleanup

* Remove unnecessary check in import type checking

* Revert to DIY code.

It is more correct and will go away in a few days.

* Exported class expressions can be used as type

In both JS and TS

* Do not require named class expressions
2018-04-23 15:24:31 -07:00
Andy
222f35d927 Make symbol display at ExportSpecifier use 'export', not 'import' (#23629) 2018-04-23 13:29:14 -07:00