How to add support for Jenkinsfile* in PhpStorm? - autocomplete

In PhpStorm the Jenkinsfile's code is highlighted and autocompleted. In my project I have multiple Jenkinsfiles (like Jenkinsfile_DEV, Jenkinsfile_TEST, Jenkinsfile_PROD). In that files highlighting and autocompletion are not working.
How to get PhpStorm supporting not only the files with the name Jenkinsfile, but also associate other files with this highlighting/autocompletion (e.g. Jenkinsfile_*)?
What I tried so far: I looked for the "Jenkinsfile" entry in the File -> Settings -> Editor -> File Types -> Recognized file types. The plan was just to add an entry like "Jenkinsfile*" to the "Jenkinsfile" entry. But I haven't found an entry like this.

Jenkinsfile syntax is provided by Groovy textmate bundles at File | Settings | Editor | TextMate Bundles. Unfortunately it's not configurable: Jenkinsfile is hardcoded to be associated with Groovy in PhpStorm. The only option here is to add .groovy extension to those files.

Related

Custom syntax for workspace in VSCode

I have a custom syntax (json varietas) for a specific project.
I've created a project that contains the t-json.tmLanguage.json and language-configuration.json, but I won't publish it as an extension because it's not general used.
So can I configure something in .vscode/ folder for support the syntax only for this workspace?

To create yml file in eclipse

I would like to create buildspec.yml file in eclipse. I have downloaded yaml editor and ydit from eclipse market place. How to create yaml file in src code. i could see only class and other files. not yaml. Please help on this
It's just normal file text, Right click your wanted project -> New -> Other -> File.
If you need more support you could install Yedit from Eclipse Market.
YEdit is an Eclipse editor for editing YAML files. It has the following features:
Syntax highlighting
Syntax checking
Content outline
Templates
Various text editing support like auto-indenting and toggling of comments.
Symfony compatibility mode. * Source formatting (experimental)
Use Right-click > New > Other > File and make sure its extension is .yaml or .yml.
PS: I suggest you try https://marketplace.eclipse.org/content/eclipse-wild-web-developer-web-development-eclipse-ide instead of Yedit. It's a better alternative IMO.

Can syntax highlighting be enabled for Groovy DSL with custom file extension in Eclipse?

We are working on creating a custom Domain Specific Language in Groovy. We plan to use a custom file name extension ( for example .xyz ) for the code written in this DSL.
I and using eclipse as my IDE.
When i change the extension of the file from .groovy to .xyz, eclipse considers this file as a text file and removes all the color codes that are associated with a groovy file.
Is there any configuration in Eclipse that will associate the .xyz file as a groovy source file?
I see that there are a .dsld file https://spring.io/blog/2011/05/09/better-dsl-support-in-groovy-eclipse but this do not seem to be a solution to my above problem.
You can associate a file extension with a editor content type in the Eclipse Preferences. Go to the 'General > Content Types' page in the preferences.
Find and select the Groovy content type in the list and click 'Add..' to add your '.xyz' extension to the list of file associations.
You can also do this in an Eclipse plugin using org.eclipse.core.contenttype.contentTypes extension point.

Eclipse: How to set file encoding based on file extension

Problem
I have an eclipse project that is committed to source control.
The project looks something like this:
MyProject
.classpath
.project
src/
com/myCompany/code
DoStuff.java
DoOtherStuff.java
someText.foo
conf
someOtherTextFile.foo
As you can see we have files of file extension foo. The foo files use a different file encoding (ISO-8859-1) then the rest of the files in my project. I want to configure eclipse to use ISO-8859-1 whenever those files are opened.
Here are the options that I have found so far:
Solution 1 - Mark each file one by one
Right Click File -> Properties -> Text file encoding -> Other: ISO-8859-1
This then adds a line to .settings/org.eclipse.core.resources.prefs:
encoding//conf/someOtherTextFile.foo=ISO-8859-1
This solution works ok, but I need to do it for every foo file in my project and I need to make sure that no one ever forgets to do it when they add a new foo file.
Solution 2 - Configure it in my workplace settings
This is done like this:
Open the Eclipse Preferences and go to 'General > Content Types'.
Select the type of the file, for example 'Text'
In the File Associations area click 'Add' and add '*.foo'. Enter
'ISO-8859-1' in the 'Default Encoding' field.
Click OK and you should be set.
(Thanks greg-449 for clarifying how to do this).
This solution does not work for my team because we don't commit the Eclipse workspace settings into source control (we only commit the project settings).
What I really want to do
I would like to be able to say that all files in the project ending with .foo should be displayed with the encoding ISO-8859-1. I need to configure this at the project level because my team commits project settings into source control but not workspace settings.
Any hints on how to do this?
Greg-449 already explained you the steps, I am pasting the same explanation with screenshots:
Windows -> Preference -> General -> Content Types -> Text ->Add -> *.foo -> ok -> click on *.foo and fill the Default encoding as 'ISO-8859-1' -> update -> ok

Pydev: Go to arbitrary module source?

In Pydev, is there a convenient way to open arbitrary (external, globally installed) module? Say, I want to see the source of markdown.blockprocessors module. How can I do that without typing an import directive (import markdown.blockparser), using "Go To Definition" (F3) and removing the directive? It would be nice to see the hierarchy of the whole markdown package in the Package Explorer, but I don't know how.
There are 2 main ways of finding something without using F3:
Open Resource action (Ctrl+Shift+R): allows you to find any file in your workspace (so, it's useful not only for python modules, but any file, but those need to be in your workspace).
The PyDev tokens browser (Ctrl+Shift+T): allows you to find any token (class/method/attributes/globals -- but currently not module name) for modules in the PYTHONPATH (either source folder or external libraries under the project properties > pydev pythonpath). You can filter things as 'myproject.*something' (the dialog that opens provides instructions on how to filter tokens).
Add Markdown source code folder here::
Project properties -> PyDev PYTHONPATH -> Source folders.