question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Snippets do not respect user's indentation configuration.

See original GitHub issue

Summary

I use 4 space hard tabs for indentation when working, so when I used the standard for snippets i found it indented with 3 spaces.

Steps To Reproduce:

  1. Enable whitespace rendering in atom. (ctrl+shift+p -> View: Toggle Render Whitespace)
  2. Change indentation to 4 space tabs or other indentation configuration other than 3 spaces.
  3. Insert any snippet that contains indentation. (Ex: for, while, testMethod, try, etc.)

Expected result

The snippet should be inserted with the new indentation respecting the user’s configuration.

Actual result

The snippet is inserted with a three space indentation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Gkupcecommented, Mar 14, 2019

Actually you can, I wrote personal snippets, indented them with \t, tested them with multiple indentation configurations and found them working as expected.

Example snippet

"New test method": {
	"prefix": "newTest",
	"body": [
		"@isTest",
		"private static void ${1:testName}() {",
		"\t$0",
		"}"
	]
}
0reactions
ntottencommented, Mar 21, 2019

Shipped today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

indent-region does not respect my c-mode style
It's awkward to have clangd auto-format with its default config, which looks vastly different, when what I wrote already looks like the correct ......
Read more >
65293 – [formatting] Javadoc formatting: doesn't fully respect code ...
I did a complete Format of the file and just double-checked that it is indeed the code formatter which removes all the indentation....
Read more >
Can you configure indentation for language server snippets to ...
BTW, yes, I'm using a light theme (don't know why either). EDIT: I'm thinking a possible solution was overriding the code actions handler,...
Read more >
Inconsistency of indentation of tabs between markup editor / code ...
In Stack Snippets, a tab corresponds not with 4 but with 8 spaces. That makes it pretty difficult and tedious to properly indent...
Read more >
Indentation Error in Python | How to Solve it - Edureka
Go to the setting of your code editor and enable the option which shows the tab and whitespaces. Once this feature in turned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found