Add APIs for enabling CompileOnSave on tsserver#9837
Merged
Conversation
… into compileOnSave0
| return undefined; | ||
| } | ||
|
|
||
| export function findFirst<T>(array: T[], predicate: (item: T) => boolean): T { |
Contributor
There was a problem hiding this comment.
forEach has pretty much the same semantics
added 3 commits
August 14, 2016 01:20
Also move the CompileOnSave option out of compilerOptions
| if (!hasProperty(jsonOption, "compileOnSave")) { | ||
| return false; | ||
| } | ||
| const result = convertJsonOption({ name: "compileOnSave", type: "boolean" }, jsonOption["compileOnSave"], basePath, errors); |
Contributor
There was a problem hiding this comment.
extract { name: "compileOnSave", type: "boolean" } into a variable so it can be used here and in commandLineParser.ts
| } | ||
| } | ||
|
|
||
| export function convertCompileOnSaveOptionFromJson(jsonOption: any, basePath: string, errors: Diagnostic[]): boolean { |
Contributor
There was a problem hiding this comment.
hasProperty(jsonOption, compileOnSaveCommandLineOption.name)
added 2 commits
August 21, 2016 23:39
| return; | ||
| } | ||
|
|
||
| if (array.length === 1 && array[0] === fileInfo) { |
Contributor
There was a problem hiding this comment.
you can do splice only if array[0] === fileInfo otherwise just exit
6802f9a to
600b05d
Compare
added 2 commits
August 23, 2016 15:56
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.
Added two APIs to enable "Compile On Save" on tsserver:
CompileOnSaveAffectedFileList: returns the list of files that need to be saved and recompiled due to the current changes. The editor can use this list to queue up files to compile and prompt the user with options of saving the files / checking out the files from source control etc.CompileFile: writes the emit output of a single file to the file system.