E
E
Eugene2018-06-23 14:46:35
Visual Studio Code
Eugene, 2018-06-23 14:46:35

Is it possible somehow, according to a certain rule, to disable the formatting of a certain area of ​​the file, and not the entire file in Visual Studio Code?

There is a Django template in which we have an entry in the style (taken just for example):

<script>
  const isMobile = {{ is_mobile|yesno:"true,false" }};
</script>

Auto format inserts spaces after "|" and ":", which causes an error in Django. Is there any way to force VSCode to ignore only such sections of code, leaving the formatting of the rest of the document with a built-in tool or another normal third-party formatting plugin?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2018-06-24
@deliro

Get PyCharm and enjoy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question