# Setting java api paths for intellisense

8 messages
Open this post in threaded view
|

## Setting java api paths for intellisense

 Hi I have recently added the intellisense plugin from http://www.vim.org/scripts/script.php?script_id=747to my VIM 6.3 and this is working very well, except that I cannot seem to add additional paths to my list of paths to use for having class methods pop-ups. In the documentation intellisense.txt I found this, to have manual settings for java:         if has('win32')             let g:intellisense_root_dir = expand('$VIM/Intellisense') if isdirectory(expand($JAVA_HOME))                let g:intellisense_jvm_dir  = expand('$JAVA_HOME\jre\bin\server') let g:intellisense_javaapi_dir = expand('$JAVA_HOME\docs\api')             endif         endif I only need to add paths to my intellisense_javaapi_dir, so in my _vimrc I put the following lines: First I set a global directory, as the path is quite long: let g:WinWinDir = "U:\2cc_documentation\WIN_Project\WIN_source_code\src\java\au\gov\wa\wrc \win" Then I use the g:WinWinDir to build my path: let g:intellisense_javaapi_dir  = expand('U:\javadoc\j2sdk-1_3_1-doc\docs\api,' . g:WinWinDir . '\client,' . g:WinWinDir . '\gui,' . g:WinWinDir . '\common,' . g:WinWinDir . '\business,'  . g:WinWinDir . '\server,' . g:WinWinDir . '\batchimport') But it is not working i.e. in those directories, when typing in a . (dot) after an object does not expand its methods. Am I perhaps doing something wrong with the quotes? Seeing it is "expand", I also tried to put the common path in, thinking it may "expand" down (this way there are no problems with quotes):   let g:intellisense_javaapi_dir  = expand('U:\javadoc\j2sdk-1_3_1-doc\docs\api,U:\2cc_documentation\WIN_Pro ject\WIN_source_code\src\java\au\gov\wa\wrc\win')   But that is not working either, Note that in all cases, classes in the path U:\javadoc\j2sdk-1_3_1-doc\docs\api are resolved (i.e list their methods) which makes me think that the variable g:intellisense_javaapi_dir may perhaps never be sourced from _vimrc, and perhaps always overridden by the initial setting somewhere in intellisense itself (it asked me for the path during installation, which I supplied as U:\javadoc\j2sdk-1_3_1-doc). Anybody has any ideas on how to expand the intellisense_javaapi_dir? Any help will be greatly appreciated. Thanks Hugo Hugo Bouckaert Oracle Analyst / Programmer Two's Complement Computing -------------------------------------------------- This email and any attachments may be confidential or legally privileged. If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail. Thank you for your cooperation.
Open this post in threaded view
|

## Re: Setting java api paths for intellisense

 Hello, I do this in conjunction with the Project plugin. When you say "popup" do you mean triggering the intellisense popup for the javadocs popup? I add a script that sets up my project context each time I walk into a project or change project files.  If there is a way to only trigger this on a project load basis, that would be cool, but I am not clear on how to do this.  Anyone have any ideas?  In this script,  I add the following: -- " set lib references let $CLASSPATH = ".;" let$CLASSPATH = $CLASSPATH . "C:\\vim\\Intellisense\\javaft.jar;" let$CLASSPATH = $CLASSPATH . "C:\\src\\XalanTest\\lib\\log4j-1.2.9.jar;" let$CLASSPATH = $CLASSPATH . "C:\\bea\\weblogic81\\server\\lib\\weblogic.jar;" let$CLASSPATH = $CLASSPATH . "C:\\xalan-j_2_7_0\\xalan.jar;" let$CLASSPATH = $CLASSPATH . "C:\\src\\XalanTest\\lib\\csc-util.jar;" let$CLASSPATH = $CLASSPATH . "C:\\src\\XalanTest\\lib\\commons-httpclient-2.0.2.jar;" let$CLASSPATH = $CLASSPATH . "C:\\logging-log4j-1.2.9\\dist\\lib\\log4j-1.2.9.jar;" let$CLASSPATH = $CLASSPATH . "C:\\commons-logging-1.0.5\\commons-logging.jar" let g:intellisense_javaapi_dir = ".;C:\\commons-httpclient-2.0.2\\docs\\apidocs;" . expand('$JAVA_HOME\docs\api') . ";C:\\logging-log4j-1.2.9\\docs\\api" compiler javac --- I have noticed a couple of problems w/ the intellisense plugin in general.  Although it works out for most packages, I've noticed that some packages do not trigger an intellisense popup for SOME classes.   I've noticed this when trying to include the HttpClient class from the commons-httpclient jar.  I've verified that the package is in my classpath and I can compile and run successfully, however, intellisense refuses to show the existence of the HttpClient class.  I've logged a bug with the maintainer and shot them an email, but have not heard any response.  I'd be interested to know you experience with this. There is probably a more elegant way to do this, but this is pretty straightforward...  I know it mucks with the classpath a bit, but it works and is easy to understand. Let me know if that helps or not. Thanks, Alejandro Bouckaert, Hugo wrote: >Hi > >I have recently added the intellisense plugin from > >http://www.vim.org/scripts/script.php?script_id=747> >to my VIM 6.3 and this is working very well, except that I cannot seem >to add additional paths to my list of paths to use for having class >methods pop-ups. > >In the documentation intellisense.txt I found this, to have manual >settings for java: > > if has('win32') >    let g:intellisense_root_dir = expand('$VIM/Intellisense') > if isdirectory(expand($JAVA_HOME)) >               let g:intellisense_jvm_dir  = >expand('$JAVA_HOME\jre\bin\server') > let g:intellisense_javaapi_dir = >expand('$JAVA_HOME\docs\api') >            endif > endif > >I only need to add paths to my intellisense_javaapi_dir, so in my _vimrc >I put the following lines: > >First I set a global directory, as the path is quite long: >let g:WinWinDir = >"U:\2cc_documentation\WIN_Project\WIN_source_code\src\java\au\gov\wa\wrc >\win" > >Then I use the g:WinWinDir to build my path: > >let g:intellisense_javaapi_dir  = >expand('U:\javadoc\j2sdk-1_3_1-doc\docs\api,' . g:WinWinDir . '\client,' >. g:WinWinDir . '\gui,' . g:WinWinDir . '\common,' . g:WinWinDir . >'\business,'  . g:WinWinDir . '\server,' . g:WinWinDir . '\batchimport') > >But it is not working i.e. in those directories, when typing in a . >(dot) after an object does not expand its methods. Am I perhaps doing >something wrong with the quotes? > >Seeing it is "expand", I also tried to put the common path in, thinking >it may "expand" down (this way there are no problems with quotes):   > >let g:intellisense_javaapi_dir  = >expand('U:\javadoc\j2sdk-1_3_1-doc\docs\api,U:\2cc_documentation\WIN_Pro >ject\WIN_source_code\src\java\au\gov\wa\wrc\win') > >But that is not working either, Note that in all cases, classes in the >path U:\javadoc\j2sdk-1_3_1-doc\docs\api are resolved (i.e list their >methods) which makes me think that the variable >g:intellisense_javaapi_dir may perhaps never be sourced from _vimrc, and >perhaps always overridden by the initial setting somewhere in >intellisense itself (it asked me for the path during installation, which >I supplied as U:\javadoc\j2sdk-1_3_1-doc). > >Anybody has any ideas on how to expand the intellisense_javaapi_dir? > >Any help will be greatly appreciated. > >Thanks > >Hugo > > > >Hugo Bouckaert >Oracle Analyst / Programmer >Two's Complement Computing >-------------------------------------------------- >This email and any attachments may be confidential or legally >privileged. If you received this message in error or are not the >intended recipient, you should destroy the e-mail message and any >attachments or copies, and you are prohibited from retaining, >distributing, disclosing or using any information contained herein. >Please inform us of the erroneous delivery by return e-mail. Thank you >for your cooperation. > > > > > >   >
Open this post in threaded view
|

## RE: Setting java api paths for intellisense

 In reply to this post by Bouckaert, Hugo   > -----Original Message----- > From: Bouckaert, Hugo [mailto:[hidden email]] > Sent: Thursday, September 22, 2005 2:31 AM > To: vim mailing list > Subject: Setting java api paths for intellisense > > Hi > > I have recently added the intellisense plugin from > > http://www.vim.org/scripts/script.php?script_id=747> > to my VIM 6.3 and this is working very well, except that I > cannot seem to add additional paths to my list of paths to > use for having class methods pop-ups. > > In the documentation intellisense.txt I found this, to have > manual settings for java: > > if has('win32') >    let g:intellisense_root_dir = expand('$VIM/Intellisense') > if isdirectory(expand($JAVA_HOME)) >                let g:intellisense_jvm_dir  = > expand('$JAVA_HOME\jre\bin\server') > let g:intellisense_javaapi_dir = > expand('$JAVA_HOME\docs\api') >             endif > endif > > I only need to add paths to my intellisense_javaapi_dir, so > in my _vimrc I put the following lines: > > First I set a global directory, as the path is quite long: > let g:WinWinDir = > "U:\2cc_documentation\WIN_Project\WIN_source_code\src\java\au\ > gov\wa\wrc > \win" > > Then I use the g:WinWinDir to build my path: > > let g:intellisense_javaapi_dir  = > expand('U:\javadoc\j2sdk-1_3_1-doc\docs\api,' . g:WinWinDir . > '\client,' > . g:WinWinDir . '\gui,' . g:WinWinDir . '\common,' . g:WinWinDir . > '\business,'  . g:WinWinDir . '\server,' . g:WinWinDir . > '\batchimport') > > But it is not working i.e. in those directories, when typing in a . > (dot) after an object does not expand its methods. Am I > perhaps doing something wrong with the quotes? > > Seeing it is "expand", I also tried to put the common path > in, thinking it may "expand" down (this way there are no > problems with quotes):   > > let g:intellisense_javaapi_dir  = > expand('U:\javadoc\j2sdk-1_3_1-doc\docs\api,U:\2cc_documentati > on\WIN_Pro > ject\WIN_source_code\src\java\au\gov\wa\wrc\win') >   > But that is not working either, Note that in all cases, > classes in the path U:\javadoc\j2sdk-1_3_1-doc\docs\api are > resolved (i.e list their > methods) which makes me think that the variable > g:intellisense_javaapi_dir may perhaps never be sourced from > _vimrc, and perhaps always overridden by the initial setting > somewhere in intellisense itself (it asked me for the path > during installation, which I supplied as U:\javadoc\j2sdk-1_3_1-doc). > > Anybody has any ideas on how to expand the intellisense_javaapi_dir? For any additional directories, just simply add these to the CLASSPATH prior to starting Vim.  The Intellisense plugin just adds the above directories to the CLASSPATH if they are not already there. HTH, Dave
Open this post in threaded view
|

## RE: Setting java api paths for intellisense

 In reply to this post by Alejandro Calbazana   > -----Original Message----- > From: Alejandro Calbazana [mailto:[hidden email]] > Sent: Thursday, September 22, 2005 9:20 AM > To: Bouckaert, Hugo > Cc: vim mailing list > Subject: Re: Setting java api paths for intellisense > > Hello, > > I do this in conjunction with the Project plugin. > > When you say "popup" do you mean triggering the intellisense > popup for the javadocs popup? > > I add a script that sets up my project context each time I > walk into a project or change project files.  If there is a > way to only trigger this on a project load basis, that would > be cool, but I am not clear on how to do this.  Anyone have any ideas? Project has a provision for this. I do the following: MyProject=d:\one\two\three CD=. {  src=src CD=. {   java=java CD=. in=..\..\vim\in.vim { So I would also create this file:         d:\one\two\three\vim\in.vim This file does the following: ************* let g:JavacCP='c:\somewhere\classes' let g:JavacCP = g:JavacCP.';'.expand('$envvariable\somewhere\my.jar') let g:JavacOutputDir='c:\somewhere\classes' compiler javac if$CLASSPATH != 'SQLGrid'     let $CLASSPATH=$CLASSPATH.';'.g:JavacOutputDir endif ************* Project also allows you to specify an out.vim, which can reset your environment back to normal. HTH, Dave -- Do you use Vim to edit SQL? Check the description of these plugins: dbext.vim - Provides database access to 10 databases (Oracle, Sybase, SQL Server, MySQL,...) (http://www.vim.org/scripts/script.php?script_id=356) SQLUtilities - Formatting SQL, generate - columns lists, procedures for databases (http://www.vim.org/scripts/script.php?script_id=492) sql.vim - SQL indent file for Sybase ASA and Oracle (http://www.vim.org/scripts/script.php?script_id=495) Intellisense for Vim : SQL, C++, CSharp, Java, JSP, XML, HTML (http://www.vim.org/scripts/script.php?script_id=747)