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

Here string intellisense completion and indentation #1517

Open
DarkLite1 opened this issue Sep 7, 2018 · 10 comments
Open

Here string intellisense completion and indentation #1517

DarkLite1 opened this issue Sep 7, 2018 · 10 comments
Labels
Area-Snippets Issue-Enhancement A feature request (enhancement).

Comments

@DarkLite1
Copy link

DarkLite1 commented Sep 7, 2018

In the editor here strings are not correctly completed and indented. some expamples:

image

This is very annoying when working with HTML strings.

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      8      4      0

Version: 1.28.0-insider (user setup)
Commit: a3f9f2e7240106aeec2f1d4bc03d7876bd42e2e4
Date: 2018-09-07T05:20:29.346Z
Electron: 2.0.7
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
@TylerLeonhardt
Copy link
Member

Yep. This is a duplicate of #181. We just haven't had cycles to address the problem.

I would think one would just need to send a PR to VSCode itself and add to this
https://github.com/Microsoft/vscode/blob/master/extensions/powershell/language-configuration.json#L11

But I haven't tried it.

@DarkLite1
Copy link
Author

Maybe @aeschli can have a look? It would be great if this could be fixed.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Sep 12, 2018

btw anyone should be able to play around with this. The file should be located here:

C:\Program Files\Microsoft VS Code\resources\app\extensions\powershell\language-configuration.json

(I'm on a mac so it's slightly different /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/powershell/language-configuration.json)

Try adding ["@'", "'@"] - and if that doesn't work, as a test, remove the { "open": "'", "close": "'", "notIn": ["string", "comment"]},

If that works, we should get some guidance from @aeschli on how we can have both of these entries in the langauge-configuration.json as autoClosingPairs

@DarkLite1
Copy link
Author

DarkLite1 commented Sep 13, 2018

Thanks for the help @tylerl0706 . I've tried your suggestion:

C:\Users\me\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\powershell\language-configuration.json

{
	"comments": {
		"lineComment": "#",
		"blockComment": [ "<#", "#>" ]
	},
	"brackets": [
		["{", "}"],
		["[", "]"],
		["(", ")"],
		["@'", "'@"]
	],
	"autoClosingPairs": [
		["{", "}"],
		["[", "]"],
		["(", ")"],
		{ "open": "\"", "close": "\"", "notIn": ["string"]},
		["<#", "#>"],
		["@'", "'@"]
	],
	"surroundingPairs": [
		["{", "}"],
		["[", "]"],
		["(", ")"],
		["\"", "\""],
		["'", "'"],
		["@'", "'@"]
	],
	"folding": {
		"markers": {
			"start": "^\\s*#[rR]egion\\b",
			"end": "^\\s*#[eE]nd[rR]egion\\b"
		}
	}
}

Nothing changed. After restarting VS Code Insiders it even threw an error that the PowerShell extension crashed. But that hasn't happened anymore after the first time.

@rkeithhill
Copy link
Contributor

Try modifying just this section:

    "autoClosingPairs": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["@'", "\n'@"],
        ["@\"", "\n\"@"],
        ["<#", "#>"],
    ],

That works for me but now you lose auto-close of "" and ''. :-(

@TylerLeonhardt
Copy link
Member

Yep. I get the same thing as @rkeithhill.

So I think we should open an issue on vscode for guidance.

@rkeithhill
Copy link
Contributor

If both types of closing pairs (here string & normal string) could be made to work, this would be a nice enhancement.

@TylerLeonhardt
Copy link
Member

Opened this microsoft/vscode#58619

@TylerLeonhardt
Copy link
Member

@rkeithhill I agree 100%. 😄

@TylerLeonhardt TylerLeonhardt added Issue-Enhancement A feature request (enhancement). Area-Snippets labels Sep 13, 2018
@DarkLite1
Copy link
Author

Thanks @tylerl0706 and @rkeithhill for putting it in the spotlight, been struggling with this for a while now. If this gets fixed than VS Code will be my main editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Snippets Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

3 participants