* * *

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

argb32

  • Jr. Member
  • **
  • Posts: 69
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #30 on: December 22, 2013, 08:02:47 pm »
New version released with .ppu files interface view ability.
The ppudump utility is used which comes with FPC.
ppudump should be version 2.7.1 or higher.

JD

  • Hero Member
  • *****
  • Posts: 1573
Re: IntelliJ IDEA + Pascal
« Reply #31 on: December 30, 2013, 12:38:17 am »
@argb32

Hats off to you. Looks like a lot of work. Great!
Windows (10, 7) - Lazarus 1.6.4/FPC 3.0.2 (also Delphi occasionally)
Linux Mint Cinnamon  - Lazarus 1.4/FPC 2.6.4
Indy 10.6 series; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB

cit

  • Newbie
  • Posts: 4
Re: IntelliJ IDEA + Pascal
« Reply #32 on: September 23, 2014, 03:19:24 pm »
I'm trying to make it work on IDEA 13 (Mac OS X). Unfortunately, it silently closes SDK selection dialog on any imaginable path suggested.


cit

  • Newbie
  • Posts: 4
Re: IntelliJ IDEA + Pascal
« Reply #33 on: September 23, 2014, 07:02:42 pm »
I'm trying to make it work on IDEA 13 (Mac OS X). Unfortunately, it silently closes SDK selection dialog on any imaginable path suggested.

With some quirks (manually editing jdk.table.xml) I've managed plugin to recognize SDK, but compilation doesn't work in a strange way:


2014-09-23 20:37:47,382 [  29496]   INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED
2014-09-23 20:37:47,587 [  29701]  ERROR - i.compiler.TranslatingCompiler - Cannot run program "/usr/local/lib/fpc/2.6.4/bin": error=13, Permission denied
java.io.IOException: Cannot run program "/usr/local/lib/fpc/2.6.4/bin": error=13, Permission denied
   at java.lang.ProcessBuilder.processException(ProcessBuilder.java:478)
   at java.lang.ProcessBuilder.start(ProcessBuilder.java:457)
   at java.lang.Runtime.exec(Runtime.java:593)
   at java.lang.Runtime.exec(Runtime.java:466)
   at com.intellij.compiler.impl.javaCompiler.ExternalCompiler.launchProcess(ExternalCompiler.java:81)
   at com.siberika.idea.pascal.compiler.PasFPCCompiler.compileNative(PasFPCCompiler.java:107)
   at com.siberika.idea.pascal.compiler.PasFPCCompiler.compile(PasFPCCompiler.java:54)
   at com.intellij.compiler.impl.CompileDriver.compileSources(CompileDriver.java:2051)
   at com.intellij.compiler.impl.CompileDriver.translate(CompileDriver.java:1374)
   at com.intellij.compiler.impl.CompileDriver.doCompile(CompileDriver.java:1080)
   at com.intellij.compiler.impl.CompileDriver.doCompile(CompileDriver.java:806)
   at com.intellij.compiler.impl.CompileDriver.access$1100(CompileDriver.java:111)
   at com.intellij.compiler.impl.CompileDriver$9.run(CompileDriver.java:754)
   at com.intellij.compiler.progress.CompilerTask.run(CompilerTask.java:167)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:495)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:185)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:226)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:175)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:400)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:454)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
   at java.lang.Thread.run(Thread.java:695)
   at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:152)
Caused by: java.io.IOException: error=13, Permission denied
   at java.lang.UNIXProcess.forkAndExec(Native Method)
   at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
   at java.lang.ProcessImpl.start(ProcessImpl.java:91)
   at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
   ... 25 more


It seems that last part of the compiler path has been lost somehow ...

Please, help.

argb32

  • Jr. Member
  • **
  • Posts: 69
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #34 on: October 05, 2014, 01:43:14 am »
In 13th IDEA compiler API was completely changed so I had to rewrite this part.
Now it's working (though I didn't test on Mac ever) and SDK detection was improved too.
I hope to find the time and release new version soon.

allanregistos

  • Jr. Member
  • **
  • Posts: 54
  • In Christ Alone
Re: IntelliJ IDEA + Pascal
« Reply #35 on: October 15, 2014, 08:13:24 am »
In 13th IDEA compiler API was completely changed so I had to rewrite this part.
Now it's working (though I didn't test on Mac ever) and SDK detection was improved too.
I hope to find the time and release new version soon.
Hi argb32,
It seems it still doesn't recognize the /usr/lib/fpc/$fpc_ver directory, and therefore not usable. While you are at it, do you have fix or workarounds? The IDE was run as the same user would run lazarus/fpc, so file permission should not be a suspect.
(Ubuntu 14.04 64-bit fpc 2.6.4)
See screenshot.

God is my refuge and my strength.

argb32

  • Jr. Member
  • **
  • Posts: 69
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #36 on: October 16, 2014, 11:28:25 pm »
It seems it still doesn't recognize the /usr/lib/fpc/$fpc_ver directory, and therefore not usable. While you are at it, do you have fix or workarounds? The IDE was run as the same user would run lazarus/fpc, so file permission should not be a suspect.
(Ubuntu 14.04 64-bit fpc 2.6.4)
See screenshot.

The only workaround with existing version I'm aware of is to use FPC coming with CodeTyphoon. It has compatible SDK layout.
The new version I'm finishing now is compatible with standard FPC layout.

argb32

  • Jr. Member
  • **
  • Posts: 69
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #37 on: March 23, 2015, 11:41:33 pm »
Didn't update the thread for a while.
The current version of the plugin got the following:
  • full references/find usages/rename (except WITH and some special cases within expressions)
  • much more stable parser
  • improved completion
  • unit name completion
  • module rename refactoring
  • code formatter
  • module file templates
  • IDEA 14 support
  • regressions and bug fixes

FPC path layout on OSX is also supported and tested (thank to people concerned).

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: IntelliJ IDEA + Pascal
« Reply #38 on: March 24, 2015, 01:13:39 am »
Thanks!
@argb32 I want to ask what are the usages of this plugin?
I can imagine if it used for FPC Android development like Java AS it can be great,But what other usages?

cit

  • Newbie
  • Posts: 4
Re: IntelliJ IDEA + Pascal
« Reply #39 on: March 24, 2015, 10:06:10 pm »
@argb32 Thanks a lot for your work!

Unfortunately, there are still some issues with Mac OS X and fpc 2.6.4:

- SDK dir is not recognized, until the fpc symlink created in /usr/local/lib/fpc/2.6.4 (freshly installed fpc contains only ppc* execs there) - easily fixed
- basic types (integer, char, ...) underlined as errors (attached)
- invoking compiler fails with EAccessViolation, though proposed command line pasted in terminal works fine:

Quote
Information:FPC: Map: /Users/cit/Projects/pascal-test/src/helloworld.pas => /Users/cit/Projects/pascal-test/out/production/pascal-test/helloworld.ppu
Information:FPC: Compiler command:  /usr/local/lib/fpc/2.6.4/fpc  -viewnb -FE/Users/cit/Projects/pascal-test/out/production/pascal-test -Fu/Users/cit/Projects/pascal-test/src -Fi/Users/cit/Projects/pascal-test/src -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/pthreads -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/pthreads -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/regexpr -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/regexpr -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/x11 -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/x11 -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/rtl -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/rtl /Users/cit/Projects/pascal-test/src/helloworld.pas (Module: pascal-test)
Information:FPC: Command line:
Information:FPC: /usr/local/lib/fpc/2.6.4/fpc
Information:FPC:
Information:FPC: -viewnb
Information:FPC: -FE/Users/cit/Projects/pascal-test/out/production/pascal-test
Information:FPC: -Fu/Users/cit/Projects/pascal-test/src
Information:FPC: -Fi/Users/cit/Projects/pascal-test/src
Information:FPC: -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/pthreads
Information:FPC: -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/pthreads
Information:FPC: -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/regexpr
Information:FPC: -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/regexpr
Information:FPC: -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/x11
Information:FPC: -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/x11
Information:FPC: -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/rtl
Information:FPC: -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/rtl
Information:FPC: /Users/cit/Projects/pascal-test/src/helloworld.pas
Information:FPC: An unhandled exception occurred at $000CA390 :
Information:FPC: EAccessViolation : Access violation
Information:FPC: $000CA390
Information:FPC: $000CB696
Information:FPC: $000329B3
Information:25.03.15 0:39 - Compilation completed with 2 errors and 0 warnings in 1s 845ms
Error:FPC: Compilation aborted
Error:FPC: Error. Compiler exit code: 217

In terminal:
Quote
cit@WinterPro:~/Projects/pascal-test$ /usr/local/lib/fpc/2.6.4/fpc  -viewnb -B -FE/Users/cit/Projects/pascal-test/out/production/pascal-test -Fu/Users/cit/Projects/pascal-test/src -Fi/Users/cit/Projects/pascal-test/src -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/pthreads -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/pthreads -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/regexpr -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/regexpr -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/x11 -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/x11 -Fu/usr/local/lib/fpc/2.6.4/units/i386-darwin/rtl -Fi/usr/local/lib/fpc/2.6.4/units/i386-darwin/rtl /Users/cit/Projects/pascal-test/src/helloworld.pas
Free Pascal Compiler version 2.6.4 [2014/02/26] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Darwin for i386
Compiling /Users/cit/Projects/pascal-test/src/helloworld.pas
Assembling (pipe) /Users/cit/Projects/pascal-test/out/production/pascal-test/helloworld.s
Linking /Users/cit/Projects/pascal-test/out/production/pascal-test/helloworld
19 lines compiled, 0.1 sec


argb32

  • Jr. Member
  • **
  • Posts: 69
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #40 on: March 24, 2015, 11:08:15 pm »
cit:
The file /usr/local/bin/fpc should be used as compiler executable if it can't be found in $SDKHOME/bin. Does it exists? No symlink should be needed.

Most basic types are declared in system.ppu. FPC 2.6.4 doesn't has ppudump with XML output capability therefore system.ppu can't be parsed. The only way to fix this is to use newer FPC version.

As of EAccessViolation - I encountered it myself. Some version of FPC can't handle empty parameters. It's was fixed in newer FPC versions. As a workaround (besides switching to newer FPC version) you can set something in "additional compiler options" field in SDK settings. E.g. "-O3".

aradeonas:
The usage of the plugin is to effectively write and analyze code. It's ideal for cases when no GUI design needed - game development or server programming. But even for GUI applications the plugin can be used to write code.
After programming in such IDEs as Eclipse and especially IDEA I'm not satisfied with usability of existing Pascal IDE's in writing code anymore. It's hard to explain to someone who didn't try IDEA (I didn't believe it myself :) ). May be some video demos can explain better.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: IntelliJ IDEA + Pascal
« Reply #41 on: March 24, 2015, 11:10:52 pm »
I can understand what you say.
Do have any plan to make it a Android development IDE?

cit

  • Newbie
  • Posts: 4
Re: IntelliJ IDEA + Pascal
« Reply #42 on: March 25, 2015, 08:58:05 pm »
The file /usr/local/bin/fpc should be used as compiler executable if it can't be found in $SDKHOME/bin. Does it exists? No symlink should be needed.

cit@citusb:~/Projects/pascal-test$ file /usr/local/bin/fpc
/usr/local/bin/fpc: Mach-O i386 executable

Checked again - plugin refuses SDK path without fpc

Most basic types are declared in system.ppu. FPC 2.6.4 doesn't has ppudump with XML output capability therefore system.ppu can't be parsed. The only way to fix this is to use newer FPC version.

Ok, will try to build from sources.  :(

As of EAccessViolation - I encountered it myself. Some version of FPC can't handle empty parameters. It's was fixed in newer FPC versions. As a workaround (besides switching to newer FPC version) you can set something in "additional compiler options" field in SDK settings. E.g. "-O3".

Added "-g" - it works! Thank you!  :)

argb32

  • Jr. Member
  • **
  • Posts: 69
    • Pascal IDE based on IntelliJ platform
Re: IntelliJ IDEA + Pascal
« Reply #43 on: March 26, 2015, 09:37:37 pm »
Do have any plan to make it a Android development IDE?

I've plans on Android development and will use the plugin for it. Probably there will be some features specific to Android or iOS (e.g. support of specific build tools). But the general line is IDE for writing/analyzing/refactoring code. No matter for which platform.

Checked again - plugin refuses SDK path without fpc

Weird... The only thing I can think of is the file permissions.

Quote from: cit
Ok, will try to build from sources.  :(

FPCUp worked for me.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: IntelliJ IDEA + Pascal
« Reply #44 on: March 26, 2015, 09:45:44 pm »
ok I get it but with attaching it to Android it can be serious product and not just a developer tools.Its not bad be a developer tools,its great but it can have a bigger future.
Thank you for making it.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus