How to implement "CodeIgniter 2.0" code completion capabilities with Notepad++ ? - codeigniter

How could I make Notepad++ have an intellisense for CodeIgniter 2.0 so that if I press Ctrl + SpaceBar on the keyboard code suggestions would be shown?

Here are the steps:
Use a User Defined Language derived from the PHP language given that Code Igniter is a PHP Framework.
If you want more advanced features and feel comfortable at coding, External Lexer is the way to go. It's a kind of specific Plugin mimicking built-in languages features. Install it.
Autocompletion is language based and has distinct API files for each language.
Notepad++ offers two types of auto completion:
Function Completion (providing a hint based on a list of well known keywords)
Word Completion (providing hint on words retrieved from the current file)
To trigger them, you must respectively select:
Edit->Auto-Completion->Function Completion
Edit->Auto-Completion->Word Completion
Notepad++ development community is a vibrant one, hopefully you find relevant indepth materials on the web.

Here is a link that should explain everything you need to know to make your own user defined language wiki
And Here is a list of user defined languages repository of user created languages

Related

how do i add syntax highlighting in slack for a new language

When I create a snippet in Slack, I have to option to apply syntax highlighting to the text by selecting from a long list of "built-in" languages.
How do I add syntax highlighting for my own language within Slack?
Slack uses the open-source CodeMirror 5.60.0 library for its snippet editor, as disclosed here. The process to add another language would therefore probably look a bit like this:
Write a mode for CodeMirror 5 and a language package for CodeMirror 6 that can highlight your language.
Have the CodeMirror maintainers merge your code into an upcoming release.
Wait for Slack to update their dependency on CodeMirror to either new version.
This will take some time and a lot of effort. It may not be worth it if there are not many users of your language.

How to integrate Microsoft.CodeAnalysis in a VSIX extension

As the title says, I would like to build a VS extension that's able to react to certain changes made on the editor window (for various languages). Not necessarily an adornment.
To do this I would like to be able to analyse the editor document through the Roslyn service API (that if I understood well is now part for the Microsoft.CodeAnalysis).
Can someone indicate some documentation?
What's the best practice to do this?
What are the interface to import via MEF?
As example you can export a custom ISuggestedActionsSourceProvider to add new feature in the light bulb, you can use ExportCodeRefactoringProviderAttribute to add a new refactoring, also you can export IClassifierProvider and ITagProvider to classificate a elements in the text editor, import ITextDocumentFactoryService to retrieve the current VS Document by ITextBuffer and etc.
Also you wouldn't be enough to use only Microsoft.CodeAnalysis for some kind of analyzing, so you will need to add a some additional packages in these cases. As example these packages can be Microsoft.CodeAnalysis.EditorFeatures.Text, Microsoft.CodeAnalysis.Workspaces.Common and etc.
If you want to get from community the more concrete answer you should concrete what exactly do you want in the question.
Also you can check a more useful links and examples: Roslynator are refactoring and analyzing a code, Getting start editor extensions, Light bulb guide, Classification elements for highlighting

Is there a solution for code completion of Factory Design pattern in vim

So I have switched over to VIM for all of my coding. I use to use PHPStorm for my Magento development. One of the things that make development hard in Magento, and using an IDE, is the fact they use a Factory Design pattern for using classes.
For example to load the following class
Mage_Catalog_Model_Product
you would call with
Mage::getModel('catal/product');
I am looking for a way to be able to say
Mage::getModel('catal/product')->
And code completion give me a list of methods from Mage_Catalog_Model_Product
For the last two years people have been pushing for the following in PHPStorm and a solution has been developed for that IDE Generic support for factory design pattern in PHP chaining (e.g. Magento, Doctrine, Kohana, etc..)
PHPStorm has came up with a solution, where it allows you to create a mapping of classes that PHPStorm will use to give you code completion.
I am wondering with VIM is there a way I could use a similar mapping as to https://gist.github.com/colinmollenhour/937195, with a current Code Completion plugin or maybe some tips to creating my own plugin to offer this type of code completion. I have been looking at a few articles, it seems like it should be possible, but I have never coded anything for VIM.
Your question is a bit hard to follow. If you have a list of e.g. class names and you want to offer completion, you can implement a custom insert mode completion. See :help E840 for a simple example; you can read the list of completions from an external command via system().
To insert an amount of skeleton code with dynamic placeholders, snippets are like the built-in :abbreviate on steroids, usually with parameter insertions, mirroring, and multiple stops inside them. One of the first, very famous (and still widely used) Vim plugins is snipMate (inspired by the TextMate editor); unfortunately, it's not maintained any more; though there is [a fork][https://github.com/garbas/vim-snipmate]. A modern alternative (that requires Python though) is UltiSnips. There are more, see this list on the Vim Tips Wiki.

Syntax higlighters for RPG And CLP that generate HTML and/or RTF?

I found that ToHtml.com has a nice bunch of syntax highlightes that generate HTML.
But they don't include RPG or CLP.
So: anyone who knows a syntax highlighter for RPG or/and CLP that generates either HTML or RTF?
Some more references
the custom brushes for SyntaxHighlighter does display RPG, but it doesn't generate HTML that you can copy to the clipboard; SyntaxHighlighterModified does, but it is hard to integrate custom brushes like the RPG one
GeSHi, BlogTrog, CodeHtmlEr and Gist do not do CLP nor RPG
I've had the same need for awhile and finally bit the bullet and created an RPG mode for the Ace Editor. You can see it here. I also modified the Ace "Tomorrow" theme to have more RPG features.
I was going to fork/pull the Ace Editor and add this, but they have a more laborious contribution scenario so I haven't taken the time to do that yet.
Been using it for browser-based code documentation. See below.
EDIT:
Another option is using VSCode. They added a feature to the latest version that allows copying the source from VSCode and pasting it into the medium of your choice (presentation, email, etc) fully marked up with syntax coloring. Couple that with the VSCode RPG Syntax plugin and you have a winning solution.
We would have to create the highlighters. I haven't looked and any in dept to see how complicated it would would be. Most of them are open-source and would gladly accept the new languages.

What are the most important IDE features missing in Vim?

I have been programming almost exclusively in Vim since 1/1/2001, and I feel that Vim fulfulls all my needs as an editor/IDE, but I can't help but wonder if perhaps there have been some new killer features developed for other IDEs in the last decade that would allow me to be more productive than I can be using Vim. So I ask: What are the most important IDE features missing in Vim??
Integrated debugging with all the fanciness that Visual Studio/Eclipse provide (thread debugging, etc etc)
Autocomplete with inline documentation support for methods/properties
Build and run from 'within' the editor application
I miss the excellent refactoring support and code tips from tools such as Resharper. Regexs are powerful for code modification, but understanding the code as Resharper does is just a tad better IMO.
Fortunately I can get both Resharper and Vim in Visual Studio so I am happy.
The real question is: what do VIM have that IDEs are missing.
I find that refactoring would be a real nice thing to have. Changing a java package name in vim with lots of source files can be pretty cumbersome.
Originally the refactoring was the killer feature that made us switch from Emacs. I have now used Eclipse extensively for Java for the last 6 years, and I expect any replacement to have:
Refactoring: Rename variables, functions, change method signatures (including all calls to it).
Debugging: "You are here" "Your current variables are" plus stuff like "go to the defined class for this object" or "go to the actual type for this object". I belive the latter requires quite a bit of integration between debugger and editor.
Code replacement while debugging. Change code, press Ctrl-S and the code in your debugging session is updated with what you just changed. A killer feature for big programs.
Navigation: Simple navigation of class hierarchy (please show me all implementations of this method in this interface and similar).
Javadoc integration - Eclipse can show javadoc just by hovering the mouse over an identifier.
Plus some more :)
Edit: I occasionally miss the Emacs functionality inside Eclipse, but the Eclipse editor has become stronger so it is not so bad anymore. In this regard the Save Action allowing a Format at every save was a killer. This ensures that changes show up properly in the source repository.
Search in files: In most editors, there is a separate window doing the search in files, and simultaneously editing can continue on the main window. The search results are updated as and when they are found. Also the current results can be viewed by clicking on it, even when the searching is ongoing, without waiting for the entire search to be completed.(whereas in cim one has to wait till vimgrep/ctags has finished to view the results)
This is particularly useful for search in large number of files.
So basically something like a search in background and simultaneously show results which can be clicked on to view them simultaneously.
(something like Microsoft Visual Studio 6.0 does)
The things I missed were code completion and debugging. That's why I started using eclim http://eclim.sourceforge.net/index.html so I could use vim for what it does best and eclipse when I actually need it. Try it out - it's a fantastic combination.
It's like the old question "What's worn under a kilt?"
Answer: "Nothing. Everything's in perfect working order!".
But seriously, I'd like to see a more intuitive (easy to use) help system added to Vim.
There is nothing missing in Vim that an IDE has. The only thing we could argue about is; Vim needs to be customized and IDE comes out of the box.
Let me comment the other answeres and how to solve such "needs".
build
As mentioned, use :make and learn how to customize it.
refactoring
Use the very well known ropevim (for Python), it makes a great reafactoring tool. You won't need more than that. There are many others, search for your language.
Autocompletion
I use this snippet together with mapping to TAB (I think supertab plugin does that)
" python stuff
python << EOF
import os
import sys
import vim
for p in sys.path:
if os.path.isdir(p):
vim.command(r"set path+=%s" % (p.replace(" ", r"\ ")))
EOF
" tags for python libs
set tags+=~/.vim/tags/python.ctags
autocmd FileType python,mako set omnifunc=pythoncomplete#Complete
autocmd FileType html,mako set omnifunc=htmlcomplete#Complete
autocmd FileType html,mako set omnifunc=htmlcomplete#CompleteTags
autocmd FileType mako set filetype=mako.html.js
Help system
in Vim is perfect, you just have to learn it's system. It has it's own conventions how are things organized.
Debugging
I don't know for other languages than Python, but running pdb and !python % does it's job.

Resources