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

Cannot apply html (twig) as default language for .twig file #35

Open
ghost opened this issue Nov 1, 2023 · 4 comments
Open

Cannot apply html (twig) as default language for .twig file #35

ghost opened this issue Nov 1, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 1, 2023

Hello,

I recently attempted to install your extension for syntax highlighting and completion. However, I encountered an issue in setting up the extension by default in the language mode. Despite configuring the file association in VS Code and selecting HTML (Twig), the changes reflected in my configuration file appeared as follows:

"files.associations": {
  "*.twig": "twig"
},

Yet, when I reopen a file with the extension .html.twig, it defaults to HTML rather than HTML (Twig). Do you have any insights into why VS Code fails to select the correct language?

have nice day

@ghost ghost changed the title Cannot apply html (twig) by default Cannot apply html (twig) as default language for .twig file Nov 1, 2023
@brabli
Copy link

brabli commented Nov 7, 2023

While my VS Code was claiming it recognised my Twig files as Twig, my custom Twig snippets stopped working with this extension enabled (0.5.1).

Downgrading to 0.5.0 appears to have fixed the issue for me.

@kaermorchen
Copy link
Owner

In 0.5.1 I have changed same language settings for fix syntax highlighting.

Can you show me example of you custom snippet and settings?

@ghost
Copy link
Author

ghost commented Nov 9, 2023

where my configuration file

{
  "intelephense.files.associations": [
    "*.php",
    "*.phtml",
    "*.module",
    "*.theme"
  ],
  "files.associations": {
    "*.theme": "php",
    "*.module": "php",
    "*.svelte": "html",
    "*.install": "php",
    "*.twig": "twig"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.stickyScroll.enabled": true
  },
  "[typescript]": {
    "editor.stickyScroll.enabled": true,
    "editor.defaultFormatter": "vscode.typescript-language-features",
  },
  "[vue]": {
    "editor.defaultFormatter": "Vue.volar"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "emmet.includeLanguages": {
    "twig": "html"
  },
  "editor.fontFamily": "\"Fira Code\"",
  "editor.fontLigatures": true,
  "editor.cursorBlinking": "phase",
  "editor.cursorWidth": 3,
}

in my vscode i choose the HTML(twig) for the .html.twig file but after that when i reopen a twig file ... it fallback on default HTML

@gorbat-o
Copy link

Same issue here!

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

No branches or pull requests

3 participants