Commit Graph

3793 Commits

Author SHA1 Message Date
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
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
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
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
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
Ron Buckton
91c37f72d3 Merge pull request #19401 from Microsoft/fix19349
Remove escaped names of well known symbols from string completions
2017-10-30 12:37:13 -07:00
Andrew Casey
aa59a69e14 Correct typo - pass correct argument
All of the other calls in extractSymbol are already correct.
2017-10-30 11:21:22 -07:00
Andy
212efd5c7b In quick info, show all jsdoc tags (#19357) 2017-10-30 10:27:19 -07:00
Andy
9c96eee7a4 Support completion details for special JsDoc completions (#19494) 2017-10-26 10:58:33 -07:00
Andy
9615e54e13 Support multiple completions with the same name but different source module (#19455)
* Support multiple completions with the same name but different source module

* Use optional parameters for source

* Simplify use of `uniques`

* Update test

* Fix `undefined` error
2017-10-26 08:22:17 -07:00
Armando Aguirre
f3059ce698 Addressed PR comments. 2017-10-24 16:08:23 -07:00
Armando Aguirre
c62f2880cb Merge branch 'AddDefinitionAndBoundSpan' of https://github.com/armanio123/TypeScript into AddDefinitionAndBoundSpan 2017-10-24 14:02:41 -07:00
Armando Aguirre
7f577dcef3 Added triple slash support 2017-10-24 14:02:02 -07:00
Andrew Casey
e4d5d1c16d Extract refineNode into its own function 2017-10-24 11:33:30 -07:00
Armando Aguirre
ae266f6aa1 Merge branch 'master' into AddDefinitionAndBoundSpan 2017-10-24 11:18:07 -07:00
Andrew Casey
1b6e991924 Demote some extraction ranges to produce better results
Attempt to extract return expressions, rather than return statements, and
initializers, rather than variable declarations.
2017-10-24 11:13:49 -07:00
Ron Buckton
a0412da4fa Merge branch 'master' into fix19349 2017-10-23 14:51:05 -07:00
Ron Buckton
9f1100cf30 PR cleanup 2017-10-23 13:55:31 -07:00
Andy
f916e38015 For @types installing quickfix, only activate for implicit-any module (#19394) 2017-10-23 13:36:36 -07:00
Ron Buckton
a31ce789f4 Remove escaped names of well known symbols from string completions 2017-10-21 17:19:46 -07:00
Mohamed Hegazy
e0d76d1dca Check for --strict along with --noImplicitAny for code fix 2017-10-20 14:39:58 -07:00
Mohamed Hegazy
8a292e3514 Update version (#19353)
* Update version

* Accept baselines after version change
2017-10-19 15:37:38 -07:00
Andy
1f282f19e0 Fix "noStringLiteral" lint errors (#19310) 2017-10-19 08:15:48 -07:00
Andy
a53d3bb5aa Remove some unnecessary undefined checks in extractSymbol (#19256) 2017-10-19 08:15:01 -07:00
Sheetal Nandi
8fc651870e Merge pull request #19306 from Microsoft/doNoWriteFilesMultipleTimes
Fixes the issue with emit where in same file is emitted multiple times
2017-10-18 16:12:36 -07:00
Andy
0f55f4a701 Use Promise instead of PromiseLike (#19305) 2017-10-18 16:04:42 -07:00
Armando Aguirre
16c3255988 Updated an incredible amount of tests. 2017-10-18 15:49:46 -07:00
Andy
f1abe3c284 Fix undefined error using getEffectiveTypeRoots (#19300) 2017-10-18 15:47:15 -07:00
Andy
e5f8287e5c findAllRefs: Support anonymous default export (#19302) 2017-10-18 15:46:39 -07:00
Wesley Wigham
75a687b524 make getCurrentDirectory required (#19303) 2017-10-18 14:57:18 -07:00
Nathan Shively-Sanders
b40e18df00 Merge pull request #19304 from Microsoft/dedupe-jsdoc-annotation-refactors
Fixes for refactor "Annotate with type from JSDoc"
2017-10-18 14:50:13 -07:00
Armando Aguirre
8004fec2ce Addressed PR comments: added simplified/full version, changed design 2017-10-18 14:48:06 -07:00
Sheetal Nandi
8fbfb5ffc0 Modify api to emit affected files using callback instead of generating in memory output
Also marking few apis introduced during watch improvements changes that are suppose to be internal for now
2017-10-18 13:34:13 -07:00
Nathan Shively-Sanders
f82dd7b1da Move isJSDocIndexSignature to utilities 2017-10-18 13:16:22 -07:00
Nathan Shively-Sanders
aa73ed8226 Fix bugs in jsdoc annotation refactor
1. Transform index signatures to TS index signatures.
2. Print object literals on a single line.
3. Only offer the refactor when it could add types. (There must not be a
type annotation already, and there must be a JSDoc that applies.)
2017-10-18 13:07:54 -07:00
Wesley Wigham
f9df4e69e6 Respect newLine compiler option in language service output (#19279) 2017-10-17 18:45:21 -07:00
Mohamed Hegazy
0c1730a218 Fix #19257: Ensure a generated signature has a return type (#19264)
* Fix #19257: Ensure a generated signature has a return type

* Ensure generated properties have types

* Use the same context for multiple inferences to the same property access
2017-10-17 16:51:22 -07:00
Nathan Shively-Sanders
64fc495234 Collapse jsdoc annotation refactors to one
Previously there were two, and two always fired.
2017-10-17 16:33:52 -07:00
Andy
d05443bb1d Add quickfix and refactoring to install @types packages (#19130)
* Add quickfix and refactoring to install @types packages

* Move `validatePackageName` to `jsTyping.ts`

* Remove combinePaths overloads

* Respond to code review

* Update api baselines

* Use native PromiseConstructor

* Return false instead of undefined

* Remove getProjectRootPath

* Update api
2017-10-17 15:04:09 -07:00
Andy
2b566b9a53 Add exported members of all project files in the global completion list (#19069)
* checker.ts: Remove null check on symbols

* tsserverProjectSystem.ts: add two tests

* client.ts, completions.ts, types.ts: Add codeActions member to CompletionEntryDetails

* protocol.ts, session.ts: Add codeActions member to CompletionEntryDetails protocol

* protocol.ts, session.ts, types.ts: add hasAction to CompletionEntry

* session.ts, services.ts, types.ts: Add formattingOptions parameter to getCompletionEntryDetails

* completions.ts: define SymbolOriginInfo type

* completions.ts, services.ts: Add allSourceFiles parameter to getCompletionsAtPosition

* completions.ts, services.ts: Plumb allSourceFiles into new function getSymbolsFromOtherSourceFileExports inside getCompletionData

* completions.ts: add symbolToOriginInfoMap parameter to getCompletionEntriesFromSymbols and to return value of getCompletionData

* utilities.ts: Add getOtherModuleSymbols, getUniqueSymbolIdAsString, getUniqueSymbolId

* completions.ts: Set CompletionEntry.hasAction when symbol is found in symbolToOriginInfoMap (meaning there's an import action)

* completions.ts: Populate list with possible exports (implement getSymbolsFromOtherSourceFileExports)

* completions.ts, services.ts: Plumb host and rulesProvider into getCompletionEntryDetails

* completions.ts: Add TODO comment

* importFixes.ts: Add types ImportDeclarationMap and ImportCodeFixContext

* Move getImportDeclarations into getCodeActionForImport, immediately after the implementation

* importFixes.ts: Move createChangeTracker into getCodeActionForImport, immediately after getImportDeclarations

* importFixes.ts: Add convertToImportCodeFixContext function and reference it from the getCodeActions lambda

* importFixes.ts: Add context: ImportCodeFixContext parameter to getCodeActionForImport, update call sites, destructure it, use compilerOptions in getModuleSpecifierForNewImport

* importFixes.ts: Remove moduleSymbol parameter from getImportDeclarations and use the ambient one

* importFixes.ts: Use cachedImportDeclarations from context in getCodeActionForImport

* importFixes.ts: Move createCodeAction out, immediately above convertToImportCodeFixContext

* Move the declaration for lastImportDeclaration out of the getCodeActions lambda into getCodeActionForImport

* importFixes.ts: Use symbolToken in getCodeActionForImport

* importFixes.ts: Remove useCaseSensitiveFileNames altogether from getCodeActions lambda

* importFixes.ts: Remove local getUniqueSymbolId function and add checker parameter to calls to it

* importFixes.ts: Move getCodeActionForImport out into an export, immediately below convertToImportCodeFixContext

* completions.ts: In getCompletionEntryDetails, if there's symbolOriginInfo, call getCodeActionForImport

* importFixes.ts: Create and use importFixContext within getCodeActions lambda

* importFixes.ts: Use local newLineCharacter instead of context.newLineCharacter in getCodeActionForImport

* importFixes.ts: Use local host instead of context.host in getCodeActionForImport

* importFixes.ts: Remove dummy getCanonicalFileName line

* Filter symbols after gathering exports instead of before

* Lint

* Test, fix bugs, refactor

* Suggestions from code review

* Update api baseline

* Fix bug if previousToken is not an Identifier

* Replace `startsWith` with `stringContainsCharactersInOrder`
2017-10-17 10:20:11 -07:00
Armando Aguirre
b86153da88 Changed command designed based on review input 2017-10-16 17:50:35 -07:00
Arthur Ozga
63074bcba0 Merge pull request #16695 from aozgaa/fixIifeIndentation
Fix indentation for function argument in call expression
2017-10-16 14:03:25 -07:00
Andy
bac30fc1a2 In convertFunctionToEs6Class.ts, share code for getting symbol (#19160) 2017-10-16 11:41:35 -07:00