1446 Commits

Author SHA1 Message Date
Ryan Cavanaugh
cf87bd446d Merge branch 'master' into tsbuild 2018-06-05 14:55:51 -07:00
Wesley Wigham
d9b93903c0
Use more nodelike paths for import types when possible (#24610)
* Use more nodelike paths for import types when possible

* move functionality from services into compiler, fix with propert file/directory conflict handling

* mark suspect cast
2018-06-05 12:54:36 -07:00
Ryan Cavanaugh
45842a0c34 Merge remote-tracking branch 'weswigham/sourcemap-concatenation-station' into tsbuild 2018-06-05 12:31:32 -07:00
Andy
886377f8d3
Add autoCloseTag language service (#24543)
* Add autoCloseTag language service

* Change name to getJsxClosingTagAtPosition and return an object
2018-06-04 10:08:15 -07:00
Benjamin Lichtman
80dbaf90c6 Make tag readonly 2018-06-01 16:03:04 -07:00
Benjamin Lichtman
4f4759590b Always get latest tag of types-registry 2018-06-01 15:52: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
d671c7ae96
getEditsForFileRename: Support directory rename (#24305)
* getEditsForFileRename: Support directory rename

* Code review

* Handle imports inside the new file/directory

* Document path updaters

* Shorten relative paths where possible

* Reduce duplicate code

* Rewrite, use moduleSpecifiers.ts to get module specifiers from scratch instead of updating relative paths

* Update additional tsconfig.json fields

* Add test with '.js' extension

* Handle case-insensitive paths

* Better tsconfig handling

* Handle properties inside compilerOptions

* Use getOptionFromName
2018-06-01 08:23:37 -07:00
Andy
43bf039a94
Add refactor to convert namespace to named imports and back (#24469)
* Add refactor to convert namespace to named imports and back

* Add tests and comments

* Code review

* Handle shorthand property assignment and re-export

* Don't use forEachFreeIdentifier

* Fix rename after "."
2018-05-30 14:11:53 -07:00
Andy
77371679be
Support getting references even if quickInfo failed (#24476)
* Support getting references even if quickInfo failed

* Add test
2018-05-30 14:11:36 -07:00
Mohamed Hegazy
832893e559 Revert "Check detected npm path is existing"
This reverts commit 1fda3a4165b83fb82b666bd15e601c73590b52ec.
2018-05-25 14:54:53 -07:00
Mohamed Hegazy
dd6dc5e27a
Merge pull request #24328 from Microsoft/getEditsForFileRename_oldFileStillPresent
getEditsForFileRename: Handle old file still being present
2018-05-23 16:16:00 -07:00
Wenlu Wang
4606709672 add code fix convert to mapped object type (#24286)
* add code fix convert to mapped object type

* add support for type literal and improve test

* fix typo

* add support for heritageClauses

* only determine declaration is not class
2018-05-23 14:09:49 -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 Hanson
46eaf62abb getEditsForFileRename: Handle old file still being present 2018-05-22 12:20:34 -07:00
Sheetal Nandi
f44dd6f53b
Merge pull request #24206 from Microsoft/documentRegistery
Cache the latest source file from document registery in script info so that we do not have to reparse orphan script info
2018-05-22 12:11:16 -07:00
Andy
7106a587cc
Add type for diagnostics where location is defined (#23686)
* Add type for diagnostics where location is defined

* getSemanticDiagnostics may return global diagnostics

* Reduce array creation
2018-05-22 11:01:18 -07:00
Mohamed Hegazy
7fb3123984
Merge pull request #24298 from Microsoft/noErrOnBackgroundUpdate
Add noGetErrOnBackgroundUpdate session option to not queue diagnostics check for open files
2018-05-22 10:56:18 -07:00
Mine Starks
5e5c5a761a
Merge pull request #24139 from minestarks/dynamicprojectassert
Normalize ProjectService.currentDirectory
2018-05-22 09:04:45 -07:00
Sheetal Nandi
f1acbc93ef Add noGetErrOnBackgroundUpdate session option to not queue diagnostics check for open files
This will ensure that the getErr will be queued in by host and hence would make sure that it is cancellable.
Handles one of the scenario delaying completions in #19458
2018-05-21 12:53:31 -07:00
Sheetal Nandi
e4c380a698 Merge branch 'master' into documentRegistery 2018-05-21 12:27:12 -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
3eb66da155
Add code fix to remove unused label (#24037)
* Add code fix to remove unused label

* Test with trivia and fix indentation with dedented label
2018-05-18 15:25:24 -07:00
Sheetal Nandi
81ca6502ea Cache the latest source file from document registry so we can keep it alive when script info is orphan 2018-05-17 09:54:07 -07:00
Sheetal Nandi
59d19251cf Add test to verify the document is released from source file when info is orphan 2018-05-17 09:54:07 -07:00
王文璐
5d233054c3 add quick fix for import type missing typeof 2018-05-17 16:35:20 +08:00
Andrew Casey
0b89460c18 Don't collect open-file telemetry on the syntax server
It's throwing an exception (since there's no program from which to
retrieve the SourceFile) and there's no reason to fix it since the
same files are open in the semantic server.
2018-05-16 13:40:24 -07:00
Mine Starks
0ab3c1fe96 Normalize this.currentDirectory 2018-05-15 14:34:24 -07:00
Andy
cbbe34b35e
Fix conversion of TextChanges to FileCodeEdits for new file (#24126) 2018-05-15 13:55:26 -07:00
Andy
7e515af240
Copy allowTextChangesInNewFiles property to protocol.ts (#24127) 2018-05-15 12:35:08 -07:00
Ryan Cavanaugh
2ca0792976
Merge pull request #24074 from RyanCavanaugh/splitTransparentGoToDef
Return mapped locations in alternate fields
2018-05-16 05:39:51 +12:00
Ryan Cavanaugh
f01338fa33 Comments/naming 2018-05-14 18:27:21 -07:00
Andy
9b6378b938
Use SHA256 hash for project info telemetry (#24099)
* Use SHA256 hash for project info telemetry

* Update API baselines
2018-05-14 11:32:16 -07:00
Ryan Cavanaugh
69f73eba16 Return mapped locations in alternate fields 2018-05-11 17:22:10 -07:00
Armando Aguirre
fdd078064d Added deferred to FileStats telemetry 2018-05-10 18:08:36 -07:00
Andy
6ae4d3a516
Add code fix to remove unreachable code (#24028)
* Add code fix to remove unreachable code

* Code review

* Preserve more kinds of statements
2018-05-10 16:44:48 -07:00
Andy
e33e229a52
Extract 'moduleSpecifiers' namespace out of importFixes (#24010) 2018-05-10 16:30:24 -07:00
Andy
7271ec1240
Add 'move to new file' refactor (#23726)
* Add 'move to new file' refactor

* Code review, and support commonjs

* Compute movedSymbols completely before using, and support `export import`

* Fix assertion error: sort empty change before non-empty change

* Remove extra newline

* Add allowTextChangesInNewFiles preference

* Add the new file to 'files' in tsconfig

* Avoid parameter initializer

* Update API baselines

* Use path relative to tsconfig.json

* Code review

* Fix error where node in tsconfig file was missing a source file
2018-05-10 11:17:04 -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
Mohamed Hegazy
27550d3013
Merge pull request #23925 from rhysd/fix-npm-default-location-detection
Check detected default npm path is really existing
2018-05-08 11:33:30 -07:00
Andy
ddf20ecd6d
Support '.' as a trigger character (#23890)
* Support '.' as a trigger character

* Add a CompletionsTriggerCharacter type

* Add more trigger characters

* Add another type CompletionsTriggerCharacter

* Update API baselines
2018-05-08 09:52: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
rhysd
1fda3a4165 Check detected npm path is existing 2018-05-07 13:22:42 +09:00
Sheetal Nandi
5133c70e7e
Merge pull request #22167 from Microsoft/requireJson
Resolve the modue names with "modulename.json" to json files when doing node module resolution
2018-05-04 12:42:10 -07:00
Sheetal Nandi
ec19733f61
Merge pull request #22072 from Microsoft/configFileWithIncorrectProjectRoot
Search till root just like tsc when the projectRootPath specified doesnt contain the info.path
2018-05-04 12:23:56 -07:00
Mohamed Hegazy
e52efb04f3 Fix #22419: Add kind field to OutliningSpan 2018-05-03 16:28:55 -07:00
Sheetal Nandi
92d08738d5 Merge branch 'master' into configFileWithIncorrectProjectRoot 2018-05-03 15:56:00 -07:00
Sheetal Nandi
15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Ron Buckton
56648ad0f1
Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00