Skip to content
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

show squiggly line when import class not in build target #473

Conversation

idankWix
Copy link

No description provided.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@idankWix
Copy link
Author

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.

What to do if you already signed the CLA

Individual signers
Corporate signers

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@idankWix
Copy link
Author

before

after

Copy link

@or-shachar or-shachar left a comment

Choose a reason for hiding this comment

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

waiting for @hmemcpy for technical insights. Looks good. I had minor comments about google style... and a question about intellij event system.

@@ -65,7 +67,7 @@ private BlazeBeforeRunCommandHelper() {}
(BlazeCommandRunConfigurationCommonState) configuration.getHandler().getState();
WorkspaceRoot workspaceRoot = WorkspaceRoot.fromProject(project);
ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();

ServiceManager.getService(ImportProblemContainerService.class).resetIssues();

Choose a reason for hiding this comment

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

@hmemcpy - is there an event system in Intellij such that instead of triggering an action here, we can broadcast an event that will cause other processes to be triggered?

@ittaiz
Copy link
Member

ittaiz commented Dec 21, 2018

@brendandouglas wdyt?

private void addTargetToDepsIfNeeded(Argument.Keyword depsKeyword, Label targetToBeAdded, Project project) {
PsiElement depsElement = depsKeyword.getPsiChild(BuildElementTypes.LIST_LITERAL, null);
if(depsDoesntHaveWhiteSpace(depsElement)){
addWhiteSpaceElement(project, depsElement, "\n ");

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

todo

@idankWix
Copy link
Author

idankWix commented Jan 8, 2019

@brendandouglas can you pls go over the PR ?

base/BUILD Outdated
@@ -19,6 +19,7 @@ java_library(
"//sdkcompat",
"//third_party/auto_value",
"@error_prone_annotations//jar",
"//third_party/scala",
Copy link
Contributor

Choose a reason for hiding this comment

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

The 'base' module is used across all IDEs, and can't have a language specific dep (unless that language is supported in all JetBrains IDEs).

Copy link
Author

Choose a reason for hiding this comment

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

fixed by moving to async messaging

@brendandouglas
Copy link
Contributor

Thanks for the pull request. I haven't had a chance to look over it yet, but will try to get to it within the next day or two.

private static final String NEW_LINE = "\n";
private static String missingImportRegEx = "object .* is not a member of package .*";
private static String wildCardOrStaticRegEx = "package .* does not exist";
private static String javaStaticImport = "static import only from classes and interfaces";
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't problems like this already be annotated in the IDE?

Copy link
Author

Choose a reason for hiding this comment

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

they are not currently

@brendandouglas
Copy link
Contributor

Thanks again for the PR. I think the general approach of annotating missing imports/deps and providing a quick-fix action is good. Ideally, we wouldn't need to run a bazel build to find these.

We have a separate system for this internally. Bazel outputs a error with a suggested fix such as "Command to add missing dependencies: '[command line script]'". We add a hyperlink to the bazel console view (also linked in the bazel problems view) to run the script and apply the fix.

Otherwise, I'm not sure when we'd be able to work on this PR, since there's a fair bit of work involved applying it upstream. Some examples: I'd prefer to use buildozer directly rather than manually modifying BUILD files, the language-specific bits need to be moved to the appropriate modules, we'd need to add some tests and documentation, and make some style changes.

@or-shachar
Copy link

or-shachar commented Jan 14, 2019

@brendandouglas - how do we proceed on this?

Ideally, we wouldn't need to run a bazel build to find these.

What are the alternatives?

We have a separate system for this internally.

Great! but we need to enrich this public plugin as well.. And this is our contribution to make it better and complete. Can you elaborate on the tool? is it something Wix can use?

Otherwise, I'm not sure when we'd be able to work on this PR, since there's a fair bit of work involved
applying it upstream.

I'm a bit confused by this. What does it mean?

I'd prefer to use buildozer directly rather than manually modifying BUILD files, the language-specific
bits need to be moved to the appropriate modules

See my suggestions here: #477 - would love to hear your comment . If you need our contribution here - we can do it.

we'd need to add some tests and documentation, and make some style changes.

What is the style guide? Where can we add documentation?

===
Bottom line - From the belief in bazel as a build tool and Intellij as our IDE, and from an Open Source approach - we are willing to work hard and contribute but we need your hand in this.

Would really like to know what are the concrete steps you want to do in order to push this plugin forward.

Thanks!
cc: @ittaiz

@brendandouglas
Copy link
Contributor

@or-shachar, our preferred way of implementing this kind of feature would be via 'add_deps' support at bazel build time (there's some discussion of this in bazelbuild/bazel/issues/4846 and bazelbuild/bazel/issues/4584).

That moves responsibility for determining the appropriate fix to the build, rather than having a separate layer in the IDE. If that was implemented in bazel, we'd simply parse the relevant command in bazel's stdout/stderr, and add an entry to the 'bazel problems' view, as well as adding a link to the console output.

Otherwise, I'm not sure when we'd be able to work on this PR, since there's a fair bit of work involved
applying it upstream.

I'm a bit confused by this. What does it mean?

This github project is just a mirror of our internal project. Applying patches involves:

  • rewriting the PR to conform to our coding practices, style guide, etc.
  • adding appropriate unit and integration tests and safeguards to lessen the chance of internal regressions, especially related to performance.

All of this takes time, so we prefer to iron out the details of a potential contribution beforehand, to save effort (see the 'contributions' section of the top level readme).

@idankWix idankWix force-pushed the same-repo-import-issue-resolver branch from caa3f04 to 827d098 Compare January 23, 2019 09:27
@sgowroji
Copy link
Member

sgowroji commented Sep 1, 2022

Hello @idankWix , If you are still looking to submit the above PR for review. Could you please resolve the code conflicts and fix the build checks. I can help you in arranging the review. Thanks!

@sgowroji sgowroji added the awaiting-user-response Awaiting response from author on PRs label Sep 1, 2022
@bazelbuild bazelbuild deleted a comment from sgowroji Dec 7, 2022
@keertk
Copy link
Member

keertk commented Dec 7, 2022

Hi there! Thank you for contributing to the IntelliJ repository. We appreciate your time and effort. We're doing a clean up of old PRs and will be closing this one since it seems to have stalled. Please feel free to reopen/let us know if you’re still interested in pursuing this or if you'd like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

@keertk keertk closed this Dec 7, 2022
@jastice jastice removed the awaiting-user-response Awaiting response from author on PRs label Jan 17, 2023
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.

8 participants