SlideShare una empresa de Scribd logo
1 de 43
Supporting JavaScript Toolkits with JSDT Chuck Bridgham, WTP Java EE Project Lead, PMC [email_address] Nitin Dahyabhai, WTP SSE, JSDT Project Lead [email_address]
JavaScript Development Tools ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why not our original tools? ,[object Object]
Why not our original editor? ,[object Object],[object Object],[object Object]
Why not our original editor? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where did JSDT come from? ,[object Object]
Where did JSDT come from? ,[object Object],[object Object]
Where did JSDT come from? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where did JSDT come from? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where did JSDT come from? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
So why is Java suited for IDE support? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How is JavaScript unlike Java?
How is JavaScript unlike Java? ,[object Object]
How is JavaScript unlike Java? ,[object Object],[object Object]
How is JavaScript unlike Java? ,[object Object],[object Object],[object Object]
How is JavaScript unlike Java? ,[object Object],[object Object],[object Object],[object Object]
How is JavaScript unlike Java? ,[object Object],[object Object],[object Object],[object Object],[object Object]
How is JavaScript unlike Java? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Include Paths ,[object Object]
Include Paths ,[object Object],[object Object]
Include Paths ,[object Object],[object Object],[object Object]
Include Paths ,[object Object],[object Object],[object Object],[object Object],[object Object]
It’s still not Java ,[object Object]
It’s still not Java ,[object Object],[object Object]
It’s still not Java ,[object Object],[object Object],[object Object]
That can be a good thing.  ,[object Object],[object Object],[object Object]
Type Inference ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Type Inference – the model ,[object Object],[object Object],[object Object],[object Object],[object Object]
Type Inference – the model ,[object Object],[object Object],[object Object]
Type Inference – the model ,[object Object],[object Object],[object Object]
Type Inference ,[object Object]
Type Inference ,[object Object],[object Object],[object Object],[object Object]
Supporting Documentation
Supporting Documentation ,[object Object]
Supporting Documentation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What’s upcoming? ,[object Object]
What’s upcoming? ,[object Object],[object Object]
What’s upcoming? ,[object Object],[object Object],[object Object]
What’s upcoming? ,[object Object],[object Object],[object Object],[object Object]
What’s upcoming? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Want to get involved? ,[object Object],[object Object],[object Object],[object Object]
Thanks!
Legal Notices ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

Destacado

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Eclipsecon 2011 Supporting javascript toolkits with jsdt

Notas del editor

  1. This is “Supporting Javascript Toolkits – and its intended for developers to discover the underlying JSDT framework, and also the available extensions required to support the various Javascript toolkits and libraries.
  2. WTP’s Original Javascript editor – Available in WTP 2.0 (Europa) - based on WTP’s SSE Framework
  3. The original editor, based on WTP’s source editor framework, - provided simple syntax coloring, content assist on a limited list of well know browser objects. - It supported not only JS files, but also integration within the existing HTML and JSP editors
  4. But restrictions start to pile up: - The editor provided no pluggable facility to upgrade syntax level as Javascript versions were released, - There was no extension mechanism for adding more objects / classes/ functions/ libraries. - No model existed to help provide features such as advanced content assist, hover help, refactoring, any meaningful semantic validation
  5. JSDT began as a project by a small team within IBM Research. It became part of the Eclipse ATF project right around the time we started turning a critical eye to WTP’s JavaScript support and finding it lacking when it came to real world scenarios. JSDT’s abilities already surpassed what was in WTP 2.0, and once it was able to provide a similar level of integration with the other source editors, it was moved from ATF to become part of the WTP 3.0 release
  6. As with many IDEs built on top of Eclipse, JSDT followed the tried-and-true route of starting as a fork from the JDT sources, in this case from a late JDT 3.3 milestone.
  7. Among other changes, - parser was modified to support JavaScript syntax, - the compiler altered to not write out byte codes , - the Semantic analyzer and Search was updated, - the type resolution in the compiler altered to support the less stringent demands of JavaScript.
  8. The core jsdt package has only the platform as a pre-req.
  9. Components (Features) from WTP’s Common and Source Editing projects that support editing web pages also include the necessary plug-ins for integrating JSDT.
  10. Java, in many ways, is designed for IDE support. A statically typed language, a Java compiler can relatively easily determine the type of a variable, and find whether a message being sent will be understood by that variable, or whether a field access will actually resolve properly. The evaluation of expressions is clearly defined for a given set of operands. Methods can only be defined to return objects of one type or satisfying one interface. The ordered classpath and source file layout ensure that for a given fully qualified type name, the matching source or binary file must be in one location relative to an entry in the classpath, which must searched in that order. All of the members of a type must also be defined in that single file or otherwise inherited from a supertype listed with the type declaration, for which there is a reserved keyword.
  11. The dynamic (“duck”) typing allows for incredibly expressive and functional code to be written a very compact form. I come from a smalltalk background, and loved the elegance and simplicity But, this freedom can be daunting for programmers used to static type restrictions, and increasingly hard to navigate as the code base grows ever larger.
  12. So how does JSDT tackle these “shortcomings” in the language to provide a high quality experience similar to that provided by JDT, but for JavaScript?
  13. JavaScript doesn’t define a standard for how to work with content across multiple files. Web pages can define which script files they use statically.
  14. or have that list of inclusions modified through client-side scripting or server-side scripting
  15. The solution JSDT employs is to reuse the familiar JDT Build Path model, this time an an Include Path for folders whose files’ contents are simply always known to each other.
  16. JSDT thus also inherits JDT’s support allowing plug-ins to contribute reusable libraries and containers to simplify working within teams.
  17. the APIs for looking up types no longer restrict results with the expectation that a type be represented in one file—the model returns as many types of the same name as there are files declaring them,
  18. or properties of them based on information provided from the inference engine - So what is an Inference engine?
  19. Whether someone thinks JavaScript has or doesn’t have Types, it’s still a useful approach to working with source code in an IDE. A Java compiler, in one of its earlier stages, will convert the source into an Abstract Syntax Tree (AST). This representation models the types, methods, and fields, all the way down to individual statements and the expressions that compose them. The expressions declare which types are in use. JSDT also creates an AST, but then attempts to perform type inference using static analysis of the syntax tree along with any inline documentation. Common coding practices are recognized and used to infer types and their properties, those findings then used to drive IDE functions such as the Outline view, Content Assist, explorer views, and Search. This analysis is encapsulated in what we refer to as an Inference Engine . JSDT’s built-in inference engine recognizes the prototype keyword, types of literals, constructor-like usage of functions, type information documented using JSDoc, and more cases I won’t list here. It’s at this point that JSDT’s support for AJAX toolkits falters, many libraries having a unique or specific way to define types that eludes detection by our inference engine. And here’s where the most significant of our extension points comes into play: org.eclipse.wst.jsdt.core.inferrenceSupport
  20. This extension point allows a plug-in developer to contribute their own Inference Engine to run on a file for analysis. That engine has access to the internal compiler AST, allowing it to add inferred types and members to JSDT’s knowledge of a particular file.   org.eclipse.wst.jsdt.core.infer.IInferEngine – the interface all inference engines must implement org.eclipse.wst.jsdt.core.infer.InferEngine – our default implementation, largely built as an ASTVisitor. org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration – an object that provides the inference engines access to a single file’s location
  21. org.eclipse.wst.jsdt.core.infer.InferredType – represents a “type” as a JavaScript developer might think of it. If a toolkit doesn’t use constructor functions directly, an engine can still add types so that they’re available for content assist and search. An inferred type is limited to knowing the fields and methods contained in the one file that the CompilationUnitDeclaration holds. InferredTypes are expected to be added for all referenced types and all declared types, even if it’s just for adding one property to a type that’s formally declared in a different file. Types that don’t have names (object literals) should also be added for completeness.
  22. org.eclipse.wst.jsdt.core.infer.InferredMethod – represents any property of an object that points to a function by encapsulating that function expression. Different InferredMethods on different InferredTypes are allowed to point to the same function. Static analysis of the function and its documentation is used by the inference engine to set up type information for the method’s return type and argument types
  23. org.eclipse.wst.jsdt.core.infer.InferredAttribute – a property of an object that is not a function, static analysis and documentation is used by the inference engine to set up type information for the attribute.
  24. When JSDT is indexing your sources, it’s using these objects to help populate its Search Index. They’re also converted, as needed, into the IJavaScriptElements used to populate JSDT’s model and shown throughout JSDT’s UI. The declared engines have the critically important duty of thoroughly finding all of the declared types and picking the right offsets for the name of the inferred types and members, as that will be used when navigating with hyper-links, showing search results, and eventually proper Refactoring support. Without good engines, all you really get is syntax coloring.
  25. Multiple inference engines can be run on the same file, allowing for the supporting of mixed coding styles and the derivation of type information from any number of inline documentation formats. Work is ongoing in the area of getting engines to coexist properly, and avoid duplicating both results and performance problems.
  26. JSDT offers a general view for rendering documentation written in JSDoc, a format chosen in part because it is not tied to a particular toolkit and also for its resemblance to JavaDoc.
  27. Tellingly, it’s not called the JSDoc view because as with the type inference mechanism, JSDT doesn’t assume that all documentation is written as JSDoc.
  28. Enter the org.eclipse.wst.jsdt.ui.documentationProvider extension point. This extension point allows a plug-in developer to contribute a class for providing the text documentation associated with a type or member, as well as for rendering it into HTML for use in the Documentation view--an implementer of org.eclipse.wst.jsdt.ui.IDocumentationReader It is expected to provide a Reader for the documentation text as well as a Reader for the documentation text converted into HTML for a styled display.
  29. “ Some” upgrades to ECMA5 will be finished by Indigo
  30. Validation: working on filtering out problems in JSDT for unresolved fields/methods/types, duplicate variables JavaScript has a single function scope
  31. Links: http://wiki.eclipse.org/index.php/JSDT http://www.ibm.com/developerworks/library/os-eclipse-jsdt/
  32. Links: http://wiki.eclipse.org/index.php/JSDT http://www.ibm.com/developerworks/library/os-eclipse-jsdt/