On 23 February 2013 06:38, Bob Furber burnsmicro@gmail.com wrote:
On 13-02-21 06:21 PM, Lex Trotman wrote:
Hi Bob,
Lets just summarise the steps for you to check:
- You are using Geany 0.21 or 1.22 (older may work but no guarantee)
It turns out I had Geany 0.21, so I upgraded to 1.22: sudo add-apt-repository ppa:geany-dev/ppa sudo apt-get update sudo apt-get upgrade
- You followed Colomban's advice to menu->tools->configuration
files->filetype_extensions.conf and added the two lines from the wiki, note one is in the [extensions] section and one in the [groups] section.
Yes. Under [Extensions], I added JSON=*.json;
..and, under [Groups] I added: Misc=JSON;
- You followed Colomban's advice to copy the filetypes.JSON.conf from
the wiki to your ~/.config/geany/filedefs directory
Yes, I started up Geany in Supervisor mode from the command line: ~$ sudo geany
Then I copied the code from the wiki into a new file: [styling] default=default number=number string=string word=word identifier=identifier,bold
[keywords] primary=true false null [settings] lexer_filetype=YAML extension=json comment_single= [indentation] width=2 # 0 is spaces, 1 is tabs, 2 is tab & spaces type=0
..and saved the file as ~/.config/geany/filedef/filetypes.JSON.conf
These steps are all you need to have the filetype recognised for files with the .json extension, check in the status bar for filetype:JSON when you open such a file. If it doesn't work, check your use of case, thats the most common error, *everything* is case sensitive including filenames and file contents and extensions.
Ahhh, did you restart Geany?
Loading MyFile.json loads it as filetype:None
Saving MyFile.json as MyFile.JSON saves it as filetype:None
Loading MyFile.json as MyFile.JSON loads it as filetype:None
Document -> Set Filetype -> Miscellaneous -> JSON file changes the filetype to JSON and variable names are bolded and numbers are green
In short, I am almost there.
- You put the check_json script somewhere that is in your PATH list
Hmmmmmmm... I cannot find any trace of /usr/local/bin/check_json
Its the script listed on the wiki, you have to create it so the command can run it, which is why I said *someewhere* on your PATH, like ~/bin, not necessarily in a system directory.
So it appears I don't understand how to use the Build -> Set Build Commands dialog, which shows "check" in the Name field of the topmost line, followed by "/usr/local/bin/check_json %f" and I see that /usr/local/bin/ is already on my PATH:
~$ echo $PATH /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Hmmm, looks like you only have system dirs in your PATH, I'd add ~/bin (spell it out in full, ~ won't work) so you don't have to put any local programs into system directories.
But what does it take for this dialog to generate the check_json script? Clicking Ok does not do it.
It doesn't it runs it, see above.
Cheers Lex
- You edited the build commands and the error exception
This should now give you a "check" item in the build menu when you have a JSON file open and error messages in the compiler window should point to the line in the source where it occurs.
This is where I run into problems.
Thanks for your patience,
RF
Cheers Lex
On 22 February 2013 12:14, Bob Furber burnsmicro@gmail.com wrote:
Ok, I named the top line of the Build Command dialog "check".
I entered /usr/local/bin/check_json %f in the Command field beside it.
I left the Working Directory field blank.
I entered ([^:]+):([0-9]+) in the Error Regular Expression field at the bottom of the top block.
Then I clicked Ok and nothing happened. There is no syntax highlighting of my Json files ..even after restarting Geany.
I am missing something obvious, but I do not see it.
What is it?
Thanks for all your help,
RF
On 13-02-20 02:55 PM, Lex Trotman wrote:
On 21 February 2013 09:41, Bob Furber burnsmicro@gmail.com wrote:
Some progress, thanks to you, Colomban.
But, still some questions:
What is meant in the wiki by:
- "use /usr/local/bin/check_json %f as the compile command"? Under "Set
Build Commands" I have many choices where to place the command, but I do not see a Compile command.
You don't see one because you havn't added it yet :) Just use the top line of the dialog, thats traditionally the compile command. Note, since you have to give it the name as well, you might want to call it "check" instead of "compile" since thats what it runs.
I do see a "Make" and "Make Custom Target" commands.
- "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in
the "Error regular expression" field immediately below wherever I paste the compile command?
Yes.
Finally, if I am successful, I would be pleased to rewrite this wiki page to make it clearer for dummies like me.
All contributions welcome.
Cheers Lex
Thanks,
RF
On 13-02-20 12:49 PM, Colomban Wendling wrote:
Hi,
Le 20/02/2013 20:46, Bob Furber a écrit :
The Geany wiki provides instructions on how to add json support.
But I have run into problems:
- I cannot find |filetypes_extensions.conf|, the file I need to
modify on my Linux Ubuntu system.
It may not already exist in your user config, but it's supposed to be in ~/.config/geany/. You can also open it for editing using Tools->Configuration files->filetype_extensions.conf from inside Geany.
- I assume I deed to add the new filetypes.JSON.conf to the
/usr/share/geany folder
No, this is the system path, to add a filetype for your user, add it in ~/.config/geany/filedefs/
Regards, Colomban
Can anyone help me add json support to an otherwise outstanding code editor?
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users