After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781693 - snippets do not work on a newly created empty file
snippets do not work on a newly created empty file
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: snippets
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-25 06:23 UTC by Sri Ramkrishna
Modified: 2017-04-25 06:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sourceview: reload snippets when the buffer language changes (939 bytes, patch)
2017-04-25 06:30 UTC, Christian Hergert
committed Details | Review

Description Sri Ramkrishna 2017-04-25 06:23:34 UTC
If you create a new file, you can't use any snippets until you save the file and Builder is able to detect what kind of source file it is.  Not sure if this is the expected behavior.
Comment 1 Alexandre Franke 2017-04-25 06:25:13 UTC
It is worth noting that even selecting a specific language for syntax highlighting is not enough.
Comment 2 Christian Hergert 2017-04-25 06:26:52 UTC
(In reply to Alexandre Franke from comment #1)
> It is worth noting that even selecting a specific language for syntax
> highlighting is not enough.

Good to know that is the root of the issue.

Also, adding a shebang should be enough to guess the language. Something like:

 #!/usr/bin/env python3
Comment 3 Christian Hergert 2017-04-25 06:30:52 UTC
Created attachment 350367 [details] [review]
sourceview: reload snippets when the buffer language changes
Comment 4 Christian Hergert 2017-04-25 06:31:43 UTC
Attachment 350367 [details] pushed as 8de9b22 - sourceview: reload snippets when the buffer language changes