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

Hugo snippets in non hugo files #11

Open
maciejcieslik opened this issue Sep 23, 2019 · 8 comments
Open

Hugo snippets in non hugo files #11

maciejcieslik opened this issue Sep 23, 2019 · 8 comments
Labels
bug Something isn't working question Further information is requested

Comments

@maciejcieslik
Copy link

Snippets shouldn't work in any html file but only in hugo project. Now it is unusable because in other project it get in other snippets' way - for example comment snippets - in html should be {{/**/}}

@budparr
Copy link
Member

budparr commented Sep 28, 2019

Hi @maciejcieslik Maybe you can give me some information on your version? For me, HTML comments are the usual HTML comments.

@budparr budparr added bug Something isn't working question Further information is requested labels Sep 28, 2019
@maciejcieslik
Copy link
Author

VSCode version: 1.38.1

@budparr
Copy link
Member

budparr commented Sep 29, 2019

I see what you're saying. Being that Hugo templates are in HTML, I'm not sure that's possible. However, the way I make comments in HTML is command / (mac, not sure in windows/linux). Maybe that will help.

@maciejcieslik
Copy link
Author

Plugin should have configurable shortcuts - now it is with conflict with default vscode shortcut or add hugo snippets only in hugo projects, not all html files.

@budparr
Copy link
Member

budparr commented Sep 30, 2019

Thanks, @maciejcieslik We'd really welcome a PR on this.

@jmooring
Copy link
Contributor

@maciejcieslik,

If you like this extension's code highlighting, but would prefer to disable the snippets, use the Control Snippets extension.

Disable or enable VS Code's built-in snippets and manually installed snippets from extensions.

@jmooring
Copy link
Contributor

@maciejcieslik,

Another option is to disable (not uninstall) this extension, then enable it for one or more workspaces as needed. Details here...

@wolfspyre
Copy link

@maciejcieslik,

Another option is to disable (not uninstall) this extension, then enable it for one or more workspaces as needed. Details here...

This feels like the best overall guidance, although I'm totally open to being proven wrong...

Given that one would want a hugo-scoped-editor-enhancer to be able to decorate/alter potentially any file within hugo's ability to consume, this plugins' filetype constrains aught be pretty lax and its applicability pretty universal within those contexts...

Might it be beneficial to this stance it a step further?

IE: have this plugin disable itself globally by default, and have a blob of 'add this to a hugo project's /.vscode/settings.json to enable it` in the readme?

Mindset being something along the lines of:

This plugin assumes that when its enabled, the user will want the hugo sugar ubiquitously available; which can conflict with other parsers/highlighters. Correspondingly, we adopt a default off behavior so as to not unintentionally clobber other non-hugo projects a user may also use vscode to alter

  • The enablement effort expended is fairly small and only needs be done once-per-project;...
  • Requires EXPLICIT enablement at a project level, and as such, allows the plugin to consider a much wider swath of content fair game for applicability
  • provides a clearly described mechanism of enablement and preference-store and bounds the plugin's scope to a project which is more than less aligned with the editor's philosophy..

or I spoze this could be a terrible idea / waste of everyones' time... ¯\_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants