Skip to content

Merge release-2.0.5 to master #11197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 384 commits into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
c0f4fdd
merge with origin/master
vladima Jul 21, 2016
e091f67
introduce ExternalFile interface
vladima Jul 21, 2016
7da455c
read ScriptKind\HasMixedContent when opening external project
vladima Jul 21, 2016
2c25477
added tests
vladima Jul 21, 2016
253253d
Merge pull request #9855 from Microsoft/tsaImmutableTo-2.0
DanielRosenwasser Jul 21, 2016
14aa132
[Release-2.0] Fix 9632 Auto-completion for quoted property in object …
yuit Jul 22, 2016
5768b42
Skip `this` in emitter in 2 more places
sandersn Jul 13, 2016
97e4578
Test that emitter skips `this` with rest parameter
sandersn Jul 13, 2016
da21296
Use originalKeywordKind to detect this parameters
sandersn Jul 13, 2016
bd6d2c0
[Release-2.0] Fix 9829 : do not report error using import, export, mo…
yuit Jul 22, 2016
bb01614
call updateGraph before getting language service
vladima Jul 22, 2016
c3ec428
Merge remote-tracking branch 'origin/tsserverVS-WIP' into tsserverVS-…
vladima Jul 22, 2016
a8925f8
do not sync program for brace matching
vladima Jul 22, 2016
90849c2
Merge remote-tracking branch 'origin/tsserverVS-WIP' into tsserverVS-…
vladima Jul 22, 2016
91b0eea
Merge remote-tracking branch 'origin/master' into tsserverVS-WIP-mixe…
vladima Jul 26, 2016
5919595
Add support for including dotted and .min.js files explicitly in include
riknoll Jul 26, 2016
d182d7f
Fixed broken singleAsteriskRegex. Fixes #9918 (#9920)
Artazor Jul 25, 2016
01c1bdb
use FileMap to store script info objects to avoid issues due to misma…
vladima Jul 26, 2016
a1e5eeb
merge with origin/master
vladima Jul 27, 2016
4e778c0
Support emitting static properties for classes with no name
Jul 27, 2016
80e80b1
Merge pull request #9981 from Microsoft/release-2.0_class_expression_…
Jul 27, 2016
2cb3122
Merge remote-tracking branch 'origin/master' into tsserverVS-WIP
vladima Jul 28, 2016
2f7e738
resolve merge issues
vladima Jul 28, 2016
b9bbd86
Merge remote-tracking branch 'origin/tsserverVS-WIP' into tsserverVS-…
vladima Jul 28, 2016
b587127
Merge remote-tracking branch 'origin/release-2.0' into explicitly_inc…
riknoll Jul 29, 2016
d98846b
Merge pull request #9972 from Microsoft/explicitly_included_globs_2.0
riknoll Jul 29, 2016
361a852
use ExternalFile in ApplyChangesInOpenFiles
vladima Jul 29, 2016
6d497e3
allow to change configuration for inferred projects
vladima Aug 1, 2016
5fb2fbd
Provide `realpath` for module resolution in LSHost
Aug 1, 2016
e77f9b2
allow to change settings for inferred projects
vladima Aug 1, 2016
de37f35
set compilation settings of project as a part of sync process
vladima Aug 2, 2016
8ceeb4b
Merge pull request #10070 from Microsoft/release-2.0_lshost_realpath
Aug 2, 2016
126c1ee
[Release-2.0] fix 9802: fix language service for UMD module alias (#1…
yuit Aug 2, 2016
c0bcf8f
release cached tree in compilation settings change
vladima Aug 3, 2016
0aaec56
Add a helper function `getOrUpdateProperty` to prevent unprotected ac…
Aug 4, 2016
d173bca
Merge pull request #10136 from Microsoft/release-2.0_export_specifier…
Aug 4, 2016
0a1ec43
addref in all configured projects that contain the file
vladima Aug 4, 2016
8830d76
Port PR#9867 to Release-2.0 (#10147)
yuit Aug 5, 2016
0cfeaaf
[Release 2.0] fix10179: 2.0 emits optional class properties defined i…
yuit Aug 8, 2016
5d0e199
[Release 2.0] fix10076 : Destructing with "this" (#10209)
yuit Aug 9, 2016
d8d117f
[WIP] typings discovery in tsserver
vladima Aug 12, 2016
51e2b02
add runTsd method
vladima Aug 12, 2016
b1871a5
[WIP] pass ITypingsInstaller to ProjectService
vladima Aug 12, 2016
959b6b6
remove unused dependencies to reduce the size of output file
vladima Aug 12, 2016
512ec04
[WIP] send\receive install typing requests
vladima Aug 13, 2016
d07261a
ensure tsd cache directory exists
vladima Aug 13, 2016
253d5d6
[WIP] initial version of tests
vladima Aug 14, 2016
5d03895
fix build issues on linux
vladima Aug 14, 2016
9a18012
merge with origin/master
vladima Aug 14, 2016
af95f17
update tests
vladima Aug 14, 2016
c7fd72f
fix linter
vladima Aug 15, 2016
12cdda1
[WIP] home dir
vladima Aug 15, 2016
5424df7
adjust typing directory
vladima Aug 15, 2016
f603f02
fix test
vladima Aug 15, 2016
672813a
move global cache location to node typings installer
vladima Aug 15, 2016
dd70fdb
add logging to typings installer, read npm bin path to start globally…
vladima Aug 15, 2016
f0e1f9b
[WIP] file watching
vladima Aug 16, 2016
758d8de
record projectName instead of projectRootPath
vladima Aug 16, 2016
ce35f96
shutdown typing installer if parent process is exited
vladima Aug 17, 2016
a2e5c2d
merge with origin/master
vladima Aug 17, 2016
a3a07a0
lint more files
vladima Aug 17, 2016
dbd5249
added missing files
vladima Aug 17, 2016
3f18fbc
introduce branded type for TypingsArray
vladima Aug 17, 2016
edfd104
use localhost:<eventPort> to send notifications when typings are updated
vladima Aug 18, 2016
1d9124e
[Release-2.0] Merge master into Release-2.0 (#10347)
yuit Aug 18, 2016
b10c2ba
Update version to 2.0.2
mhegazy Aug 18, 2016
27deb31
Merge remote-tracking branch 'origin/master' into tsserver-typings
vladima Aug 18, 2016
c7c3158
Update LKG
mhegazy Aug 18, 2016
37f26cb
add missing methods
vladima Aug 18, 2016
78f2593
Merge branch 'master' into release-2.0
mhegazy Aug 18, 2016
875e62c
remove compression
vladima Aug 19, 2016
a1da770
propagate debug/inspect flags to typingsInstaller process
vladima Aug 19, 2016
b81b2ba
fix linter issues
vladima Aug 19, 2016
683d6ef
merge with origin/master
vladima Aug 19, 2016
9189846
move module resolution to core.ts
vladima Aug 19, 2016
41b61cb
merge with origin/master
vladima Aug 20, 2016
7b6846d
Merge master to release-2.0 on 08/19 (#10444)
yuit Aug 20, 2016
c05a866
Update LKG on 08/19 (#10445)
yuit Aug 20, 2016
f642a47
switch to using dedicated functions to create\throw errors
vladima Aug 22, 2016
bdaaf66
added type installer test for inferred project
vladima Aug 22, 2016
970ec1a
normalize slashes in names of external projects
vladima Aug 22, 2016
234b3bb
Merge master 08/22 (#10487)
yuit Aug 23, 2016
796c079
Merge branch 'master' into release-2.0
Aug 23, 2016
c254e95
Update LKG on 08/22
Aug 23, 2016
5e37a31
types 2.0 WIP
jramsay Aug 23, 2016
aff4556
do not send events via stdout if eventPort is specified
vladima Aug 23, 2016
d736db3
add typingOptions to the protocol.ExternalProject
vladima Aug 23, 2016
a082857
Add APIs for enabling CompileOnSave on tsserver (#9837)
zhengbli Aug 23, 2016
8fe0d2d
remove merge artefacts
vladima Aug 23, 2016
d72287e
Fix issue when building dependency graph for files with circular refs…
zhengbli Aug 24, 2016
dd979e8
added more tests for cases when typingOptions are provided by externa…
vladima Aug 24, 2016
84b5fe6
Merge branch 'tsserverVS-WIP' of https://github.com/Microsoft/TypeScr…
vladima Aug 24, 2016
6c49dc2
strip comments when re-emitting tsconfig.json (#10529)
zhengbli Aug 25, 2016
1357606
Update LKG
mhegazy Aug 25, 2016
eea2ddd
Correct default compileOnSave value for different projects (#10528)
zhengbli Aug 25, 2016
3953d6b
[CoS] return results from all projects if not specified project file …
zhengbli Aug 25, 2016
3ed8bca
Merge branch 'master' into release-2.0
Aug 25, 2016
d6dac6a
Update LKG 08/25
Aug 25, 2016
1f9f20f
Swap out TSD for Types 2.0
jramsay Aug 25, 2016
8075a0d
store project errors on project so they can be reported later
vladima Aug 26, 2016
7d3f22f
Changes from CR feedback
jramsay Aug 26, 2016
7132fe5
Merge branch 'tsserverVS-WIP' into tsserverVS-Types2.0
jramsay Aug 26, 2016
7e97974
merge with origin/release-2.0
vladima Aug 29, 2016
a2f92aa
invalidate cached typings on add or remove file
jramsay Aug 29, 2016
ce02f83
use ScriptKind instead of file extension
vladima Aug 29, 2016
6ea624a
Merge branch 'tsserverVS-WIP' into tsserverVS-Types2.0
jramsay Aug 29, 2016
456227b
Move invalidate typings cache to UpdateGraphWorker
jramsay Aug 29, 2016
199e533
- Command line should use spaces between types instead of comma
jramsay Aug 30, 2016
38ce627
add tsserver specific resolution pass that will load typings from cac…
vladima Aug 30, 2016
1fb969f
Split tests and fix issues with missing referenced files (#10599)
zhengbli Aug 30, 2016
24ef426
Install packages separately
jramsay Aug 30, 2016
ba50c6e
Merge branch 'tsserverVS-WIP' into tsserverVS-Types2.0
jramsay Aug 30, 2016
01caa69
fix findArgument
vladima Aug 30, 2016
d153816
- invalidate typings fix
jramsay Aug 30, 2016
48736de
onSourceFileChanged return immediately when info is undefined
jramsay Aug 30, 2016
95378aa
Fix compile on save issues (#10615)
zhengbli Aug 31, 2016
3a993c8
update runInstall
jramsay Sep 1, 2016
4f7a518
switch to using npm ls -json instead npm install -json
jramsay Sep 1, 2016
511b3cd
Fix existing TypingsInstaller tests
jramsay Sep 1, 2016
ce16f0a
Update version
mhegazy Sep 1, 2016
a3cd7d8
Avoid returning type symbols for js configured projects (#10654)
zhengbli Sep 1, 2016
852b1d2
Merge remote-tracking branch 'origin/release-2.0.5' into tsserverVS-WIP
vladima Sep 1, 2016
ed0ce16
fix recursive directory creation
vladima Sep 1, 2016
798232c
Fixing unit tests, lint errors & addressing CR feedback
jramsay Sep 2, 2016
12ad9d0
Search for `node_modules` in parent directories when getting type roots.
Sep 2, 2016
d61fd42
remove unused code
vladima Sep 2, 2016
66d456d
Merge pull request #10691 from Microsoft/release-2.0_node_modules_parent
Sep 2, 2016
7d0fc64
Adding typingsInstaller unit tests
jramsay Sep 2, 2016
4fc38fb
Merge pull request #10673 from Microsoft/tsserverVS-Types2.0
jramsay Sep 2, 2016
ed69a8a
Merge pull request #10692 from Microsoft/import_completions_pr
riknoll Sep 3, 2016
b728972
Introduce resolvingSignature to ensure caching works for anySignature
ahejlsberg Sep 4, 2016
9adc26c
Add repro from #10697
ahejlsberg Sep 4, 2016
faaf219
Merge pull request #10726 from Microsoft/port10703
mhegazy Sep 6, 2016
11e9f50
Port #10728: Fix #6500
zhengbli Sep 6, 2016
cb21601
Fix versions of TS and tslint
mhegazy Sep 7, 2016
2b8d963
Avoid circular references in core.ts (#10783)
zhengbli Sep 8, 2016
545d7e5
A shorthand ambient module should be considered as possibly exporting…
Sep 9, 2016
98ab0de
Assume outer variables are always initialized in control flow analysis
ahejlsberg Sep 9, 2016
f4c621b
Add regression tests
ahejlsberg Sep 9, 2016
88fd3d5
Use union type when binding element has initializer
ahejlsberg Aug 27, 2016
aee1bf6
Accept new baselines
ahejlsberg Aug 27, 2016
5c11d4c
Use 'true' and 'false' types when contextual type is 'boolean'
ahejlsberg Aug 27, 2016
2cd4d20
Accept new baselines
ahejlsberg Aug 27, 2016
6d6f3b1
Fix typescript and tslint versions
mhegazy Sep 9, 2016
8ae5b5f
Update LKG
mhegazy Sep 9, 2016
5c16cb6
Merge pull request #10807 from Microsoft/release-2.0_re_export_shorthand
Sep 9, 2016
709b4eb
Preserve type parameter types in narrowing
ahejlsberg Sep 10, 2016
9986f81
Add regression test
ahejlsberg Sep 10, 2016
b8759b3
Update LKG
mhegazy Sep 12, 2016
88349ab
Quick bail out when narrowing type any by equality
ahejlsberg Sep 12, 2016
81c69b2
Add regression test
ahejlsberg Sep 12, 2016
b3bb39d
Update baseline
mhegazy Sep 13, 2016
60d6578
Update LKG
mhegazy Sep 13, 2016
8c95c2b
Wrap IO for import completions in try catch
riknoll Sep 13, 2016
dae4ec6
Number is assignable to enum, even inside union
sandersn Sep 8, 2016
495ea0d
Test that number is assignable to enum in a union
sandersn Sep 8, 2016
7482d5b
Enum literal is assignable to enum, even inside union
sandersn Sep 8, 2016
bf3941d
Test that enum literal is assignable to an enum in a union
sandersn Sep 8, 2016
a0c3d4f
Fix both new enum assignability predicates
sandersn Sep 8, 2016
64e4f6f
Address PR comments
sandersn Sep 12, 2016
eb933f9
More tests of enum assignability
sandersn Sep 12, 2016
661c277
Fix lint
sandersn Sep 12, 2016
f50a437
Update baselines
sandersn Sep 12, 2016
85f9568
Enum assignability:loosen numbers+tighten computed
sandersn Sep 12, 2016
046a37d
Update baselines for updated enum assignability
sandersn Sep 12, 2016
b07f2da
Computed enum assignability is semi-structural
sandersn Sep 12, 2016
7d066fe
Update baselines
sandersn Sep 12, 2016
ab1df7b
Merge pull request #10903 from Microsoft/safe_import_completions_2.0.5
riknoll Sep 13, 2016
76fa7b9
Remove unnecessary parentheses
sandersn Sep 13, 2016
fcac9c4
Update baselines after cherry-pick to 2.0
sandersn Sep 13, 2016
f0b210c
Number is assignable to enum, even inside union
sandersn Sep 8, 2016
e32d854
Test that number is assignable to enum in a union
sandersn Sep 8, 2016
c47cdb8
Enum literal is assignable to enum, even inside union
sandersn Sep 8, 2016
083f342
Test that enum literal is assignable to an enum in a union
sandersn Sep 8, 2016
90d685b
Fix both new enum assignability predicates
sandersn Sep 8, 2016
e177979
Address PR comments
sandersn Sep 12, 2016
aa3d250
More tests of enum assignability
sandersn Sep 12, 2016
3683ec2
Fix lint
sandersn Sep 12, 2016
e384317
Update baselines
sandersn Sep 12, 2016
d0f8be5
Enum assignability:loosen numbers+tighten computed
sandersn Sep 12, 2016
bfed544
Update baselines for updated enum assignability
sandersn Sep 12, 2016
267042f
Computed enum assignability is semi-structural
sandersn Sep 12, 2016
71fa082
Update baselines
sandersn Sep 12, 2016
d81ad46
Remove unnecessary parentheses
sandersn Sep 13, 2016
28ec7d6
Update baselines after cherry-pick to 2.0.5
sandersn Sep 13, 2016
82a4d58
Merge branch 'release-2.0.5' of https://github.com/Microsoft/TypeScri…
sandersn Sep 13, 2016
d14183c
merge with origin/release-2.0.5
vladima Sep 13, 2016
2ca9953
Support compile on save for inferred projects (#10847)
zhengbli Sep 13, 2016
3c20df5
Create folders for sys.writeFile if folder doesn't exist (#10848)
zhengbli Sep 13, 2016
332b316
Emit declaration file which inferred type alias with its value
Sep 14, 2016
ced8cf8
Add tests and update baselines
Sep 14, 2016
b6aeaab
Update version
mhegazy Sep 14, 2016
14b59b2
Address PR
Sep 14, 2016
0c443c2
Update LKG
mhegazy Sep 14, 2016
9cabffe
Merge branch 'release-2.0' into release-2.0_fix10625
mhegazy Sep 14, 2016
93e0451
Merge branch 'release-2.0_fix10625' into release-2.0
mhegazy Sep 14, 2016
4ce2280
Update LKG
mhegazy Sep 14, 2016
48e51b5
Add tests and baselines
Sep 14, 2016
d37391f
Allow type and NS references to UMD globals from modules
RyanCavanaugh Sep 14, 2016
bca3493
Merge pull request #10930 from RyanCavanaugh/release-2.0
RyanCavanaugh Sep 14, 2016
c98103b
Merge pull request #10928 from Microsoft/addTestFix10625
yuit Sep 14, 2016
5f1336b
Update LKG
Sep 14, 2016
7fd5699
Merge branch 'release-2.0' into release-2.0.5
Sep 14, 2016
3a9d850
Update LKG
Sep 15, 2016
5c604f9
correctly update external project if config file is added or removed
vladima Sep 15, 2016
4668c99
Merge pull request #10943 from Microsoft/update-external-project
vladima Sep 16, 2016
121b04e
(lshost): run second module resolution pass if first pass yielded non…
vladima Sep 16, 2016
4b9e554
Add throttle limit to typings installer requests
jramsay Sep 16, 2016
286a12e
defer settings format options on file until it is explicitly requeste…
vladima Sep 19, 2016
55f6d4f
do not adjust location being passed to the managed side (#10999)
vladima Sep 19, 2016
2612a74
Working version
RyanCavanaugh Sep 19, 2016
6de3dc4
Cleanup
RyanCavanaugh Sep 20, 2016
c1630e5
Fixup
RyanCavanaugh Sep 20, 2016
924a2bf
Remove unused
RyanCavanaugh Sep 20, 2016
46dfd68
Always return []
RyanCavanaugh Sep 20, 2016
c080643
Refactor
RyanCavanaugh Sep 20, 2016
76f51ad
Cleanup
RyanCavanaugh Sep 20, 2016
609e56e
- Reorganize nodeTypingsInstaller and typingsInstaller for testing pu…
jramsay Sep 19, 2016
aa03a04
Use explicit coercion
RyanCavanaugh Sep 20, 2016
3c7b213
PR updates
RyanCavanaugh Sep 20, 2016
2dfcafe
)
RyanCavanaugh Sep 20, 2016
7ca85e0
move throttling to runAsync
vladima Sep 20, 2016
ec7c7a4
Merge pull request #11021 from Microsoft/throttle-in-runAsync
jramsay Sep 20, 2016
8c899a6
An elegant weapon for a more civilized age
RyanCavanaugh Sep 20, 2016
6275da2
Merge pull request #10960 from Microsoft/throttleTypingsInstallerRequ…
jramsay Sep 20, 2016
6449e5c
Lint
RyanCavanaugh Sep 20, 2016
52fddfa
Add TODO
RyanCavanaugh Sep 21, 2016
53232b9
Merge pull request #11002 from RyanCavanaugh/watchForTypes
RyanCavanaugh Sep 21, 2016
2a206b3
add check if expected directory path is non-empty string
vladima Sep 21, 2016
dd77c8c
Merge pull request #11029 from Microsoft/fix-write-file
vladima Sep 21, 2016
3c4786d
fix 9610 (#11042)
zhengbli Sep 21, 2016
1fd0a8c
added unittest for watching @types (#11027)
vladima Sep 22, 2016
f13cef1
Add fallback for npm location if not running under node.exe
mhegazy Sep 22, 2016
92ae0f1
Add cancellationToken and typingsInstaller to LKG command
mhegazy Sep 22, 2016
311e285
Merge branch 'release-2.0.5' into FixNPMLocation
mhegazy Sep 22, 2016
12578a5
set allowSyntheticDefaultImports to true by default for jsconfig.json
zhengbli Sep 22, 2016
59b12d7
Merge pull request #11069 from Microsoft/FixNPMLocation
mhegazy Sep 22, 2016
0cd1af4
Add gulp build tasks for cancellationToken and typingsInstaller
mhegazy Sep 22, 2016
9482233
Merge branch 'release-2.0.5' into gulpbuild
mhegazy Sep 22, 2016
0a0b7e4
Update LKG
mhegazy Sep 22, 2016
ff082eb
Merge pull request #11070 from zhengbli/allowSynthetic
zhengbli Sep 23, 2016
a991673
allow to replace content of script info with empty text (#11075)
vladima Sep 23, 2016
a9d97ae
Merge pull request #11071 from Microsoft/gulpbuild
mhegazy Sep 23, 2016
833a46c
merge with origin/master
vladima Sep 27, 2016
d126173
Merge remote-tracking branch 'origin/master' into release205-to-master
vladima Sep 27, 2016
912e685
update LKG, resolve merge issues
vladima Sep 27, 2016
9c0e64d
fix merge issues, restore tests
vladima Sep 27, 2016
daa4b1f
update LKG
vladima Sep 27, 2016
f361ed1
fixes: merge issue in test baselines, linter
vladima Sep 27, 2016
3f2e391
revert versions
vladima Sep 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions Gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,35 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
]).pipe(gulp.dest(builtLocalDirectory));
});

// cancellationToken.js
const cancellationTokenJs = path.join(builtLocalDirectory, "cancellationToken.js");
gulp.task(cancellationTokenJs, false, [servicesFile], () => {
const cancellationTokenProject = tsc.createProject("src/server/cancellationToken/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
return cancellationTokenProject.src()
.pipe(newer(cancellationTokenJs))
.pipe(sourcemaps.init())
.pipe(tsc(cancellationTokenProject))
.pipe(prependCopyright())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(builtLocalDirectory));
});

// typingsInstallerFile.js
const typingsInstallerJs = path.join(builtLocalDirectory, "typingsInstaller.js");
gulp.task(typingsInstallerJs, false, [servicesFile], () => {
const cancellationTokenProject = tsc.createProject("src/server/typingsInstaller/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
return cancellationTokenProject.src()
.pipe(newer(typingsInstallerJs))
.pipe(sourcemaps.init())
.pipe(tsc(cancellationTokenProject))
.pipe(prependCopyright())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(builtLocalDirectory));
});

const serverFile = path.join(builtLocalDirectory, "tsserver.js");

gulp.task(serverFile, false, [servicesFile], () => {
gulp.task(serverFile, false, [servicesFile, typingsInstallerJs, cancellationTokenJs], () => {
const serverProject = tsc.createProject("src/server/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
return serverProject.src()
.pipe(newer(serverFile))
Expand Down Expand Up @@ -454,7 +480,6 @@ gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]);
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);


// Generate Markdown spec
const word2mdJs = path.join(scriptsDirectory, "word2md.js");
const word2mdTs = path.join(scriptsDirectory, "word2md.ts");
Expand Down Expand Up @@ -493,7 +518,7 @@ gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); })
gulp.task("dontUseDebugMode", false, [], (done) => { useDebugMode = false; done(); });

gulp.task("VerifyLKG", false, [], () => {
const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile].concat(libraryTargets);
const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, typingsInstallerJs, cancellationTokenJs].concat(libraryTargets);
const missingFiles = expectedFiles.filter(function(f) {
return !fs.existsSync(f);
});
Expand Down
59 changes: 53 additions & 6 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var runTestsInParallel = require("./scripts/mocha-parallel").runTestsInParallel;
var compilerDirectory = "src/compiler/";
var servicesDirectory = "src/services/";
var serverDirectory = "src/server/";
var typingsInstallerDirectory = "src/server/typingsInstaller";
var cancellationTokenDirectory = "src/server/cancellationToken";
var harnessDirectory = "src/harness/";
var libraryDirectory = "src/lib/";
var scriptsDirectory = "scripts/";
Expand Down Expand Up @@ -164,6 +166,13 @@ var servicesSources = [
}));

var serverCoreSources = [
"types.d.ts",
"utilities.ts",
"scriptVersionCache.ts",
"typingsCache.ts",
"scriptInfo.ts",
"lsHost.ts",
"project.ts",
"editorServices.ts",
"protocol.d.ts",
"session.ts",
Expand All @@ -172,12 +181,33 @@ var serverCoreSources = [
return path.join(serverDirectory, f);
});

var cancellationTokenSources = [
"cancellationToken.ts"
].map(function (f) {
return path.join(cancellationTokenDirectory, f);
});

var typingsInstallerSources = [
"../types.d.ts",
"typingsInstaller.ts",
"nodeTypingsInstaller.ts"
].map(function (f) {
return path.join(typingsInstallerDirectory, f);
});

var serverSources = serverCoreSources.concat(servicesSources);

var languageServiceLibrarySources = [
"protocol.d.ts",
"utilities.ts",
"scriptVersionCache.ts",
"scriptInfo.ts",
"lsHost.ts",
"project.ts",
"editorServices.ts",
"protocol.d.ts",
"session.ts"
"session.ts",

].map(function (f) {
return path.join(serverDirectory, f);
}).concat(servicesSources);
Expand Down Expand Up @@ -221,15 +251,24 @@ var harnessSources = harnessCoreSources.concat([
"convertCompilerOptionsFromJson.ts",
"convertTypingOptionsFromJson.ts",
"tsserverProjectSystem.ts",
"compileOnSave.ts",
"typingsInstaller.ts",
"projectErrors.ts",
"matchFiles.ts",
"initializeTSConfig.ts",
].map(function (f) {
return path.join(unittestsDirectory, f);
})).concat([
"protocol.d.ts",
"utilities.ts",
"scriptVersionCache.ts",
"scriptInfo.ts",
"lsHost.ts",
"project.ts",
"typingsCache.ts",
"editorServices.ts",
"protocol.d.ts",
"session.ts",
"client.ts",
"editorServices.ts"
].map(function (f) {
return path.join(serverDirectory, f);
}));
Expand Down Expand Up @@ -616,8 +655,14 @@ compileFile(
inlineSourceMap: true
});

var cancellationTokenFile = path.join(builtLocalDirectory, "cancellationToken.js");
compileFile(cancellationTokenFile, cancellationTokenSources, [builtLocalDirectory].concat(cancellationTokenSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { outDir: builtLocalDirectory, noOutFile: true });

var typingsInstallerFile = path.join(builtLocalDirectory, "typingsInstaller.js");
compileFile(typingsInstallerFile, typingsInstallerSources, [builtLocalDirectory].concat(typingsInstallerSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { outDir: builtLocalDirectory, noOutFile: false });

var serverFile = path.join(builtLocalDirectory, "tsserver.js");
compileFile(serverFile, serverSources, [builtLocalDirectory, copyright].concat(serverSources), /*prefixes*/[copyright], /*useBuiltCompiler*/ true, { types: ["node"] });
compileFile(serverFile, serverSources, [builtLocalDirectory, copyright, cancellationTokenFile, typingsInstallerFile].concat(serverSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"] });
var tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
var tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
compileFile(
Expand Down Expand Up @@ -700,7 +745,7 @@ task("generate-spec", [specMd]);
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
desc("Makes a new LKG out of the built js files");
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function () {
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile].concat(libraryTargets);
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, cancellationTokenFile, typingsInstallerFile].concat(libraryTargets);
var missingFiles = expectedFiles.filter(function (f) {
return !fs.existsSync(f);
});
Expand Down Expand Up @@ -948,7 +993,7 @@ desc("Runs the tests using the built run.js file like 'jake runtests'. Syntax is
task("runtests-browser", ["tests", "browserify", builtLocalDirectory, servicesFileInBrowserTest], function () {
cleanTestDirs();
host = "node";
browser = process.env.browser || process.env.b || "IE";
browser = process.env.browser || process.env.b || (os.platform() === "linux" ? "chrome" : "IE");
tests = process.env.test || process.env.tests || process.env.t;
var light = process.env.light || false;
var testConfigFile = 'test.config';
Expand Down Expand Up @@ -1130,6 +1175,8 @@ var lintTargets = compilerSources
.concat(serverCoreSources)
.concat(tslintRulesFiles)
.concat(servicesSources)
.concat(typingsInstallerSources)
.concat(cancellationTokenSources)
.concat(["Gulpfile.ts"])
.concat([nodeServerInFile, perftscPath, "tests/perfsys.ts", webhostPath]);

Expand Down
41 changes: 41 additions & 0 deletions lib/cancellationToken.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

"use strict";
var fs = require("fs");
function createCancellationToken(args) {
var cancellationPipeName;
for (var i = 0; i < args.length - 1; i++) {
if (args[i] === "--cancellationPipeName") {
cancellationPipeName = args[i + 1];
break;
}
}
if (!cancellationPipeName) {
return { isCancellationRequested: function () { return false; } };
}
return {
isCancellationRequested: function () {
try {
fs.statSync(cancellationPipeName);
return true;
}
catch (e) {
return false;
}
}
};
}
module.exports = createCancellationToken;
Loading