Skip to content

Add advanced safelist for exclusions#14999

Merged
RyanCavanaugh merged 12 commits into
microsoft:masterfrom
RyanCavanaugh:typesMap
Apr 10, 2017
Merged

Add advanced safelist for exclusions#14999
RyanCavanaugh merged 12 commits into
microsoft:masterfrom
RyanCavanaugh:typesMap

Conversation

@RyanCavanaugh

@RyanCavanaugh RyanCavanaugh commented Apr 4, 2017

Copy link
Copy Markdown
Member

No description provided.

content: JSON.stringify({
"jquery": {
// jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
"match": "/jquery(-(\\.\\d+)+)?(\\.intellisense)?(\\.min)?\\.js$",

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.

This don't match jquery-1.10.2.min.js, matches something like jquery-.10.2.min.js.

@RyanCavanaugh RyanCavanaugh changed the title [WIPish] Add advanced safelist for exclusions Add advanced safelist for exclusions Apr 5, 2017
Comment thread src/server/editorServices.ts Outdated
const raw: SafeList = JSON.parse(this.host.readFile(fileName, "utf-8"));
// Parse the regexps
for (const k of Object.keys(raw)) {
raw[k].match = new RegExp(raw[k].match as {} as string, "gi");

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.

Remove g flag

Comment thread src/server/protocol.ts Outdated
export type LoadTypesMap = "loadTypesMap";
export type GetCodeFixes = "getCodeFixes";
/* @internal */
/* @internal */

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.

merge victim?

Comment thread src/server/session.ts Outdated
return this.requiredResponse(true);
},
[CommandNames.LoadTypesMap]: (request: protocol.FileRequest) => {
const loadArgs = <protocol.FileRequestArgs>request.arguments;

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.

FileRequestArgs has a projectFileName member which you never look at. While it's optional, it still gives the false impression that project context matters for this message (it doesn't -- it loads the same type map for all projects). I'd use a different type that only contains file.

@RyanCavanaugh RyanCavanaugh merged commit 2ca90b7 into microsoft:master Apr 10, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 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