Commit Graph

3842 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
9b36e1155a Merge pull request #19039 from Microsoft/guard-name-in-getSuggestionForNonexistentSymbol
In getSuggestionForNonexistentSymbol, guard name against undefined
2017-11-07 15:03:26 -08:00
Andrew Casey
62eeb7254c Merge pull request #19791 from amcasey/ImportLineBreaks
Handle windows linebreaks in getSourceFileImportLocation
2017-11-07 11:34:39 -08:00
Andrew Casey
2715f890b4 PascalCase -> camelCase 2017-11-07 10:47:36 -08:00
Andrew Casey
3e339d88a1 Handle other linebreak characters and add boundary checks 2017-11-07 10:33:35 -08:00
Andrew Casey
d1fa006a1e Use CharacterCode enum 2017-11-07 10:10:34 -08:00
Aluan Haddad
b2b54cbf5c Import fix add import require support (#19802)
* import fix: suggest import..require where supported if synthetic defaults are unavailable

* Add tests for import..require fix when targeting CommonJS, AMD, and UMD modules

* fix failing tests
2017-11-07 09:45:30 -08:00
Andy
bd2e97597d Enable 'no-empty' tslint rule (#19769)
* Enable 'no-empty' tslint rule

* Fix bug
2017-11-07 09:22:28 -08:00
Andy
2fcf8b7068 Fix assertion -- an import may come from a require() call (#19667)
* Fix assertion -- an import may come from a require() call

* Add test for `import("./a")`
2017-11-07 07:41:21 -08:00
Aluan Haddad
70cabdda41 fix inconsistencies in import UMD code fixes adapting to module format (#19572)
* improve import code fixes for UMD modules
 - use default import under --allowSyntheticDefaultImports
 - import..require support
 - make make quick fix info match resulting import
 - make diagnostics

* Address PR feedback:
 - extract test for synethetic default imports into getAllowSyntheticDefaultImports in core.ts
 - use getAllowSyntheticDefaultImports in checker.ts and importFixes.ts
 - move compilerOptions to top level destructuring

* add tests

* remove `import =` quick fix and supporting code.

* update feature tests

* remove errant whitespace
2017-11-06 22:55:37 -08:00
Andy
6d273cfb33 Consistently use "JSX Attribute" completion kind (#19781)
* Consistently use "JSX Attribute" completion kind

* Update tests and fix bug

* Fix bug: In a JsxOpeningElement, if at an Identifier we are not at an attribute but at the tag itself.
If at a GreaterThanToken, we are about to fill in an attribute.
2017-11-06 19:14:24 -08:00
Ron Buckton
3f248ecfe1 Merge pull request #19452 from Microsoft/compareStrings
Clean up outdated string comparison logic
2017-11-06 18:48:15 -08:00
Andy
77b24aec83 Apply 'unified-signatures' tslint rule (#19738)
* Apply 'unified-signatures' tslint rule

* Fix new failure
2017-11-06 18:38:03 -08:00
Andrew Casey
2f13222180 Handle windows linebreaks in getSourceFileImportLocation 2017-11-06 18:29:38 -08:00
Sean Barag
a46d2705ef Use documentation comments from inherited properties when @inheritDoc is present (#18804)
* Use documentation comments from inherited properties when @inheritDoc is present

The JSDoc `@ineheritDoc` [tag](http://usejsdoc.org/tags-inheritdoc.html)
"indicates that a symbol should inherit its documentation from its
parent class".  In the case of a TypeScript file, this also includes
implemented interfaces and parent interfaces.

With this change, a class method or property (or an interface property)
with the `@inheritDoc` tag in its JSDoc comment will automatically use
the comments from its nearest ancestor that has no `@inheritDoc` tag.
To prevent breaking backwards compatibility,
`Symbol.getDocumentationComment` now accepts an optional `TypeChecker`
instance to support this feature.

fixes #8912

* Use ts.getJSDocTags as per @andy-ms 's recommendation

* Convert @inheritDoc tests to verify.quickInfoAt

* Concatenate inherited and local docs when @inheritDoc is present

* Make typeChecker param explicitly `TypeChecker | undefined`

* Re-accept baseline after switch to explicit `| undefined`

* Update APISample_jsodc.ts to match new getDocumentationComment signature

* Re-accept baselines after rebasing
2017-11-06 13:18:21 -08:00
Andy
ed38889ca6 Enable 'no-unused-expression' tslint rule (#19734) 2017-11-06 13:01:07 -08:00
Benjamin Lichtman
4977bf4328 Merge pull request #19544 from uniqueiniquity/interfaceJsDoc
Insert JsDoc comment templates for additional nodes
2017-11-06 09:49:59 -08:00
Andy
0a7b7e07ee Apply 'variable-name' tslint rule (#19743) 2017-11-06 09:23:47 -08:00
Ron Buckton
31c3d444f1 Merge branch 'master' into compareStrings 2017-11-03 23:01:51 -07:00
Andy
8d5b0529b2 Add localizable diagnostic for "Install '{0}'" (#19651) 2017-11-03 18:14:21 -07:00
Andy
bb7fb7dda9 For getCompletionsAtPosition, require a flag to provide completions with code actions (#19687)
* For getCompletionsAtPosition, require a flag to provide completions with code actions

* Change name

* Increase API version

* Update API baselines

* Add comment

* Update API baseline
2017-11-03 15:55:31 -07:00
Andy
d998e97d8c Apply 'prefer-for-of' tslint rule (#19721) 2017-11-03 15:20:35 -07:00
Andy
1d7f449a87 Minor cleanups in pathCompletions.ts (#19685)
* Minor cleanups in pathCompletions.ts

* Update name
2017-11-03 15:06:22 -07:00
Andy
749e151c23 Support path completions inside node_modules (#19692)
* Support path completions inside node_modules

* Fix: Start searching from current file's directory, not host.getCurrentDirectory()

* Add test for nested node_modules

* Also test in /src/folder/b.ts
2017-11-03 15:05:44 -07:00
uniqueiniquity
21093503a8 Respond to CR 2017-11-03 11:19:53 -07:00
uniqueiniquity
612616a105 Loosen restrictions on jsdoc completion locations 2017-11-03 09:53:56 -07:00
Andy
d54ad4b01a Add refactoring to use default import (#19659)
* Add refactoring to use default import

* Add localizable description
2017-11-03 08:31:13 -07:00
Andy
cc2a2a79b5 Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors (#17831)
* Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors

* Set context flags on tokens

* Remove 'isDeclarationFile' parameter to 'initializeState' and move to 'parseSourceFileWorker'

* Changes based on code review

* Update API baselines
2017-11-03 08:08:48 -07:00
Andy
f67a9ba96e Apply 'interface-name' lint rule (#19695) 2017-11-02 17:20:18 -07:00
Andy
fd41521421 Enable 'callable-types' tslint rule (#19654) 2017-11-02 17:16:09 -07:00
Andy
01ad4f7dfb Support quick info at function and => locations (#19669)
* Support quick info at `function` and `=>` locations

* Fixes
2017-11-02 14:47:23 -07:00
uniqueiniquity
b1b611f40a Add undefined to return type 2017-11-02 11:08:26 -07:00
uniqueiniquity
12baae6c84 Revert "Return empty doc comment instead of undefined"
This reverts commit 22eb519b0f.
2017-11-02 10:59:58 -07:00
uniqueiniquity
509b9ad087 Complete to single line jsdoc comment if no params 2017-11-02 09:55:56 -07:00
Mike Morearty
1a7a587a9e Fix TokenOrIdentifierObject.getText() crash (#19673)
TokenOrIdentifierObject.getText() needs to pass `sourceFile` as an
argument to `getStart()`.

Fixes https://github.com/Microsoft/TypeScript/issues/19670
2017-11-01 16:37:06 -07:00
Nathan Shively-Sanders
146addc4d5 Use explicit undefined checkk 2017-11-01 10:35:54 -07:00
Nathan Shively-Sanders
f4d4e89fa9 Merge branch 'master' into guard-name-in-getSuggestionForNonexistentSymbol 2017-11-01 10:34:19 -07:00
Nathan Shively-Sanders
a6a5b85b52 Switch from undefined guard to asserts
In both fixSpelling and getSuggestionForNonexistentSymbol
2017-11-01 10:33:24 -07:00
Benjamin Lichtman
dcc1f1497f Merge pull request #19619 from uniqueiniquity/indentJsxText
Properly indent JSXText on format document
2017-11-01 09:03:52 -07:00
Armando Aguirre
cf2bdf8250 Merge pull request #19175 from armanio123/AddDefinitionAndBoundSpan
Added DefinitionAndBoundSpan command
2017-10-31 14:58:36 -07:00
uniqueiniquity
b6ea2f955a Refactor test and annotate object literal 2017-10-31 14:52:15 -07:00
wenlu.wang
deb94886fd fix completion module path (#19351)(#19367) (#19366)
* completion module path with re-export(#19351)

* completion module path with dynamic import(#19367)
2017-10-31 14:10:38 -07:00
uniqueiniquity
f962aba24a Indent all lines of single JsxText node 2017-10-31 14:09:36 -07:00
Ron Buckton
542a060875 Remove case-insensitive UI comparisons for now 2017-10-31 12:33:35 -07:00
Ron Buckton
1d0a9ee453 PR feedback 2017-10-31 10:49:08 -07:00
Andy
f4236ec5c8 Rename "isPartOfExpression" (#18469) 2017-10-31 08:05:39 -07:00
Armando Aguirre
d5c18a6fb7 Merge branch 'master' into AddDefinitionAndBoundSpan 2017-10-30 17:02:23 -07:00
Andrew Casey
a89c055a48 Merge pull request #19578 from amcasey/GH19395
Don't pass synthesized node to typeToTypeNode
2017-10-30 16:35:20 -07:00
Andy
277e3189c2 Make getCompletionEntryDetails and getCompletionEntrySymbol parameters non-optional (#19507)
* Make getCompletionEntryDetails and getCompletionEntrySymbol parameters non-optional

* Increment servicesVersion

* Update api baselines
2017-10-30 15:10:34 -07:00
uniqueiniquity
976c25c672 Add support for enums and property signatures 2017-10-30 15:05:55 -07:00
Mohamed Hegazy
6c71ca84e7 Add utility function to check for strict option flags (#19427)
* Add utility function to check for strict option flags
- Correctelly check for noImplicitAny in checker
- Correctelly check for noImplicitAny in installTypesForPackage refactor

* Respond to code review comments

* Accept baselines

* Revert "Accept baselines"

This reverts commit cf4ef62830.

* Move type alias to core
2017-10-30 13:05:54 -07:00