Skip to content

fix: don't show "start a build" if the file is in node_modules #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

ah-yu
Copy link
Contributor

@ah-yu ah-yu commented Jun 29, 2022

Closes #471

@ah-yu ah-yu changed the title fix: do show "start a build" if the file is in node_modules fix: don't show "start a build" if the file is in node_modules Jun 29, 2022
Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

Awesome.
Thanks for the super quick fix.

@@ -188,7 +189,7 @@ let openedFile = (fileUri: string, fileContent: string) => {
openFiles: new Set(),
filesWithDiagnostics: new Set(),
bsbWatcherByEditor: null,
hasPromptedToStartBuild: false,
hasPromptedToStartBuild: projectRootPath.includes("node_modules") ? "never" : false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this just string search?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Any risk one puts the file in this_is_not_node_modules_carrots or is that too pedantic?

Copy link
Collaborator

Choose a reason for hiding this comment

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

One could make it includes("/node_modules/") and we should be as safe as we can be.

Copy link
Contributor Author

@ah-yu ah-yu Jun 29, 2022

Choose a reason for hiding this comment

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

@zth but it will fail on windows

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right. But looks like you accounted for that in your fix.

Zhang and others added 2 commits June 29, 2022 18:52
@cristianoc cristianoc merged commit 2665678 into rescript-lang:master Jun 29, 2022
@cristianoc
Copy link
Collaborator

This is great. Merged.
Thanks a lot for the contribution.

@ah-yu ah-yu deleted the block-prompt branch June 29, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not show "Start a build" when click+hover on a value from another module.
3 participants