Skip to content

Commit

Permalink
1. optimize some codes.
Browse files Browse the repository at this point in the history
2. prevent adding `()` in IF condition for django template, fix: #26
  • Loading branch information
junstyle committed May 9, 2024
1 parent badfa5d commit bf4981e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion out/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions out/extension.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "📍formatter, django template support, highlight, format, prettier, auto-complete",
"author": "junstyle",
"license": "MIT",
"version": "1.0.31",
"version": "1.0.32",
"repository": {
"type": "git",
"url": "https://github.com/junstyle/vscode-django-support"
Expand Down
2 changes: 2 additions & 0 deletions src/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ export function formatting(document: TextDocument, diagnosticCollection?: Diagno
],
"htmlWhitespaceSensitivity": "ignore",
"embeddedLanguageFormatting": 'auto',
"templateType": 'django' //django | twig
};
Object.assign(options, resolveConfig.sync(document.uri.fsPath) ?? []);
options.twigSingleQuote = true;
options.plugins = [djangoPlugin];
options.parser = "melody";
options.htmlWhitespaceSensitivity = 'ignore';
options.embeddedLanguageFormatting = 'off';
options.templateType = 'django'

const doc = { text: document.getText() };
try {
Expand Down

0 comments on commit bf4981e

Please sign in to comment.