108 Commits

Author SHA1 Message Date
Sheetal Nandi
2f84741725 Remove unnecessary fields 2018-12-06 15:22:46 -08:00
Sheetal Nandi
3dc0d5a77c Watch missing map file and update the source mapping accordingly 2018-12-06 15:22:44 -08:00
Sheetal Nandi
d0976509c9 Add tests and fix DocumentPositionMapper creation on updates to d.ts, source file, map file etc 2018-12-06 15:22:43 -08:00
Sheetal Nandi
0113f43632 Fix the edits clamping from #28583 after rebasing to master 2018-12-06 15:22:43 -08:00
Sheetal Nandi
751cb9e2c3 Update source and declaration projects on update to declaration file or map file
TODO: add tests
2018-12-06 15:22:42 -08:00
Sheetal Nandi
56a39b754c Keep alive declaration script info and map file info if source file info is alive 2018-12-06 15:22:42 -08:00
Sheetal Nandi
0aa4da43ad Life time of declaration, sources and map infos
Map Info and sources is not ideal and need to revisited since we need to update mapper and projects correctly
// TODO: lifetime of source project and declaration map
2018-12-06 15:22:41 -08:00
Sheetal Nandi
5c920f3368 Dont unnecessarily make textStorage internal 2018-12-06 15:22:40 -08:00
Sheetal Nandi
12428d45c0 Add method on host to get DocumentPositionMapper so it can be cached. 2018-12-06 15:22:39 -08:00
Andy
12f3d0d54c
Enable --strictPropertyInitialization (#27558)
* Enable --strictPropertyInitialization

* Code review
2018-11-16 16:02:23 -08:00
Andrew Casey
a8c634d70d Restore useText 2018-11-16 10:48:06 -08:00
Andrew Casey
2c7d67fded Expose aggregate file sizes in FileStats
We're not sure that file counts are a good proxy for project size and
this will give us more direct insight.
2018-11-15 13:56:24 -08:00
Andrew Casey
02d5cb045c Expose file size from TextStorage
Since it's for telemetry, it prefers to return a stale value rather than
triggering file IO (though it will load the file if not even a stale
value is available).
2018-11-15 13:56:24 -08:00
Klaus Meinhardt
e2947fac1c remove even more redundant internal comments 2018-11-07 16:12:48 +00: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
Sheetal Nandi
b5639786bd
Merge pull request #26135 from Microsoft/watchDirectoryOfNodeModulesScriptInfo
Instead of watching individual script infos, watch the node modules folder for script infos in node modules
2018-09-14 09:49:41 -07:00
Nathan Shively-Sanders
64d0e0d448
Shorten more internal names to JS or TS (#27080) 2018-09-13 15:05:57 -07:00
Sheetal Nandi
e2edb69638 Instead of watching individual script infos, watch the node modules folder for script infos in node modules 2018-09-13 13:48:48 -07:00
Nathan Shively-Sanders
6bd1da20c9
Rename JS-specific concepts (#26795)
* Rename JS concepts

1. Assignment declaration -- an assignment that is treated like a
declaration. Previously called [JS] special (assignment|declaration),
among other things.
2. Expando -- a value that can be used as a target in assignment
declarations. Currently, a class, function or empty object literal.
Functions are allowed in Typescript, too. Previously called a JS
container, JS initializer or expando object.
3. JavaScript -> Javascript. This is annoying to type, and looks like
'Java Script' in a camelCase world.

Everything is a pure rename as far as I know. The only test change is
the API baselines, which reflect the rename from SymbolFlags.JSContainer
to SymbolFlags.Assignment.

* Remove TODO

* Rename Javascript->JS

Note that this introduces a variable name collision in a couple of
places, which I resolved like this:

```ts
const isInJavascript = isInJSFile(node);
```
2018-09-12 10:44:46 -07:00
Sheetal Nandi
03bb5d170e Use protocol.UserPreferences in server to store UserPreferences 2018-08-28 15:53:00 -07:00
Sheetal Nandi
7e117f2707 Check large file size only for non ts files 2018-08-13 13:30:31 -07:00
Sheetal Nandi
f2011ce755
Merge pull request #26197 from Microsoft/largeFileEvent
Send event on referencing large file
2018-08-13 11:14:22 -07:00
Ryan Cavanaugh
14d3c69c72 Disallow exprs of type void to be used in truthiness checks 2018-08-06 09:40:22 -07:00
Sheetal Nandi
1e5e61873d Send event on referencing large file 2018-08-03 15:22:28 -07:00
Sheetal Nandi
135425d40b Do not read files greater than maxFileSize which is currently 4mb
Fixes #24762
2018-08-02 13:03:58 -07:00
Ron Buckton
0713e754e7 Build script updates 2018-07-10 12:13:27 -07:00
Daniel Rosenwasser
c046958752 Merge remote-tracking branch 'origin/master' into triggerSignatureHelpIArdlyKnowSignatureHelp 2018-07-02 15:36:41 -07:00
Sheetal Nandi
b155a71e70 Retain the version information of script infos when they are deleted
This helps in having to not restart the versioning,
which could potentially have same version but different contents and project could confuse with it
2018-06-26 15:03:35 -07:00
Daniel Rosenwasser
5e3c96bb9a Implemented support for trigger characters in signature help. 2018-06-12 15:48:40 -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
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
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
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
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
Ryan Cavanaugh
df95de3231 Merge branch 'master' into referencesDogfood_1 2018-04-11 16:17:38 -07:00
Ryan Cavanaugh
3ca1d2d7e3 Remove all reference comments from server/ 2018-04-11 15:38:26 -07:00
Andy
4b706fc479
Add 'disableSuggestions' to UserPreferences (#23283)
* Add 'disableSuggestions' to UserPreferences

* Make mergeMapLikes return a new object

* Avoid additional clone

* mergeMapLikes -> object spread
2018-04-10 11:53:24 -07:00
Andy
cc3921323c
Support services settings (#22236)
* Support services settings

* Code review

* More review

* Use different names for Options and GetCompletionsAtPositionOptions (todo: come up with better names)

* More renames

* More renaming

* Support quote style in importFixes

* Add `importModuleSpecifierPreference` option

* Support quote style for `throw new Error('Method not implemented.')` (#18169)

* options -> preferences
2018-03-20 13:07:59 -07:00
Sheetal Nandi
08ab6eb42d Reload the text from file if there is pending reload of the script info before determining to use SVC
Fixes #20806
2018-02-23 12:10:24 -08:00
Sheetal Nandi
146256b7dc Allow dynamic files without external project and also use file names starting with ^ as dynamic file
Fixes #21204
2018-01-22 11:44:43 -08:00
Sheetal Nandi
ed23ca582a Merge branch 'master' into builderApi 2018-01-17 16:11:44 -08:00
Sheetal Nandi
9ad9dc106c
Merge pull request #21171 from Microsoft/renameSymLinks
Rename through all projects with same file through symLink
2018-01-17 15:08:27 -08:00
Sheetal Nandi
5bd3f97b18 Merge branch 'master' into builderApi 2018-01-16 11:14:39 -08:00
Sheetal Nandi
428e0529fd Rename through all projects with the same file symLink 2018-01-12 16:24:04 -08:00
Andy
d2fd137d88
Add a getFullText() helper method to IScriptSnapshot (#21155)
* Add a `getFullText()` helper method to `IScriptSnapshot`

* Use a function instead of a method
2018-01-12 10:44:39 -08:00
Sheetal Nandi
43c2610a69 More functions moved from system to WatchCompilerHost 2017-12-05 16:53:34 -08:00
Sheetal Nandi
373510c4d9 Handle the script infos that are opened with non rooted disk path
Fixes #19588
2017-11-03 15:38:58 -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
Sheetal Nandi
68d360585a PR feedback 2017-09-26 16:21:15 -07:00