Skip to content

Avoid copying symbols that come from the project table and fix bug for ambiguous descriptors with null FQN#1040

Merged
guillaume-dequenne merged 2 commits into
masterfrom
fix-stackoverflow-again
Dec 17, 2021
Merged

Avoid copying symbols that come from the project table and fix bug for ambiguous descriptors with null FQN#1040
guillaume-dequenne merged 2 commits into
masterfrom
fix-stackoverflow-again

Conversation

@guillaume-dequenne

Copy link
Copy Markdown
Contributor

Thanks to descriptors, symbols from the project symbol table are always new and shouldn't require any copy logic (copyWithoutUsage or copySymbol).

This PR also fix a bug when a descriptor within an ambiguous descriptor has a null FQN and cannot be retrieved properly by createdSymbols.

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.

LGTM, I think it's ok to merge this PR to fix the problems we have on Peach. However, I think we should clean-up DescriptorUtils before shipping it to production

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.

Maybe we could call the copyWithoutUsages inside typeshedSymbolWithFQN?

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.

I think we should clean-up a bit those static methods that create symbols: this could become a Builder Class where we keep projectLevelSymbolTable, createdSymbolsByDescriptor and createdSymbolsByFqn as internal states. I don't think we need to do it in this PR, however believe it's important to do it before releasing new version to avoid adding more technical dept.

Let's add a TODO comment and maybe a task ticket in the Kanbar.

@sonarsource-next

Copy link
Copy Markdown

@guillaume-dequenne guillaume-dequenne merged commit 5f7804b into master Dec 17, 2021
@guillaume-dequenne guillaume-dequenne deleted the fix-stackoverflow-again branch December 17, 2021 17:25
hashicorp-vault-sonar-prod Bot pushed a commit that referenced this pull request Apr 14, 2026
…match their assigned variable names (#1040)

GitOrigin-RevId: 6c637df3b657e7959d17bda21463f8ce4a4bb3f7
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.

2 participants