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 772360 - vala autocompletion lacks included libraries with meson build system
vala autocompletion lacks included libraries with meson build system
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on: 771694 773210
Blocks:
 
 
Reported: 2016-10-03 12:07 UTC by Felix Häcker
Modified: 2017-03-08 19:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example1.png (696.47 KB, image/png)
2016-10-03 12:07 UTC, Felix Häcker
  Details
meson: fallback to ninja to discover vala commands (3.82 KB, patch)
2017-03-02 08:31 UTC, Christian Hergert
committed Details | Review
gtk/gst namespace (258.03 KB, image/png)
2017-03-07 09:13 UTC, Christian Hergert
  Details

Description Felix Häcker 2016-10-03 12:07:06 UTC
Created attachment 336801 [details]
example1.png

-- Software:
Fedora 25 Alpha
Builder 3.22 - Non flatpak version

-- How to reproduce:
   - Type "GLib."

-- What should happen?
   - A popup appears with complete-suggestions (attachment example1.png")

-- What happen?
   - Nothing

Vala plugin is enabled.

### Builder log ###

[runtime.host]
hostname = "HP"
username = "haecker-felix"
codeset = "UTF-8"
cpus = 2
cache_dir = "/home/haecker-felix/.cache"
data_dir = "/home/haecker-felix/.local/share"
config_dir = "/home/haecker-felix/.config"
runtime_dir = "/run/user/1000"
home_dir = "/home/haecker-felix"
tmp_dir = "/tmp"
current_dir = "/home/haecker-felix"
started-at = "2016-10-03T11:41:28Z"
generated-at = "2016-10-03T11:44:22Z"

[runtime.libraries]
glib = "2.50.0"
gtk = "3.22.0"

[runtime.display]
name = "wayland-0"
n_monitors = 1
geometry[0] = [1920,1080]

[runtime.environ]
XDG_VTNR = "XDG_VTNR=2"
XDG_SESSION_ID = "XDG_SESSION_ID=2"
WAYLAND_DISPLAY = "WAYLAND_DISPLAY=wayland-0"
SHELL = "SHELL=/bin/bash"
TERM = "TERM=xterm-256color"
XDG_MENU_PREFIX = "XDG_MENU_PREFIX=gnome-"
VTE_VERSION = "VTE_VERSION=4600"
GJS_DEBUG_OUTPUT = "GJS_DEBUG_OUTPUT=stderr"
GJS_DEBUG_TOPICS = "GJS_DEBUG_TOPICS=JS ERROR;JS LOG"
USER = "USER=haecker-felix"
LS_COLORS = "LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:"
SSH_AUTH_SOCK = "SSH_AUTH_SOCK=/run/user/1000/keyring/ssh"
SESSION_MANAGER = "SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/1345,unix/unix:/tmp/.ICE-unix/1345"
USERNAME = "USERNAME=haecker-felix"
CCACHE_CPP2 = "CCACHE_CPP2="
PATH = "PATH=/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin"
DESKTOP_SESSION = "DESKTOP_SESSION=gnome"
QT_IM_MODULE = "QT_IM_MODULE=ibus"
QT_QPA_PLATFORMTHEME = "QT_QPA_PLATFORMTHEME=qgnomeplatform"
XDG_SESSION_TYPE = "XDG_SESSION_TYPE=wayland"
PWD = "PWD=/home/haecker-felix"
XMODIFIERS = "XMODIFIERS=@im=ibus"
LANG = "LANG=de_DE.UTF-8"
MODULEPATH = "MODULEPATH=/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles"
GDM_LANG = "GDM_LANG=de_DE.UTF-8"
LOADEDMODULES = "LOADEDMODULES="
GDMSESSION = "GDMSESSION=gnome"
HOME = "HOME=/home/haecker-felix"
XDG_SEAT = "XDG_SEAT=seat0"
SHLVL = "SHLVL=1"
GNOME_DESKTOP_SESSION_ID = "GNOME_DESKTOP_SESSION_ID=this-is-deprecated"
XDG_SESSION_DESKTOP = "XDG_SESSION_DESKTOP=gnome"
LOGNAME = "LOGNAME=haecker-felix"
XDG_DATA_DIRS = "XDG_DATA_DIRS=/home/haecker-felix/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/"
DBUS_SESSION_BUS_ADDRESS = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
MODULESHOME = "MODULESHOME=/usr/share/Modules"
LESSOPEN = "LESSOPEN=||/usr/bin/lesspipe.sh %s"
JOURNAL_STREAM = "JOURNAL_STREAM=8:25578"
XDG_RUNTIME_DIR = "XDG_RUNTIME_DIR=/run/user/1000"
DISPLAY = "DISPLAY=:0"
XDG_CURRENT_DESKTOP = "XDG_CURRENT_DESKTOP=GNOME"
CCACHE_HASHDIR = "CCACHE_HASHDIR="
COLORTERM = "COLORTERM=truecolor"
BASH_FUNC_module() = "BASH_FUNC_module()=() {  eval `/usr/bin/modulecmd bash $*`\n}"
BASH_FUNC_scl() = "BASH_FUNC_scl()=() {  local CMD=$1;\n if [ \"$CMD\" = \"load\" -o \"$CMD\" = \"unload\" ]; then\n eval \"module $@\";\n else\n /usr/bin/scl \"$@\";\n fi\n}"
_ = "_=/usr/bin/gnome-builder"

[runtime.counters]
EggTaskCache.Instances = 7
EggTaskCache.In_Flight = 0
EggTaskCache.Queued = 0
EggTaskCache.Cache_Size = 3
EggTaskCache.Cache_Hits = 96
EggTaskCache.Cache_Miss = 38
IdeBufferManager.Registered_Buffers = 1
IdeBuffer.Instances = 1
IdeDiagnostic.Instances = 17
IdeDiagnostics.Instances = 1
IdeFixit.Instances = 0
IdeSourceLocation.Instances = 34
IdeSourceRange.Instances = 17
IdeFileSettings.Instances = 4
IdeFile.Instances = 31
IdeHighlightIndex.Instances = 0
IdePatternSpec.Instances = 0
IdeCompletionResults.Instances = 1
IdeSourceView.Instances = 1
IdeSymbol.Instances = 0
ThreadPool.Total_Tasks = 80
ThreadPool.Queued_Tasks = 0
IdeTreeNode.Instances = 110
Subprocess.HostCommand_Instances = 0
IdeRefPtr.Instances = 0
IdeWorkerManager.Instances = 0
IdeWorkerProcess.Instances = 0
Clang.Total_Parse_Attempts = 0
Clang.Translation_Units = 0
Autotools.Flags_Requests = 32
IdeMakecache.Instances = 1
IdeMakecacheTarget.Instances = 1
IdeCtagsBuilder.Instances = 1
IdeCtagsBuilder.Build_Count = 0
IdeCtagsCompletionItem.Instances = 0
IdeCtagsIndex.Instances = 0
IdeCtagsIndex.N_Entries = 0
IdeCtagsIndex.Heap_Size = 0
IdeGitBufferChangeMonitor.Instances = 1


2c3f42f666112c5950dbd2e0e32055a3ebd8fec8d13558174a01b702da961a7e
Comment 1 Christian Hergert 2016-10-03 20:52:44 UTC
I think the problem right now with 3.22 is a bug in gtksourceview causing the completion window to not be displayed.

On X11, I can actually activate the completion items even though they are not visible. On Wayland, I can't even do that.
Comment 2 Felix Häcker 2016-10-04 04:22:58 UTC
Ok but even on x11 it only show these "often used words" and not real autocompletion like in the example pic.
Comment 3 Tony Houghton 2016-11-10 15:38:52 UTC
I can't find a corresponding bug report for gtksourceview. Do you have a link?
Comment 4 Christian Hergert 2016-11-11 06:03:31 UTC
(In reply to Tony Houghton from comment #3)
> I can't find a corresponding bug report for gtksourceview. Do you have a
> link?

See the Depends On bugs in the info section of the bug. They may have been moved to other projects after creation if for some reason they are not in the gtksourceview target.
Comment 5 Felix Häcker 2017-02-28 16:18:13 UTC
GNOME Builder version 3.23.90 here:  [not flatpak]

Autocomplete does works sometimes.

For example you type:

"GLib."

-> You will get a popup with glib string, Dir etc. This works fine.

But for gtk libs there is no autocomplete. If i use gtk things in my project, builder marks them red. (error: the type name '<GTK>' could not be found)

The project is building fine anyway.
Comment 6 Christian Hergert 2017-02-28 18:56:25 UTC
Which build system, autotools?
Comment 7 Felix Häcker 2017-02-28 19:16:00 UTC
Meson.

For more details:
https://github.com/haecker-felix/gradio/tree/wip_new_backend

But why is the build system relevant for auto complete? Im just curios.
Comment 8 Christian Hergert 2017-02-28 19:30:58 UTC
The(In reply to Felix Häcker from comment #7)
> Meson.

That explains it.

> But why is the build system relevant for auto complete? Im just curios.

Because there is not a consistent way to determine which "--pkg foo" commands to prime the compiler with. So we have to extract those flags from the build system. We have some crazy autotools hacks to do this.

The Meson plugin in Builder currently lacks that feature. I think the reason for that is that mesonintrospect does not tell us about the valac compiler flags, only the flags which are ultimately passed to GCC/Clang (and are not useful to us here).

I've filed https://github.com/mesonbuild/meson/issues/1439 with meson upstream.
Comment 9 Felix Häcker 2017-02-28 19:33:36 UTC
Ah make sense. Thanks for fast reply.
Comment 10 Tony Houghton 2017-03-01 21:55:40 UTC
Couldn't you just have a dialog or something to enter build flags manually for people who want to use a build system that isn't fully supported? All other IDEs I've used let you enter the flags manually.
Comment 11 Christian Hergert 2017-03-01 22:04:16 UTC
(In reply to Tony Houghton from comment #10)
> Couldn't you just have a dialog or something to enter build flags manually
> for people who want to use a build system that isn't fully supported? All
> other IDEs I've used let you enter the flags manually.

It's certainly possible if someone wants to implement this in plugins/vala-pack/ide-vala-{index,service}.vala. It's newcomer difficulty.

You'll need to handle the IdeConfigurationManager::invalidate signal and clear/reset the index when that happens using config.get_env("VALAFLAGS") for the appropriate build flags. (Then you can just set VALAFLAGS environment variable in you the Build Preferences UI). You get access to the configuration manager from the service like: "this.get_context().get_configuration_manager()".
Comment 12 Christian Hergert 2017-03-02 08:31:36 UTC
Created attachment 347034 [details] [review]
meson: fallback to ninja to discover vala commands

This uses the "ninja -t compdb vala_COMPILER" command to get possible
vala commands. This isn't exactly ideal, but it's likely to get us
closer than we would otherwise.
Comment 13 Christian Hergert 2017-03-02 08:32:33 UTC
This problem has been fixed in the unstable development version. The fix will
be available in the next major software release. You may need to upgrade your
Linux distribution to obtain that newer version.

Attachment 347034 [details] pushed as 8602367 - meson: fallback to ninja to discover vala commands
Comment 14 Felix Häcker 2017-03-04 20:37:36 UTC
Doesn't work. I'm using the latest git version. (commit 2627fee5f009189c87f3a8d14f0b54b70df6b5c2)

Other libs are marked as invalid. See screenshot: http://imgur.com/a/8RXZT (please ignore the ugly colours, it is a bug in gnome 3.23 :) )

Here you see for example, the line "using Gtk;" and "using Gst;" are underlined blue (red). 

The projects builds fine anyway.
Comment 15 Patrick Griffis (tingping) 2017-03-04 20:46:49 UTC
(In reply to Christian Hergert from comment #12)
> Created attachment 347034 [details] [review] [review]
> meson: fallback to ninja to discover vala commands
> 
> This uses the "ninja -t compdb vala_COMPILER" command to get possible
> vala commands. This isn't exactly ideal, but it's likely to get us
> closer than we would otherwise.

This is perhaps fixed in the next version of Meson already: https://github.com/mesonbuild/meson/commit/b3aaab3a038f9139f5735d590b5036c25fd033a0
Comment 16 Christian Hergert 2017-03-04 22:32:25 UTC
Our workaround is just a fallback, so it should be fine when upstream gets out to users.
Comment 17 Christian Hergert 2017-03-07 09:13:27 UTC
Created attachment 347367 [details]
gtk/gst namespace

(In reply to Felix Häcker from comment #14)
> Doesn't work. I'm using the latest git version. (commit
> 2627fee5f009189c87f3a8d14f0b54b70df6b5c2)

Hrmm, it does seem to work here after making a couple of edits.

We might also need to fix some things with ensuring we are staying up to date with buffer changes.
Comment 18 Felix Häcker 2017-03-08 18:15:38 UTC
Builder 3.23.91+74-g2627fee5 (devel)

Now the vala autocomplete is working flawless. Even with external libs. Awsome! GNOME Builder is getting a perfect Vala IDE.
Comment 19 Felix Häcker 2017-03-08 18:17:31 UTC
Ah. The meson package got updated to 0.39.0-1. (2017-03-07). Make sense :)