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

Filter properties snippet with properties instead of dependency #312

Closed
angelozerr opened this issue Apr 24, 2020 · 0 comments · Fixed by #335
Closed

Filter properties snippet with properties instead of dependency #312

angelozerr opened this issue Apr 24, 2020 · 0 comments · Fixed by #335
Assignees
Labels
bug Something isn't working properties Features supported in application.properties snippets
Milestone

Comments

@angelozerr
Copy link
Contributor

Today properties snippets uses context/dependency to show the snippet according to the dependency classpath:

"Add datasource properties": {
		"prefix": "qds",
		"body": [
			"quarkus.datasource.url=${1|jdbc:mariadb://localhost:3306/mydb,jdbc:mysql://localhost:3306/test,jdbc:h2:mem:mydb,jdbc:postgresql://localhost/mydb,jdbc:sqlserver://localhost:1433;databaseName=mydb|}",
			"quarkus.datasource.driver=${2|org.mariadb.jdbc.Driver,org.mysql.jdbc.Driver,org.h2.Driver,org.postgresql.Driver,com.microsoft.sqlserver.jdbc.SQLServerDriver|}",
			"quarkus.datasource.username=${3:developer}",
			"quarkus.datasource.password=${4:developer}",
			"quarkus.hibernate-orm.database.generation=${5|update,drop-and-create,create,drop,none|}"
		],
		"description": "Configure Quarkus datasource",
		"context": {
			"dependency": "quarkus-agroal"
		}
	}

There are some limitation, because those properties could be linked to the dependency version.

To fix this limitation, a simple fix is to filter according to the properties to insert

...
		"context": {
			"properties": ["quarkus.datasource.url",
                                              "quarkus.hibernate-orm.database.generation"]
		}
	}
@angelozerr angelozerr added properties Features supported in application.properties snippets labels Apr 24, 2020
angelozerr pushed a commit to angelozerr/quarkus-ls that referenced this issue Jul 2, 2020
angelozerr pushed a commit to angelozerr/quarkus-ls that referenced this issue Jul 2, 2020
angelozerr pushed a commit to angelozerr/quarkus-ls that referenced this issue Jul 2, 2020
@angelozerr angelozerr added this to the v0.0.8 milestone Jul 2, 2020
angelozerr pushed a commit to angelozerr/quarkus-ls that referenced this issue Jul 3, 2020
angelozerr pushed a commit to angelozerr/quarkus-ls that referenced this issue Jul 3, 2020
angelozerr pushed a commit to angelozerr/quarkus-ls that referenced this issue Jul 3, 2020
angelozerr pushed a commit that referenced this issue Jul 3, 2020
Fixes #312

Signed-off-by: azerr <azerr@redhat.com>
@xorye xorye added the bug Something isn't working label Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properties Features supported in application.properties snippets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants