Skip to content

Salsa: JS support for discovering and acquiring d.ts files#7179

Merged
jramsay merged 16 commits into
masterfrom
jsTypingForAcquireDts
Mar 2, 2016
Merged

Salsa: JS support for discovering and acquiring d.ts files#7179
jramsay merged 16 commits into
masterfrom
jsTypingForAcquireDts

Conversation

@jramsay
Copy link
Copy Markdown
Member

@jramsay jramsay commented Feb 22, 2016

Salsa: JS support for discovering and acquiring d.ts files
(Isolating and continuing VS host changes from PR#6448)

(Mostly isolating VS host changes from PR#6448)
(Rules appear to be more strict - this was not caught on a local lint run)
Comment thread src/compiler/commandLineParser.ts Outdated
}
}
else if (id === "include") {
options.include = isArray(jsonTypingOptions[id]) ? <string[]>jsonTypingOptions[id] : [];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to check that the array is actually composed only of strings (same on line 621 as well)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good idea - done

- Adding check to ensure TypingOptions 'include' and 'exclude' arrays are composed of strings
- Allow leading whitespace when removing comments from json
Comment thread src/services/jsTyping.ts
if (jsonDict.hasOwnProperty("dependencies")) {
mergeTypings(Object.keys(jsonDict.dependencies));
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Per our meeting with ASP.NET (and for the general developer experience), didn't we want to search for devDependencies also?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes - thanks for the reminder! Will add those as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know how relevant it is here, but package.json has peerDependencies and optionalDependencies as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for drawing my attention to these. Doesn't seem too compelling to add them at this point but will consider adding them in future if we find the current dependencies are falling short.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No problem. Seemed like you'd want to cover those anyway, since there'll never be overlap in any of these fields and they are treated the same as regular dependencies on a local project. The only difference is when they're used as a sub-dependency dependencies.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks- included these dependencies as well

Comment thread src/compiler/commandLineParser.ts Outdated
return { options, errors };
}

function ConvertJsonOptionToStringArray(optionName: string, optionJson: any, errors: Diagnostic[], func?: (element: string) => string): string[] {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Function names begin with lower-case letters

@jramsay
Copy link
Copy Markdown
Member Author

jramsay commented Feb 26, 2016

👍

Comment thread src/services/jsTyping.ts Outdated
let safeList: Map<string>;
const notFoundTypingNames: string[] = [];

function tryParseJson(jsonPath: string, host: TypingResolutionHost): any {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i would use parseConfigFileTextToJson instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

actually readConfigFile is more appropriate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

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.

8 participants