Ext


Go Back   Ext JS Forums > Ext General Forums > Ext: Examples and Extras

Reply
 
Thread Tools
  #1  
Old 11-21-2007, 01:27 AM
DragonFist DragonFist is offline
Ext User
 
Join Date: Aug 2007
Posts: 204
DragonFist is on a distinguished road
Thumbs up [Updated 5 Dec - download avail]VS 2008 intellisense for Extjs WORKING!!!

I had an idea tonight on how to get intellisense working for ext in Visual Studio 2008 and started working on it -- and it works!

See attached image.

basically, we need to create an "ext-all" and "ext-base" that is all source, no minifying or compression or variable renaming. Later we can add the comment system that VS supports but we can create an intellisense JS that will work.

5 Dec 2007, Ext Source based Intellisense File

Here is the version that I am currently using: Ext_Intellisense.js

It is based off RC1. I will make a final release version when I get a chance. The main things to do right now are to convert all the doc comments to the xml comment system and place them inside the functions, not before them. The params are important but the returns are the really important part. This allows the intellisense to know things like .getStore() returns a Store and provides intellisense for that, e.g. getStore().load().

There are a lot of docs to convert and functions to place them in, so this will take a while doing by hand. I would like to write a parser that just does it. Once again, I need time to do this which I don't have right now. So I am posting this file as it gives useful, if not complete, intellisense right now.

26 Nov 2007 file download available

Okay, here's the version based on extsense parsing ExtSense.js

Update: As stated elsewhere, I am no longer following this path to get the intellisense working as it proved to be limited. I am keeping the file available, however.

This get used with a reference tag at the beginning of an external js file like so:

///<reference path="MyPath/to/ExtSense.js" />

This is far from finished and is provided as-is. However, it does give some Ext intellisense in VS 2008 and that's worth something. With tweaking, it could eventually be a full intellisense solution for Ext in Visual Studio.
Attached Images
File Type: jpg 1Ext_intellisence.jpg (84.4 KB, 1413 views)
File Type: jpg 2Ext_intellisence.jpg (90.4 KB, 2002 views)
Reply With Quote
  #2  
Old 11-21-2007, 02:03 AM
DragonFist DragonFist is offline
Ext User
 
Join Date: Aug 2007
Posts: 204
DragonFist is on a distinguished road
Default

Further work on this showed that I had to comment out a couple lines in the ext-base and as of yet, some methods like Ext.Store.load() don't show up. But there is some hope here of creating an "Extjs-Intellisense.js" file for use in coding.
Reply With Quote
  #3  
Old 11-21-2007, 02:22 AM
DragonFist DragonFist is offline
Ext User
 
Join Date: Aug 2007
Posts: 204
DragonFist is on a distinguished road
Default

Something else of interest that may help on this.

See the pic for details.
Attached Images
File Type: jpg 3Ext_intellisence.jpg (79.0 KB, 800 views)
Reply With Quote
  #4  
Old 11-21-2007, 08:22 AM
mleger mleger is offline
Ext User
 
Join Date: Nov 2007
Posts: 1
mleger is on a distinguished road
Default VS 2005

Any chance the same would apply for 2005? Yes, I know. I'm behind the times.

Great work. Look forward to seeing your progress.
Reply With Quote
  #5  
Old 11-21-2007, 08:25 AM
wilhol wilhol is offline
Ext User
 
Join Date: Nov 2007
Posts: 1
wilhol is on a distinguished road
Default

Is this different to the -debug js files included with ext? also note you can use the ///<reference path="something" /> syntax so you can include the minified js bug use a different file for intellisense.
Reply With Quote
  #6  
Old 11-21-2007, 10:26 AM
DragonFist DragonFist is offline
Ext User
 
Join Date: Aug 2007
Posts: 204
DragonFist is on a distinguished road
Default

@mleger

Sorry, it would not.

@wilhol

Personnally, just putting the debug version didn't work. Some errors would occur and resulting in intellisense turning itself off. Also, any methods created by extending the class don't show up for the class, but they are in the prototype. Not very useful for code completion.

And to get the code completion on parameters and all that, we are going to need to add the xml comments that MS decided to use to the inside of all the functions.
Reply With Quote
  #7  
Old 11-21-2007, 10:28 AM
rodiniz's Avatar
rodiniz rodiniz is offline
Ext User
 
Join Date: Mar 2007
Location: Rio de Janeiro, Brazil
Posts: 276
rodiniz is on a distinguished road
Send a message via MSN to rodiniz
Default

Quote:
Originally Posted by mleger View Post
Any chance the same would apply for 2005? Yes, I know. I'm behind the times.

Great work. Look forward to seeing your progress.
No... The new Javascript intelissense is Vs 2008 only.
__________________
ExtJsExtender Controls
http://www.extendersamples.qsh.eu
My Blog
http://rodiniz.blogspot.com
Reply With Quote
  #8  
Old 11-21-2007, 12:38 PM
DragonFist DragonFist is offline
Ext User
 
Join Date: Aug 2007
Posts: 204
DragonFist is on a distinguished road
Default

I started work on getting intellisense to fully work.

I found a page that has the format for the xml comments.

I am hoping some regex guru out there could write a script to convert the JSdoc comments to MS's xml comments. They seem similar enough that it could be done. Then we could move them inside the functions.

I started work on setting extended classes to equal their prototypes. This then has the full object show in dot-notation.

As an example:

Ext.Action = Ext.Action.prototype;
Ext.apply = Ext.apply.prototype;
Ext.BasicForm = Ext.BasicForm.prototype;
Ext.BoxComponent = Ext.BoxComponent.prototype;
Ext.Button = Ext.Button.prototype;
Ext.ButtonToggleMgr = Ext.ButtonToggleMgr.prototype;
Ext.ColorPalette = Ext.ColorPalette.prototype;
Ext.Component = Ext.Component.prototype;
Ext.ComponentMgr = Ext.ComponentMgr.prototype;
Ext.CompositeElement = Ext.CompositeElement.prototype;
Ext.CompositeElementLite = Ext.CompositeElementLite.prototype;
Ext.Container = Ext.Container.prototype;
Ext.CycleButton = Ext.CycleButton.prototype;
Ext.DataView = Ext.DataView.prototype;
Ext.DatePicker = Ext.DatePicker.prototype;
Ext.Editor = Ext.Editor.prototype;
Ext.FormPanel = Ext.FormPanel.prototype;
I am not sure what effect this would have on running the code but that isn't the point, you would use this code to run an app. You would reference it at the top of your external .js files for intellisense purposes like so:

/// <reference path="Extjs_Intellisense.js" />

Then it would never be run but you would have your Extjs code completion, etc.

Best,

Shawn
Reply With Quote
  #9  
Old 11-21-2007, 07:09 PM
JorisA JorisA is offline
Ext User
 
Join Date: Mar 2007
Posts: 414
JorisA is on a distinguished road
Default

Looks great, does anyone know how to get this working in Eclipse (Aptana)?
Reply With Quote
  #10  
Old 11-22-2007, 06:00 AM
woid woid is offline
Ext User
 
Join Date: Oct 2007
Location: Prague, Czech Republic
Posts: 16
woid is on a distinguished road
Default

DragonFist, I had similar idea to produce ExtSense.js file to be consumed by VS2008 using 'reference' tag.

Teflon has ExtJS parser for his ExtSharp project and he did some work to turn it into ExtSense generator:
http://extsharp.googlecode.com/svn/branches/ExtSense/

I'm using his ExtSense.js in Visual Studio 2008 Beta 2.
It works for simple cases, but it is far from perfect.

I didn't manage to save time to investigate it further. I want to take look on it after I get final version of VS2008.

You can grab my version of ExtSense.js for ExtJS2.0 rc1 from http://public.hildebrand.cz/ExtSense.zip

All ideas how to improve it will be very appreciated. I can then tweak generator to support it.
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 09:48 PM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.