Syntax highlighting of unsupported language in WebStorm with TextMate bundle - webstorm

The usual answer to this question is, "download and add a suitable TextMate bundle." I have done that.
I'm working in WebStorm on a React project using GraphQL. It has a lot of .vtl (Velocity Template Language) files that do not have syntax highlighting. I found out that I can add a TextMate bundle for VTL in order to get highlighting. I got this bundle from https://github.com/textmate/java-velocity.tmbundle. After adding it to WebStorm, there still isn't an appropriate file type, and .vtl files still don't have syntax highlighting.
So, I tried to create a new custom file type, manually supplying lists of keywords to highlight, which make the code slightly more readable. However, every .vtl file is now entirely marked with squiggly red, saying, "Unexpected tokens." I just wanted keyword highlighting, not incorrect assumptions about grammar.
Is this a problem with WebStorm, the bundle, or me? How can I get some basic syntax highlighting specifically for .vtl files?
Note that the TextMate plugin is installed.

The bundle only provides highlighting for *.vm files. Please check if the issue persists if you open java-velocity.tmbundle\Syntaxes\Velocity.tmLanguage file in some text editor and add vtl to the list of supported extensions:
<key>fileTypes</key>
<array>
<string>vm</string>
<string>vtl</string>
</array>
and re-start the IDE?
Note that you need to remove your custom file type to get the extension recognized

Related

getting include paths to work with Neovim and LSP-zero/Clangd

I'm currently Studying Computer enginering and taking embeded systems class, My isuse is that we use a custom library then compile it in a old version of Codewarrior.
how I would go about creating an include path for my lsp with nvim
I was woundering how I would go about creating an include path for my lsp with nvim, when I am not compiling the code localy but later compiling it with an old IDE
any wisdom would be apreciated.
note: in class we are required to use an exterior editor and the older version of code warrior is verry bad it is used for compiling for our micro controler but is unusable for writting code.
things I have done
I have atempted using compile_commands.json by coppying my vscode config for path location
I have tryed using a .clangd file with -I ...
I have tried other method but had no sucess so far
over all I was hopping to find a solution and have poured over the getting started page and stack overflow for several hours trying diffrent method to no avail.
The easiest approach is probably to use a .clangd file. Based on the path in your comment, the .clangd file should look like this:
CompileFlags:
Add: -I/home/bjc1269/Documents/github/libraries/lib/hc12c/include
A few things that I'm seeing in the .clangd file in your comment that don't work are:
Variable substitutions like ${workspaceFolder}. This is a VSCode feature that works in some VSCode settings like "clangd.arguments", but is not supported in a .clangd file, which is editor-agnostic (for example, it works with editors that don't have a concept of a "workspace").
Referring to your home directory as ~. Expanding ~ to /home/<username> is a feature of your shell. Command-line arguments specified in .clangd are passed directly to the compiler without being processed by the shell, so ~ will not work.
Globs like **. To be honest, I'm not even sure what the intended semantics for this could be in the context of specifying include directories.
Square brackets inside the argument to -I. Square brackets may appear in a .clangd file as YAML syntax for specifying multiple values in a list, for example you might have:
CompileFlags:
Add: [-I/path/to/directory1, -I/path/to/directory2]
But if you write -I=[/path/to/directory], the brackets just get passed on verbatim to the compiler, which does not understand this syntax.
First of all: Welcome to stackoverflow! :D
I'd recommend to use bear for this. You just simply invoke it with your build-command and the clangd LSP will read the includes automatically.

How to get tpl files highlighted in pycharm?

What file association will get the correct highlighting for *.tpl files in Pycharm? I have tried HTML and PHP, but neither seem to get it 100%.
I am using bottle and python 2.7 on a Windows machine.
Just setting it like the picture:
Choose Editor -> File Types -> Recognized File Types -> HTML
Add a Registered Patterns: *.tpl
Your question will be solved.

Reading Django documentation with restview

I am using Fedora 18 on Virtual Box on my Windows XP desktop to learn Django. After going through the .txt documentation files, I discovered these files were written using restructuredText. I've been spending the last day or so trying to figure out how to convert the files into something readable (HTML, Latex, PDF, etc.). First thing I did, was install docutils (from source - download page) and used rst2html.py to convert the files to HTML to be readable.
When I used this tool, I was getting the Unknown interpreted text role "doc", Unknown interpreted text role "ref", Unknown interpreted text role "term" errors, and more when opening the docs/intro/index.txt, docs/intro/install.txt and docs/intro/tutorial01.txt files. I was able to find very little on Google describing the exact problem I was having so I tried to use a different option.
Naively thinking the errors were native to docutils I decided to search for another tool and found this page and installed restview. Well, I didn't realize restview used docutils so I ended up back at square one.
How do I get rid of these and other errors? Did I install docutils and restview correctly?
Please tell me if I need to add more info
You need to use Sphinx. This tool is used by the Django project and it defines additional reStructuredText constructs to complement those defined by docutils. Such as
http://sphinx-doc.org/markup/inline.html#role-doc
http://sphinx-doc.org/markup/inline.html#role-ref
http://sphinx-doc.org/markup/inline.html#role-term

Can I create a cross-project source reference in redmine?

If you have two separate projects that is somehow connected. How can one make a reference to the source of the other project?
For referencing the source of your own project you use:
source:some/file
But since I want to refer to code in another project my thought was that I could write something like:
other_project:source:some/file
Anyone that knows if this is possible in some way? I have read http://www.redmine.org/wiki/redmine/RedmineTextFormatting#Redmine-links but found no clues there.
Apparently this was implemented in Redmine 1.2.0 (released 2011-05-30). The syntax is exactly the one you suggested in the question, other_project:source:some/file, other_project being the project identifier.
It is possible in a couple of ways - although neither solution is particularly neat.
use an external html link to the other_project source code, where other-proj is the identifier for the other project.
"other project source":http://myserver:3000/projects/other-proj/repository/entry/file.txt
define the source path via the parent directories, so from the source directory of your current project go up 3 directory levels before navigating back down to the repository of your other project. Note the source link needs to be inside double quotes to work. This method at least keeps the source tag at the front of the link.
source:"../../../other-proj/repository/entry/file.txt"
The Redmine Text Formatting page says the format is:
source:repo_identifier|some/file
Even so, the selected answer works for my version of Redmine (1.4.2), but it may have been changed in later versions. This link format was added to that wiki page on 2012-08-27, after OP asked their question.

Eclipse spelling engine does not exist

I'm using Eclipse 3.4 (Ganymede) with CDT 5 on Windows.
When the integrated spell checker doesn't know some word, it proposes (among others) the option to add the word to a user dictionary.
If the user dictionary doesn't exist yet, the spell checker offers then to help configuring it and shows the "General/Editors/Text Editors/Spelling" preference pane. This preference pane however states that "The selected spelling engine does not exist", but has no control to add or install an engine.
How can I put a spelling engine in existence?
Update: What solved my problem was to install also the JDT. This solution was brought up on 2008-09-07 and was accepted, but is now missing.
The CDT version of Ganymede apparently shipped improperly configured. After playing around for a while, I have come up with the following steps that fix the problem.
Export your Eclipse preferences (File > Export > General > Preferences).
Open the exported file in a text editor.
Find the line that says
/instance/org.eclipse.ui.editors/spellingEngine=org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine
Change it to
/instance/org.eclipse.ui.editors/spellingEngine=org.eclipse.cdt.internal.ui.text.spelling.CSpellingEngine
Save the preferences file.
Import the preferences back into Eclipse (File > Import > General > Preferences).
You should now be able to access the Spelling configuration page as seen above.
Note: if you want to add a custom dictionary, Eclipse must be able to access and open the file (i.e. it must exist - an empty file will work)
Are you using the C/C++ Development Tools exclusively?The Spellcheck functionality is dependent upon the Java Development Tools being installed also.The spelling engine is scheduled to be pushed down from JDT to the Platform,so you can get rid of the Java related bloat soon enough. :)
Just a word of warning: If you follow the advice to replace the preference as above, it will affect spell checking if you also use Java. I think all I needed to do was change the "Select spelling engine to use" to the C++ engine (near the top of the preference setting on the preference page General->Editors->Text Editors->Spelling).