-
Notifications
You must be signed in to change notification settings - Fork 316
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
show squiggly line when import class not in build target #473
Conversation
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. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
There was a problem hiding this 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.
base/src/com/google/idea/blaze/base/ui/problems/BlazeProblemsView.java
Outdated
Show resolved
Hide resolved
@@ -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(); |
There was a problem hiding this comment.
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?
@brendandouglas wdyt? |
base/src/com/google/idea/blaze/base/lang/buildfile/actions/BuildFileModifierImpl.java
Show resolved
Hide resolved
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 "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use https://github.com/bazelbuild/intellij/blob/master/base/src/com/google/idea/blaze/base/buildmodifier/BuildFileFormatter.java for final formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
@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", |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are not currently
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. |
@brendandouglas - how do we proceed on this?
What are the alternatives?
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?
I'm a bit confused by this. What does it mean?
See my suggestions here: #477 - would love to hear your comment . If you need our contribution here - we can do it.
What is the style guide? Where can we add documentation? === Would really like to know what are the concrete steps you want to do in order to push this plugin forward. Thanks! |
@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.
This github project is just a mirror of our internal project. Applying patches involves:
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). |
…d-action only + no line fix
caa3f04
to
827d098
Compare
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! |
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. |
No description provided.