how to force geany recognice custom filetypes and settings? - customization

I am on linux ubuntu 20.04
geany version:
geany 1.36 (built on 2020-03-22 with GTK 3.24.14, GLib 2.64.1)
simplest test possible:
at tools menu, edit the asm single line comment from ';' to '#'
reload the configuration files or restart geany
absolutely nothing happens
try to root edit related file: /usr/share/geany/filedefs/filetypes.asm
absolutely nothing happens again
is the config all hardcoded?
none of the related questions and answers helped:
geany custom filetype .svrf for syntax highlighting
Custom syntax highlighting in Geany
Make Geany recognize additional file extensions
...
am I doing something wrong?
as soon I am able to make anything work at all, I will try to add a new filetype with many specific setting, so I just need to at least make anything work at all initially.

Related

Unable to type #include statements properly in the latest Windows version of Geany IDE

At the time of this writing, the newest version of the Geany IDE is 1.37.1 . I came across an issue when using Geany to code in C/C++. My PC had the following configurations:
OS: Windows 10
Keyboard Layout: EN_US
Language: EN_IN
When I type #include followed by a header name such as <stdio.h>, the IDE excludes the .h extension. I checked if the Drop rest of word on completion option is turned on under Edit->Preferences->Editor->Completions. I tried including headers using both <> and "". Also, extensions such as .txt also didn't work. Re-installing the IDE didn't work for me.
For anyone having the same issue and similar keyboard configurations, I recommend removing any other existing language packs. Typing language in the search bar brings up a number of options like '''add a language to this device''' and '''Edit language and keyboard options''' etc. Selecting the latter brings up the language section in the Settings app. If you have any other pack installed other than EN_US, select the pack and remove it, only if you are sure that you are using a US keyboard. Now restart the Geany IDE and try typing #include statements once again. The above approach worked for me.

Configure kit for Qt automatically

SO!
Let's say I have a number of settings (GCC compiler 9.3.0 built from source, as the distribution I have to use has a very old one, along with environment setup) for a new Kit in QtCreator.
I have managed to setup an environment for compilation and execution of compiled binaries, and made a script to make it work (like qmake -nocache -recursive/make/sudo make install, direct execution of g++, and other stuff).
One thing that script can't do at the moment, is that it cannot create a kit for QtCreator with new compilers and environment being set as required, so after running a script, its user has to go through setting it up himself through GUI, which is bad, because this can cause misconfiguration.
This thing I'm trying to create is going to be used by around ~200 people in my company, so leaving readme.txt with instructions just doesn't go well enough for me - I don't want running around fixing missing "{" and "}" in Environment description in created Kits, and other stuff.
Are there ways to create Kits for QtCreator automatically from command line? Maybe, there's some files to edit?
I've looked into this one a few years back (I wanted to do something similar for registering Buildroot toolchains automatically in QtCreator), and I was unable to find an off the shelf solution. So i think there are 2 ways to implement this:
a) Implementing a command line utility the manipulate the ~/.config/QtProject/qtcreator/{toolchains,profiles}.xml files. Maybe by (re)using the existing C++ implementation within QtCreator, or just re-implement it ie. in Python. Back than I didn't start to work on this as there was no real business need.
b) Switching to qbs, as qbs has support for setting up toolchains from the command line ( see: https://doc.qt.io/qbs/cli-setup-toolchains.html)
If you decide to go with solution a), please let me know and maybe we can partner up to implement it.
Check out the command line sdktool bundled with QtCreator:
The SDK tool can be used to set up Qt versions, tool chains, devices
and kits in Qt Creator.
There still is a lot of knowledge about Qt Creator internals required
to use this tool!
I haven't tried it yet, but I did find the executable under Tools/QtCreator/libexec/qtcreator subdirectory of the Qt Creator installation directory. ./sdktool --help works for me under Linux.

VSCode "go to definition" not working

I installed Visual Studio Code 1.1 with the C/C++ extension,
opened my C++ project and tried to use "Go to definition" in vain.
The "Go to definition" is not working at all.
Example, go to definition of a class member:
int i = m_myVar;
(I opened a simpler project with one file and it was working for this one)
In the end, what I want is good indexation of my big project, is there a way to install Intellisense?
I had a the same issue: F12 and Ctrl + Click and Right Click "Go To Definition" wasn't working.
The fix for me was:
Go to Extensions
Click "Disable All Installed Extensions"
Close and Reopen VS Code
Back to Extensions and "Enable All Extensions"
Essentially enable/disable all extensions fixed the issue.
I recently came across this same issue and after trying all of the suggested solutions I could find with no success, I found this article:
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
Basically my project grew too large and VS code was no longer able to track all files, which messed up the "go to definition" functionality.
After following the steps on the link to increase the maximum number of files to be tracked, the issue was resolved.
The correction is pretty simple (tested on Ubuntu 18.04):
Add this line:
fs.inotify.max_user_watches=524288
to the end of the file /etc/sysctl.conf
After saving, run the following command:
sudo sysctl -p
Hopefully this will be useful to someone else, this has been bothering me for the last few days.
I had a similar problem except with Python and google searches for solutions kept bringing me back to this post so I figured I'd post my solution here in the hopes that it might help other people.
I was working on a remote cluster through VScode Remote and was getting similar errors to the original question(all 'go to ___' functionality was unavailable and was even getting a 'too large to track' error) and I thought I had to increase the number of watches, which didn't end up helping.
All I needed to do was install a python interpreter on the remote VScode server. This fixed my problem.
I believe vscode 1.1 (well, 1.1.1 actually) + the C++ extension (cpptools) is as much Intellisense as we can get for now.
You should load your big project with the "open folder" function to make vscode know about the other files.
https://blogs.msdn.microsoft.com/vcblog/2016/03/31/cc-extension-for-visual-studio-code/ warns about letting the indexing finish first (red icon in lower right corner during indexing) and mentions the current limitations on the source code parsing.
It wasn't working on my laptop as well after installing a few VSCode extensions. I decided to close and re-open VSCode with administrator permission and suddenly it sorted out.
I have been trying to fix this for a long time. In the end, what worked for me was simply reinstalling VSCode, then installing the latest C/C++ extension (v0.18.1). Then, in your .vscode/c_cpp_properties.json file, under includePath, add your include folder which has all your header files.
I tried the methods mentioned in this thread none of them seemed to work for me. A simple solution that worked for me is that I closed the current workspace and created a new workspace, added the folders which I required(same as the old workspace), and saved the new workspace. Waited for a couple of minutes to index and IntelliSense is able to find definitions now.
I am using VSCode 1.52.1 on Ubuntu 20.04.
In my case, for whatever reason,c_cpp_properties.json has become set to Disabled in ~/.config/Code/User/settings.json.
Manually changing it to Enabled solved the problem.
Fixed mine by UNCHECKING C_Cpp > Default > Limit Symbols To Included Headers
Your mileage may vary. Good luck!
Have you saved your workspace? Or did you just open a folder with File->Open Folder? This question already has many answers, but none of them address this case, which was my issue.
The question is not specific enough for me to know if you are having the exact same symptoms as my case.
If:
You have not saved your workspace. vscode doesn't say "(workspace)" at the top of the window.
None of the goto functions are working, but instead report: "No ___ found for ____"
The tag parser database icon in the bottom right is always there but only reports "Parsing open files", rather than telling you how many files have been parsed.
Then:
Try saving your workspace.
If you have multiple versions of a language on your PC, specify the exact language you are using in the VScode(in my case, I am using Python, so I must specify the version to the python Interpreter in VS Code)
If you could not do it whatsoever, then uninstall all the other versions that you don't use and then if you go to VS Code, it will ask the version to be used, and you would have only one version, so when you select the version, the "Go To Definition" will be activated.
I was having a similar issue with java on Ubuntu 20.04 using OpenJDK version 11 (openjdk-11-jdk in apt). At first I didn't have the JRE installed, so I installed it and it still didn't work.
Afterwards, I went to the CTRL + SHIFT + P menu and then to Java: Configure Java Runtime, there I saw in the Java Tooling Runtime tab that /usr/lib/jvm/java-11-openjdk-amd64 was selected, changed it to /usr/lib/jvm/java-1.11.0-openjdk-amd64 just to see if it would work, and after a restart it did. I'm not sure why this is, but I hope it may help somone else.
For python ensure your code analysis settings are correct. In my case the languageServer was accidentally set to 'None'. Reverting it to 'default' or 'pylance' did the trick.
Just to inform if none of above works then
In my case i was using Kite extension in my VS code, I just disabled it and it worked. I think kite extension is blocking this feature.
OS: Linux Ubuntu 22.04
if you encountered with following error:
"The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path."
Normally Vscode remains unable to locate .Net sdk. need to set path manually.
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
restart omnisharp & restart vscode
No need to do anything. Just close and re-open. It will work.
I also faced similar problem. In my mac os cmnd + 'click' is used to 'go to definition' then it suddenly stoped working. If that is the case then please follow these steps:
restart vs code
restart pc
uninstall all extensions and reinstall again followed by a pc restart.
I had a similar issue with the extension C/C++ installed. I solved it by downloading an older version of the extension and upgrading to the last version. Somehow it solved the problem...

How do I get the .gdbinit command file needed by Eclipse for debugging?

My knowledge and experience in programming is still very fresh and basic, so please bear with me.
I want to be able to use C++ on my MacBook (OS 10.9.5 Mavericks) via Eclipse, which I have already been using for Java previously.
So I followed the instructions in Eclipse GDB MacOSX Mavericks
to get GDB, but now I still need the GDB command file (.gdbinit), which I can't find anywhere (I tried which .gdbinit on Terminal to no avail).
Please help me.
.gdbinit is a configuration file. You won't have one unless you've downloaded one or written one separately. It goes in your home directory and just contains a list of commands to run on startup. You don't necessarily need one. See this answer: .gdbinit file missing
However, if you are fairly new to programming, I'd suggest starting with Xcode, Clang and LLDB on the Mac for C++ rather than Eclipse, GCC and GDB. It's far easier to get setup, and well documented.
See:
How do I set up a C++ project in Xcode 4?

Eclipse CDT syntax coloring issues

First off, I am running Eclipse 3.7.2 Build: M20120208-0800 on Ubuntu 12.04 (installed using the eclipse-* packages). I have applied all the updates available, but am still seeing the issue described below...
When I open a C++ file (*.h or *.cpp), it correctly highlights all object names in the file, but if I add new code to the file Eclipse will not apply coloring to the new code lines. However, if I restart Eclipse the new code will be correctly colored.
The indexer also appears to be working correctly because code completion seems to be working properly. The logs also appear to be clean. Has anyone seen this behavior before? Is there a good way to reset Eclipse to correct this issue?
Thanks!
My solution to this problem was to re-install the eclipse packages for Ubuntu 12.04. My syntax highlighting came back!