|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
Something else of interest that may help on this.
See the pic for details. |
|
#4
|
|||
|
|||
|
Any chance the same would apply for 2005? Yes, I know. I'm behind the times.
![]() Great work. Look forward to seeing your progress. |
|
#5
|
|||
|
|||
|
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.
|
|
#6
|
|||
|
|||
|
@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. |
|
#7
|
||||
|
||||
|
Quote:
![]()
__________________
ExtJsExtender Controls http://www.extendersamples.qsh.eu My Blog http://rodiniz.blogspot.com |
|
#8
|
|||
|
|||
|
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; /// <reference path="Extjs_Intellisense.js" /> Then it would never be run but you would have your Extjs code completion, etc. Best, Shawn |
|
#9
|
|||
|
|||
|
Looks great, does anyone know how to get this working in Eclipse (Aptana)?
|
|
#10
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
|
|