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

Avoiding trying to add a specific import if all already present. #9568

Closed
wants to merge 2 commits into from

Conversation

jdunkerley
Copy link
Member

Fixes issue with dropdown and FQN clashes.

Pull Request Description

While this doesn't fix the issues in the logic for conflict detection and the injected result, avoids the issue by checking if we have the import.

We should review the resolveTagExpression logic separately.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@jdunkerley jdunkerley added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 28, 2024
Comment on lines 315 to 320
// Let's check and see if the general import of the target module is already present.
const filteredNewImports = newImports.filter((newImport) => {
if (newImport.kind === 'Qualified') return true
return !existingImports.some((existingImport) => existingImport.from === newImport.from && existingImport.imported.kind === 'All')
});

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be done by working detectImportConflicts and filterOutRedundantImports below.

But the conflict resolution does not work properly; I would prefer removing the substitution from WidgetSelection, similar way as when creating node (

// TODO: Sort out issues with FQN with the engine.
) Then we will fix it as part of #9356

@jdunkerley jdunkerley closed this Mar 28, 2024
@jdunkerley jdunkerley deleted the wip/jd/first-last-bug branch May 8, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants