Commit Graph
100 Commits
Author SHA1 Message Date
Andy HansonandNathan Shively-Sanders b0450aed56 Add codefix for --noImplicitThis (#27565)
* Add codefix for --noImplicitThis

* Code review

* Back to building post-merge

* Remove redundant functions + update tests

Infer-from-usage also inserts `this: any` parameters when needed, so I
removed that from fixImplicitThis.

Otherwise, fixImplicitThis has better suggestions than inferFromUsage,
so I moved inferFromUsage later in the suggestion order.

* More redundancy removal

Don't need to add `@this` anymore either since inferFromUsage will do
that.

* More baseline updates

From moving inferFromUsage down in priority I think?

* remove now-redundant ad-hoc jsdoc emit

* fix more bad merge

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-03-17 13:00:14 -07:00
Andy Hanson dc7c9bad3d Avoid eagerly computing test payload (#27851) 2019-04-25 13:26:19 -07:00
Andy Hanson 9168bd4845 Simplify hasExportDeclarations (#27846) 2019-04-25 13:25:48 -07:00
Andy Hanson aafba363e4 Avoid recalculating versionPaths in loadNodeModuleFromDirectory (#27537)
* Avoid recalculating versionPaths in loadNodeModuleFromDirectory

* Update baselines
2019-04-25 11:06:31 -07:00
Andy Hanson 6e4c150d6b When function parameters span multiple lines, make the function span start at the ( (#26907)
* When function parameters span multiple lines, make the function span start at the `(`

* Undo unnecessary change
2019-04-25 10:53:39 -07:00
Andy Hanson e007ccf97b Simplify chaining of transforms (#22994) 2019-04-25 10:38:20 -07:00
Andy Hanson ed277b8ee9 Handle GetAccessor and SetAccessor in isThisless (#27869) 2019-02-01 10:50:04 -08:00
Andy 79b9fa51b6 Avoid infinite loop checking yield expression (#21728)
* Avoid infinite loop checking yield expression

* Revert now-unneeded change

* Revert test filename changes
2018-11-19 11:18:32 -08:00
Andy ca7f78b8df Fix typo (#28526) 2018-11-19 10:54:54 -08:00
Andy b8a8ceae86 Handle merging unknownSymbol (#28453)
* Handle merging unknownSymbol

* mergeSymbol of unknown target returns source, not unknown
2018-11-19 10:51:58 -08:00
Andy Hanson 59c014ba32 Properly set symbolMeanings when calling getSymbolsInScope 2018-11-16 17:04:29 -08:00
Andy da33c580eb Minor cleanups in checkUnusedIdentifiers (#28513) 2018-11-16 16:58:36 -08:00
Andy 12f3d0d54c Enable --strictPropertyInitialization (#27558)
* Enable --strictPropertyInitialization

* Code review
2018-11-16 16:02:23 -08:00
Andy e0dca0bd95 Error when destructuring private property in a parameter (#28562) 2018-11-16 12:47:05 -08:00
Andy 1089424035 Ensure getApplicableRefactors doesn't crash when given a position (#28361) 2018-11-16 09:30:37 -08:00
Andy a6ef176dbb Consistently return 'void' from ChangeTracker methods (#28563) 2018-11-16 08:58:00 -08:00
Andy 0c4ceeec24 Don't consider 'typeof a' as using 'a' (#28528)
* Don't consider 'typeof a' as using 'a'

* Also handle markPropertyAsReferenced

* Use isInTypeQuery
2018-11-16 08:35:36 -08:00
Andy Hanson d29a072a4a Merge branch 'master' into tsconfig_canonicalpath 2018-11-15 17:20:13 -08:00
Andy b059135c51 When adding relative completions with rootDirs, still add completions for regular relative imports (#28561) 2018-11-15 15:11:27 -08:00
Andy 079f0436f3 Remove unused function (#28531) 2018-11-15 09:34:07 -08:00
Andy 2600250a24 Add 'bigint' to type keywords (#28537) 2018-11-14 22:18:05 -08:00
Andy Hanson 643678bb54 generateGetAccessorAndSetAccessor: Don't use FindAllReferences 2018-11-14 15:05:46 -08:00
Andy da37457c72 When renaming an imported symbol, rename only in current file (#28406)
* When renaming an imported symbol, rename only in current file

* Improve re-export references

* Remember to use 'range' in for loop

* Uncomment tests
2018-11-14 09:09:00 -08:00
Andy 995f746c92 Add implicit-any error on JSDocFunctionType with no return type (#28487) 2018-11-12 14:39:02 -08:00
Andy fe1ba9bee3 Improvements to generateTypes (#28458)
* Improvements to generateTypes

* createProperty only if necessary
2018-11-12 11:50:48 -08:00
Andy 0077016c63 Reduce duplicate code in getListByRange (#28455) 2018-11-12 09:43:40 -08:00
Andy e335a360c8 Change 'if' in combined switch case to two separate cases (#28444) 2018-11-09 12:48:47 -08:00
Andy c0e5c80e53 Add exports of current module to getSymbolsInScope (#28442) 2018-11-09 12:48:10 -08:00
Andy aaf1d8055b Support finding references at module in module.exports = or export in export = (#28221)
* Support finding references at `module` in `module.exports =` or `export` in `export =`

* Add json test
2018-11-09 09:38:45 -08:00
Andy 772f6cdf48 Remove JSDocTag#atToken (#28376) 2018-11-06 09:54:23 -08:00
Andy c22c7e687d Strcter testing for global completions; and 'excludes' can only be a string (#28349) 2018-11-05 16:16:28 -08:00
Andy f37101e871 Fix bug when augmenting parent-less symbol (#28345) 2018-11-05 12:57:33 -08:00
Andy 92a48d8880 Improve error message when scriptInfo is missing in mapTextChangeToCodeEdit (#28258)
* Improve error message when scriptInfo is missing in mapTextChangeToCodeEdit

* Include both fileName and path, and use in more places

* Move logErrorForScriptInfoNotFound to editorServices.ts

* Update API
2018-11-02 16:12:46 -07:00
Andy 4e59096ea5 Exclude keywords from import completions (#28114)
* Exclude keywords from import completions

* Still allow contextual keywords

* Add excludes tests
2018-11-02 14:33:02 -07:00
Andy afbf89e3b3 Refactors can return ReadonlyArray<ApplicableRefactorInfo> (#28305)
* Refactors can return ReadonlyArray<ApplicableRefactorInfo>

* Remove unnecessary type assertions
2018-11-02 10:07:21 -07:00
Andy eabbaa415f Fix symbolCanBeReferencedAtTypeLocation for namespace that exports itself (#28295) 2018-11-01 15:10:21 -07:00
Andy dce6668070 Change pathCompletions to stringCompletions, move more code there (#28245) 2018-10-30 22:01:31 -07:00
Andy 903e68164e Redo resolution on ATA when previous resolution was to '.js' file (#28236)
* Redo resolution on ATA when previous resolution was to '.js' file

* Use a separate test case
2018-10-30 16:39:40 -07:00
Andy 3458360322 Prefer getValidSourceFile over Debug.assertDefined(program.getSourceFile(*)) (#28242) 2018-10-30 16:38:52 -07:00
Andy 437bc41e99 For path completions, include extension as a kindModifier (#28148) 2018-10-30 11:56:34 -07:00
Andy 176627c818 Support augmenting module with export as namespace (#27281)
* Support augmenting module with `export as namespace`

* Warn on use of merged symbol containing 'export as namespace'
2018-10-30 11:16:26 -07:00
Andy acc34bd95d Miscellaneous code cleanup relating to module resolution (#28092)
* Miscellaneous code cleanup relating to module resolution

* Revert if condition
2018-10-30 10:15:01 -07:00
Andy 7c515bf6e8 Remove toSortedArray and toDeduplicatedSortedArray, use sort and sortAndDeduplicate (#28214) 2018-10-30 08:41:31 -07:00
Andy 1c4590341f Avoid reformatting body of arrow function with single unused parameter (#28217) 2018-10-29 16:40:30 -07:00
Andy 24febc2445 Allow to combine --resolveJsonModule with --isolatedModules (#28207) 2018-10-29 11:56:49 -07:00
Andy 672b0e3e16 Have flatMap return a ReadonlyArray by default (#28205) 2018-10-29 11:12:51 -07:00
Andy c97fc64972 Always use verify.completions when testing completions (#28137) 2018-10-29 10:03:25 -07:00
Andy 36dfd775b3 Parse an object literal property as shorthand unless followed by '(' or ':' (#28121) 2018-10-26 15:00:31 -07:00
Andy 77d8e15905 Remove unused property ParameterInference#typeNode (#28115) 2018-10-26 14:44:49 -07:00
Andy 070218f828 Remove DirectoryOfFailedLookupWatch#ignore, use DirectoryOfFailedLookupWatch | undefined (#28091) 2018-10-25 15:03:46 -07:00
Andy efc831e0ba At '.' in array literal, don't close the array (#28120) 2018-10-25 12:25:33 -07:00
Andy 42740d66c2 Improve performance of suggestionDiagnostics for convertToAsyncFunction (#28089) 2018-10-24 21:23:47 -07:00
Andy e46c846ee6 Remove getBucketForCompilationSettings (#28088) 2018-10-24 15:37:46 -07:00
Andy 854f20e90f Remove 'verify.fileAfterCodeFix', use 'verify.codeFix' (#28110) 2018-10-24 15:34:15 -07:00
Andy eadf44d073 Add generateTypesForModule to public API (#28069)
* Add generateTypesForModule to public API

* Avoid parameter initializer and update baselines
2018-10-23 16:10:26 -07:00
Andy 5becc3b170 Rename of non-intrinsic JSX element should rename the declaration (#28066) 2018-10-22 18:17:32 -07:00
Andy 82773b8550 Fix bug: only getCompletionEntriesFromTypings if completions are for top-level directory (#27226)
* Fix bug: only getCompletionEntriesFromTypings if completions are for top-level directory

* Support subdirectories of a nonrelative import
2018-10-22 18:17:09 -07:00
Andy Hanson 076f0bbd0f Merge branch 'master' into tsconfig_canonicalpath 2018-10-22 14:35:42 -07:00
Andy 1930f8a790 fourslash: Add 'goToMarkerOrRange' helper (#28057) 2018-10-22 11:44:39 -07:00
Andy d3d4f83f89 Remove hack to get target of GetAccessor symbol (#27868)
* Remove hack to get target of GetAccessor symbol

* Add tests and get moveToNewFile to work with binding patterns
2018-10-22 11:44:06 -07:00
Andy afa94c527c Un-consolidate overloads for Map and WeakMap (#28052) 2018-10-22 11:18:56 -07:00
Andy 8e0142d709 Support import completions for a re-export with a different name from the original (#28055) 2018-10-22 11:16:39 -07:00
Andy 72244c5b03 Support 'isSourceFileFromExternalLibrary' for source files from '/// <reference types="" />'' (#28004)
* Support 'isSourceFileFromExternalLibrary' for source files from '/// <reference types="" />''

* Calculate `isExternalLibraryImport` at the end

* Calculate isExternalLibraryImport with symlink path
2018-10-19 18:00:45 -07:00
Andy a3c22683ab findAllRefs: Fix bug when symbol.declarations is undefined (#27977) 2018-10-18 14:27:21 -07:00
Andy eb2297df02 Fix compile errors in tsbuildWatchMode.ts (#27870)
* Fix compile errors in tsbuildWatchMode.ts

* Remove TODO comments

* new LKG

* Add tslint disables
2018-10-16 12:28:14 -07:00
Andy 0f4a615bcb Fix isSourceFileFromExternalLibrary for file with redirect (#27917)
* Fix isSourceFileFromExternalLibrary for file with redirect

* Alternate fix

* Use currentNodeModulesDepth > 0
2018-10-16 09:01:25 -07:00
Andy 54a5be1860 At '.' in object literal, don't close the object (#27850)
* At '.' in object literal, don't close the object

* Include diagnostics test
2018-10-12 08:49:04 -07:00
Andy dd764b318f importFixes: Skip alias when testing isTypeOnlySymbol (#27674) 2018-10-10 13:45:52 -07:00
Andy Hanson 0933155706 Always emit related diagnostic when a call expression can be fixed by adding a semicolon 2018-10-09 16:04:25 -07:00
Andy 1a5e66995a Don't crash if spawnSync result's stderr is null (#27616) 2018-10-09 09:42:43 -07:00
Andy f6ca10565d Fix bug: Ensure JSDoc type range is valid (#27343) 2018-10-08 17:09:48 -07:00
Andy dd9b8cab34 Have scanJsDocToken scan keywords (#27162)
* Have scanJsDocToken scan keywords

* Update API
2018-10-08 14:42:51 -07:00
Andy deeb40129d Remove duplicate case in parseJsDocCommentWorker (#27164) 2018-10-04 15:44:01 -07:00
Andy 62306bc3f9 Fix git submodule update syntax (#27549) 2018-10-04 09:03:20 -07:00
Andy 9bdd6a3b55 Support loading "index.d.ts" using "typesVersions" without "types", "typings", or "main" (#27514)
* Support loading "index.d.ts" using "typesVersions" without "types", "typings", or "main"

* Update baseline
2018-10-03 11:44:16 -07:00
Andy 16766b196c textChanges: Reuse some methods (#27492) 2018-10-02 17:34:17 -07:00
Andy 8feddcd16d Clean up amalgamatedDuplicates (#27285)
* Clean up amalgamatedDuplicates

* Code review
2018-10-01 12:16:49 -07:00
Andy 115636bb93 Minor cleanup in bindNamespaceExportDeclaration (#27367)
* Minor cleanup in bindNamespaceExportDeclaration

* Change formatting
2018-10-01 12:15:10 -07:00
Andy 19af881f94 ExpressionWithTypeArguments parent may be a JSDocAugmentsTag (#27229) 2018-09-27 18:26:57 -07:00
Andy 5f2741b2ba Make RenameInfo a union (#27382) 2018-09-27 08:56:40 -07:00
Andy 0a97663843 Add 'prefixText' and 'suffixText' when renaming shorthand properties (#27356)
* Add 'prefixText' and 'suffixText' when renaming shorthand properties

* Make prefixText and suffixText missing instead of undefined

* Fix test
2018-09-26 16:58:01 -07:00
Andy Hanson 7b1388b071 Ensure verify.noErrors tests json files 2018-09-26 16:57:23 -07:00
Andy Hanson 96f9e076f8 Don't implicit-any diagnostic for json module 2018-09-26 13:50:37 -07:00
Andy c435d1c9a4 Log text of relevant file after an exception (#27006)
* Log text of relevant file after an exception

* Require LogLevel.verbose
2018-09-26 11:31:59 -07:00
Andy 4855920314 navigationBar/Tree: Better description for anonymous function (#27063) 2018-09-26 11:22:44 -07:00
Andy b3dd471584 Support completions after 'async' in object literal (#27250) 2018-09-26 11:22:27 -07:00
Andy d4d947e488 Fix bug: Allow completions after '@' with no contextToken (#27325) 2018-09-26 11:22:08 -07:00
Andy b065902a99 Update API baselines (#27349) 2018-09-25 16:11:16 -07:00
Andy 471bc646b8 Ensure session passes along fileToRename (#27323) 2018-09-24 14:44:26 -07:00
Andy 5f563c99f6 convertToAsyncFunction: Use ReadonlyArray / ReadonlyMap where possible (#27190) 2018-09-20 16:45:28 -07:00
Andy 67d8263b30 Fix error message for class type in JSDoc missing type arguments (#27222) 2018-09-19 12:57:55 -07:00
Andy c57ff087d6 Add codefix to generate types for untyped module (#26588) 2018-09-18 11:47:29 -07:00
Andy cfd0a62357 When renaming module, ensure rename span is just the last component of the path (#27151) 2018-09-17 15:26:41 -07:00
Andy 4e3e8f5ea7 convertToAsyncFunction: Reduce casts in getTransformationBody (#27158) 2018-09-17 15:23:44 -07:00
Andy bc709a87ad Fix bug where array element is undefined (#26433)
* Fix bug where array element is undefined

* Better fix
2018-09-17 15:14:09 -07:00
Andy fc54a2c0a7 Include triggerSpan in protocol.RenameInfo (#27160) 2018-09-17 15:00:41 -07:00
Andy bfc00935df Fix bug: Get mapped location of definition for findAllReferencesFull (#27113) 2018-09-17 14:14:55 -07:00
Andy Hanson e39f679c45 Merge branch 'master' into tsconfig_canonicalpath 2018-09-17 11:27:09 -07:00
Andy Hanson 0f5d62630b Use this.toPath 2018-09-17 11:26:35 -07:00
Andy e710645bf9 Never escape string literals from textChanges (#26971)
* Never escape string literals from textChanges

* Use `boolean | undefined`
2018-09-17 11:06:39 -07:00