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

Inconsistent way to generate whole property snippet and value snippet, when it contains \" #353

Closed
fbaligand opened this issue Nov 14, 2020 · 6 comments · Fixed by #447
Closed
Assignees
Milestone

Comments

@fbaligand
Copy link
Contributor

fbaligand commented Nov 14, 2020

Given that I have this property:

"properties": {
  "property1": {
    "type": "string",
    "default": "\"mydefault\""
  }
}

If I write property1: and ask completion (Ctrl+tab), then choose first option, I get this generated:
property1: "mydefault"
That is nice.

But if I write property1 and ask completion (Ctrl+tab), then I get this generated:
property1: \"mydefault\"

So the second case is inconsistent and is an issue.
Could you fix it?

@evidolob evidolob added this to the 0.18.0 milestone Mar 24, 2021
@evidolob evidolob self-assigned this Mar 31, 2021
evidolob added a commit to evidolob/yaml-language-server that referenced this issue Apr 7, 2021
evidolob added a commit that referenced this issue Apr 7, 2021
* #353 remove escape character from default values

Signed-off-by: Yevhen Vydolob <[email protected]>

* Remove unnecessary escaping

Signed-off-by: Yevhen Vydolob <[email protected]>
@evidolob evidolob closed this as completed Apr 8, 2021
@fbaligand
Copy link
Contributor Author

Hi,

I just tried YAML extension v0.18.0, and unfortunately, I still reproduce the issue :(
So can you reopen this issue?

@evidolob
Copy link
Collaborator

@fbaligand Sure, that strange. Can you share schema where you have this?

@evidolob evidolob reopened this Apr 19, 2021
@fbaligand
Copy link
Contributor Author

Hi @evidolob,

Thanks for reopening the issue.

My test schema to reproduce this issue is exactly the schema I provided in issue description.
The whole schema is:

{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"type": "object",
	"properties": {
		"property1": {
			"type": "string",
			"default": "\"mydefault\""
		}
	}
}

@fbaligand
Copy link
Contributor Author

That said, to reproduce the issue, all characters are important:

  • If I write property1: and ask completion (Ctrl+tab) => there is a space after ":"
  • But if I write property1 and ask completion (Ctrl+tab) => no ":" at end

evidolob added a commit to evidolob/yaml-language-server that referenced this issue Apr 22, 2021
@evidolob evidolob modified the milestones: 0.18.0, 0.19.0 Apr 22, 2021
evidolob added a commit that referenced this issue Apr 22, 2021
@fbaligand
Copy link
Contributor Author

@evidolob
Thanks for the fix!
Is there a (easy) way to try the fix before next release?

@evidolob
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants