Disclaimer: This topic does not contain the implementation of what is listed in the title, and does not contain technical details. Here are just listed the problems that I am going to solve and a short plan on how this should be implemented. Given the newness of the topic and a good level of complexity for me, I can not vouch that this article will not be the first and the last. But I honestly would like to bring this undertaking to the end, parallel lighting it here. This article is, among other things, an additional motivation.Introduction to entry
It just so happened that a few weeks ago I had to relearn from a C # developer to a Salesforce developer. And I would not mind saying that it turned out to be simple and fascinating (although it is in many ways), but one fact regularly continues to spoil my mood and makes me remember my beloved .NET. For the past 5 years I have been working exclusively with VisualStudio - developing WinForms applications, SIlverlight, pure C # backend, TypeScript as a hobby. And I perceived this tool as something that will always be with me, as something that makes development comfortable, and stupidly thought that the rest of IDEs are at about the same level of development (I tried hard to forget my experience with some Flex IDE on base of eclipse).
And then bang ...
Force.com IDE - IDE based on Eclipse to work with Salesforce or
Mavensmate plug-in to Sublime Text.
Short educational program
Development under Salesforce is conducted using two main languages / technologies -
Apex code based on Java, and
VisualForce - a framework for building a custom web part of "applications".
The peculiarity of using the entire Salesforce platform is cloudiness of the brain (not in reproach - just a fact), namely - compilation of the Apex code is performed in the cloud (and this cannot be done locally), and development can be carried out directly in the browser using the so-called Developer Console, which is a weak semblance of an IDE.
')
Ok, great, take any IDE for Java and work on it. It is impossible, because the language is really different, and the aforementioned
OGM obliges us to save every sneeze into the cloud and compile it there.
What for?
It is a reasonable question - why, in fact, not relearn the new IDE as a normal person? Here, for me, everything is quite simple:
- Stupid habit of a good tool
- The opportunity to learn something new
- The idea of part-time project, which will not be "project for the sake of the project"
- The opportunity to try their hand
- An opportunity to make the world better?
- The inconvenience of the tools available
The last point should be considered a little more detailed - since I’ve only been interested in this for a couple of weeks, the list I have accumulated is small but sufficient for me:
- The lack of a decent IntelliSense alternative in Force.com IDE - searches for the first letters, slows down, is not very aware about the custom classes and their properties / methods (here maybe I said something wrong, but I did it that way). But it works more or less well in Mavensmate
- No syntax error highlighting in Mavensmate - save, send to the cloud, wait for 20-30 seconds and find out that you have forgotten the semicolon. Next time we find out that we forgot another semicolon a couple of lines below. But it works well in the Force.com IDE
- The complete lack of the ability to group files (classes / triggers / pages in their terminology), at least in folders - there are three system folders in which files lie according to their category, EVERYTHING. It's really stupid to see in 2014 the names of the files like " AAAAClassName ", " AAALessImportantClassName ", etc ... This is the structure of the code in Salesforce, but since we have a separate software - it would be possible to fight this (though using symlinks) .
- Each file save causes it to be sent to Salesforce and compiled there. Sorry, but I have a stupid habit of pressing Ctrl + S after each line. And if I think about something in the middle of the line - I can press Ctrl + S until I return to reality. Sorry, but compiling and saving files is not the same in my world.
- Inadequate mechanism of interaction with Salesforce from Mavensmate - generated pages that open in the browser and display the results of interaction with SF (test launches, logs, etc.)
As a topic for discussion, it would be interesting to know - and how do you feel about such features of the IDE?And how will we solve this?
From the headline and background history, a common vector is an extension for Visual Studio, which will allow us to fully work with Salesforce code. If you disassemble the concept into principle blocks - I would single out this (in that order):
- Apex syntax highlighting
- VisualForce syntax highlighting
- Support for Salesforce "projects" (including separating the concepts of Save and Compile)
- IntelliSense implementation
- Syntax error display
- Panel for working with unit tests and logs Salesforce
- Build Visual Studio for Salesforce based on Visual Studio Shell for free standalon distribution
- The rest of the sugar as far as possible
Interesting tasks for the first stages
One of the most interesting problems (thanks to Salesforce) is the lack of grammar of both Apex and VisualForce anywhere. Yes, Apex is based on Java, but the changes are decent and build a grammar based on Java and the text reference Apex, a long and tedious task ... But I did not find any other options, so the process is running.
What is important in the formalization of grammar is what will be used to build the lexer -
ANTLR or
Irony (the two most interesting projects). At ANTLR, I like the format of the grammar task much more (it’s much more familiar to me, because it doesn’t mix with the code), but I don’t like the approach of the project itself — the Java application that generates the lexer automatically (in Java or C #). Irony is much more flexible and free to choose how and what to implement, but I don't like the task of the grammar - a terrible mix of code and BNF rules.
I would be grateful for any additional information on similar tools for .Net in the commentsThe second problem I encountered during the week of studying materials and leisurely picking in the insides of the VS SDK is
documentation and examples. I seriously always considered the documentation on msdn one of the best examples. Everything is there, great tutorials, examples, detailed information. In this case - complete garbage. Examples from msdn articles are not compiled (well, figs with them), after the banal fix for stupid errors, the code simply does not work. Information (which the cat wept for) is spread over various places and important nuances can be collected for a dozen different materials. VS SDK 2013 (namely, I intend to develop an extension for this version) is not supplied with examples, and the examples from VS SDK 2010 are incomplete and outdated (old approaches are used without the
Managed Package Framework and the lexer itself is not included in the example at all - you have to use .NET Reflector for pick out the code.
Next steps
As I already wrote - I am not sure that I can bring this project to an adequate form, but I hope this will happen. Now I pick out the information on Syntax Highlighting and, in parallel, I am working on the Apex grammar. With a good set of circumstances in about a month I would like to share with you progress, but if nothing happens in a month, you know - I fell under the pressure of Apex or Visual Studio :)
I would be grateful for useful resources, articles, tips, examples of the implementation of the Language Service for Visual Studio 2010+ (IronPython is not an option) and generally on the topic.Thanks for attention.