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

code-template for e.g. creating a new dialect #101

Open
nnamtug opened this issue Jul 24, 2020 · 1 comment
Open

code-template for e.g. creating a new dialect #101

nnamtug opened this issue Jul 24, 2020 · 1 comment

Comments

@nnamtug
Copy link
Collaborator

nnamtug commented Jul 24, 2020

Code completion helps to create or modify elements. When it comes to create new elements, this sometimes is not enough. This applies e.g. when creating a new 'dialect' - it consist of a lot of optional keywords. One could support the user by providing a template: When hitting CTRL space at a location where the keyword 'dialect' is applicable, the user will be offered to complete with not only the keyword dialect, but with a complete example for a dialect. As a user the template allows you to navigate through the variables by hitting TAB and to accept or change the suggested values:

dialect UniqDialect {
	delimiter "${delimiter:,}"
	commentPrefix "#"
	doubleQuote true
	encoding "utf-8"
	header true
	headerRowCount 1
	lineTerminators "\\r\\n"
	quoteChar '${quoteChar:\\"}'
	skipBlankRows false
	skipColumns 0
	skipInitialSpace false
	skipRows 0
	trim false
}

@mchlrch Is there a reasonable set of dialect properties to put into a template? Or are maybe different flavors of templates to be offered?

@mchlrch
Copy link
Member

mchlrch commented Jul 30, 2020

For the dialect, the flavors "common" and "full" could be offered:

common:

dialect UniqDialect {
	delimiter "${delimiter:,}"
	encoding "utf-8"
	header true
	quoteChar '${quoteChar:\\"}'
}

Including more templates in the editor is generally a good idea.
There's issue #6 related to that as well

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

No branches or pull requests

2 participants