97 Commits

Author SHA1 Message Date
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
Sheetal Nandi
38f3a2b700 Renamed PartialSystem as DirectoryStructureHost and CachedPartialSystem as CachedDirectoryStructureHost 2017-09-26 11:05:52 -07:00
Sheetal Nandi
fdb104b242 Merge branch 'master' into watchImprovements 2017-09-11 13:49:36 -07:00
Sheetal Nandi
67f9533c67 Limit the resolution invalidation to max number of files as invalidation for larger cache might take more time than to just recalculate resolutions 2017-09-08 12:10:47 -07:00
Sheetal Nandi
10ea5bf460 Script infos while opening/closing shouldnt mark project as dirty if the contents dont change 2017-08-31 09:13:59 -07:00
Sheetal Nandi
17565d8407 Handle watches of missing directories and make project the module resolution host 2017-08-31 09:13:59 -07:00
Sheetal Nandi
4c79033894 Refactoring to watches and caching of system such that we minimize function expressions
Also unified watcher info logging
2017-08-31 09:13:59 -07:00
Sheetal Nandi
60e2e68dfb Merge branch 'watchImprovements' into builder 2017-08-18 13:38:24 -07:00
Sheetal Nandi
c425128075 When getting default project from session, get it only if the script info is not orphan
Since the closed script info's that are orphan arent removed immediately but on next open request, treat the orphan script infos as if they are not present in the session
2017-08-18 13:13:12 -07:00
Paul van Brenk
5665c098da Introduce the concept of a Dynamic File
Dynamic files are generally created by the debugger when while debugging
it can't find a matching file on disk. Since these files don't exist on
disk, we shouldn't check if the file exists on disk, and allow the content
to be controlled by the host.
2017-08-14 16:55:37 -07:00
Sheetal Nandi
f1b1b12604 More work based on feedback 2017-08-14 14:59:51 -07:00
Sheetal Nandi
594482d2c9 Merge branch 'master' into watchImprovements 2017-08-11 20:13:15 -07:00