Recent

Author Topic: IntelliJ IDEA + Pascal  (Read 87377 times)

argb32

  • Jr. Member
  • **
  • Posts: 89
    • Pascal IDE based on IntelliJ platform
IntelliJ IDEA + Pascal
« on: August 31, 2013, 09:18:52 pm »
There is a brilliant IDE for Java - Intellij IDEA.
Actually it's a platform which can be used to develop IDE for any language.
PyCharm, RubyMine, WebStorm, PHPStorm and others are based on the platform.
Many languages are supported via plugins but Pascal. :o
So I decided to change this situatuion. :D

Site with description and screenshots:
http://www.siberika.com/pasidea.htm

The plugin requires Community Edition of IDEA 12.хх (and probably 13.xx) which is available for free download here:
http://www.jetbrains.com/idea/download/index.html

Currently implemented:
  • context-aware code completion
  • undeclared identifiers usage highlight with quick fix
  • basic syntax errors highlighting
  • navigation between method or routine declaration and implementation
  • code commenter and brace matcher
  • integration with Free Pascal compiler
  • full Object Pascal language (Delphi mode) parser
  • conditional compilation support
  • identifier declaration, references and usages search and highlight
  • rename identifier refactoring
  • program running from the IDE
  • Object Pascal syntax highlighting
  • folding support

How to install
1. Choose in menu File->Settings, than Plugins
2. Click "Browse repositories"
3. Search for "Pascal IDEA plugin"
4. Right click on the plugin and choose "Download and Install"

Please note that external build option should be turned off here:
File->Settings->Compiler

Project creation and setup
In IDEA a project consists of modules. An IDEA module corresponding to a project in Lazarus or Delphi.
The plugin adds a new module type - Pascal module.

To use a Free Pascal compiler a so called SDK should be added to IDE. This can be done at a project creation time:
1. Choose in menu File->New project
2. Select "Pascal Module" to create a module
3. Click "New" to the right of "Project SDK"
4. Choose a directory where FPC installed

To get in Pascal SDK settings:
1. Choose in menu File->Project Structure
2. Select SDKs
3. Select desired SDK
Not much to setup yet.

For a module, a main file should be specified. This is the file which be compiled and runned:
1. Choose in menu File->Project Structure
2. Select Modules
3. Select desired module
4. Select main file on "Settings" tab
On "Sources" tab a library path can be specified.

Compile and run
To compile a file just select "Compile..." from a context menu (appears on right-click)
To run an application a Run configuration of type "FPC executable" should be created first (once):
1. Choose in menu Run->Run...
2. Select "Edit configurations..."
3. Click "+"
4. Select "FPC executable"
5. Click "Run" to run the application

Any feedback, suggestions questions are highly appreciated!
« Last Edit: November 06, 2013, 08:23:40 pm by argb32 »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: IntelliJ IDEA + Pascal
« Reply #1 on: August 31, 2013, 10:37:19 pm »
Wow - that must have been a lot of work! Thanks for posting this... though I think I'll stick with Lazarus for now ;) (I'm not using IDEA at the moment).
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

kodok.buncit

  • New Member
  • *
  • Posts: 35
Re: IntelliJ IDEA + Pascal
« Reply #2 on: August 31, 2013, 10:48:49 pm »
great work sir!
how about package mangement like *.lpk on lazarus?
kodok.buncit on github https://github.com/kodok-buncit/

Primary OS : Linux Ubuntu 12.04
fpc & laz      : always Trunk version

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: IntelliJ IDEA + Pascal
« Reply #3 on: September 01, 2013, 05:20:21 am »
good news  :) but i will continue with lazarus.   O:-)
Holiday season is online now. :-)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: IntelliJ IDEA + Pascal
« Reply #4 on: September 01, 2013, 05:51:17 am »
good work, but using Java based IDE will never be my option. No matter how lightweight people say, it will still be heavier than native application. Just tried this plugin with fresh IntelliJ IDEA, eats ~300 MB (just started, no files open). Lazarus eats 59 + 30 (for startlazarus) MB, with a bunch of packages installed including easy docking.
« Last Edit: September 01, 2013, 12:21:10 pm by Leledumbo »

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: IntelliJ IDEA + Pascal
« Reply #5 on: September 01, 2013, 06:54:52 am »
good work, but using Java based IDE will never be my option. No matter how lightweight people say, it will still be heavier than native application.

Agree with you.
Holiday season is online now. :-)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: IntelliJ IDEA + Pascal
« Reply #6 on: September 01, 2013, 10:47:07 am »
Nice job. You really like the IDE since this has been a lot of work. If community edition includes Android GUI designer, and it comes as a download bundled with FPC JVM (http://wiki.freepascal.org/FPC_JVM) and ready to produce Java/Android code out of the box (even if it means to pack it all into a Linux VM), then that might be enough for many people to try something new. Otherwise, most will stick with Lazarus.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

nsunny

  • Full Member
  • ***
  • Posts: 117
  • Code is magic
    • LazPlanet
Re: IntelliJ IDEA + Pascal
« Reply #7 on: September 01, 2013, 12:07:01 pm »
Nice job. You really like the IDE since this has been a lot of work. If community edition includes Android GUI designer, and it comes as a download bundled with FPC JVM (http://wiki.freepascal.org/FPC_JVM) and ready to produce Java/Android code out of the box (even if it means to pack it all into a Linux VM), then that might be enough for many people to try something new. Otherwise, most will stick with Lazarus.
Agree. I would also like this. Java based IDE for FPC seems not a good idea. But if the plugin can be improved to use IDEA as a GUI designer for Android apps then it would be a cool thing!
Lazarus TTS Tutorial | LazPlanet
Lazarus 2.2.0 | FPC 3.2.2 | Linux/OpenBSD/ReactOS

argb32

  • Jr. Member
  • **
  • Posts: 89
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #8 on: September 01, 2013, 01:21:29 pm »
"stick with Lazarus" is not an option because the plugin is not intended to replace Lazarus.
The main goal is to create a modern IDE for creating, analyzing and refactoring Pascal code using many man-years already invested in IDEA.
There is no plans to add any kind of form designers. The one in Lazarus is good enough in think.

Concerning memory consumption - JVM takes memory from OS on start and than manages it by itself.
The actual amount of memory consumed by IDEA is displayed at the right bottom. For me it is about 150MB for Pascal plugin project which includes IDEA community edition code (huge amount of code!). I only turned off unused plugins. 2% of memory on my computer. Not so bad I think. I can live with it.;)

What the memory is used for?
You can view some videos about it.
http://www.youtube.com/watch?v=XM-wD2vKwtA
http://www.youtube.com/watch?v=ydimqmbS61I&list=SPA2323EDE3F4FFE21
Anyway, it's hard to understand how IDE can improve productivity without using it for some time.

The new official Android IDE from Google is also based on IDEA (previously it was based on Eclipse):
http://developer.android.com/sdk/installing/studio.html
Of course it offers fully-featured Android form designer.
I didn't test but the Pascal plugin should work with it too.
FPC for JVM support is in plans but main goal of the plugin is modern IDE for Pascal code.

kodok.buncit, I'm almost not familiar with Lazarus package system. What kind of support of it you'd like to see?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: IntelliJ IDEA + Pascal
« Reply #9 on: September 01, 2013, 01:41:26 pm »
"stick with Lazarus" is not an option because the plugin is not intended to replace Lazarus.
Well, if you don't intend it as a replacement, I'm wondering what essential IntelliJ functionality you're missing in Lazarus. Perhaps it can be implemented in Lazarus ;)

There is no plans to add any kind of form designers. The one in Lazarus is good enough in think.
The new official Android IDE [...] offers fully-featured Android form designer.
I didn't test but the Pascal plugin should work with it too.
FPC for JVM support is in plans but main goal of the plugin is modern IDE for Pascal code.

Well.... I'd say that the Lazarus IDE itself is the natural IDE to use for Lazarus programs but to each his own. Together with other posters, I think that the possible benefits of IntelliJ FPC support would lie in Android development as you'd need interaction with Java code anyway, AFAIU.

Regardless, it's nice to see broader support for FPC development - thanks a lot!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

argb32

  • Jr. Member
  • **
  • Posts: 89
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #10 on: November 04, 2013, 01:55:46 pm »
The plugin has been updated.
Latest additions:
  • context-aware code completion
  • undeclared identifiers usage highlight
  • quick fix for the above (add variable declaration)
  • navigation between method or routine declaration and implementation (icon at the left side)
  • commenting of line/block by "ctrl+/" / "shift+ctrl+/"
  • braces matcher
  • other IntelliJ-based IDE (Pycharm, PHPStorm, etc) support. Note that custom compiler may be not supported.
Please note that external build option should be turned off here:
File->Settings->Compiler

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: IntelliJ IDEA + Pascal
« Reply #11 on: November 04, 2013, 09:17:24 pm »
thank you very much for your work, is very promising to me, and what is important in my opinion also, is to increase the number of developers using fpc in the world, intellij idea seems to be very good IDE, and programmers used to this ide in the world FPC will be able to enter the world in a simple way thanks to ARGB32.

argb32

  • Jr. Member
  • **
  • Posts: 89
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #12 on: November 06, 2013, 08:16:58 pm »
Thank you, esvignolo.
Now the plugin is in official Jetbrains plugin repository so any IDEA user can see that Pascal is supported.
And installation is simpler now.
« Last Edit: November 06, 2013, 08:21:09 pm by argb32 »

Liquid

  • Newbie
  • Posts: 1
Re: IntelliJ IDEA + Pascal
« Reply #13 on: November 14, 2013, 09:27:55 pm »
 :-\
except of me  :(

I'm not able to set up the SDK in IntelliJ 12 Ultimate. I'm on MAC OSX 10.7.5. I have fpc 2.6.2 installed.
By following the instructions I have to set the SDK, a finder open and now? I navigated to /usr/local/bin, /usr/local/lib and was looking in the Application Support Folder. But there is no folder or file I could choose.
What went wrong?

Greetings
Liquid   

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: IntelliJ IDEA + Pascal
« Reply #14 on: November 15, 2013, 01:14:17 pm »
Quote
By following the instructions I have to set the SDK, a finder open and now?

I have the same problem with Ubuntu... :-[
« Last Edit: November 15, 2013, 01:16:20 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018