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

Fix goto definition for field names. #135

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tritao
Copy link

@tritao tritao commented Oct 28, 2024

Changes Tree-Sitter field_name to contain a reference_expression.

On top of #134

Changes Tree-Sitter `field_name` to contain a `reference_expression`.
@spytheman
Copy link
Member

Why is there a need for it?
Can you show a small V code sample, that is now handled, but was not before?

@tritao
Copy link
Author

tritao commented Nov 3, 2024

Why is there a need for it? Can you show a small V code sample, that is now handled, but was not before?

fn main() {
	mut cmd := cli.Command{
		name:        metadata.manifest.name
		version:     metadata.full_version
		description: metadata.manifest.description
		execute:     run
		posix_mode:  true
	}

Sure. Any time you try to do goto-definition on a field name, like name: above. It didn't work before because all goto definition code is built with expectation of reference_expression. I tried it fixing some other way but this turned out to be a much simpler fix.

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