Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

chore: Change some APIs to use symbols instead of monikers#64029

Merged
varungandhi-src merged 1 commit into
mainfrom
vg/refactor-4
Jul 24, 2024
Merged

chore: Change some APIs to use symbols instead of monikers#64029
varungandhi-src merged 1 commit into
mainfrom
vg/refactor-4

Conversation

@varungandhi-src

@varungandhi-src varungandhi-src commented Jul 24, 2024

Copy link
Copy Markdown
Contributor

Monikers carry a bunch of redundant fields which basically consist of
information parsed out of the symbol name. This patch cleans up
some APIs to work with symbol names directly instead of monikers.

Stepping stone for GRAPH-573

Test plan

Covered by existing tests

@cla-bot cla-bot Bot added the cla-signed label Jul 24, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jul 24, 2024
Comment thread internal/codeintel/codenav/service.go Outdated
Comment on lines 358 to 361

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function is basically 2 Map calls + a method call, which I've just inlined, as this was only used in 1 place.

Base automatically changed from vg/refactor-3 to main July 24, 2024 09:14

@kritzcreek kritzcreek left a comment

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.

Nice. Just one small nit/question

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.

Should the gomod appear in this symbol somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The old code was just picking out the Identifier field, so I think this is OK.

	symbolNames := make([]string, 0, len(monikers))
	for _, arg := range monikers {
		symbolNames = append(symbolNames, arg.Identifier)
	}

	query := sqlf.Sprintf(
		bulkSymbolUsagesQuery,
		pq.Array(symbolNames),
		pq.Array(uploadIDs),
		sqlf.Sprintf(usageKind.RangesColumnName()),
		sqlf.Sprintf(usageKind.RangesColumnName()),
	)

@varungandhi-src varungandhi-src force-pushed the vg/refactor-4 branch 2 times, most recently from 437d222 to 47521e0 Compare July 24, 2024 09:54
@varungandhi-src varungandhi-src merged commit 2663704 into main Jul 24, 2024
@varungandhi-src varungandhi-src deleted the vg/refactor-4 branch July 24, 2024 12:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants