Skip to content

Conversation

paulvanbrenk
Copy link
Contributor

This adds a method to the language service to parse a tsconfig file and correctly calculate the initial collection of files to consider.

We expect the 'host' to find the files in the file system.

@@ -299,7 +299,7 @@ module ts {
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine {
export function parseConfigFile(json: any, host: ParseConfigHost, basePath?: string): ParsedCommandLine {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make basePath required.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

Please use readConfigFile instead of another JSON.parse

return {
options: {},
files: [],
errors: [realizeDiagnostic(result.error, '/r/n')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooops.

@@ -188,6 +194,7 @@ module ts {

export interface CoreServicesShim extends Shim {
getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string;
getTSConfigFileInfo(fileName: string, sourceText: IScriptSnapshot): string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getConfigFileInfo and lose the TS part

@mhegazy
Copy link
Contributor

mhegazy commented Apr 23, 2015

Thanks 👍

try {
var text = sys.readFile(fileName);
return /\S/.test(text) ? JSON.parse(text) : {};
return parseConfigFileText(fileName, text);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to move out of the try.

paulvanbrenk added a commit that referenced this pull request Apr 23, 2015
This adds a method to the language service to parse a tsconfig file and correctly calculate the initial collection of files to consider. 

We expect the 'host' to find the files in the file system.
@paulvanbrenk paulvanbrenk merged commit 3907cae into master Apr 23, 2015
@paulvanbrenk paulvanbrenk deleted the tsconfigSupportInLS branch April 23, 2015 22:21
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants