1142 Commits

Author SHA1 Message Date
Andy
6a382f1436
In typings installer, provide mandatory 'package.json' fields (#19663) 2017-11-01 14:20:26 -07:00
Homa Wong
53ad019ba1 Log top 5 largest files when TS language service is disabling. (#19315)
* Log top 5 largest files

* Show same message on second pass.

This second pass seemingly should be avoid. Bug there.

* Get all files and sort when error.

* Refactor

* Push logic to error branch

* Update to use array chain.

* Update to return string

* going functional.
2017-10-31 16:33:43 -07:00
Armando Aguirre
d5c18a6fb7
Merge branch 'master' into AddDefinitionAndBoundSpan 2017-10-30 17:02:23 -07:00
Andrew Casey
bc2a048a39 Handle --debug-brk and --inspect-brk when launching TypingsInstaller 2017-10-26 16:42:47 -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
Sheetal Nandi
b0a3f9d4ec Merge pull request #19479 from Microsoft/reloadScriptsWithoutProject
On "reload" command, reload contents of file from disk irrespective of project presence and even if file already containing its own text
2017-10-25 15:46:08 -07:00
Sheetal Nandi
2668f50577 Reload contents of file from disk irrespective of project presence and file already containing its own text
Fixes #19336
2017-10-25 13:46:12 -07:00
Armando Aguirre
7fd9fe686b Rollback spread operator changes 2017-10-24 15:58:43 -07:00
Sheetal Nandi
3d45f5b0fb Store the projectRootPath the script info was opened with so that we can reuse it later to search/set file watches 2017-10-24 14:59:29 -07:00
Armando Aguirre
ae266f6aa1 Merge branch 'master' into AddDefinitionAndBoundSpan 2017-10-24 11:18:07 -07:00
Armando Aguirre
f8ccde5218 Renamed a couple of methods, refactored code for reusability 2017-10-24 11:05:21 -07:00
Andy
c1b4d59752 Fixup line and offset of rename location of refactor (#19265)
* Fixup line and offset of rename location of refactor

* Fixes

* Handle "\r" only documents

* Update api baselines

* Fix error if an edit comes *after* the rename location

* Add bounds check

* Simpler implementation: get new text, then calculate line starts the usual way
2017-10-19 14:31:23 -07:00
Andy
1f282f19e0 Fix "noStringLiteral" lint errors (#19310) 2017-10-19 08:15:48 -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
Andy
6c1afba389 Remove extra blank line in logs (#19307) 2017-10-18 16:04:18 -07:00
Armando Aguirre
8004fec2ce Addressed PR comments: added simplified/full version, changed design 2017-10-18 14:48:06 -07:00
Sheetal Nandi
f59241971d Merge pull request #19138 from Microsoft/configuredProjectRef
Handle the configured project lifetime to account for files added to the project after config file gets reloaded
2017-10-18 14:23:25 -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
Sheetal Nandi
f9c901ada7 Use get files affected by internally and hence use file paths as input 2017-10-18 13:34:13 -07:00
Bill Ticehurst
45ba0ac3b9 Set the scriptKind from the host configuration if present 2017-10-18 10:41:57 -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
d0c4d13fe2 In tsserver, indent logged JSON (#19080) 2017-10-17 11:34:59 -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
Sheetal Nandi
734bda833c Add comments about why we need two methods that return compilerOptions 2017-10-16 13:06:15 -07:00
Sheetal Nandi
3c27e782da Add getCompilerOptions method to project
Fixes #19218
2017-10-16 11:22:49 -07:00
Armando Aguirre
1cb2d24c5d Added DefinitionAndBoundSpan command 2017-10-12 17:18:38 -07:00
Sheetal Nandi
b68a636348 Fix the way configured project's reference is managed so that the open file 2017-10-12 11:50:24 -07:00
Sheetal Nandi
29ed92e20d Merge pull request #19118 from Microsoft/caseSensitivityInferredProjectRoot
Handles case sensitivity of project root with respect to inferred projects
2017-10-12 11:49:29 -07:00
Sheetal Nandi
6e5a4a9476 Merge pull request #18959 from Microsoft/configFileDiag
Do not report config file errors if the file opened isn't from configured project and that project doesn't have the config errors
2017-10-12 08:56:00 -07:00
Sheetal Nandi
4d7c112ef7 Make sure project root paths of inferred projects are canonical when comparing 2017-10-11 15:33:17 -07:00
Sheetal Nandi
562a0463bc Merge pull request #19111 from Microsoft/useCaseSensitiveProjectRootToSearchConfigFile
Handle case sensitivity when looking up config file for Script info
2017-10-11 15:31:00 -07:00
Andy
917ae32937 Always log output of execSync (#19110)
* Always log output of execSync

* Fix lint
2017-10-11 14:50:45 -07:00
Sheetal Nandi
deed981715 Handle case sensitivity when looking up config file for Script info
Fixes #17726
2017-10-11 13:35:06 -07:00
Sheetal Nandi
a7fa187fb2 Merge pull request #19058 from Microsoft/whenWatchesFail
Swallow the directory watcher exceptions and ignore them
2017-10-10 18:32:22 -07:00
Sheetal Nandi
7f1ddaf7b8 Merge branch 'master' into configFileDiag 2017-10-10 18:30:59 -07:00
Sheetal Nandi
bb4abbd95e Do not generate config file diagnostics event when the file opened doesnot belong to the configured project 2017-10-10 17:37:02 -07:00
Sheetal Nandi
52d7c7278d Add comment about swallowing exception 2017-10-10 17:16:53 -07:00
Sheetal Nandi
e30a66d22f Add utitlity for stringContains 2017-10-10 17:16:39 -07:00
Sheetal Nandi
c4298a3c9d Merge branch 'master' into configFileDiag 2017-10-10 11:12:07 -07:00
Sheetal Nandi
d71406c866 Merge branch 'master' into resolutionCacheDefensiveChecks 2017-10-10 11:02:46 -07:00
Sheetal Nandi
67a6a9477f Merge pull request #16586 from Microsoft/projectRootAsCurrentDirectoryInEmit
Use the project root or the directory of current script info as the current directory to emit the file
2017-10-10 10:28:14 -07:00
Sheetal Nandi
98d58d6517 Handle project close to release all the script infos held by the project 2017-10-09 20:12:53 -07:00
Sheetal Nandi
aa22c56282 Swallow the directory watcher exceptions 2017-10-09 18:04:14 -07:00
Sheetal Nandi
6887dbc750 Assert if the script info that is attached to closed project is present
Adds assertion to investigate #19003 and #18928
2017-10-09 15:25:01 -07:00
Sheetal Nandi
07ba906594 Handle the case when finishCachingPerDirectoryResolution is not called because of exception
Fixes #18975
2017-10-09 14:32:33 -07:00
Sheetal Nandi
32d705dbb5 Fine tune logging so that only triggers in watch are logged in normal logging vs verbose 2017-10-05 11:35:18 -07:00
Sheetal Nandi
03441fe120 Merge branch 'master' into projectRootAsCurrentDirectoryInEmit 2017-10-04 18:48:16 -07:00
Sheetal Nandi
249725d4b7 Do not report config file errors if the file opened isnt from configured project and that project doesnt have the config errors
Fixes #16635
2017-10-04 16:11:20 -07:00