Watch for changes in types roots#11002
Merged
RyanCavanaugh merged 13 commits intomicrosoft:release-2.0.5from Sep 21, 2016
Merged
Watch for changes in types roots#11002RyanCavanaugh merged 13 commits intomicrosoft:release-2.0.5from
RyanCavanaugh merged 13 commits intomicrosoft:release-2.0.5from
Conversation
billti
reviewed
Sep 20, 2016
|
|
||
| return Math.max.apply(Math, paths.map(path => { | ||
| if (host.directoryExists(path)) { | ||
| return host.getModifiedTime(path); |
Member
There was a problem hiding this comment.
This returns a Date, but this function should return a number (Math.max probably converts it implicitly here).
Member
|
👍 |
mhegazy
reviewed
Sep 20, 2016
| } | ||
|
|
||
| watchTypeRoots(callback: (project: ConfiguredProject, path: string) => void) { | ||
| const roots = ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host); |
Contributor
There was a problem hiding this comment.
this.getEffectiveTypeRoots() ?
| if (roots) { | ||
| for (const root of roots) { | ||
| this.projectService.logger.info(`Add type root watcher for: ${root}`); | ||
| watchers.push(this.projectService.host.watchDirectory(root, path => callback(this, path), true)); |
Contributor
There was a problem hiding this comment.
why recursive? we only care about the top level.
| } | ||
|
|
||
| private onTypeRootFileChanged(project: ConfiguredProject, fileName: string) { | ||
| this.updateConfiguredProject(project); |
Contributor
There was a problem hiding this comment.
consider adding a log message here.
| } | ||
|
|
||
| private onTypeRootFileChanged(project: ConfiguredProject, fileName: string) { | ||
| this.updateConfiguredProject(project); |
Contributor
There was a problem hiding this comment.
why not this.throttledOperations.schedule ? in case there is a flurry of these, e.g. npm install
Contributor
|
@vladima can you take a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Watch for changes in type roots and reload the project when that happens.
Only tested in VS code so far