1117 Commits

Author SHA1 Message Date
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
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
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
Sheetal Nandi
ee05d0eb1c Compile public api so that all the updates are ensured to be correct 2017-10-04 16:09:16 -07:00
Andy
efa274f722 When emitting all files, emit the changed file first (#18930)
* When emitting all files, emit the changed file first

* Export interface
2017-10-04 13:30:37 -07:00
Sheetal Nandi
c2427f22d0 Wrap the cancellation token in throttled cancellation token from server 2017-10-03 16:34:46 -07:00
Sheetal Nandi
4bb4711eff Merge branch 'master' into watchImprovements 2017-10-02 16:34:43 -07:00
Sheetal Nandi
7f969e8138 Making APIs as internal so that we can enable them after we have figured out final details 2017-10-02 16:27:26 -07:00
Andy
eefe5c9706 Fix acquiring format options for getEditsForRefactor (#18848)
* Fix acquiring format options for getEditsForRefactor

* Add test

* Fix test description

* Use `executeCommandSeq`
2017-10-02 13:26:35 -07:00
Sheetal Nandi
898559b4e5 Merge branch 'master' into watchImprovements 2017-10-02 12:34:34 -07:00
Ryan Cavanaugh
141cd574c7 Merge pull request #18603 from RyanCavanaugh/pluginWork
Report external files in initial case for project load
2017-10-02 10:32:04 -07:00
Sheetal Nandi
fad71d3dc6 Use project root as the current directory whenever possible to create the project 2017-09-27 17:19:54 -07:00
Sheetal Nandi
68d360585a PR feedback 2017-09-26 16:21:15 -07:00
Sheetal Nandi
38f3a2b700 Renamed PartialSystem as DirectoryStructureHost and CachedPartialSystem as CachedDirectoryStructureHost 2017-09-26 11:05:52 -07:00
Sheetal Nandi
23acff5bc8 Merge branch 'master' into watchImprovements 2017-09-25 16:18:26 -07:00
Andy
25ad0b5581 Apply "array-type" lint rule (#18699) 2017-09-22 16:14:41 -07:00
Ryan Cavanaugh
54070786e4 Report external files in initial case 2017-09-20 10:52:56 -07:00
Ryan Cavanaugh
b9b112738c Merge pull request #18456 from RyanCavanaugh/pluginWork
Properly report external filenames
2017-09-20 10:51:54 -07:00
Andrew Casey
0ac8406cd7 Merge pull request #18501 from Microsoft/formatOptions
Make formatOptions optional in GetEditsForRefactorRequestArgs
2017-09-15 17:11:08 -07:00
Andrew Casey
965a4d5aeb Restructure handling to TI messages to enforce exhaustiveness 2017-09-15 11:33:05 -07:00
Andy Hanson
0b76e43977 Make formatOptions optional in GetEditsForRefactorRequestArgs 2017-09-15 07:21:38 -07:00
Andrew Casey
f3411d4361 Only decrement activeRequestCount on SetTypings responses
InvalidateCache responses are triggered by file watchers, rather than by
requests.
2017-09-14 15:45:26 -07:00
Andy
0de1b2301e Cleanup getDiagnosticsForProject (#18151) 2017-09-14 12:38:48 -07:00
Andy
d96dfeb708 Don't normalize whitespace in fourslash tests (#18447)
* Don't normalize whitespace in fourslash tests

* Only render whitespace when the diff is text-only
2017-09-14 08:23:50 -07:00
Sheetal Nandi
cf72f2aaf0 Merge branch 'master' into watchImprovements 2017-09-13 17:35:21 -07:00
Ryan Cavanaugh
9046fcb658 Add files as one batch to preserve errors 2017-09-13 16:09:18 -07:00
Ryan Cavanaugh
3bd4c4f847 Properly report external filenames 2017-09-13 15:19:07 -07:00
Andy
2a70bf5158 Don't count a write-only reference as a use (#17752)
* Don't count a write-only reference as a use

* Split isWriteAccess to isWriteOnlyAccess and isReadOnlyAccess

* Update "unusedParameterUsedInTypeOf" to use "b"

* Update diagnostic messages: "is never used" -> "its value is never read"

* Use a WriteKind enum

* Rename enum and move documentation to enum members
2017-09-13 09:02:33 -07:00