Commit graph

339 commits

Author SHA1 Message Date
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
Mine Starks 1fbabd5534 Merge pull request #28106 from minestarks/configure-plugins
configurePlugins command for tsserver
2018-10-29 14:06:40 -07:00
Andy 672b0e3e16
Have flatMap return a ReadonlyArray by default (#28205) 2018-10-29 11:12:51 -07:00
Klaus Meinhardt 5b3fe6e68b update other interfaces and implementations
and accept baseline
2018-10-22 21:23:04 +02:00
Sheetal Nandi 88f79de9f4 Merge branch 'master' into transitiveReferences 2018-10-09 14:03:58 -07:00
Sheetal Nandi 37e25c8873 Send even for ProjectLoadStart and ProjectLoadFinish
Fixes #27206
2018-10-05 15:09:33 -07:00
Sheetal Nandi 2fb11d8530 Test transitive references in folders side by side so that later we can add tsserver tests as well 2018-10-04 15:04:12 -07:00
Sheetal Nandi 94df5167b0 Handle resolution caching when referenced tsconfig changes 2018-10-04 15:04:12 -07:00
Sheetal Nandi 0e4b10d726 Use resolution options of project reference if the file is from the project reference 2018-10-04 15:04:10 -07:00
Sheetal Nandi 0ac96580d5 Resolve project references transitively 2018-10-04 15:04:10 -07:00
Sheetal Nandi aed876dfb4 Refactoring to unify updating no input files error 2018-09-27 11:58:15 -07:00
Sheetal Nandi 865b3e7862
Merge pull request #27172 from Microsoft/moduleResolutionWithOutDir
Use originalFileName (fileName of input project reference file) to resolve module/typereferences/reference paths in it instead of output decl file path
2018-09-18 14:33:33 -07:00
Andy c57ff087d6
Add codefix to generate types for untyped module (#26588) 2018-09-18 11:47:29 -07:00
Sheetal Nandi d51b8d940c Use originalFileName (fileName of input project reference file) to resolve module/typereferences/reference paths in it instead of output decl file path
This also ensures that originalFileName, resolvedPath are set correctly even when we are reusing program structure
Fixes #26036
2018-09-17 19:00:30 -07:00
Sheetal Nandi ea67e3ac56 Fix watch of project with project references 2018-09-13 15:41:07 -07:00
Nathan Shively-Sanders 30f611b055
Add survey event (#26455)
* Start adding survey event

* Add surveyReady event

* Remove old notes

* Move event, simplify type, add test

1. Move the survey event to sendProjectTelemetry so that it happens on
open instead of on editing tsconfig.
2. Remove URL from the survey type; VS code should control this
information.
3. Add test based on large files event test. I'm not sure it's in the
right place, though.

* Fix tests and update API baseline

* Split survey sending from telemetry

Based on tests requested during review.

* Add additional assertion
2018-08-28 19:57:39 -07:00
Sheetal Nandi fc90b8f98b lazyConfiguredProjectsFromExternalProject as userpreference instead of command line option 2018-08-28 14:41:22 -07:00
Sheetal Nandi f67bdd429a Skip loading configured project just to report project info through synchronizeProjectList for project opened by external project 2018-08-06 16:24:14 -07:00
Sheetal Nandi a0190e397a Delay update graph when opening external project, and delay load configured project referenced from external project when opening it 2018-08-06 16:01:15 -07:00
Sheetal Nandi 46d223dc1b Fixes to ensure getDefinitionAndBoundSpan works correctly when using composite projects
Project references need to be detached from the project when closing project
In SourceMapDecoder handle when the redirected file to project reference is set as the output of the project
Keep configured project alive if project it references has open ref
Fixes #26164
2018-08-02 16:36:50 -07:00
Sheetal Nandi d74d8613bd Use updateGraphIfDirty to do quick check if project update is needed
With this updateGraph is used only in locations we are certain project is dirty
2018-08-01 16:08:25 -07:00
Sheetal Nandi d65cb21fcd Keep the original configured project alive created during findAllReferences 2018-07-30 14:44:21 -07:00
Sheetal Nandi f3b0a2de06 Move the original location getter to ProjectService.
This is in anticipation of work needed to keep original projects alive
2018-07-30 14:44:21 -07:00
Andy 64555aa6a9
navigateTo: Collect results from all referenced projects. (#25283)
* navigateTo: Collect results from all referenced projects.

* Don't use project references, just source maps

* Move more code to session

* Test when implementation file is deleted

* Use tsserver tests instead of fourslash tests to ensure session is used

* Support find-all-references

* Restore fourslash tests

* Update emit baselines (added missing newline)

* Support rename

* @weswigham code review

* Don't open/close files

* Avoid growing `toDo` too eagerly

* @sheetalkamat code review

* Also get symlinked projects for originalLocation

* Update API (#24966)

* More @sheetalkamat code review

* Remove unnecessary test

* Update API (#24966)
2018-07-05 15:39:03 -07:00
Ryan Cavanaugh f4fcb1912c
Merge pull request #24465 from RyanCavanaugh/tsbuild
"tsc -b" with minimal watch capabilities
2018-06-10 05:15:53 +12:00
Andy 399ae51406
Support 'tsconfig.json' when converting TextChanges to CodeEdits (#24667)
* Support 'tsconfig.json' when converting TextChanges to CodeEdits

* Create Project#getSourceFileOrConfigFile to use instead
2018-06-07 14:30:19 -07:00
Ryan Cavanaugh 7e9e29ce64 Store + use the resolved path of sourceFiles in proj. ref. scenarios 2018-06-01 13:20:57 -07:00
Andy e53e56cf82
Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Andy 4c22bf786e
getEditsForFileRename: Do fresh module resolution instead of relying on cache (#24211)
* getEditsForFileRename: Do fresh module resolution instead of relying on cache

* Add host.resolveModuleNameWithFailedLookupLocations method

* Make host.resolveModuleNameWithFailedLookupLocations mandatory, and implement for Project

* Add test, and no need to check host.fileExists

* Change method name and always use cache

* Update name in string
2018-05-18 16:42:42 -07:00
Andy cbbe34b35e
Fix conversion of TextChanges to FileCodeEdits for new file (#24126) 2018-05-15 13:55:26 -07:00
Armando Aguirre fdd078064d Added deferred to FileStats telemetry 2018-05-10 18:08:36 -07:00
Andy 7fb7eecf2c
Add telemetry for open JS files (#23833)
* Add telemetry for open JS files

* Send event every time

* Keep stats even for closed files

* Remove tsCheckCountForOpenFilesTelemetry

* Use 'info.path'

* Update API
2018-05-09 07:51:46 -07:00
Ryan Cavanaugh ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Andy 05b250691f
Expose ProjectService to plugins (#23824)
Add refreshDiagnostics() method to Project
2018-05-07 12:38:38 -07:00
Armando Aguirre 1d593fd81e
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
2018-05-02 18:13:34 -07:00
Andy 5aa0a79dac
Use 'firstDefined' in 'enablePlugin' (#23825) 2018-05-02 15:37:22 -07:00
Sheetal Nandi d6dfd9a217 Do not remove inferred project immediately and try to reuse it on next file open 2018-04-24 11:53:36 -07:00
Sheetal Nandi 616458261c Detach the removed typing files from the project 2018-04-24 11:53:36 -07:00
Sheetal Nandi 4b19d12e0e Rearrange code such that project Root path of open file is always used in watching and removing the config file watches 2018-04-24 11:53:35 -07:00
Armando Aguirre db08a77c3f Merge branch 'master' into AddVueSupport 2018-04-18 15:51:58 -07:00
Sheetal Nandi 7c5f5249ae Renames as per PR feedback 2018-04-18 11:05:56 -07:00
Sheetal Nandi d64f2483e4 Update to respond to PR feedback 2018-04-17 14:17:15 -07:00
Armando Aguirre 9923003ee6 Merge branch 'master' into AddVueSupport 2018-04-16 13:45:34 -07:00
Sheetal Nandi 60b19f5782 Invalidate the unresolved import resolutions when typing files are set
This has 3 changes:
1. In updateGraph when enqueue the typing installation request (depending on unresolved imports)
2. When ActionSet event is received, invalidate only files with unresolved imports and resolve those.
3. When ActionInvalidate event is received, typing installer has detected some change in global typing cache location, so just enqueue a new typing installation request. This will repeat the cycle of setting correct typings and pickiing unresolved imports
2018-04-13 15:17:13 -07:00
Sheetal Nandi 35abe26824 Force new typings resolution only if there are more or less script infos in the project.
This helps in reducing number of forced typing installation requests
We anyways use changes in unresolved import array to determine if we need to enqueue new typing request
Hence there is no need to soley rely on hasChanges from updateGraph which just indicates that we didnt reused the program (that does not mean new files were added to the program or changes in unresolved imports)
2018-04-13 15:17:13 -07:00
Sheetal Nandi c9479f7263 Remove the specialized type UnresolvedImportsMap which is just a redirection and helps only in test only 2018-04-13 15:17:13 -07:00
Ryan Cavanaugh 3ca1d2d7e3 Remove all reference comments from server/ 2018-04-11 15:38:26 -07:00
Armando Aguirre 50eb512566 Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExtensionInfo 2018-04-05 17:30:04 -07:00
Andrew Casey 855171bde5 Introduce a --syntaxOnly server mode
1. Disable the LS in all projects
 2. Don't create Program objects
 3. Ignore config files
2018-04-04 16:44:15 -07:00