Skip to content

fmt: remove the prefixed module name of the const name in same module. (related #22183) - #22185

Merged
spytheman merged 3 commits into
vlang:masterfrom
yuyi98:remove_prefix_const
Sep 10, 2024
Merged

spytheman merged 3 commits into
vlang:masterfrom
yuyi98:remove_prefix_const

Conversation

@yuyi98

@yuyi98 yuyi98 commented Sep 9, 2024

Copy link
Copy Markdown
Member

This PR remove the prefixed module name of the const name in same module.(related #22183)

  • Remove the prefixed module name of the const name in same module.
  • Modify all the related files and tests.
module tt1

const full_name = 'Robert the Tomato'

fn print_full_name() {
	println(full_name)
	println(full_name)
}

fn print_name() {
	println(name)
	println(name)
}
module tt1

const name = 'Bob'

@spytheman spytheman 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.

Excellent work 🥳 !
Less arbitrary rules and exceptions in v.fmt, producing shorter and cleaner code ❤️ .

@spytheman
spytheman merged commit 008aaad into vlang:master Sep 10, 2024
@yuyi98
yuyi98 deleted the remove_prefix_const branch September 10, 2024 08:54
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