Skip to content

vscode-dotty: Auto-indentation support for brace-less syntax, release 0.1.15 #7225

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

Merged
merged 5 commits into from
Sep 16, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Sep 13, 2019

By default, vscode knows how to auto-indent code with braces, e.g.
given:

if (foo) {

pressing "Enter" will add one level of indentation. Similarly, entering
a closing brace can unindent a line.

Ideally, we'd like to do something similar with the brace-less syntax.
This commit is a first attempt at doing so by using the built-in support
in vscode for defining indentation patterns. Proper automatic
unindentation seems much harder to achieve.

By default, vscode knows how to auto-indent code with braces, e.g.
given:

    if (foo) {

pressing "Enter" will add one level of indentation. Similarly, entering
a closing brace can unindent a line.

Ideally, we'd like to do something similar with the brace-less syntax.
This commit is a first attempt at doing so by using the built-in support
in vscode for defining indentation patterns. Proper automatic
unindentation seems much harder to achieve.
@smarter
Copy link
Member Author

smarter commented Sep 15, 2019

@odersky Have you had a chance to try this out ? I'd like to release the updated vscode extension soon to make sure we can test it properly before students start using it.

@odersky
Copy link
Contributor

odersky commented Sep 16, 2019

I'll merge it and try it out now.

@odersky odersky merged commit f89bd19 into scala:master Sep 16, 2019
@odersky odersky deleted the vscode-indent branch September 16, 2019 16:14
@odersky
Copy link
Contributor

odersky commented Sep 16, 2019

At first glance it works as advertised, i.e. indent works, outdent not. But outdent can anyway be expected only in a few special circumstances, so it might even be better not to do it at all.

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

Successfully merging this pull request may close these issues.

2 participants