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

snippets variable not resolved in JSON proposal #52931

Closed
joaomoreno opened this issue Jun 26, 2018 · 10 comments
Closed

snippets variable not resolved in JSON proposal #52931

joaomoreno opened this issue Jun 26, 2018 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug snippets verified Verification succeeded
Milestone

Comments

@joaomoreno
Copy link
Member

Seen on Linux.

  1. Open User Settings
  2. Type linux, pick the terminal.integrated.shell.linux suggestion

You'll end up with

"terminal.integrated.shell.linux": "${1:/usr/bin/zsh}",

You should've ended up with

"terminal.integrated.shell.linux": "/usr/bin/zsh",
@aeschli
Copy link
Contributor

aeschli commented Jun 26, 2018

The terminal sets the default for terminal.integrated.shell.linux to process.env.SHELL

@aeschli aeschli assigned Tyriar and unassigned aeschli and sandy081 Jun 26, 2018
@Tyriar
Copy link
Member

Tyriar commented Jun 26, 2018

I don't know what I could have done to change this, all I do is set the default value.

I'm guessing something changed in settings code as the default value is correct.

image

@Tyriar Tyriar assigned roblourens and sandy081 and unassigned Tyriar Jun 26, 2018
@Tyriar Tyriar added the config VS Code configuration, set up issues label Jun 26, 2018
@roblourens
Copy link
Member

@sandy081 where do these completions come from? These aren't from the configuration-editing extension. I didn't change anything related to this (as far as I can tell)

@aeschli aeschli self-assigned this Jun 27, 2018
@sandy081
Copy link
Member

These come from JSON language server.

@sandy081 sandy081 added the json JSON support issues label Jun 27, 2018
@aeschli
Copy link
Contributor

aeschli commented Jun 28, 2018

Problem is a change in the snippet engine:
The following user snippet reproduces the problem:

{
	"test": {
		"prefix": "test",
		"body": [
			"\"terminal.integrated.shell.linux\": \"${1:/bin/bash}\"",
		]
	}
}

@aeschli aeschli assigned jrieken and unassigned aeschli Jun 28, 2018
@aeschli aeschli changed the title Settings suggestions not resolving arguments snippets variable not resolved in JSON proposal Jun 28, 2018
@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug snippets and removed config VS Code configuration, set up issues json JSON support issues labels Jun 28, 2018
@jrieken jrieken added this to the June 2018 milestone Jun 28, 2018
@jrieken
Copy link
Member

jrieken commented Jun 28, 2018

This is a regression from #51621

@jrieken
Copy link
Member

jrieken commented Jun 28, 2018

@go2sh Supporting the non-standard transform '${' int ':' any transform '}' breaks existing snippets. The sample above is a special case any === "" but also other snippets will be broken, like ${1:my/sample/path/}

@jrieken
Copy link
Member

jrieken commented Jun 28, 2018

@go2sh Sorry, but I don't wanna risk breaking more/other snippets and therefore I have un-done the custom snippet extensions. It now only supports ${«int»/«regexp»/«format»/«options»} as spec'd here: http://manual.textmate.org/snippets.html#transformations.

We will ship the next stable release soon and therefore little risk can be taken. Lets revisit early July and lets check for better solution to your problem.

@go2sh
Copy link
Contributor

go2sh commented Jun 28, 2018

Ahh sorry, I didn't thought about that. :-/ I totally understand that you have to revert this. With backward compatibility in mind, there is no easy way to extend the current behavior. Maybe we could use some other special char like ?, # to create some new extended behavior, which doesn't mess with the existing one.

@jrieken jrieken closed this as completed Jun 29, 2018
@jrieken
Copy link
Member

jrieken commented Jun 29, 2018

Maybe we could use some other special char like ?, # to create some new extended behavior, which doesn't mess with the existing one.

Yeah, we should experiment with that. We can also take a look at existing, popular snippet extensions and see what kind of snippets they bring along

@JacksonKearl JacksonKearl added the verified Verification succeeded label Jun 29, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug snippets verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants