├── .gitignore ├── .hgignore ├── README.md ├── epl-v10.html ├── resources └── logo │ ├── logo.icns │ ├── logo.ico │ ├── logo_128.png │ ├── logo_16.png │ ├── logo_256.png │ ├── logo_32.png │ ├── logo_48.png │ └── logo_64.png ├── src ├── .project ├── .settings │ └── org.eclipse.m2e.core.prefs ├── com.axmor.eclipse.typescript.builder │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── plugin.xml │ ├── pom.xml │ └── src │ │ └── com │ │ └── axmor │ │ └── eclipse │ │ └── typescript │ │ └── builder │ │ ├── Activator.java │ │ ├── builder │ │ ├── AddTypeScriptSupportHandler.java │ │ ├── IResourceVisitorHelper.java │ │ ├── RemoveTypeScriptSupportHandler.java │ │ ├── TypescriptBuilder.java │ │ └── TypescriptNature.java │ │ ├── i18n │ │ ├── Messages.java │ │ └── messages.properties │ │ └── ui │ │ └── TypescriptProjectPropertiesPage.java ├── com.axmor.eclipse.typescript.core.test │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── pom.xml │ ├── resources │ │ └── assets-1.0 │ │ │ ├── module1.ts │ │ │ └── module2.ts │ └── src │ │ └── com │ │ └── axmor │ │ └── eclipse │ │ └── typescript │ │ └── core │ │ └── test │ │ ├── IndexerJobTest.java │ │ └── bridge │ │ └── TSBridge10Test.java ├── com.axmor.eclipse.typescript.core │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── lib │ │ ├── guava-16.0.jar │ │ ├── libthrift-0.9.2.jar │ │ ├── mapdb-1.0.7.jar │ │ ├── resty-0.3.2.jar │ │ ├── slf4j-api-1.5.8.jar │ │ ├── slf4j-simple-1.5.8.jar │ │ └── typescript-bridge │ │ │ ├── .project │ │ │ ├── .settings │ │ │ └── com.axmor.eclipse.typescript.bridge.prefs │ │ │ ├── js │ │ │ ├── args.js │ │ │ ├── bridge.js │ │ │ ├── gen-nodejs │ │ │ │ ├── TSBridgeService.js │ │ │ │ └── bridge_types.js │ │ │ ├── host.js │ │ │ ├── log.js │ │ │ ├── new_bridge.js │ │ │ ├── path-util.js │ │ │ ├── service.js │ │ │ ├── test.js │ │ │ └── thrift │ │ │ │ ├── binary.js │ │ │ │ ├── bridge.thrift │ │ │ │ ├── connection.js │ │ │ │ ├── gen-java │ │ │ │ └── TSBridgeService.java │ │ │ │ ├── index.js │ │ │ │ ├── node-int64.js │ │ │ │ ├── protocol.js │ │ │ │ ├── q.js │ │ │ │ ├── server.js │ │ │ │ ├── thrift.js │ │ │ │ └── transport.js │ │ │ ├── node │ │ │ └── node.d.ts │ │ │ ├── src │ │ │ ├── args.ts │ │ │ ├── bridge.ts │ │ │ ├── host.ts │ │ │ ├── log.ts │ │ │ ├── new_bridge.ts │ │ │ ├── path-util.ts │ │ │ ├── service.ts │ │ │ └── test.ts │ │ │ └── ts │ │ │ ├── lib.core.d.ts │ │ │ ├── lib.core.es6.d.ts │ │ │ ├── lib.d.ts │ │ │ ├── lib.dom.d.ts │ │ │ ├── lib.es6.d.ts │ │ │ ├── lib.scriptHost.d.ts │ │ │ ├── lib.webworker.d.ts │ │ │ ├── typescript.d.ts │ │ │ ├── typescriptServices.d.ts │ │ │ └── typescriptServices.js │ ├── plugin.xml │ ├── pom.xml │ └── src │ │ └── com │ │ └── axmor │ │ └── eclipse │ │ └── typescript │ │ └── core │ │ ├── Activator.java │ │ ├── TypeScriptAPI.java │ │ ├── TypeScriptAPIFactory.java │ │ ├── TypeScriptCompilerSettings.java │ │ ├── TypeScriptEditorSettings.java │ │ ├── TypeScriptResources.java │ │ ├── TypeScriptSettingsInitializer.java │ │ ├── TypeScriptUtils.java │ │ ├── i18n │ │ ├── Messages.java │ │ └── messages.properties │ │ ├── index │ │ ├── IndexInfo.java │ │ ├── IndexJob.java │ │ ├── TypeScriptIndexManager.java │ │ └── TypeScriptIndexer.java │ │ ├── internal │ │ ├── TSBridgeService.java │ │ ├── TypeScriptAPIImpl.java │ │ └── TypeScriptBridge.java │ │ └── ui │ │ ├── ErrorDialog.java │ │ ├── SWTFactory.java │ │ ├── TypeScriptElementSelectionDialog.java │ │ ├── TypescriptEditorPreferencePage.java │ │ └── TypescriptWorkbenchPreferencePage.java ├── com.axmor.eclipse.typescript.debug.ui │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── icons │ │ ├── main_tab.gif │ │ ├── ts_app.png │ │ ├── ts_web_app.png │ │ └── typecs16.png │ ├── plugin.xml │ ├── pom.xml │ └── src │ │ └── com │ │ └── axmor │ │ └── eclipse │ │ └── typescript │ │ └── debug │ │ └── ui │ │ ├── Activator.java │ │ ├── DebugUIConstants.java │ │ ├── launching │ │ ├── LaunchStandaloneConfigurationTabGroup.java │ │ ├── LaunchStandaloneMainTab.java │ │ ├── LaunchWebConfigurationTabGroup.java │ │ └── LaunchWebMainTab.java │ │ └── model │ │ ├── TypeScriptBreakpointAdapter.java │ │ ├── TypeScriptBreakpointAdapterFactory.java │ │ └── TypeScriptModelPresentation.java ├── com.axmor.eclipse.typescript.debug │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── plugin.xml │ ├── pom.xml │ └── src │ │ └── com │ │ └── axmor │ │ └── eclipse │ │ └── typescript │ │ └── debug │ │ ├── Activator.java │ │ ├── DebugUtils.java │ │ ├── JavaScriptVmSynchronizer.java │ │ ├── console │ │ ├── ICommandHandler.java │ │ ├── ScriptConsolePartitioner.java │ │ ├── TypeScriptConsoleDocumentListener.java │ │ ├── TypeScriptConsoleManager.java │ │ ├── TypeScriptConsolePage.java │ │ ├── TypeScriptConsoleViewer.java │ │ ├── TypescriptConsole.java │ │ ├── TypescriptConsoleFactory.java │ │ └── TypescriptConsoleInterpreter.java │ │ ├── launching │ │ ├── LaunchStandaloneConfigurationDelegate.java │ │ ├── LaunchWebConfigurationDelegate.java │ │ ├── TypeScriptDebugConstants.java │ │ ├── TypeScriptSourceLookupDirector.java │ │ ├── TypeScriptSourceLookupParticipant.java │ │ └── TypeScriptSourcePathComputerDelegate.java │ │ ├── model │ │ ├── AbstractTypeScriptDebugTarget.java │ │ ├── ArrayValue.java │ │ ├── TypeScriptDebugElement.java │ │ ├── TypeScriptDebugTarget.java │ │ ├── TypeScriptDebugThread.java │ │ ├── TypeScriptLineBreakpoint.java │ │ ├── TypeScriptStackFrame.java │ │ ├── Value.java │ │ ├── ValueBase.java │ │ └── Variable.java │ │ └── sourcemap │ │ ├── SourceMap.java │ │ ├── SourceMapItem.java │ │ └── SourceMapParser.java ├── com.axmor.eclipse.typescript.editor │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── css │ │ ├── JavadocHoverStyleSheet.css │ │ ├── JavadocViewStyleSheet.css │ │ └── e4-dark_typecs_syntaxhighlighting.css │ ├── icons │ │ ├── full │ │ │ ├── call_hierarchy.gif │ │ │ ├── class_obj.gif │ │ │ ├── constr_ovr.gif │ │ │ ├── dtool16 │ │ │ │ ├── mark_occurrences.gif │ │ │ │ └── mark_occurrences.png │ │ │ ├── enum_obj.gif │ │ │ ├── enum_private_obj.gif │ │ │ ├── etool16 │ │ │ │ ├── mark_occurrences.gif │ │ │ │ └── mark_occurrences.png │ │ │ ├── field_default_obj.gif │ │ │ ├── field_private_obj.gif │ │ │ ├── field_public_obj.gif │ │ │ ├── implm_co.gif │ │ │ ├── innerclass_default_obj.gif │ │ │ ├── innerclass_private_obj.gif │ │ │ ├── innerclass_public_obj.gif │ │ │ ├── innerinterface_default_obj.gif │ │ │ ├── innerinterface_private_obj.gif │ │ │ ├── innerinterface_public_obj.gif │ │ │ ├── int_default_obj.gif │ │ │ ├── int_obj.gif │ │ │ ├── methdef_obj.gif │ │ │ ├── methpri_obj.gif │ │ │ ├── methpub_obj.gif │ │ │ ├── over_co.gif │ │ │ ├── package_obj.gif │ │ │ ├── recursive_co.gif │ │ │ ├── search_ref_obj.gif │ │ │ ├── static_co.gif │ │ │ ├── template_obj.png │ │ │ ├── typedef_obj.gif │ │ │ ├── typepri_obj.gif │ │ │ ├── typepub_obj.gif │ │ │ └── warning_co.gif │ │ ├── typescript_def_file.png │ │ └── typescript_file.png │ ├── plugin.xml │ ├── pom.xml │ ├── src │ │ └── com │ │ │ └── axmor │ │ │ └── eclipse │ │ │ └── typescript │ │ │ └── editor │ │ │ ├── Activator.java │ │ │ ├── DelayedDocumentListener.java │ │ │ ├── IDocumentProcessor.java │ │ │ ├── ImageDescriptorRegistry.java │ │ │ ├── QuickOutlineMouseMoveListener.java │ │ │ ├── SmartSemicolonAutoEditStrategy.java │ │ │ ├── TypeScriptAutoIndentStrategy.java │ │ │ ├── TypeScriptContentOutlinePage.java │ │ │ ├── TypeScriptDocumentProvider.java │ │ │ ├── TypeScriptEditor.java │ │ │ ├── TypeScriptEditorActionContributor.java │ │ │ ├── TypeScriptEditorConfiguration.java │ │ │ ├── TypeScriptEditorUtils.java │ │ │ ├── TypeScriptElementHyperlink.java │ │ │ ├── TypeScriptElementHyperlinkDetector.java │ │ │ ├── TypeScriptImageDescriptor.java │ │ │ ├── TypeScriptOutlineContentProvider.java │ │ │ ├── TypeScriptOutlineLabelProvider.java │ │ │ ├── TypeScriptProjectionViewer.java │ │ │ ├── TypeScriptQuickOutlineDialog.java │ │ │ ├── TypeScriptReconcilingStrategy.java │ │ │ ├── TypeScriptSourceInfoProvider.java │ │ │ ├── TypeScriptUIImages.java │ │ │ ├── actions │ │ │ ├── Messages.java │ │ │ ├── ToggleMarkOccurrencesAction.java │ │ │ └── messages.properties │ │ │ ├── color │ │ │ └── ColorManager.java │ │ │ ├── compare │ │ │ ├── TypeScriptBracketInserter.java │ │ │ ├── TypeScriptMergeViewer.java │ │ │ ├── TypeScriptMergeViewerCreator.java │ │ │ ├── TypeScriptViewer.java │ │ │ └── TypeScriptViewerCreator.java │ │ │ ├── contentassist │ │ │ ├── TypeScriptAssistProcessor.java │ │ │ ├── TypeScriptCompletionProposal.java │ │ │ ├── TypeScriptContextInformation.java │ │ │ └── TypeScriptContextInformationValidator.java │ │ │ ├── definitions │ │ │ ├── AddTypeScriptDefinitionDialog.java │ │ │ ├── TypeScriptDefinition.java │ │ │ ├── TypeScriptDefinitionLabelProvider.java │ │ │ └── TypeScriptDefinitionsLoader.java │ │ │ ├── handlers │ │ │ ├── AddTypeScriptDefinitionHandler.java │ │ │ ├── CallHierarchyHandler.java │ │ │ ├── FindReferencesHandler.java │ │ │ ├── FormatCodeHandler.java │ │ │ ├── OpenDeclarationHandler.java │ │ │ ├── OpenTypeHandler.java │ │ │ ├── QuickOutlineHandler.java │ │ │ ├── QuickRenameHandler.java │ │ │ ├── RenameCodeHandler.java │ │ │ └── ToggleCommentHandler.java │ │ │ ├── hierarchy │ │ │ ├── CallHierarchyViewPart.java │ │ │ ├── TreeRoot.java │ │ │ ├── TypeScriptHierarchyContentProvider.java │ │ │ ├── TypeScriptHierarchyUI.java │ │ │ └── TypeScriptHierarchyViewer.java │ │ │ ├── hover │ │ │ └── TypeScriptTextHover.java │ │ │ ├── occurrence │ │ │ ├── OccurrencesFinderJob.java │ │ │ └── OccurrencesFinderJobCanceler.java │ │ │ ├── parser │ │ │ ├── JavaDocCommentRuler.java │ │ │ ├── SingleTokenScanner.java │ │ │ ├── SymbolRule.java │ │ │ ├── TypeScriptImageKeys.java │ │ │ ├── TypeScriptKeywordRuler.java │ │ │ ├── TypeScriptModelKinds.java │ │ │ ├── TypeScriptPartitionScanner.java │ │ │ ├── TypeScriptSyntaxScanner.java │ │ │ ├── TypeScriptTokenConstants.java │ │ │ └── TypeScriptWhitespaceDetector.java │ │ │ ├── preferences │ │ │ ├── ColorEditor.java │ │ │ ├── OverlayPreferenceStore.java │ │ │ ├── SyntaxPreviewCode.txt │ │ │ ├── TypescriptPreferenceInitializer.java │ │ │ ├── TypescriptPreviewerUpdater.java │ │ │ ├── TypescriptSyntaxColoringPage.java │ │ │ ├── TypescriptTemplateAccess.java │ │ │ ├── TypescriptTemplateContextType.java │ │ │ └── TypescriptTemplatePreferencePage.java │ │ │ ├── rename │ │ │ ├── QuickRenameAssistProposal.java │ │ │ ├── RenameInfo.java │ │ │ ├── RenameInputPage.java │ │ │ ├── RenameProcessor.java │ │ │ └── RenameWizard.java │ │ │ ├── search │ │ │ ├── TypeScriptOpenTypeSelectionDialog.java │ │ │ ├── TypeScriptSearchQuery.java │ │ │ ├── TypeScriptSearchResult.java │ │ │ └── TypeScriptSearchResultPage.java │ │ │ ├── semantichighlight │ │ │ ├── TypeScriptPresentationReconciler.java │ │ │ ├── TypeScriptSemanticHighlighting.java │ │ │ ├── TypeScriptSemanticHighlightings.java │ │ │ ├── TypeScriptSemanticManager.java │ │ │ ├── TypeScriptSemanticPresenter.java │ │ │ └── TypeScriptSemanticReconciler.java │ │ │ └── wizards │ │ │ ├── NewClassCode.txt │ │ │ ├── NewClassWizard.java │ │ │ └── NewClassWizardPage.java │ └── templates │ │ ├── typescript-default.properties │ │ └── typescript-default.xml ├── com.axmor.eclipse.typescript.feature │ ├── .project │ ├── .settings │ │ └── org.eclipse.m2e.core.prefs │ ├── build.properties │ ├── epl-v10.html │ ├── feature.properties │ ├── feature.xml │ └── pom.xml ├── com.axmor.eclipse.typescript.repository │ ├── .project │ ├── .settings │ │ └── org.eclipse.m2e.core.prefs │ ├── category.xml │ └── pom.xml ├── com.axmor.eclipse.typescript.ui │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── icons │ │ └── typecs16.png │ ├── plugin.xml │ ├── pom.xml │ └── src │ │ └── com │ │ └── axmor │ │ └── eclipse │ │ └── typescript │ │ ├── PerspectiveFactory.java │ │ └── ui │ │ ├── Activator.java │ │ └── Startup.java ├── com.axmor.eclipse.typescript │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── about.ini │ ├── build.properties │ ├── pom.xml │ ├── typecs.png │ └── typecs16.png └── pom.xml └── tools ├── EclipseTypeScript-checkstyle.xml ├── EclipseTypeScript-codetemplates.xml └── EclipseTypeScript.xml /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | target/ 3 | \.checkstyle 4 | tools/axmor.keystore 5 | src\com.axmor.eclipse.typescript.editor\.settings\org.eclipse.jdt.ui.prefs 6 | *.js.map 7 | .settings -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax:regexp 2 | .*/bin/ 3 | .*/target/ 4 | .*\.orig 5 | .*/\.checkstyle 6 | tools/axmor.keystore 7 | src\com.axmor.eclipse.typescript.editor\.settings\org.eclipse.jdt.ui.prefs -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Gitter chat](https://badges.gitter.im/axmor/typecs.png)](https://gitter.im/axmor/typecs) [![Issue Stats](http://issuestats.com/github/axmor/typecs/badge/issue)](http://issuestats.com/github/axmor/typecs) [![Build Status](https://drone.io/github.com/axmor/typecs/status.png)](https://drone.io/github.com/axmor/typecs/latest) Drag to your running Eclipse workspace to install TypEcs 2 | 3 | # Installation 4 | 5 | 0. Required software: Java 7, [Eclipse Kepler 4.3](http://www.eclipse.org/kepler/) or higher, [Node.js](http://nodejs.org/). 6 | 1. In Eclipse go to **Help → Install New Software...** 7 | 2. Provide the installation location `http://axmor.github.io/typecs/stable/update-site/` 8 | 3. Mark the plugin version you would like to install then press **Next...** 9 | 4. On **Install Details** press **Next...** 10 | 5. Review and confirm the plugin to install. 11 | 6. Restart Eclipse. 12 | 13 | # New and Noteworthy 14 | 15 | * [v4.0 - New and Noteworthy](https://github.com/axmor/typecs/wiki/4.0 - New and Noteworthy) 16 | * [v3.0 - New and Noteworthy](https://github.com/axmor/typecs/wiki/3.0 - New and Noteworthy) 17 | * [v2.0 - New and Noteworthy](https://github.com/axmor/typecs/wiki/2.0 - New and Noteworthy) 18 | * [v1.5 - New and Noteworthy](https://github.com/axmor/typecs/wiki/1.5 - New and Noteworthy) 19 | 20 | # Plugin Features 21 | 22 | * NodeJS and WebRemote Debug Support 23 | * Syntax highlighting 24 | * Code Completion 25 | * Code Outline 26 | * Find References 27 | * Rename / Refactor 28 | * Open Type 29 | * Code Compilation 30 | * Format Code 31 | * Comment Code 32 | * Open Declaration 33 | 34 | [Features Details](https://github.com/axmor/typecs/wiki/Features-Details) 35 | 36 | # Development builds 37 | [![Build Status](https://drone.io/github.com/axmor/typecs/status.png)](https://drone.io/github.com/axmor/typecs/latest) 38 | 39 | [Zipped Update Site](https://drone.io/github.com/axmor/typecs/files/src/com.axmor.eclipse.typescript.repository/target/com.axmor.eclipse.typescript.repository-4.0.0-SNAPSHOT.zip) 40 | -------------------------------------------------------------------------------- /resources/logo/logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo.icns -------------------------------------------------------------------------------- /resources/logo/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo.ico -------------------------------------------------------------------------------- /resources/logo/logo_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo_128.png -------------------------------------------------------------------------------- /resources/logo/logo_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo_16.png -------------------------------------------------------------------------------- /resources/logo/logo_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo_256.png -------------------------------------------------------------------------------- /resources/logo/logo_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo_32.png -------------------------------------------------------------------------------- /resources/logo/logo_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo_48.png -------------------------------------------------------------------------------- /resources/logo/logo_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/resources/logo/logo_64.png -------------------------------------------------------------------------------- /src/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | product 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.builder 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | net.sf.eclipsecs.core.CheckstyleBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | net.sf.eclipsecs.core.CheckstyleNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.7 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: TypEcs Builder Plugin 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.builder;singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Activator: com.axmor.eclipse.typescript.builder.Activator 7 | Bundle-Vendor: Axmor Software Inc. 8 | Require-Bundle: org.eclipse.ui, 9 | org.eclipse.core.runtime, 10 | org.eclipse.core.resources, 11 | org.eclipse.core.filesystem;bundle-version="1.3.200", 12 | com.axmor.eclipse.typescript.core, 13 | org.eclipse.ui.ide, 14 | org.eclipse.core.expressions;bundle-version="3.4.500" 15 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 16 | Bundle-ActivationPolicy: lazy 17 | Export-Package: com.axmor.eclipse.typescript.builder.builder 18 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | build.properties 7 | jre.compilation.profile = JavaSE-1.7 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.builder 13 | eclipse-plugin 14 | 15 | TypEcs Builder Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/src/com/axmor/eclipse/typescript/builder/Activator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | 9 | package com.axmor.eclipse.typescript.builder; 10 | 11 | import org.eclipse.core.runtime.Status; 12 | import org.eclipse.jface.resource.ImageDescriptor; 13 | import org.eclipse.ui.plugin.AbstractUIPlugin; 14 | import org.osgi.framework.BundleContext; 15 | 16 | /** 17 | * The activator class controls the plug-in life cycle. 18 | * 19 | * @author Konstantin Zaitcev 20 | */ 21 | public class Activator extends AbstractUIPlugin { 22 | 23 | /** The plug-in ID. */ 24 | public static final String PLUGIN_ID = "com.axmor.eclipse.typescript.builder"; //$NON-NLS-1$ 25 | 26 | /** The shared instance. */ 27 | private static Activator plugin; 28 | 29 | /** 30 | * The constructor. 31 | */ 32 | public Activator() { 33 | } 34 | 35 | @Override 36 | public void start(BundleContext context) throws Exception { 37 | super.start(context); 38 | plugin = this; 39 | } 40 | 41 | @Override 42 | public void stop(BundleContext context) throws Exception { 43 | plugin = null; 44 | super.stop(context); 45 | } 46 | 47 | /** 48 | * Returns the shared instance. 49 | * 50 | * @return the shared instance 51 | */ 52 | public static Activator getDefault() { 53 | return plugin; 54 | } 55 | 56 | /** 57 | * Returns an image descriptor for the image file at the given plug-in relative path. 58 | * 59 | * @param path 60 | * the path 61 | * @return the image descriptor 62 | */ 63 | public static ImageDescriptor getImageDescriptor(String path) { 64 | return imageDescriptorFromPlugin(PLUGIN_ID, path); 65 | } 66 | 67 | /** 68 | * Sends exception to error log. 69 | * 70 | * @param e 71 | * exception 72 | */ 73 | public static void error(Exception e) { 74 | plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, e.getMessage(), e)); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/src/com/axmor/eclipse/typescript/builder/builder/IResourceVisitorHelper.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.builder.builder; 2 | 3 | import org.eclipse.core.resources.IResource; 4 | import org.eclipse.core.resources.IResourceDelta; 5 | import org.eclipse.core.resources.IResourceDeltaVisitor; 6 | import org.eclipse.core.resources.IResourceVisitor; 7 | import org.eclipse.core.runtime.CoreException; 8 | 9 | /** 10 | * Helper class that enables to use {@link IResourceVisitor} the same way with both 11 | * {@link IResource} and {@link IResourceDelta} 12 | * 13 | * @author Ats Uiboupin 14 | */ 15 | class IResourceVisitorHelper { 16 | private final IResourceVisitor visitor; 17 | 18 | IResourceVisitorHelper(IResourceVisitor visitor) { 19 | this.visitor = visitor; 20 | } 21 | 22 | void accept(IResource res) { 23 | try { 24 | res.accept(visitor); 25 | } catch (CoreException e) { 26 | throw new RuntimeException("Failed to visit resource " + res + " using visitor " + visitor, e); 27 | } 28 | } 29 | 30 | void accept(IResourceDelta delta) throws CoreException { 31 | delta.accept(new IResourceDeltaVisitor() { 32 | @Override 33 | public boolean visit(IResourceDelta delta) throws CoreException { 34 | return visitor.visit(delta.getResource()); 35 | } 36 | }); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/src/com/axmor/eclipse/typescript/builder/i18n/Messages.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.builder.i18n; 9 | 10 | import org.eclipse.osgi.util.NLS; 11 | 12 | /** 13 | * @author Konstantin Zaitcev 14 | * 15 | */ 16 | public class Messages extends NLS { 17 | private static final String BUNDLE_NAME = "com.axmor.eclipse.typescript.builder.i18n.messages"; //$NON-NLS-1$ 18 | public static String ProjectPrefPage_browseButton; 19 | public static String ProjectPrefPage_compileSection; 20 | public static String ProjectPrefPage_declaration; 21 | public static String ProjectPrefPage_generationSection; 22 | public static String ProjectPrefPage_mapRootLabel; 23 | public static String ProjectPrefPage_moduleLabel; 24 | public static String ProjectPrefPage_noImlicitAny; 25 | public static String ProjectPrefPage_noResolve; 26 | public static String ProjectPrefPage_removeComments; 27 | public static String ProjectPrefPage_rootSelectionDesc; 28 | public static String ProjectPrefPage_rootSelectionTitle; 29 | public static String ProjectPrefPage_sourceLabel; 30 | public static String ProjectPrefPage_sourceMap; 31 | public static String ProjectPrefPage_sourceSelectionDesc; 32 | public static String ProjectPrefPage_sourceSelectionTitle; 33 | public static String ProjectPrefPage_targetLabel; 34 | public static String ProjectPrefPage_targetRelativePathBasedOnSource; 35 | public static String ProjectPrefPage_targetSelectionDesc; 36 | public static String ProjectPrefPage_targetSelectionTitle; 37 | public static String ProjectPrefPage_targetVersion; 38 | public static String ProjectPrefPage_title; 39 | static { 40 | // initialize resource bundle 41 | NLS.initializeMessages(BUNDLE_NAME, Messages.class); 42 | } 43 | 44 | private Messages() { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.builder/src/com/axmor/eclipse/typescript/builder/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | ProjectPrefPage_browseButton=&Browse... 2 | ProjectPrefPage_compileSection=Compilation 3 | ProjectPrefPage_declaration=Generate corresponding .d.ts file 4 | ProjectPrefPage_generationSection=Generation 5 | ProjectPrefPage_mapRootLabel=Specifies the location where debugger should look for map files instead of\ngenerated locations 6 | ProjectPrefPage_moduleLabel=Specify module code generation: 7 | ProjectPrefPage_noImlicitAny=Warn on expressions and declarations with an implied 'any' type 8 | ProjectPrefPage_noResolve=Skip resolution and preprocessing 9 | ProjectPrefPage_removeComments=Do not emit comments to output 10 | ProjectPrefPage_rootSelectionDesc=Select the target folder or file: 11 | ProjectPrefPage_rootSelectionTitle=Folder Selection 12 | ProjectPrefPage_sourceLabel=Source directory or file: 13 | ProjectPrefPage_sourceMap=Generate corresponding .map file 14 | ProjectPrefPage_sourceSelectionDesc=Select the source folder or file: 15 | ProjectPrefPage_sourceSelectionTitle=Source Selection 16 | ProjectPrefPage_targetLabel=Target directory or file: 17 | ProjectPrefPage_targetRelativePathBasedOnSource=Set relative path from target directory to output file based on relative path from source directory to input file 18 | ProjectPrefPage_targetSelectionDesc=Select the target folder or file: 19 | ProjectPrefPage_targetSelectionTitle=Target Selection 20 | ProjectPrefPage_targetVersion=Specify ECMAScript target version: 21 | ProjectPrefPage_title=This page allows you to configure TypeScript compiler options 22 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.core.test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | net.sf.eclipsecs.core.CheckstyleBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | net.sf.eclipsecs.core.CheckstyleNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.7 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.7 12 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: TypEcs Core Test Plugin 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.core.test;singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Vendor: Axmor Software Inc. 7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 8 | Fragment-Host: com.axmor.eclipse.typescript.core 9 | Require-Bundle: org.junit;bundle-version="4.11.0" 10 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | build.properties 6 | jre.compilation.profile = JavaSE-1.7 7 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.core.test 13 | eclipse-test-plugin 14 | 15 | TypEcs Core Test Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/resources/assets-1.0/module1.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstract class for user 3 | */ 4 | class User { 5 | // First name 6 | public firstName: string; 7 | // Last name 8 | public lastName: string; 9 | 10 | getFullName(): string { 11 | return this.firstName + this.lastName; 12 | } 13 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/resources/assets-1.0/module2.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | class User1 extends User { 4 | constructor () { 5 | super(); 6 | this.firstName = "User"; 7 | this.lastName = "User1"; 8 | } 9 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/src/com/axmor/eclipse/typescript/core/test/IndexerJobTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.core.test; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import com.axmor.eclipse.typescript.core.Activator; 14 | 15 | /** 16 | * @author Konstantin Zaitcev 17 | */ 18 | public class IndexerJobTest extends Assert { 19 | 20 | /** 21 | * Tests index initialization. 22 | */ 23 | @Test 24 | public void testIndexInit() { 25 | assertFalse(Activator.getDefault().getSearchResults("**").iterator().hasNext()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core.test/src/com/axmor/eclipse/typescript/core/test/bridge/TSBridge10Test.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.core.test.bridge; 9 | 10 | import java.io.File; 11 | import java.io.IOException; 12 | 13 | import com.axmor.eclipse.typescript.core.internal.TypeScriptBridge; 14 | 15 | /** 16 | * @author Konstantin Zaitcev 17 | */ 18 | public class TSBridge10Test { 19 | 20 | //@Test 21 | public void testCompile() throws IOException { 22 | File dir = createTempDirectory(); 23 | TypeScriptBridge bridge = new TypeScriptBridge(dir); 24 | Thread t = new Thread(bridge); 25 | t.start(); 26 | 27 | t.interrupt(); 28 | } 29 | 30 | public static File createTempDirectory() throws IOException { 31 | final File temp; 32 | 33 | temp = File.createTempFile("temp", Long.toString(System.nanoTime())); 34 | 35 | if (!(temp.delete())) { 36 | throw new IOException("Could not delete temp file: " + temp.getAbsolutePath()); 37 | } 38 | 39 | if (!(temp.mkdir())) { 40 | throw new IOException("Could not create temp directory: " + temp.getAbsolutePath()); 41 | } 42 | 43 | return (temp); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | net.sf.eclipsecs.core.CheckstyleBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | net.sf.eclipsecs.core.CheckstyleNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.7 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.7 12 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: TypEcs Core Plugin 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.core;singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Activator: com.axmor.eclipse.typescript.core.Activator 7 | Bundle-Vendor: Axmor Software Inc. 8 | Eclipse-BundleShape: dir 9 | Require-Bundle: org.eclipse.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.core.resources, 12 | org.eclipse.core.filesystem, 13 | org.eclipse.ui.console, 14 | org.eclipse.ui.forms 15 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 16 | Bundle-ActivationPolicy: lazy 17 | Bundle-ClassPath: lib/guava-16.0.jar, 18 | lib/resty-0.3.2.jar, 19 | lib/mapdb-1.0.7.jar, 20 | lib/libthrift-0.9.2.jar, 21 | lib/slf4j-api-1.5.8.jar, 22 | lib/slf4j-simple-1.5.8.jar, 23 | . 24 | Export-Package: com.axmor.eclipse.typescript.core, 25 | com.axmor.eclipse.typescript.core.i18n, 26 | com.axmor.eclipse.typescript.core.index, 27 | com.axmor.eclipse.typescript.core.internal, 28 | com.axmor.eclipse.typescript.core.ui, 29 | com.google.common.annotations, 30 | com.google.common.base, 31 | com.google.common.base.internal, 32 | com.google.common.cache, 33 | com.google.common.collect, 34 | com.google.common.escape, 35 | com.google.common.eventbus, 36 | com.google.common.hash, 37 | com.google.common.html, 38 | com.google.common.io, 39 | com.google.common.math, 40 | com.google.common.net, 41 | com.google.common.primitives, 42 | com.google.common.reflect, 43 | com.google.common.util.concurrent, 44 | com.google.common.xml, 45 | com.google.thirdparty.publicsuffix, 46 | us.monoid.json, 47 | us.monoid.util, 48 | us.monoid.web, 49 | us.monoid.web.auth, 50 | us.monoid.web.jp.javacc, 51 | us.monoid.web.mime 52 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | build.properties,\ 7 | lib/,\ 8 | lib/resty-0.3.2.jar,\ 9 | lib/guava-16.0.jar,\ 10 | lib/mapdb-1.0.7.jar,\ 11 | lib/libthrift-0.9.2.jar,\ 12 | lib/slf4j-api-1.5.8.jar,\ 13 | lib/slf4j-simple-1.5.8.jar 14 | jre.compilation.profile = JavaSE-1.7 15 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/guava-16.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.core/lib/guava-16.0.jar -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/libthrift-0.9.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.core/lib/libthrift-0.9.2.jar -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/mapdb-1.0.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.core/lib/mapdb-1.0.7.jar -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/resty-0.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.core/lib/resty-0.3.2.jar -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/slf4j-api-1.5.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.core/lib/slf4j-api-1.5.8.jar -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/slf4j-simple-1.5.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.core/lib/slf4j-simple-1.5.8.jar -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | typescript-bridge 4 | 5 | 6 | 7 | 8 | 9 | com.axmor.eclipse.typescript.builder.typescriptBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.axmor.eclipse.typescript.builder.typescriptNature 16 | 17 | 18 | 19 | std-lib 20 | 2 21 | virtual:/virtual 22 | 23 | 24 | std-lib/lib.d.ts 25 | 1 26 | D:/work/typecs/src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/ts/lib.d.ts 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/.settings/com.axmor.eclipse.typescript.bridge.prefs: -------------------------------------------------------------------------------- 1 | declaration=false 2 | eclipse.preferences.version=1 3 | mapRoot= 4 | module=commonjs 5 | noImplicitAny=false 6 | noResolve=false 7 | removeComments=false 8 | source=src 9 | sourceMap=true 10 | target=js 11 | targetRelativePathBasedOnSource=false 12 | targetVersion=ES5 13 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/js/args.js: -------------------------------------------------------------------------------- 1 | /// 2 | var args = new Array(); 3 | process.argv.splice(2).map(function (s) { var p = s.split('='); args[p[0]] = p[1]; return s; }); 4 | exports.src = args['src'] ? args['src'] : './'; 5 | exports.serv = args['serv'] != undefined; 6 | exports.logLevel = args['log'] ? args['log'] : 'error'; 7 | exports.port = args['port'] ? args['port'] : 9090; 8 | //# sourceMappingURL=args.js.map -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/js/gen-nodejs/bridge_types.js: -------------------------------------------------------------------------------- 1 | // 2 | // Autogenerated by Thrift Compiler (0.9.2) 3 | // 4 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 | // 6 | var thrift = require('../thrift'); 7 | var Thrift = thrift.Thrift; 8 | var Q = thrift.Q; 9 | 10 | 11 | var ttypes = module.exports = {}; 12 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/js/log.js: -------------------------------------------------------------------------------- 1 | /// 2 | var args = require('./args'); 3 | var level = args.logLevel === 'error' ? 2 : (args.logLevel === 'info' ? 1 : 0); 4 | exports.error = console.error; 5 | exports.info = level > 0 ? console.log : empty; 6 | exports.debug = level == 0 ? console.log : empty; 7 | exports.trace = level == -1 ? console.log : empty; 8 | function empty(s) { } 9 | //# sourceMappingURL=log.js.map -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/js/thrift/bridge.thrift: -------------------------------------------------------------------------------- 1 | service TSBridgeService { 2 | string invoke(1: string method, 2: string file, 3: i32 position, 4: string params) 3 | } 4 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/js/thrift/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | exports.Thrift = require('./thrift'); 20 | 21 | var connection = require('./connection'); 22 | exports.Connection = connection.Connection; 23 | exports.createClient = connection.createClient; 24 | exports.createConnection = connection.createConnection; 25 | exports.createSSLConnection = connection.createSSLConnection; 26 | exports.createStdIOClient = connection.createStdIOClient; 27 | exports.createStdIOConnection = connection.createStdIOConnection; 28 | 29 | var server = require('./server'); 30 | exports.createServer = server.createServer; 31 | 32 | exports.Int64 = require('./node-int64'); 33 | exports.Q = require('./q'); 34 | 35 | /* 36 | * Export transport and protocol so they can be used outside of a 37 | * cassandra/server context 38 | */ 39 | exports.TFramedTransport = require('./transport').TFramedTransport; 40 | exports.TBufferedTransport = require('./transport').TBufferedTransport; 41 | exports.TBinaryProtocol = require('./protocol').TBinaryProtocol; 42 | exports.TJSONProtocol = require('./protocol').TJSONProtocol; 43 | exports.TCompactProtocol = require('./protocol').TCompactProtocol; 44 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/src/args.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | var args = new Array(); 4 | process.argv.splice(2).map(function(s) { var p = s.split('='); args[p[0]] = p[1]; return s; }); 5 | 6 | export var src = args['src'] ? args['src'] : './'; 7 | export var serv = args['serv'] != undefined; 8 | export var logLevel = args['log'] ? args['log'] : 'error'; 9 | export var port: number = args['port'] ? args['port'] : 9090; -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/src/log.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | 4 | import args = require('./args'); 5 | var level = args.logLevel === 'error' ? 2 : (args.logLevel === 'info' ? 1 : 0); 6 | 7 | export var error: (message?: any, ...optionalParams: any[]) => void = console.error; 8 | export var info: (message?: any, ...optionalParams: any[]) => void = level > 0 ? console.log : empty; 9 | export var debug: (message?: any, ...optionalParams: any[]) => void = level == 0 ? console.log : empty; 10 | export var trace: (message?: any, ...optionalParams: any[]) => void = level == -1 ? console.log : empty; 11 | 12 | function empty(s) { } 13 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 12 | 13 | 14 | 15 | 17 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.core 13 | eclipse-plugin 14 | 15 | TypEcs Core Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/src/com/axmor/eclipse/typescript/core/TypeScriptAPIFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.core; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | import org.eclipse.core.resources.IProject; 14 | 15 | import com.axmor.eclipse.typescript.core.internal.TypeScriptAPIImpl; 16 | 17 | /** 18 | * API Provider. 19 | * 20 | * @author Konstantin Zaitcev 21 | */ 22 | public final class TypeScriptAPIFactory { 23 | /** Singleton instance. */ 24 | private static Map apis = new HashMap<>(); 25 | 26 | /** 27 | * Hide constructor. 28 | */ 29 | private TypeScriptAPIFactory() { 30 | // empty block 31 | } 32 | 33 | /** 34 | * @param project 35 | * project 36 | * @return appropriate TypeScriptAPI 37 | */ 38 | public static synchronized TypeScriptAPI getTypeScriptAPI(final IProject project) { 39 | if (!apis.containsKey(project)) { 40 | apis.put(project, new TypeScriptAPIImpl(project)); 41 | } 42 | return apis.get(project); 43 | } 44 | 45 | /** 46 | * Stops all API instances. 47 | */ 48 | public static synchronized void stopTypeScriptAPIs() { 49 | for (TypeScriptAPI api : apis.values()) { 50 | api.dispose(); 51 | } 52 | apis.clear(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/src/com/axmor/eclipse/typescript/core/TypeScriptSettingsInitializer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.core; 9 | 10 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 11 | import org.eclipse.jface.preference.IPreferenceStore; 12 | 13 | /** 14 | * @author kudrin 15 | * 16 | */ 17 | public class TypeScriptSettingsInitializer extends AbstractPreferenceInitializer { 18 | 19 | public TypeScriptSettingsInitializer() { 20 | super(); 21 | } 22 | 23 | @Override 24 | public void initializeDefaultPreferences() { 25 | IPreferenceStore store = Activator.getDefault().getPreferenceStore(); 26 | store.setDefault("indentSize", 4); 27 | store.setDefault("tabSize", 4); 28 | store.setDefault("newLineChar", "\r\n"); 29 | store.setDefault("convertTabs", true); 30 | store.setDefault("autoFormatOnSave", true); 31 | store.setDefault("insertSpaceComma", true); 32 | store.setDefault("insertSpaceSemicolon", true); 33 | store.setDefault("insertSpaceBinary", true); 34 | store.setDefault("insertSpaceKeywords", true); 35 | store.setDefault("insertSpaceFunction", false); 36 | store.setDefault("insertSpaceParenthesis", false); 37 | store.setDefault("placeBraceFunctions", false); 38 | store.setDefault("placeBraceBlocks", false); 39 | store.setDefault("insertCloseBrackets", true); 40 | store.setDefault("insertSemicolons", true); 41 | store.setDefault("ts_log_level", "error"); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/src/com/axmor/eclipse/typescript/core/TypeScriptUtils.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.core; 9 | 10 | import java.io.File; 11 | import java.io.FileNotFoundException; 12 | 13 | import org.eclipse.core.runtime.FileLocator; 14 | import org.eclipse.core.runtime.Platform; 15 | 16 | /** 17 | * @author Konstantin Zaitcev 18 | */ 19 | public final class TypeScriptUtils { 20 | /** Protect from initialization. */ 21 | private TypeScriptUtils() { 22 | // empty block 23 | } 24 | 25 | /** 26 | * @return path to nodejs runtime. 27 | * @throws FileNotFoundException 28 | * if cannot found nodejs in any locaiton 29 | */ 30 | public static String findNodeJS() throws FileNotFoundException { 31 | String[] paths = new String[] { "node", "/usr/local/bin/node" }; 32 | switch (Platform.getOS()) { 33 | case Platform.OS_WIN32: 34 | paths = new String[] { "node.exe", "c:\\Program Files\\nodejs\\node.exe", 35 | "c:\\Program Files (x86)\\nodejs\\node.exe" }; 36 | break; 37 | default: 38 | break; 39 | } 40 | for (String path : paths) { 41 | if (checkNodeJS(path)) { 42 | return path; 43 | } 44 | } 45 | throw new FileNotFoundException(); 46 | } 47 | 48 | /** 49 | * @param path 50 | * path to check 51 | * @return true if nodejs exist in this location 52 | */ 53 | private static boolean checkNodeJS(String path) { 54 | try { 55 | File file = FileLocator.getBundleFile(Activator.getDefault().getBundle()); 56 | ProcessBuilder ps = new ProcessBuilder(path, "-v").directory(file); 57 | return ps.start().waitFor() == 0; 58 | } catch (Exception e) { 59 | return false; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/src/com/axmor/eclipse/typescript/core/i18n/Messages.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.core.i18n; 9 | 10 | import org.eclipse.osgi.util.NLS; 11 | 12 | /** 13 | * @author Konstantin Zaitcev 14 | */ 15 | public class Messages extends NLS { 16 | private static final String BUNDLE_NAME = "com.axmor.eclipse.typescript.core.i18n.messages"; //$NON-NLS-1$ 17 | public static String TSBridge_cannotStart; 18 | public static String TSBridge_Console; 19 | public static String TSBridge_InitErrorMessage; 20 | public static String TSBridge_InitErrorTitle; 21 | public static String TypeScriptBridge_NodeJSStopError; 22 | public static String TypescriptWorkbenchPreferencePage_compiler_version; 23 | static { 24 | // initialize resource bundle 25 | NLS.initializeMessages(BUNDLE_NAME, Messages.class); 26 | } 27 | 28 | private Messages() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/src/com/axmor/eclipse/typescript/core/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | TSBridge_cannotStart=Cannot start TS bridge 2 | TSBridge_Console=TS Bridge Console 3 | TSBridge_InitErrorMessage=
An error occured during TypeScript engine initialization.
TypeScript runtime requires NodeJS that should be installed separately.

It seems NodeJS is not installed or is not available in system path.
Please download and install NodeJS from the following location http://nodejs.org and restart Eclipse IDE.
4 | TSBridge_InitErrorTitle=TypeScript Runtime Initialization Error 5 | TypeScriptBridge_NodeJSStopError=Cannot stop previous NodeJS instance. 6 | TypescriptWorkbenchPreferencePage_compiler_version=&Typescript compiler version: 7 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.core/src/com/axmor/eclipse/typescript/core/ui/TypescriptWorkbenchPreferencePage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | 9 | package com.axmor.eclipse.typescript.core.ui; 10 | 11 | import org.eclipse.jface.preference.ComboFieldEditor; 12 | import org.eclipse.jface.preference.FieldEditorPreferencePage; 13 | import org.eclipse.ui.IWorkbench; 14 | import org.eclipse.ui.IWorkbenchPreferencePage; 15 | 16 | import com.axmor.eclipse.typescript.core.Activator; 17 | 18 | /** 19 | * @author Konstantin Zaitcev 20 | */ 21 | public class TypescriptWorkbenchPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { 22 | 23 | @Override 24 | public void init(IWorkbench workbench) { 25 | setPreferenceStore(Activator.getDefault().getPreferenceStore()); 26 | } 27 | 28 | @Override 29 | protected void createFieldEditors() { 30 | addField(new ComboFieldEditor("ts_log_level", "TypeScript Console Log Level (A restart is required)", 31 | new String[][] { new String[] { "Error", "error" }, new String[] { "Info", "info" }, 32 | new String[] { "Debug", "debug" } }, getFieldEditorParent())); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.debug.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.7 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Debug 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.debug.ui;singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Activator: com.axmor.eclipse.typescript.debug.ui.Activator 7 | Bundle-Vendor: Axmor Software Inc 8 | Require-Bundle: com.axmor.eclipse.typescript.debug;bundle-version="1.0.0", 9 | org.eclipse.debug.ui;bundle-version="3.9.0", 10 | org.eclipse.jface;bundle-version="3.9.1", 11 | org.eclipse.ui.workbench, 12 | org.eclipse.ui.workbench.texteditor, 13 | org.eclipse.jface.text;bundle-version="3.8.101", 14 | org.eclipse.core.runtime;bundle-version="3.9.0", 15 | org.eclipse.ui.ide;bundle-version="3.9.1", 16 | org.eclipse.ui.editors;bundle-version="3.8.100", 17 | com.axmor.eclipse.typescript.core, 18 | com.axmor.eclipse.typescript.builder, 19 | org.chromium.sdk.wip.eclipse, 20 | org.chromium.sdk, 21 | com.axmor.eclipse.typescript.editor 22 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 23 | Bundle-ActivationPolicy: lazy 24 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | icons/ 7 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/icons/main_tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.debug.ui/icons/main_tab.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/icons/ts_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.debug.ui/icons/ts_app.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/icons/ts_web_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.debug.ui/icons/ts_web_app.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/icons/typecs16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.debug.ui/icons/typecs16.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.debug.ui 13 | eclipse-plugin 14 | 15 | TypEcs Debug UI Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/src/com/axmor/eclipse/typescript/debug/ui/Activator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.ui; 9 | 10 | import static com.axmor.eclipse.typescript.debug.ui.DebugUIConstants.IMG_MAIN_TAB; 11 | 12 | import org.eclipse.jface.resource.ImageDescriptor; 13 | import org.eclipse.jface.resource.ImageRegistry; 14 | import org.eclipse.swt.graphics.Image; 15 | import org.eclipse.ui.plugin.AbstractUIPlugin; 16 | import org.osgi.framework.BundleContext; 17 | 18 | /** 19 | * The activator class controls the plug-in life cycle 20 | */ 21 | public class Activator extends AbstractUIPlugin { 22 | 23 | // The plug-in ID 24 | public static final String PLUGIN_ID = "com.axmor.eclipse.typescript.debug.ui"; //$NON-NLS-1$ 25 | 26 | // The shared instance 27 | private static Activator plugin; 28 | 29 | /** 30 | * The constructor 31 | */ 32 | public Activator() { 33 | } 34 | 35 | /* 36 | * (non-Javadoc) 37 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) 38 | */ 39 | public void start(BundleContext context) throws Exception { 40 | super.start(context); 41 | plugin = this; 42 | } 43 | 44 | /* 45 | * (non-Javadoc) 46 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) 47 | */ 48 | public void stop(BundleContext context) throws Exception { 49 | plugin = null; 50 | super.stop(context); 51 | } 52 | 53 | /** 54 | * Returns the shared instance 55 | * 56 | * @return the shared instance 57 | */ 58 | public static Activator getDefault() { 59 | return plugin; 60 | } 61 | 62 | /** 63 | * Returns an image descriptor for the image file at the given 64 | * plug-in relative path 65 | * 66 | * @param path the path 67 | * @return the image descriptor 68 | */ 69 | public static ImageDescriptor getImageDescriptor(String path) { 70 | return imageDescriptorFromPlugin(PLUGIN_ID, path); 71 | } 72 | 73 | @Override 74 | protected void initializeImageRegistry(ImageRegistry reg) { 75 | reg.put(IMG_MAIN_TAB, getImageDescriptor("icons/main_tab.gif")); 76 | } 77 | 78 | /** 79 | * @param key image key 80 | * @return image by key from registry 81 | */ 82 | public static Image getImage(String key) { 83 | if (plugin != null) { 84 | return plugin.getImageRegistry().get(key); 85 | } 86 | return null; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/src/com/axmor/eclipse/typescript/debug/ui/DebugUIConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.ui; 9 | 10 | /** 11 | * @author Konstantin Zaitcev 12 | */ 13 | public interface DebugUIConstants { 14 | 15 | /** Image constant. */ 16 | public static final String IMG_MAIN_TAB = "main_tab"; 17 | } 18 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/src/com/axmor/eclipse/typescript/debug/ui/launching/LaunchStandaloneConfigurationTabGroup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.ui.launching; 9 | 10 | import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 11 | import org.eclipse.debug.ui.CommonTab; 12 | import org.eclipse.debug.ui.ILaunchConfigurationDialog; 13 | import org.eclipse.debug.ui.ILaunchConfigurationTab; 14 | import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; 15 | 16 | /** 17 | * Launch tab group for standalone mode. 18 | * 19 | * @author Konstantin Zaitcev 20 | */ 21 | public class LaunchStandaloneConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { 22 | 23 | @Override 24 | public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 25 | setTabs(new ILaunchConfigurationTab[] { new LaunchStandaloneMainTab(), new SourceLookupTab(), new CommonTab() }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/src/com/axmor/eclipse/typescript/debug/ui/launching/LaunchWebConfigurationTabGroup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.ui.launching; 9 | 10 | import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 11 | import org.eclipse.debug.ui.CommonTab; 12 | import org.eclipse.debug.ui.ILaunchConfigurationDialog; 13 | import org.eclipse.debug.ui.ILaunchConfigurationTab; 14 | import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; 15 | 16 | /** 17 | * Launch tab group for web remote mode. 18 | * 19 | * @author Konstantin Zaitcev 20 | */ 21 | public class LaunchWebConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { 22 | 23 | @Override 24 | public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 25 | setTabs(new ILaunchConfigurationTab[] { new LaunchWebMainTab(), new SourceLookupTab(), new CommonTab() }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug.ui/src/com/axmor/eclipse/typescript/debug/ui/model/TypeScriptBreakpointAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.ui.model; 9 | 10 | import static com.axmor.eclipse.typescript.core.TypeScriptResources.TS_EXT; 11 | 12 | import org.eclipse.core.resources.IResource; 13 | import org.eclipse.core.runtime.IAdapterFactory; 14 | import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; 15 | import org.eclipse.ui.texteditor.ITextEditor; 16 | 17 | /** 18 | * @author Konstantin Zaitcev 19 | * 20 | */ 21 | @SuppressWarnings("rawtypes") 22 | public class TypeScriptBreakpointAdapterFactory implements IAdapterFactory { 23 | 24 | @Override 25 | public Object getAdapter(Object adaptableObject, Class adapterType) { 26 | if (adaptableObject instanceof ITextEditor) { 27 | ITextEditor editorPart = (ITextEditor) adaptableObject; 28 | IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class); 29 | if (resource != null) { 30 | String extension = resource.getFileExtension(); 31 | if (extension != null && extension.equals(TS_EXT)) { 32 | return new TypeScriptBreakpointAdapter(); 33 | } 34 | } 35 | } 36 | return null; 37 | } 38 | 39 | @Override 40 | public Class[] getAdapterList() { 41 | return new Class[] { IToggleBreakpointsTarget.class }; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.debug 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.7 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Debug 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.debug;singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Activator: com.axmor.eclipse.typescript.debug.Activator 7 | Bundle-Vendor: Axmor Software Inc 8 | Require-Bundle: org.chromium.sdk, 9 | org.chromium.debug.ui, 10 | org.chromium.debug.core, 11 | org.chromium.sdk.wip.eclipse, 12 | org.eclipse.debug.core;bundle-version="3.8.0", 13 | org.eclipse.core.runtime;bundle-version="3.9.0", 14 | com.axmor.eclipse.typescript.core, 15 | org.eclipse.ui;bundle-version="3.105.0", 16 | org.eclipse.debug.ui;bundle-version="3.9.0", 17 | org.eclipse.ui.console, 18 | org.eclipse.jface.text 19 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 20 | Bundle-ActivationPolicy: lazy 21 | Export-Package: com.axmor.eclipse.typescript.debug.launching, 22 | com.axmor.eclipse.typescript.debug.model 23 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | . 6 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.debug 13 | eclipse-plugin 14 | 15 | TypEcs Debug Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/Activator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug; 9 | 10 | import org.eclipse.core.resources.ResourcesPlugin; 11 | import org.eclipse.core.runtime.Plugin; 12 | import org.eclipse.core.runtime.Status; 13 | import org.osgi.framework.BundleContext; 14 | 15 | /** 16 | * The activator class controls the plug-in life cycle 17 | */ 18 | public class Activator extends Plugin { 19 | 20 | /** The plug-in ID */ 21 | public static final String PLUGIN_ID = "com.axmor.eclipse.typescript.debug"; //$NON-NLS-1$ 22 | 23 | /** The shared instance */ 24 | private static Activator plugin; 25 | 26 | /** 27 | * The constructor 28 | */ 29 | public Activator() { 30 | } 31 | 32 | @Override 33 | public void start(BundleContext context) throws Exception { 34 | super.start(context); 35 | plugin = this; 36 | JavaScriptVmSynchronizer synchronizer = new JavaScriptVmSynchronizer(); 37 | ResourcesPlugin.getWorkspace().addResourceChangeListener(synchronizer); 38 | ResourcesPlugin.getWorkspace().getRoot().accept(synchronizer); 39 | } 40 | 41 | @Override 42 | public void stop(BundleContext context) throws Exception { 43 | plugin = null; 44 | super.stop(context); 45 | } 46 | 47 | /** 48 | * Returns the shared instance 49 | * 50 | * @return the shared instance 51 | */ 52 | public static Activator getDefault() { 53 | return plugin; 54 | } 55 | 56 | /** 57 | * Print error message to Error log. 58 | * 59 | * @param e 60 | * exception 61 | */ 62 | public static void error(final Exception e) { 63 | plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, e.getMessage(), e)); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/DebugUtils.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug; 9 | 10 | import static com.axmor.eclipse.typescript.debug.launching.TypeScriptDebugConstants.TS_DEBUG_MODEL; 11 | import static org.eclipse.core.runtime.IStatus.ERROR; 12 | 13 | import java.io.IOException; 14 | import java.net.ServerSocket; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.eclipse.core.runtime.Status; 18 | 19 | /** 20 | * @author Konstantin Zaitcev 21 | */ 22 | public final class DebugUtils { 23 | 24 | /** Protect from initialization */ 25 | private DebugUtils() { 26 | // empty block 27 | } 28 | 29 | /** 30 | * Find free unused TCP port. 31 | * 32 | * @return free port or -1 if port not found 33 | */ 34 | public static int findFreePort() { 35 | try (ServerSocket socket = new ServerSocket(0)) { 36 | return socket.getLocalPort(); 37 | } catch (IOException e) { 38 | return -1; 39 | } 40 | } 41 | 42 | /** 43 | * Throws core exception with given error message. 44 | * 45 | * @param message 46 | * error message 47 | * @throws CoreException 48 | * exception 49 | */ 50 | public static void error(String message) throws CoreException { 51 | error(message, null); 52 | } 53 | 54 | /** 55 | * Throws core exception with given error message. 56 | * 57 | * @param message 58 | * error message 59 | * @param ex 60 | * original exception 61 | * @throws CoreException 62 | * exception 63 | */ 64 | public static void error(String message, Exception ex) throws CoreException { 65 | throw new CoreException(new Status(ERROR, TS_DEBUG_MODEL, 0, message, ex)); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/console/ICommandHandler.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.debug.console; 2 | 3 | import com.axmor.eclipse.typescript.debug.console.TypeScriptConsoleDocumentListener.Callback; 4 | 5 | public interface ICommandHandler { 6 | 7 | void handleCommand(String userInput, Callback onContentsReceived); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/console/ScriptConsolePartitioner.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.debug.console; 2 | 3 | import org.eclipse.jface.text.DocumentEvent; 4 | import org.eclipse.jface.text.IDocument; 5 | import org.eclipse.jface.text.ITypedRegion; 6 | import org.eclipse.jface.text.TypedRegion; 7 | import org.eclipse.swt.custom.StyleRange; 8 | import org.eclipse.ui.console.IConsoleDocumentPartitioner; 9 | 10 | public class ScriptConsolePartitioner implements IConsoleDocumentPartitioner { 11 | 12 | private static final String[] LEGAL_CONTENT_TYPES = new String[] { IDocument.DEFAULT_CONTENT_TYPE }; 13 | 14 | @Override 15 | public ITypedRegion[] computePartitioning(int offset, int length) { 16 | return new TypedRegion[] { new TypedRegion(offset, length, IDocument.DEFAULT_CONTENT_TYPE) }; 17 | } 18 | 19 | @Override 20 | public void connect(IDocument document) { 21 | } 22 | 23 | @Override 24 | public void disconnect() { 25 | } 26 | 27 | @Override 28 | public void documentAboutToBeChanged(DocumentEvent event) { 29 | } 30 | 31 | @Override 32 | public boolean documentChanged(DocumentEvent event) { 33 | return false; 34 | } 35 | 36 | @Override 37 | public String getContentType(int offset) { 38 | return IDocument.DEFAULT_CONTENT_TYPE; 39 | } 40 | 41 | @Override 42 | public String[] getLegalContentTypes() { 43 | return LEGAL_CONTENT_TYPES; 44 | } 45 | 46 | @Override 47 | public ITypedRegion getPartition(int offset) { 48 | return new TypedRegion(offset, 1, IDocument.DEFAULT_CONTENT_TYPE); 49 | } 50 | 51 | @Override 52 | public StyleRange[] getStyleRanges(int offset, int length) { 53 | return new StyleRange[0]; 54 | } 55 | 56 | @Override 57 | public boolean isReadOnly(int offset) { 58 | return false; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/console/TypeScriptConsoleManager.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.debug.console; 2 | 3 | import org.eclipse.ui.console.ConsolePlugin; 4 | import org.eclipse.ui.console.IConsole; 5 | import org.eclipse.ui.console.IConsoleManager; 6 | 7 | public class TypeScriptConsoleManager { 8 | 9 | private static TypeScriptConsoleManager instance; 10 | 11 | /** 12 | * @return the singleton for the script console manager. 13 | */ 14 | public static synchronized TypeScriptConsoleManager getInstance() { 15 | if (instance == null) { 16 | instance = new TypeScriptConsoleManager(); 17 | } 18 | 19 | return instance; 20 | } 21 | 22 | /** 23 | * Reference to the console manager singleton from eclipse. 24 | */ 25 | private IConsoleManager manager; 26 | 27 | protected TypeScriptConsoleManager() { 28 | this.manager = ConsolePlugin.getDefault().getConsoleManager(); 29 | } 30 | 31 | /** 32 | * Terminates the execution of the given console and removes it from the list of available 33 | * consoles. 34 | * 35 | * @param console 36 | * the console to be terminated and removed. 37 | */ 38 | public void close(TypescriptConsole console) { 39 | console.terminate(); 40 | manager.removeConsoles(new IConsole[] { console }); 41 | } 42 | 43 | /** 44 | * Closes all the script consoles available. 45 | */ 46 | public void closeAll() { 47 | IConsole[] consoles = manager.getConsoles(); 48 | for (int i = 0; i < consoles.length; ++i) { 49 | IConsole console = consoles[i]; 50 | if (console instanceof TypescriptConsole) { 51 | close((TypescriptConsole) console); 52 | } 53 | } 54 | } 55 | 56 | /** 57 | * Adds a given console to the console view. 58 | * 59 | * @param console 60 | * the console to be added to the console view 61 | * @param show 62 | * whether it should be shown or not. 63 | */ 64 | public void add(TypescriptConsole console, boolean show) { 65 | manager.addConsoles(new IConsole[] { console }); 66 | if (show) { 67 | manager.showConsoleView(console); 68 | } 69 | } 70 | 71 | /** 72 | * Enable/Disable linking of the debug console with the suspended frame. 73 | */ 74 | public void linkWithDebugSelection(TypescriptConsole console, boolean isChecked) { 75 | console.linkWithDebugSelection(isChecked); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/console/TypeScriptConsolePage.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.debug.console; 2 | 3 | import org.eclipse.jface.text.source.SourceViewerConfiguration; 4 | import org.eclipse.swt.widgets.Composite; 5 | import org.eclipse.ui.console.IConsoleView; 6 | import org.eclipse.ui.console.TextConsole; 7 | import org.eclipse.ui.console.TextConsolePage; 8 | import org.eclipse.ui.console.TextConsoleViewer; 9 | 10 | public class TypeScriptConsolePage extends TextConsolePage { 11 | 12 | private TypeScriptConsoleViewer viewer; 13 | 14 | public TypeScriptConsolePage(TextConsole console, IConsoleView view) { 15 | super(console, view); 16 | } 17 | 18 | @Override 19 | protected TextConsoleViewer createViewer(Composite parent) { 20 | TypescriptConsole console = (TypescriptConsole) getConsole(); 21 | viewer = new TypeScriptConsoleViewer(parent, console); 22 | viewer.configure(new SourceViewerConfiguration()); 23 | return viewer; 24 | } 25 | 26 | public void clearConsolePage() { 27 | viewer.clear(false); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/console/TypeScriptConsoleViewer.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.debug.console; 2 | 3 | import org.eclipse.swt.custom.StyledText; 4 | import org.eclipse.swt.events.FocusEvent; 5 | import org.eclipse.swt.events.FocusListener; 6 | import org.eclipse.swt.widgets.Composite; 7 | import org.eclipse.swt.widgets.Display; 8 | import org.eclipse.ui.console.TextConsoleViewer; 9 | 10 | public class TypeScriptConsoleViewer extends TextConsoleViewer { 11 | 12 | /** 13 | * Listens and acts to document changes (and passes them to the shell) 14 | */ 15 | private TypeScriptConsoleDocumentListener listener; 16 | 17 | public TypeScriptConsoleViewer(Composite parent, TypescriptConsole console) { 18 | super(parent, console); 19 | this.listener = new TypeScriptConsoleDocumentListener(this, console); 20 | this.listener.setDocument(getDocument()); 21 | this.listener.appendInvitation(false); 22 | final StyledText styledText = getTextWidget(); 23 | styledText.addFocusListener(new FocusListener() { 24 | 25 | /** 26 | * When the initial focus is gained, set the caret position to the last position (just 27 | * after the prompt) 28 | */ 29 | public void focusGained(FocusEvent e) { 30 | setCaretOffset(getDocument().getLength(), true); 31 | // just a 1-time listener 32 | styledText.removeFocusListener(this); 33 | } 34 | 35 | public void focusLost(FocusEvent e) { 36 | 37 | } 38 | }); 39 | } 40 | 41 | /** 42 | * Sets the new caret position in the console. * 43 | * 44 | */ 45 | public void setCaretOffset(final int offset, boolean async) { 46 | final StyledText textWidget = getTextWidget(); 47 | if (textWidget != null) { 48 | if (async) { 49 | Display display = textWidget.getDisplay(); 50 | if (display != null) { 51 | display.asyncExec(new Runnable() { 52 | public void run() { 53 | textWidget.setCaretOffset(offset); 54 | } 55 | }); 56 | } 57 | } else { 58 | textWidget.setCaretOffset(offset); 59 | } 60 | } 61 | } 62 | 63 | /** 64 | * Creates the styled text for the console 65 | */ 66 | @Override 67 | protected StyledText createTextWidget(Composite parent, int styles) { 68 | return new StyledText(parent, styles); 69 | } 70 | 71 | /** 72 | * Used to clear the contents of the document 73 | */ 74 | public void clear(boolean addInitialCommands) { 75 | listener.clear(addInitialCommands); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/console/TypescriptConsole.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.debug.console; 2 | 3 | import org.eclipse.ui.console.IConsoleDocumentPartitioner; 4 | import org.eclipse.ui.console.IConsoleView; 5 | import org.eclipse.ui.console.TextConsole; 6 | import org.eclipse.ui.part.IPageBookViewPage; 7 | 8 | import com.axmor.eclipse.typescript.debug.console.TypeScriptConsoleDocumentListener.Callback; 9 | 10 | public class TypescriptConsole extends TextConsole implements ICommandHandler { 11 | 12 | public static final String CONSOLE_NAME = "TypeScript Console"; 13 | 14 | public static final String DEFAULT_CONSOLE_TYPE = "com.axmor.eclipse.typescript.editor.console.TypescriptConsole"; 15 | 16 | public static int nextId = -1; 17 | 18 | private TypescriptConsoleInterpreter interpreter; 19 | 20 | private TypeScriptConsolePage page; 21 | 22 | protected ScriptConsolePartitioner partitioner; 23 | 24 | public TypescriptConsole(TypescriptConsoleInterpreter interpreter, String additionalInitialComands) { 25 | super(CONSOLE_NAME + " [" + getNextId() + "]", DEFAULT_CONSOLE_TYPE, null, true); 26 | this.interpreter = interpreter; 27 | 28 | partitioner = new ScriptConsolePartitioner(); 29 | getDocument().setDocumentPartitioner(partitioner); 30 | partitioner.connect(getDocument()); 31 | } 32 | 33 | @Override 34 | protected IConsoleDocumentPartitioner getPartitioner() { 35 | return null; 36 | } 37 | 38 | private static String getNextId() { 39 | nextId += 1; 40 | return String.valueOf(nextId); 41 | } 42 | 43 | public void terminate() { 44 | try { 45 | interpreter.close(); 46 | } catch (Exception e) { 47 | } 48 | interpreter = null; 49 | } 50 | 51 | public void linkWithDebugSelection(boolean isChecked) { 52 | } 53 | 54 | /** 55 | * Creates the actual page to be shown to the user. 56 | */ 57 | @Override 58 | public IPageBookViewPage createPage(IConsoleView view) { 59 | page = new TypeScriptConsolePage(this, view); 60 | return page; 61 | } 62 | 63 | /** 64 | * Clears the console 65 | */ 66 | @Override 67 | public void clearConsole() { 68 | page.clearConsolePage(); 69 | } 70 | 71 | /** 72 | * Handles some command that the user entered 73 | * 74 | * @param userInput 75 | * that's the command to be evaluated by the user. 76 | */ 77 | public void handleCommand(String userInput, Callback onContentsReceived) { 78 | 79 | // executes the user input in the interpreter 80 | if (interpreter != null) { 81 | interpreter.exec(userInput, onContentsReceived); 82 | } 83 | 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/launching/TypeScriptDebugConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.launching; 9 | 10 | import com.axmor.eclipse.typescript.debug.Activator; 11 | 12 | /** 13 | * @author Konstantin Zaitcev 14 | */ 15 | public interface TypeScriptDebugConstants { 16 | public static final String TS_DEBUG_MODEL = "com.axmor.eclipse.typescript.debug"; 17 | 18 | public static final String TS_LAUNCH_STANDALONE_PROJECT = Activator.PLUGIN_ID + ".launchStandaloneProject"; 19 | public static final String TS_LAUNCH_STANDALONE_FILE = Activator.PLUGIN_ID + ".launchStandaloneFile"; 20 | 21 | public static final String TS_LAUNCH_WEB_HOST = Activator.PLUGIN_ID + ".launchWebHost"; 22 | public static final String TS_LAUNCH_WEB_PORT = Activator.PLUGIN_ID + ".launchWebPort"; 23 | public static final String TS_LAUNCH_WEB_WIP = Activator.PLUGIN_ID + ".launchWebWip"; 24 | } 25 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/launching/TypeScriptSourceLookupDirector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.launching; 9 | 10 | import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; 11 | import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; 12 | 13 | /** 14 | * @author Konstantin Zaitcev 15 | */ 16 | public class TypeScriptSourceLookupDirector extends AbstractSourceLookupDirector { 17 | 18 | @Override 19 | public void initializeParticipants() { 20 | addParticipants(new ISourceLookupParticipant[] { new TypeScriptSourceLookupParticipant() }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/launching/TypeScriptSourceLookupParticipant.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.launching; 9 | 10 | import org.eclipse.core.runtime.CoreException; 11 | import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant; 12 | 13 | import com.axmor.eclipse.typescript.debug.model.TypeScriptStackFrame; 14 | 15 | /** 16 | * @author Konstantin Zaitcev 17 | */ 18 | public class TypeScriptSourceLookupParticipant extends AbstractSourceLookupParticipant { 19 | 20 | @Override 21 | public String getSourceName(Object object) throws CoreException { 22 | if (object instanceof TypeScriptStackFrame) { 23 | TypeScriptStackFrame sf = (TypeScriptStackFrame) object; 24 | return sf.getSourceName(); 25 | } 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/launching/TypeScriptSourcePathComputerDelegate.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.launching; 9 | 10 | import static com.axmor.eclipse.typescript.debug.launching.TypeScriptDebugConstants.TS_LAUNCH_STANDALONE_PROJECT; 11 | 12 | import org.eclipse.core.resources.IProject; 13 | import org.eclipse.core.resources.ResourcesPlugin; 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.core.runtime.IProgressMonitor; 16 | import org.eclipse.debug.core.ILaunchConfiguration; 17 | import org.eclipse.debug.core.sourcelookup.ISourceContainer; 18 | import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate; 19 | import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer; 20 | import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer; 21 | 22 | /** 23 | * @author Konstantin Zaitcev 24 | */ 25 | public class TypeScriptSourcePathComputerDelegate implements ISourcePathComputerDelegate { 26 | 27 | @Override 28 | public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) 29 | throws CoreException { 30 | ISourceContainer sourceContainer = null; 31 | 32 | String projectName = configuration.getAttribute(TS_LAUNCH_STANDALONE_PROJECT, ""); 33 | if (!projectName.isEmpty()) { 34 | IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); 35 | sourceContainer = new ProjectSourceContainer(project, false); 36 | } 37 | 38 | if (sourceContainer == null) { 39 | sourceContainer = new WorkspaceSourceContainer(); 40 | } 41 | 42 | return new ISourceContainer[] { sourceContainer }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/model/ArrayValue.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package com.axmor.eclipse.typescript.debug.model; 6 | 7 | import java.util.Collections; 8 | import java.util.Set; 9 | import java.util.concurrent.atomic.AtomicReference; 10 | 11 | import org.chromium.sdk.JsArray; 12 | import org.chromium.sdk.JsEvaluateContext; 13 | import org.eclipse.debug.core.DebugException; 14 | import org.eclipse.debug.core.model.IDebugTarget; 15 | import org.eclipse.debug.core.model.IIndexedValue; 16 | import org.eclipse.debug.core.model.IVariable; 17 | 18 | /** 19 | * An IIndexedValue implementation for an array element range using a JsArray 20 | * instance. 21 | */ 22 | public class ArrayValue extends Value implements IIndexedValue { 23 | 24 | private final AtomicReference elementsRef = new AtomicReference( 25 | null); 26 | 27 | public ArrayValue(JsEvaluateContext evaluateContext, 28 | IDebugTarget debugTarget, JsArray array, 29 | ValueBase.ValueAsHostObject hostObject) { 30 | super(evaluateContext, debugTarget, array, hostObject); 31 | } 32 | 33 | private IVariable[] createElements() { 34 | JsArray jsArray = (JsArray) getJsValue(); 35 | return TypeScriptStackFrame.wrapVariables(getEvaluateContext(), 36 | getDebugTarget(), jsArray.getProperties(), 37 | ARRAY_HIDDEN_PROPERTY_NAMES, 38 | // Do not show internal properties for arrays (this may be an 39 | // option). 40 | null, getHostObject(), null); 41 | } 42 | 43 | private IVariable[] getElements() { 44 | IVariable[] result = elementsRef.get(); 45 | if (result == null) { 46 | result = createElements(); 47 | elementsRef.compareAndSet(null, result); 48 | return elementsRef.get(); 49 | } else { 50 | return result; 51 | } 52 | } 53 | 54 | public int getInitialOffset() { 55 | return 0; 56 | } 57 | 58 | public int getSize() throws DebugException { 59 | return getElements().length; 60 | } 61 | 62 | public IVariable getVariable(int offset) throws DebugException { 63 | return getElements()[offset]; 64 | } 65 | 66 | public IVariable[] getVariables(int offset, int length) 67 | throws DebugException { 68 | IVariable[] result = new IVariable[length]; 69 | System.arraycopy(getElements(), offset, result, 0, length); 70 | return result; 71 | } 72 | 73 | @Override 74 | public IVariable[] getVariables() throws DebugException { 75 | return getElements(); 76 | } 77 | 78 | @Override 79 | public boolean hasVariables() throws DebugException { 80 | return getElements().length > 0; 81 | } 82 | 83 | private static final Set ARRAY_HIDDEN_PROPERTY_NAMES = Collections 84 | .singleton("length"); 85 | } 86 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/model/TypeScriptDebugElement.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.model; 9 | 10 | import static com.axmor.eclipse.typescript.debug.launching.TypeScriptDebugConstants.TS_DEBUG_MODEL; 11 | 12 | import org.eclipse.core.runtime.PlatformObject; 13 | import org.eclipse.debug.core.ILaunch; 14 | import org.eclipse.debug.core.model.IDebugElement; 15 | import org.eclipse.debug.core.model.IDebugTarget; 16 | 17 | /** 18 | * Common debug element. 19 | * 20 | * @author Konstantin Zaitcev 21 | */ 22 | public abstract class TypeScriptDebugElement extends PlatformObject implements IDebugElement { 23 | 24 | private IDebugTarget target; 25 | 26 | public TypeScriptDebugElement(IDebugTarget target) { 27 | this.target = target; 28 | } 29 | 30 | @Override 31 | public String getModelIdentifier() { 32 | return TS_DEBUG_MODEL; 33 | } 34 | 35 | @SuppressWarnings("rawtypes") 36 | @Override 37 | public Object getAdapter(Class adapter) { 38 | if (adapter == IDebugElement.class) { 39 | return this; 40 | } 41 | if (adapter == ILaunch.class) { 42 | return getLaunch(); 43 | } 44 | return super.getAdapter(adapter); 45 | } 46 | 47 | @Override 48 | public IDebugTarget getDebugTarget() { 49 | return target; 50 | } 51 | 52 | @Override 53 | public ILaunch getLaunch() { 54 | return target.getLaunch(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.debug/src/com/axmor/eclipse/typescript/debug/model/TypeScriptLineBreakpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.debug.model; 9 | 10 | import static com.axmor.eclipse.typescript.debug.launching.TypeScriptDebugConstants.TS_DEBUG_MODEL; 11 | 12 | import org.eclipse.core.resources.IMarker; 13 | import org.eclipse.core.resources.IResource; 14 | import org.eclipse.core.resources.IWorkspaceRunnable; 15 | import org.eclipse.core.runtime.CoreException; 16 | import org.eclipse.core.runtime.IProgressMonitor; 17 | import org.eclipse.debug.core.model.IBreakpoint; 18 | import org.eclipse.debug.core.model.LineBreakpoint; 19 | 20 | /** 21 | * @author Konstantin Zaitcev 22 | */ 23 | public class TypeScriptLineBreakpoint extends LineBreakpoint { 24 | 25 | /** 26 | * Default constructor need for breakpoint manager for recreate. 27 | */ 28 | public TypeScriptLineBreakpoint() { 29 | // empty block 30 | } 31 | 32 | public TypeScriptLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException { 33 | IWorkspaceRunnable runnable = new IWorkspaceRunnable() { 34 | public void run(IProgressMonitor monitor) throws CoreException { 35 | IMarker marker = resource.createMarker("com.axmor.eclipse.typescript.debug.typeScriptBreakpoint"); 36 | setMarker(marker); 37 | setEnabled(true); 38 | marker.setAttribute(IMarker.SOURCE_ID, resource.getName()); 39 | marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); 40 | marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); 41 | marker.setAttribute(IMarker.MESSAGE, "Line Breakpoint: " + resource.getName() + " [line: " + lineNumber 42 | + "]"); 43 | } 44 | }; 45 | run(getMarkerRule(resource), runnable); 46 | } 47 | 48 | @Override 49 | public String getModelIdentifier() { 50 | return TS_DEBUG_MODEL; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.editor 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | net.sf.eclipsecs.core.CheckstyleBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | net.sf.eclipsecs.core.CheckstyleNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.7 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: TypEcs Editor Plugin 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.editor; singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Activator: com.axmor.eclipse.typescript.editor.Activator 7 | Bundle-Vendor: Axmor Software Inc. 8 | Require-Bundle: org.eclipse.ui, 9 | org.eclipse.core.runtime, 10 | org.eclipse.jface.text, 11 | org.eclipse.ui.editors, 12 | com.axmor.eclipse.typescript.core, 13 | org.eclipse.ui.views, 14 | org.eclipse.core.resources, 15 | org.eclipse.ui.ide, 16 | org.eclipse.ltk.core.refactoring, 17 | org.eclipse.ltk.ui.refactoring, 18 | com.ibm.icu;bundle-version="50.1.1", 19 | org.eclipse.compare, 20 | org.eclipse.search, 21 | org.eclipse.core.filesystem, 22 | org.eclipse.swt, 23 | org.eclipse.ui.workbench.texteditor, 24 | org.eclipse.jdt.ui 25 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 26 | Bundle-ActivationPolicy: lazy 27 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | icons/,\ 7 | css/,\ 8 | templates/ 9 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/css/JavadocHoverStyleSheet.css: -------------------------------------------------------------------------------- 1 | /* Font definitions */ 2 | html { font-family: sans-serif; font-size: 9pt; font-style: normal; font-weight: normal; } 3 | body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt { font-size: 1em; } 4 | pre { font-family: monospace; } 5 | 6 | /* Margins */ 7 | body { overflow: auto; margin-top: 0px; margin-bottom: 0.5em; margin-left: 0.3em; margin-right: 0px; } 8 | h1 { margin-top: 0.3em; margin-bottom: 0.04em; } 9 | h2 { margin-top: 2em; margin-bottom: 0.25em; } 10 | h3 { margin-top: 1.7em; margin-bottom: 0.25em; } 11 | h4 { margin-top: 2em; margin-bottom: 0.3em; } 12 | h5 { margin-top: 0px; margin-bottom: 0px; } 13 | p { margin-top: 1em; margin-bottom: 1em; } 14 | pre { margin-left: 0.6em; } 15 | ul { margin-top: 0px; margin-bottom: 1em; margin-left: 1em; padding-left: 1em;} 16 | li { margin-top: 0px; margin-bottom: 0px; } 17 | li p { margin-top: 0px; margin-bottom: 0px; } 18 | ol { margin-top: 0px; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; } 19 | dl { margin-top: 0px; margin-bottom: 1em; } 20 | dt { margin-top: 0px; margin-bottom: 0px; font-weight: bold; } 21 | dd { margin-top: 0px; margin-bottom: 0px; } 22 | 23 | /* Styles and colors */ 24 | a:link { color: #0000FF; } 25 | a:hover { color: #000080; } 26 | a:visited { text-decoration: underline; } 27 | a.header:link { text-decoration: none; color: InfoText } 28 | a.header:visited { text-decoration: none; color: InfoText } 29 | a.header:hover { text-decoration: underline; color: #000080; } 30 | h4 { font-style: italic; } 31 | strong { font-weight: bold; } 32 | em { font-style: italic; } 33 | var { font-style: italic; } 34 | th { font-weight: bold; } 35 | 36 | /* Workarounds for new Javadoc stylesheet (1.7) */ 37 | ul.blockList li.blockList, ul.blockListLast li.blockList { 38 | list-style:none; 39 | } 40 | ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { 41 | list-style:none; 42 | } 43 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/css/JavadocViewStyleSheet.css: -------------------------------------------------------------------------------- 1 | /* Font definitions */ 2 | html { font-family: sans-serif; font-size: 9pt; font-style: normal; font-weight: normal; } 3 | body, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt { font-size: 1em; } 4 | pre { font-family: monospace; } 5 | h1 { font-size: 1.8em; } 6 | h2 { font-size: 1.2em; } 7 | h3 { font-size: 1.1em; } 8 | 9 | /* Margins */ 10 | body { overflow: auto; margin-top: 5px; margin-bottom: 4px; margin-left: 8px; margin-right: 4px; } 11 | h1 { margin-top: 0.3em; margin-bottom: 0.04em; } 12 | h2 { margin-top: 2em; margin-bottom: 0.25em; } 13 | h3 { margin-top: 1.7em; margin-bottom: 0.25em; } 14 | h4 { margin-top: 2em; margin-bottom: 0.3em; } 15 | h5 { margin-top: 0px; margin-bottom: 0px; } 16 | p { margin-top: 1em; margin-bottom: 1em; } 17 | pre { margin-left: 0.6em; } 18 | ul { margin-top: 0px; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; } 19 | li { margin-top: 0px; margin-bottom: 0px; } 20 | li p { margin-top: 0px; margin-bottom: 0px; } 21 | ol { margin-top: 0px; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; } 22 | dl { margin-top: 0px; margin-bottom: 1em; } 23 | dt { margin-top: 0px; margin-bottom: 0px; font-weight: bold; } 24 | dd { margin-top: 0px; margin-bottom: 0px; } 25 | 26 | /* Styles and colors */ 27 | a:link { color: #0000FF; } 28 | a:hover { color: #000080; } 29 | a:visited { text-decoration: underline; } 30 | a.header:link { text-decoration: none; color: InfoText } 31 | a.header:visited { text-decoration: none; color: InfoText } 32 | a.header:hover { text-decoration: underline; color: #000080; } 33 | h4 { font-style: italic; } 34 | strong { font-weight: bold; } 35 | em { font-style: italic; } 36 | var { font-style: italic; } 37 | th { font-weight: bold; } 38 | 39 | /* Workarounds for new Javadoc stylesheet (1.7) */ 40 | ul.blockList li.blockList, ul.blockListLast li.blockList { 41 | list-style:none; 42 | } 43 | ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { 44 | list-style:none; 45 | } 46 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/css/e4-dark_typecs_syntaxhighlighting.css: -------------------------------------------------------------------------------- 1 | IEclipsePreferences#com-axmor-eclipse-typescript-editor { 2 | preferences: 3 | 'ts_default=216,216,216' 4 | 'ts_reference=190,214,255' 5 | 'ts_keyword=255,255,255' 6 | 'ts_string=225,198,0' 7 | 'ts_comment=199,221,12' 8 | 'ts_number=127,179,71' 9 | 'ts_java_doc=204,223,50' 10 | 'ts_brackets=216,216,216' 11 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/call_hierarchy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/call_hierarchy.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/class_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/class_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/constr_ovr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/constr_ovr.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/dtool16/mark_occurrences.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/dtool16/mark_occurrences.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/dtool16/mark_occurrences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/dtool16/mark_occurrences.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/enum_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/enum_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/enum_private_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/enum_private_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/etool16/mark_occurrences.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/etool16/mark_occurrences.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/etool16/mark_occurrences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/etool16/mark_occurrences.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/field_default_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/field_default_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/field_private_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/field_private_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/field_public_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/field_public_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/implm_co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/implm_co.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/innerclass_default_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/innerclass_default_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/innerclass_private_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/innerclass_private_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/innerclass_public_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/innerclass_public_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/innerinterface_default_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/innerinterface_default_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/innerinterface_private_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/innerinterface_private_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/innerinterface_public_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/innerinterface_public_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/int_default_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/int_default_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/int_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/int_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/methdef_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/methdef_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/methpri_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/methpri_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/methpub_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/methpub_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/over_co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/over_co.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/package_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/package_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/recursive_co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/recursive_co.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/search_ref_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/search_ref_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/static_co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/static_co.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/template_obj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/template_obj.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/typedef_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/typedef_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/typepri_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/typepri_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/typepub_obj.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/typepub_obj.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/full/warning_co.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/full/warning_co.gif -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/typescript_def_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/typescript_def_file.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/icons/typescript_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.editor/icons/typescript_file.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.editor 13 | eclipse-plugin 14 | 15 | TypEcs Editor Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/Activator.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor; 2 | 3 | import org.eclipse.core.runtime.Status; 4 | import org.eclipse.jface.resource.ImageDescriptor; 5 | import org.eclipse.jface.resource.ImageRegistry; 6 | import org.eclipse.swt.widgets.Display; 7 | import org.eclipse.ui.plugin.AbstractUIPlugin; 8 | import org.osgi.framework.BundleContext; 9 | 10 | /** 11 | * The activator class controls the plug-in life cycle 12 | */ 13 | public class Activator extends AbstractUIPlugin { 14 | 15 | /** 16 | * The plug-in ID 17 | */ 18 | public static final String PLUGIN_ID = "com.axmor.eclipse.typescript.editor"; //$NON-NLS-1$ 19 | 20 | /** 21 | * The shared instance 22 | */ 23 | private static Activator plugin; 24 | 25 | /** 26 | * The constructor 27 | */ 28 | public Activator() { 29 | } 30 | 31 | @Override 32 | public void start(BundleContext context) throws Exception { 33 | super.start(context); 34 | plugin = this; 35 | } 36 | 37 | @Override 38 | public void stop(BundleContext context) throws Exception { 39 | try { 40 | plugin = null; 41 | TypeScriptUIImages.disposeImageDescriptorRegistry(); 42 | } finally { 43 | super.stop(context); 44 | } 45 | } 46 | 47 | /** 48 | * Returns the shared instance 49 | * 50 | * @return the shared instance 51 | */ 52 | public static Activator getDefault() { 53 | return plugin; 54 | } 55 | 56 | /** 57 | * The method first checks, if the thread calling this method has an associated display. If so, 58 | * this display is returned. Otherwise the method returns the default display. 59 | * 60 | * @return the standard display to be used 61 | */ 62 | public static Display getStandardDisplay() { 63 | Display display = Display.getCurrent(); 64 | if (display == null) { 65 | display = Display.getDefault(); 66 | } 67 | return display; 68 | } 69 | 70 | /** 71 | * Returns an image descriptor for the image file at the given plug-in relative path 72 | * 73 | * @param path 74 | * the path 75 | * @return the image descriptor 76 | */ 77 | public static ImageDescriptor getImageDescriptor(String path) { 78 | return imageDescriptorFromPlugin(PLUGIN_ID, path); 79 | } 80 | 81 | @Override 82 | protected ImageRegistry createImageRegistry() { 83 | return TypeScriptUIImages.initializeImageRegistry(); 84 | } 85 | 86 | /** 87 | * Print error message to Error log. 88 | * 89 | * @param e 90 | * exception 91 | */ 92 | public static void error(final Exception e) { 93 | plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, e.getMessage(), e)); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/IDocumentProcessor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor; 9 | 10 | import org.eclipse.core.resources.IFile; 11 | import org.eclipse.jface.text.IDocument; 12 | 13 | /** 14 | * The document processor for the TypeScript Editor. 15 | * 16 | * @author Konstantin Zaitcev 17 | */ 18 | public interface IDocumentProcessor { 19 | 20 | /** 21 | * Invokes on document changes. 22 | * 23 | * @param file TypeScript file corresponding to a given document 24 | * @param doc the document which is changed 25 | */ 26 | void processDocument(IFile file, IDocument doc); 27 | } 28 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/QuickOutlineMouseMoveListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor; 9 | 10 | import org.eclipse.jface.viewers.TreeViewer; 11 | import org.eclipse.swt.events.MouseEvent; 12 | import org.eclipse.swt.events.MouseMoveListener; 13 | import org.eclipse.swt.graphics.Point; 14 | import org.eclipse.swt.widgets.Item; 15 | import org.eclipse.swt.widgets.Tree; 16 | import org.eclipse.swt.widgets.TreeItem; 17 | 18 | /** 19 | * @author Konstantin Zaitcev 20 | */ 21 | public class QuickOutlineMouseMoveListener implements MouseMoveListener { 22 | 23 | private TreeItem fLastItem; 24 | 25 | private TreeViewer fTreeViewer; 26 | 27 | public QuickOutlineMouseMoveListener(TreeViewer treeViewer) { 28 | fLastItem = null; 29 | fTreeViewer = treeViewer; 30 | } 31 | 32 | @Override 33 | public void mouseMove(MouseEvent e) { 34 | Tree tree = fTreeViewer.getTree(); 35 | if (tree.equals(e.getSource())) { 36 | Object o = tree.getItem(new Point(e.x, e.y)); 37 | if (o instanceof TreeItem) { 38 | if (!o.equals(fLastItem)) { 39 | fLastItem = (TreeItem) o; 40 | tree.setSelection(new TreeItem[] {fLastItem}); 41 | } else if (e.y < tree.getItemHeight() / 4) { 42 | // Scroll up 43 | Point p = tree.toDisplay(e.x, e.y); 44 | Item item = fTreeViewer.scrollUp(p.x, p.y); 45 | if (item instanceof TreeItem) { 46 | fLastItem = (TreeItem) item; 47 | tree.setSelection(new TreeItem[] {fLastItem}); 48 | } 49 | } else if (e.y > tree.getBounds().height - tree.getItemHeight() / 4) { 50 | // Scroll down 51 | Point p = tree.toDisplay(e.x, e.y); 52 | Item item = fTreeViewer.scrollDown(p.x, p.y); 53 | if (item instanceof TreeItem) { 54 | fLastItem = (TreeItem) item; 55 | tree.setSelection(new TreeItem[] {fLastItem}); 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/TypeScriptDocumentProvider.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor; 2 | 3 | import org.eclipse.core.runtime.CoreException; 4 | import org.eclipse.jface.text.IDocument; 5 | import org.eclipse.jface.text.IDocumentPartitioner; 6 | import org.eclipse.jface.text.rules.FastPartitioner; 7 | import org.eclipse.ui.editors.text.FileDocumentProvider; 8 | 9 | import com.axmor.eclipse.typescript.editor.parser.TypeScriptPartitionScanner; 10 | 11 | /** 12 | * @author Konstantin Zaitcev 13 | */ 14 | public class TypeScriptDocumentProvider extends FileDocumentProvider { 15 | @Override 16 | protected IDocument createDocument(Object element) throws CoreException { 17 | IDocument document = super.createDocument(element); 18 | if (document != null) { 19 | IDocumentPartitioner partitioner = new FastPartitioner(new TypeScriptPartitionScanner(), 20 | TypeScriptPartitionScanner.TS_PARTITION_TYPES); 21 | partitioner.connect(document); 22 | document.setDocumentPartitioner(partitioner); 23 | } 24 | return document; 25 | } 26 | 27 | public IDocument addDocument(Object element) throws CoreException { 28 | return this.createDocument(element); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/TypeScriptEditorActionContributor.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor; 2 | 3 | import org.eclipse.ui.IActionBars; 4 | import org.eclipse.ui.IEditorPart; 5 | import org.eclipse.ui.IWorkbenchPage; 6 | import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; 7 | import org.eclipse.ui.texteditor.ITextEditor; 8 | 9 | import com.axmor.eclipse.typescript.editor.actions.ToggleMarkOccurrencesAction; 10 | 11 | /** 12 | * @author Konstantin Zaitcev 13 | */ 14 | public class TypeScriptEditorActionContributor extends 15 | BasicTextEditorActionContributor { 16 | 17 | private ToggleMarkOccurrencesAction fToggleMarkOccurrencesAction; 18 | 19 | public TypeScriptEditorActionContributor() { 20 | super(); 21 | fToggleMarkOccurrencesAction = new ToggleMarkOccurrencesAction(); 22 | } 23 | 24 | @Override 25 | public void setActiveEditor(IEditorPart part) { 26 | super.setActiveEditor(part); 27 | if (fToggleMarkOccurrencesAction != null) { 28 | fToggleMarkOccurrencesAction.setEditor((ITextEditor) part); 29 | } 30 | } 31 | 32 | @Override 33 | public void init(IActionBars bars, IWorkbenchPage page) { 34 | super.init(bars, page); 35 | bars.setGlobalActionHandler("com.axmor.eclipse.typescript.toggleMarkOccurrences", fToggleMarkOccurrencesAction); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/TypeScriptElementHyperlink.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor; 9 | 10 | import org.eclipse.jface.text.IRegion; 11 | import org.eclipse.jface.text.hyperlink.IHyperlink; 12 | 13 | /** 14 | * Represents a TypeScript text hyperlink. 15 | * 16 | * @author Asya Vorobyova 17 | * 18 | */ 19 | public class TypeScriptElementHyperlink implements IHyperlink { 20 | 21 | /** 22 | * A TypeScript editor 23 | */ 24 | private TypeScriptEditor editor; 25 | 26 | /** 27 | * A region corresponding to an element 28 | */ 29 | private IRegion region; 30 | 31 | /** 32 | * @param editor an editor 33 | * @param region a region 34 | */ 35 | public TypeScriptElementHyperlink(TypeScriptEditor editor, IRegion region) { 36 | super(); 37 | this.editor = editor; 38 | this.region = region; 39 | } 40 | 41 | @Override 42 | public IRegion getHyperlinkRegion() { 43 | return region; 44 | } 45 | 46 | @Override 47 | public String getTypeLabel() { 48 | return null; 49 | } 50 | 51 | @Override 52 | public String getHyperlinkText() { 53 | return null; 54 | } 55 | 56 | @Override 57 | public void open() { 58 | TypeScriptEditorUtils.openDeclaration(editor); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/TypeScriptElementHyperlinkDetector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor; 9 | 10 | import org.eclipse.jface.text.BadLocationException; 11 | import org.eclipse.jface.text.IDocument; 12 | import org.eclipse.jface.text.IRegion; 13 | import org.eclipse.jface.text.ITextViewer; 14 | import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector; 15 | import org.eclipse.jface.text.hyperlink.IHyperlink; 16 | import org.eclipse.ui.IEditorInput; 17 | import org.eclipse.ui.texteditor.IDocumentProvider; 18 | import org.eclipse.ui.texteditor.ITextEditor; 19 | 20 | import com.axmor.eclipse.typescript.editor.parser.TypeScriptKeywordRuler; 21 | 22 | /** 23 | * Class that tries to find a hyperlink at a given location in a given text viewer. 24 | * 25 | * @author Asya Vorobyova 26 | * 27 | */ 28 | public class TypeScriptElementHyperlinkDetector extends AbstractHyperlinkDetector { 29 | 30 | @Override 31 | public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { 32 | TypeScriptEditor textEditor = (TypeScriptEditor) getAdapter(ITextEditor.class); 33 | if (region == null) { 34 | return null; 35 | } 36 | 37 | IDocumentProvider documentProvider = textEditor.getDocumentProvider(); 38 | IEditorInput editorInput = textEditor.getEditorInput(); 39 | IDocument document = documentProvider.getDocument(editorInput); 40 | IRegion wordRegion = TypeScriptEditorUtils.findWord(document, region.getOffset()); 41 | if (wordRegion == null || wordRegion.getLength() == 0) { 42 | return null; 43 | } 44 | try { 45 | String word = document.get(wordRegion.getOffset(), wordRegion.getLength()); 46 | if (TypeScriptKeywordRuler.KEYWORDS.contains(word) && !word.equals("super") && !word.equals("this")) { 47 | return null; 48 | } 49 | } catch (BadLocationException e) { 50 | Activator.error(e); 51 | } 52 | return new IHyperlink[] { new TypeScriptElementHyperlink(textEditor, wordRegion) }; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/TypeScriptOutlineLabelProvider.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor; 2 | 3 | import org.eclipse.jface.viewers.LabelProvider; 4 | import org.eclipse.swt.graphics.Image; 5 | 6 | import us.monoid.json.JSONException; 7 | import us.monoid.json.JSONObject; 8 | 9 | import com.google.common.base.Throwables; 10 | 11 | /** 12 | * A label provider to get images and texts for elements viewing 13 | * 14 | * @author Asya Vorobyova 15 | * 16 | */ 17 | class TypeScriptOutlineLabelProvider extends LabelProvider { 18 | 19 | @Override 20 | public Image getImage(Object element) { 21 | JSONObject obj = (JSONObject) element; 22 | TypeScriptUIImages imagesFactory = new TypeScriptUIImages(); 23 | return imagesFactory.getImageForModelObject(obj); 24 | } 25 | 26 | @Override 27 | public String getText(Object element) { 28 | try { 29 | JSONObject obj = (JSONObject) element; 30 | return obj.getString("text"); 31 | } catch (JSONException e) { 32 | throw Throwables.propagate(e); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/TypeScriptReconcilingStrategy.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor; 2 | 3 | import org.eclipse.core.runtime.IProgressMonitor; 4 | import org.eclipse.jface.text.IDocument; 5 | import org.eclipse.jface.text.IRegion; 6 | import org.eclipse.jface.text.Region; 7 | import org.eclipse.jface.text.reconciler.DirtyRegion; 8 | import org.eclipse.jface.text.reconciler.IReconcilingStrategy; 9 | import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension; 10 | import org.eclipse.jface.text.source.ISourceViewer; 11 | import org.eclipse.ui.texteditor.ITextEditor; 12 | 13 | public class TypeScriptReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension { 14 | 15 | private IDocument document; 16 | private ITextEditor editor; 17 | 18 | public TypeScriptReconcilingStrategy(ISourceViewer viewer, ITextEditor editor) { 19 | this.editor = editor; 20 | } 21 | 22 | @Override 23 | public void initialReconcile() { 24 | reconcile(new Region(0, document.getLength())); 25 | } 26 | 27 | @Override 28 | public void setProgressMonitor(IProgressMonitor monitor) { 29 | } 30 | 31 | @Override 32 | public void reconcile(IRegion partition) { 33 | if (editor instanceof TypeScriptEditor) { 34 | ((TypeScriptEditor) editor).updateSemanticHigliting(); 35 | } 36 | } 37 | 38 | @Override 39 | public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) { 40 | reconcile(dirtyRegion); 41 | } 42 | 43 | @Override 44 | public void setDocument(IDocument document) { 45 | this.document = document; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/actions/Messages.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.actions; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | import org.eclipse.osgi.util.NLS; 6 | 7 | public class Messages extends NLS { 8 | private static final String BUNDLE_NAME = "com.axmor.eclipse.typescript.editor.actions.messages"; //$NON-NLS-1$ 9 | private static final ResourceBundle fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME); 10 | 11 | public static String ToggleMarkOccurrencesAction_label; 12 | public static String TypescriptEditorPreferencePage_references; 13 | public static String TypescriptEditorPreferencePage_keywords; 14 | public static String TypescriptEditorPreferencePage_string; 15 | public static String TypescriptEditorPreferencePage_numbers; 16 | public static String TypescriptEditorPreferencePage_comments; 17 | public static String TypescriptEditorPreferencePage_java_doc; 18 | public static String TypescriptEditorPreferencePage_brackets; 19 | public static String TypescriptSyntaxColoringPage_default; 20 | static { 21 | // initialize resource bundle 22 | NLS.initializeMessages(BUNDLE_NAME, Messages.class); 23 | } 24 | 25 | private Messages() { 26 | } 27 | 28 | public static ResourceBundle getResourceBundle() { 29 | return fgResourceBundle; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/actions/messages.properties: -------------------------------------------------------------------------------- 1 | ToggleMarkOccurrencesAction_label=Toggle TypeScript Mark Occurrences 2 | TypescriptEditorPreferencePage_references=References 3 | TypescriptEditorPreferencePage_keywords=Keywords 4 | TypescriptEditorPreferencePage_string=String 5 | TypescriptEditorPreferencePage_numbers=Numbers 6 | TypescriptEditorPreferencePage_comments=Comments 7 | TypescriptEditorPreferencePage_java_doc=Java Doc 8 | TypescriptEditorPreferencePage_brackets=Brackets 9 | TypescriptSyntaxColoringPage_default=Default 10 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/color/ColorManager.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.color; 2 | 3 | import java.util.HashMap; 4 | import java.util.Iterator; 5 | import java.util.Map; 6 | 7 | import org.eclipse.jface.text.source.ISharedTextColors; 8 | import org.eclipse.swt.graphics.Color; 9 | import org.eclipse.swt.graphics.RGB; 10 | import org.eclipse.swt.widgets.Display; 11 | 12 | public class ColorManager implements ISharedTextColors { 13 | 14 | private static ColorManager fgColorManager; 15 | 16 | private ColorManager() { 17 | } 18 | 19 | public static ColorManager getDefault() { 20 | if (fgColorManager == null) { 21 | fgColorManager= new ColorManager(); 22 | } 23 | return fgColorManager; 24 | } 25 | 26 | protected Map fColorTable= new HashMap(10); 27 | 28 | @Override 29 | public Color getColor(RGB rgb) { 30 | Color color= fColorTable.get(rgb); 31 | if (color == null) { 32 | color= new Color(Display.getCurrent(), rgb); 33 | fColorTable.put(rgb, color); 34 | } 35 | return color; 36 | } 37 | 38 | @Override 39 | public void dispose() { 40 | Iterator e= fColorTable.values().iterator(); 41 | while (e.hasNext()) { 42 | (e.next()).dispose(); 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/compare/TypeScriptMergeViewer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.compare; 9 | 10 | import org.eclipse.compare.CompareConfiguration; 11 | import org.eclipse.compare.contentmergeviewer.TextMergeViewer; 12 | import org.eclipse.jface.text.IDocumentPartitioner; 13 | import org.eclipse.jface.text.TextViewer; 14 | import org.eclipse.jface.text.rules.FastPartitioner; 15 | import org.eclipse.jface.text.source.SourceViewer; 16 | import org.eclipse.swt.widgets.Composite; 17 | 18 | import com.axmor.eclipse.typescript.editor.TypeScriptEditorConfiguration; 19 | import com.axmor.eclipse.typescript.editor.parser.TypeScriptPartitionScanner; 20 | 21 | /** 22 | * @author Konstantin Zaitcev 23 | */ 24 | public class TypeScriptMergeViewer extends TextMergeViewer { 25 | 26 | /** 27 | * @param parent 28 | * parent 29 | * @param configuration 30 | * configuration 31 | */ 32 | public TypeScriptMergeViewer(Composite parent, CompareConfiguration configuration) { 33 | super(parent, configuration); 34 | } 35 | 36 | @Override 37 | protected void configureTextViewer(TextViewer textViewer) { 38 | ((SourceViewer) textViewer).configure(new TypeScriptEditorConfiguration()); 39 | } 40 | 41 | @Override 42 | protected IDocumentPartitioner getDocumentPartitioner() { 43 | return new FastPartitioner(new TypeScriptPartitionScanner(), TypeScriptPartitionScanner.TS_PARTITION_TYPES); 44 | } 45 | 46 | @Override 47 | protected String getDocumentPartitioning() { 48 | return "__ts_partitioner"; 49 | } 50 | 51 | @Override 52 | public String getTitle() { 53 | return "TypeScript Source Compare"; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/compare/TypeScriptMergeViewerCreator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.compare; 9 | 10 | import org.eclipse.compare.CompareConfiguration; 11 | import org.eclipse.compare.IViewerCreator; 12 | import org.eclipse.jface.viewers.Viewer; 13 | import org.eclipse.swt.widgets.Composite; 14 | 15 | /** 16 | * @author Konstantin Zaitcev 17 | */ 18 | public class TypeScriptMergeViewerCreator implements IViewerCreator { 19 | 20 | @Override 21 | public Viewer createViewer(Composite parent, CompareConfiguration config) { 22 | return new TypeScriptMergeViewer(parent, config); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/compare/TypeScriptViewerCreator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.compare; 9 | 10 | import org.eclipse.compare.CompareConfiguration; 11 | import org.eclipse.compare.IViewerCreator; 12 | import org.eclipse.jface.viewers.Viewer; 13 | import org.eclipse.swt.widgets.Composite; 14 | 15 | /** 16 | * @author Konstantin Zaitcev 17 | */ 18 | public class TypeScriptViewerCreator implements IViewerCreator { 19 | 20 | @Override 21 | public Viewer createViewer(Composite parent, CompareConfiguration config) { 22 | return new TypeScriptViewer(parent); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/contentassist/TypeScriptContextInformation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.contentassist; 9 | 10 | import org.eclipse.jface.text.Position; 11 | import org.eclipse.jface.text.contentassist.IContextInformation; 12 | import org.eclipse.swt.graphics.Image; 13 | 14 | /** 15 | * @author kudrin 16 | * 17 | */ 18 | public final class TypeScriptContextInformation implements IContextInformation { 19 | 20 | /** The name of the context. */ 21 | private final String fContextDisplayString; 22 | /** The information to be displayed. */ 23 | private final String fInformationDisplayString; 24 | /** The position of the context. */ 25 | private final Position fPosition; 26 | 27 | /** 28 | * Creates a new context information. 29 | * 30 | * @param contextDisplayString the string to be used when presenting the context 31 | * @param informationDisplayString the string to be displayed when presenting the context information 32 | */ 33 | public TypeScriptContextInformation(String contextDisplayString, String informationDisplayString, Position position) { 34 | fContextDisplayString = contextDisplayString; 35 | fInformationDisplayString = informationDisplayString; 36 | fPosition = position; 37 | } 38 | 39 | @Override 40 | public String getContextDisplayString() { 41 | return fContextDisplayString; 42 | } 43 | 44 | @Override 45 | public Image getImage() { 46 | return null; 47 | } 48 | 49 | @Override 50 | public String getInformationDisplayString() { 51 | return fInformationDisplayString; 52 | } 53 | 54 | public Position getPosition() { 55 | return fPosition; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/definitions/TypeScriptDefinitionLabelProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.definitions; 9 | 10 | import static com.google.common.base.Strings.nullToEmpty; 11 | 12 | import org.eclipse.jface.viewers.LabelProvider; 13 | import org.eclipse.swt.graphics.Image; 14 | 15 | import com.axmor.eclipse.typescript.editor.TypeScriptUIImages; 16 | import com.axmor.eclipse.typescript.editor.parser.TypeScriptImageKeys; 17 | 18 | /** 19 | * @author Konstantin Zaitcev 20 | */ 21 | public class TypeScriptDefinitionLabelProvider extends LabelProvider { 22 | 23 | @Override 24 | public Image getImage(Object element) { 25 | return TypeScriptUIImages.getImage(TypeScriptImageKeys.IMG_DTS_FILE); 26 | } 27 | 28 | @Override 29 | public String getText(Object element) { 30 | TypeScriptDefinition module = (TypeScriptDefinition) element; 31 | if (module != null) { 32 | return nullToEmpty(module.getName()) + " (" + nullToEmpty(module.getVersion()) + ")"; 33 | } 34 | return ""; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/handlers/CallHierarchyHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.handlers; 9 | 10 | import org.eclipse.core.commands.AbstractHandler; 11 | import org.eclipse.core.commands.ExecutionEvent; 12 | import org.eclipse.core.commands.ExecutionException; 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.jface.text.ITextSelection; 15 | import org.eclipse.ui.IEditorPart; 16 | import org.eclipse.ui.handlers.HandlerUtil; 17 | import org.eclipse.ui.part.FileEditorInput; 18 | 19 | import us.monoid.json.JSONArray; 20 | 21 | import com.axmor.eclipse.typescript.core.TypeScriptAPI; 22 | import com.axmor.eclipse.typescript.editor.TypeScriptEditor; 23 | import com.axmor.eclipse.typescript.editor.hierarchy.TypeScriptHierarchyUI; 24 | 25 | /** 26 | * @author kudrin 27 | * 28 | */ 29 | public class CallHierarchyHandler extends AbstractHandler { 30 | 31 | @Override 32 | public Object execute(ExecutionEvent event) throws ExecutionException { 33 | IEditorPart activeEditor = HandlerUtil.getActiveEditor(event); 34 | if (activeEditor == null || !(activeEditor instanceof TypeScriptEditor)) { 35 | return null; 36 | } 37 | TypeScriptEditor editor = (TypeScriptEditor) activeEditor; 38 | 39 | ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); 40 | int start = selection.getOffset(); 41 | IFile file = ((FileEditorInput) editor.getEditorInput()).getFile(); 42 | TypeScriptAPI api = editor.getApi(); 43 | JSONArray references = api.getReferencesAtPosition(file, start); 44 | TypeScriptHierarchyUI.openView(editor, file, references); 45 | return null; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/handlers/OpenDeclarationHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.handlers; 9 | 10 | import org.eclipse.core.commands.AbstractHandler; 11 | import org.eclipse.core.commands.ExecutionEvent; 12 | import org.eclipse.core.commands.ExecutionException; 13 | import org.eclipse.ui.handlers.HandlerUtil; 14 | 15 | import com.axmor.eclipse.typescript.editor.TypeScriptEditor; 16 | import com.axmor.eclipse.typescript.editor.TypeScriptEditorUtils; 17 | 18 | /** 19 | * Handler to perform declaration opening 20 | * 21 | * @author Asya Vorobyova 22 | * 23 | */ 24 | public class OpenDeclarationHandler extends AbstractHandler { 25 | 26 | @Override 27 | public Object execute(ExecutionEvent event) throws ExecutionException { 28 | TypeScriptEditor editor = (TypeScriptEditor) HandlerUtil.getActiveEditor(event); 29 | if (editor == null) { 30 | return null; 31 | } 32 | TypeScriptEditorUtils.openDeclaration(editor); 33 | return null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/handlers/QuickOutlineHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.handlers; 9 | 10 | import org.eclipse.core.commands.AbstractHandler; 11 | import org.eclipse.core.commands.ExecutionEvent; 12 | import org.eclipse.core.commands.ExecutionException; 13 | import org.eclipse.jface.dialogs.MessageDialog; 14 | import org.eclipse.jface.text.ITextOperationTarget; 15 | import org.eclipse.swt.custom.BusyIndicator; 16 | import org.eclipse.swt.widgets.Display; 17 | import org.eclipse.swt.widgets.Shell; 18 | import org.eclipse.ui.handlers.HandlerUtil; 19 | 20 | import com.axmor.eclipse.typescript.editor.TypeScriptEditor; 21 | import com.axmor.eclipse.typescript.editor.TypeScriptProjectionViewer; 22 | 23 | /** 24 | * Handler to show quick outline popup dialog 25 | * 26 | * @author Asya Vorobyova 27 | */ 28 | public class QuickOutlineHandler extends AbstractHandler { 29 | 30 | /** The text operation target */ 31 | private ITextOperationTarget operationTarget; 32 | 33 | @Override 34 | public Object execute(ExecutionEvent event) throws ExecutionException { 35 | TypeScriptEditor editor = (TypeScriptEditor) HandlerUtil.getActiveEditor(event); 36 | if (editor == null) { 37 | return null; 38 | } 39 | operationTarget = (TypeScriptProjectionViewer) editor.getViewer(); 40 | final int operationCode = TypeScriptProjectionViewer.QUICK_OUTLINE; 41 | 42 | Shell shell = HandlerUtil.getActiveShell(event); 43 | if (!operationTarget.canDoOperation(operationCode)) { 44 | if (shell != null) { 45 | MessageDialog.openError(shell, "Quick Outline", "Cannot show a quick outline dialog"); 46 | } 47 | return null; 48 | } 49 | 50 | Display display = null; 51 | if (shell != null && !shell.isDisposed()) { 52 | display = shell.getDisplay(); 53 | } 54 | 55 | BusyIndicator.showWhile(display, new Runnable() { 56 | public void run() { 57 | operationTarget.doOperation(operationCode); 58 | } 59 | }); 60 | 61 | return null; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/handlers/QuickRenameHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.handlers; 9 | 10 | import org.eclipse.core.commands.AbstractHandler; 11 | import org.eclipse.core.commands.ExecutionEvent; 12 | import org.eclipse.core.commands.ExecutionException; 13 | import org.eclipse.core.resources.IFile; 14 | import org.eclipse.jface.text.ITextSelection; 15 | import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2; 16 | import org.eclipse.ui.IEditorPart; 17 | import org.eclipse.ui.handlers.HandlerUtil; 18 | import org.eclipse.ui.part.FileEditorInput; 19 | 20 | import com.axmor.eclipse.typescript.core.TypeScriptAPI; 21 | import com.axmor.eclipse.typescript.editor.TypeScriptEditor; 22 | import com.axmor.eclipse.typescript.editor.rename.QuickRenameAssistProposal; 23 | 24 | /** 25 | * @author kudrin 26 | * 27 | */ 28 | public class QuickRenameHandler extends AbstractHandler { 29 | 30 | @Override 31 | public Object execute(ExecutionEvent event) throws ExecutionException { 32 | IEditorPart activeEditor = HandlerUtil.getActiveEditor(event); 33 | if (activeEditor == null || !(activeEditor instanceof TypeScriptEditor)) { 34 | return null; 35 | } 36 | TypeScriptEditor editor = (TypeScriptEditor) activeEditor; 37 | ITextSelection selection= (ITextSelection) editor.getSelectionProvider().getSelection(); 38 | IFile file = ((FileEditorInput) editor.getEditorInput()).getFile(); 39 | TypeScriptAPI api = editor.getApi(); 40 | QuickRenameAssistProposal proposal = new QuickRenameAssistProposal(api, file); 41 | ((ICompletionProposalExtension2) proposal).apply(editor.getViewer(), (char) 0, 0, selection.getOffset()); 42 | 43 | return null; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/hierarchy/TypeScriptHierarchyContentProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.hierarchy; 9 | 10 | import org.eclipse.jface.viewers.ITreeContentProvider; 11 | import org.eclipse.jface.viewers.Viewer; 12 | 13 | /** 14 | * @author kudrin 15 | * 16 | */ 17 | public class TypeScriptHierarchyContentProvider implements ITreeContentProvider { 18 | 19 | static final Object[] NO_CHILDREN = new Object[0]; 20 | 21 | public TypeScriptHierarchyContentProvider(CallHierarchyViewPart part) { 22 | super(); 23 | } 24 | 25 | @Override 26 | public void dispose() { 27 | } 28 | 29 | @Override 30 | public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 31 | } 32 | 33 | @Override 34 | public Object[] getElements(Object inputElement) { 35 | return (Object[]) inputElement; 36 | } 37 | 38 | @Override 39 | public Object[] getChildren(Object parentElement) { 40 | if (parentElement instanceof TreeRoot) { 41 | TreeRoot obj = (TreeRoot) parentElement; 42 | return obj.getChildren(); 43 | } 44 | return NO_CHILDREN; 45 | } 46 | 47 | @Override 48 | public Object getParent(Object element) { 49 | return null; 50 | } 51 | 52 | @Override 53 | public boolean hasChildren(Object element) { 54 | if (element instanceof TreeRoot) { 55 | TreeRoot obj = (TreeRoot) element; 56 | return obj.hasChildren(); 57 | } 58 | return false; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/hierarchy/TypeScriptHierarchyViewer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.hierarchy; 9 | 10 | import org.eclipse.jface.viewers.LabelProvider; 11 | import org.eclipse.jface.viewers.TreeViewer; 12 | import org.eclipse.swt.SWT; 13 | import org.eclipse.swt.graphics.Image; 14 | import org.eclipse.swt.widgets.Composite; 15 | 16 | /** 17 | * @author kudrin 18 | * 19 | */ 20 | public class TypeScriptHierarchyViewer extends TreeViewer { 21 | 22 | public static final Object EMPTY_ROOT = new Object(); 23 | 24 | private final CallHierarchyViewPart fPart; 25 | 26 | private TypeScriptHierarchyContentProvider fContentProvider; 27 | 28 | TypeScriptHierarchyViewer(Composite parent, CallHierarchyViewPart part) { 29 | super(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); 30 | fPart = part; 31 | 32 | fContentProvider = new TypeScriptHierarchyContentProvider(fPart); 33 | setContentProvider(fContentProvider); 34 | setLabelProvider(new ViewLabelProvider()); 35 | setAutoExpandLevel(2); 36 | } 37 | 38 | class ViewLabelProvider extends LabelProvider { 39 | @Override 40 | public Image getImage(Object element) { 41 | TreeRoot obj = (TreeRoot) element; 42 | return obj.getImage(); 43 | } 44 | 45 | @Override 46 | public String getText(Object element) { 47 | TreeRoot obj = (TreeRoot) element; 48 | return obj.getName() + " : " + obj.getLine() + " (" + obj.getFile().getProjectRelativePath().toString() 49 | + ")"; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/occurrence/OccurrencesFinderJobCanceler.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.occurrence; 2 | 3 | import org.eclipse.jface.text.DocumentEvent; 4 | import org.eclipse.jface.text.IDocument; 5 | import org.eclipse.jface.text.IDocumentListener; 6 | import org.eclipse.jface.text.ITextInputListener; 7 | import org.eclipse.jface.text.source.ISourceViewer; 8 | import org.eclipse.swt.custom.StyledText; 9 | import org.eclipse.ui.texteditor.IDocumentProvider; 10 | 11 | import com.axmor.eclipse.typescript.editor.TypeScriptEditor; 12 | 13 | /** 14 | * Cancels the occurrences finder job upon document changes. 15 | */ 16 | public class OccurrencesFinderJobCanceler implements IDocumentListener, ITextInputListener { 17 | 18 | private final TypeScriptEditor editor; 19 | private OccurrencesFinderJob fOccurrencesFinderJob; 20 | 21 | public OccurrencesFinderJobCanceler(TypeScriptEditor editor, OccurrencesFinderJob fOccurrencesFinderJob) { 22 | this.editor = editor; 23 | this.fOccurrencesFinderJob = fOccurrencesFinderJob; 24 | } 25 | 26 | public void install() { 27 | ISourceViewer sourceViewer = editor.getViewer(); 28 | if (sourceViewer == null) { 29 | return; 30 | } 31 | 32 | StyledText text = sourceViewer.getTextWidget(); 33 | if (text == null || text.isDisposed()) { 34 | return; 35 | } 36 | 37 | sourceViewer.addTextInputListener(this); 38 | 39 | IDocument document = sourceViewer.getDocument(); 40 | if (document != null) { 41 | document.addDocumentListener(this); 42 | } 43 | } 44 | 45 | public void uninstall() { 46 | ISourceViewer sourceViewer = editor.getViewer(); 47 | if (sourceViewer != null) { 48 | sourceViewer.removeTextInputListener(this); 49 | } 50 | 51 | IDocumentProvider documentProvider = editor.getDocumentProvider(); 52 | if (documentProvider != null) { 53 | IDocument document = documentProvider.getDocument(editor.getEditorInput()); 54 | if (document != null) { 55 | document.removeDocumentListener(this); 56 | } 57 | } 58 | } 59 | 60 | @Override 61 | public void documentAboutToBeChanged(DocumentEvent event) { 62 | if (fOccurrencesFinderJob != null) { 63 | fOccurrencesFinderJob.doCancel(); 64 | } 65 | } 66 | 67 | @Override 68 | public void documentChanged(DocumentEvent event) { 69 | // do nothing 70 | } 71 | 72 | @Override 73 | public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { 74 | if (oldInput == null) { 75 | return; 76 | } 77 | 78 | oldInput.removeDocumentListener(this); 79 | } 80 | 81 | @Override 82 | public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { 83 | if (newInput == null) { 84 | return; 85 | } 86 | newInput.addDocumentListener(this); 87 | } 88 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/JavaDocCommentRuler.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.parser; 2 | 3 | import org.eclipse.jface.text.rules.ICharacterScanner; 4 | import org.eclipse.jface.text.rules.IToken; 5 | import org.eclipse.jface.text.rules.MultiLineRule; 6 | 7 | /** 8 | * A rule for detecting patterns corresponding to comments 9 | * 10 | * @author Asya Vorobyova 11 | * 12 | */ 13 | public class JavaDocCommentRuler extends MultiLineRule { 14 | /** 15 | * A constructor 16 | * 17 | * @param token the token to be returned on success 18 | */ 19 | public JavaDocCommentRuler(IToken token) { 20 | super("/**", "*/", token); 21 | } 22 | 23 | @Override 24 | protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) { 25 | int c = scanner.read(); 26 | System.out.println("--------------"); 27 | System.out.println(sequence); 28 | System.out.println((char) c); 29 | 30 | if (sequence[0] == '/') { 31 | return true; 32 | } else if (sequence[0] == '/') { 33 | scanner.unread(); 34 | } 35 | return super.sequenceDetected(scanner, sequence, eofAllowed); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/SingleTokenScanner.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.parser; 2 | 3 | import org.eclipse.jface.text.TextAttribute; 4 | import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; 5 | import org.eclipse.jface.text.rules.Token; 6 | 7 | /** 8 | * 9 | * @author Konstantin Zaitcev 10 | * 11 | */ 12 | public class SingleTokenScanner extends BufferedRuleBasedScanner { 13 | /** 14 | * A constructor 15 | * 16 | * @param attribute for default return token 17 | */ 18 | public SingleTokenScanner(TextAttribute attribute) { 19 | setDefaultReturnToken(new Token(attribute)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/SymbolRule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.parser; 9 | 10 | import org.eclipse.core.runtime.Assert; 11 | import org.eclipse.jface.text.rules.ICharacterScanner; 12 | import org.eclipse.jface.text.rules.IRule; 13 | import org.eclipse.jface.text.rules.IToken; 14 | import org.eclipse.jface.text.rules.Token; 15 | 16 | /** 17 | * Rule to determine a specific symbol 18 | * 19 | * @author Asya Vorobyova 20 | * 21 | */ 22 | public class SymbolRule implements IRule { 23 | 24 | /** 25 | * Symbol to be determined 26 | */ 27 | private char fSymbol; 28 | 29 | /** 30 | * The token to be returned on success 31 | */ 32 | private IToken fToken; 33 | 34 | /** 35 | * A constructor 36 | * 37 | * @param symbol 38 | * to be determined 39 | * @param token 40 | * to be returned on success 41 | */ 42 | public SymbolRule(char symbol, IToken token) { 43 | Assert.isNotNull(token); 44 | 45 | fSymbol = symbol; 46 | fToken = token; 47 | } 48 | 49 | @Override 50 | public IToken evaluate(ICharacterScanner scanner) { 51 | int c = scanner.read(); 52 | if ((char) c == fSymbol) { 53 | return fToken; 54 | } 55 | scanner.unread(); 56 | return Token.UNDEFINED; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/TypeScriptModelKinds.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.parser; 9 | 10 | /** 11 | * Class to get kinds of model objects 12 | * 13 | * @author Asya Vorobyova 14 | */ 15 | public class TypeScriptModelKinds { 16 | 17 | /** 18 | * Model kinds 19 | */ 20 | public enum Kinds { 21 | /** Primitive type. */ 22 | PRIMITIVE_TYPE, 23 | /** Keyword. */ 24 | KEYWORD, 25 | /** Class. */ 26 | CLASS, 27 | /** Interface. */ 28 | INTERFACE, 29 | /** Module. */ 30 | MODULE, 31 | /** Property. */ 32 | PROPERTY, 33 | /** Method. */ 34 | METHOD, 35 | /** Constructor. */ 36 | CONSTRUCTOR, 37 | /** Function. */ 38 | FUNCTION, 39 | /** Variable. */ 40 | VAR, 41 | /** Enumeration. */ 42 | ENUM, 43 | /** Private modifier. */ 44 | PRIVATE, 45 | /** Public modifier. */ 46 | PUBLIC, 47 | /** Static modifier. */ 48 | STATIC, 49 | /** Type. */ 50 | TYPE; 51 | 52 | @Override 53 | public String toString() { 54 | if (name().equals("PRIMITIVE_TYPE")) { 55 | return "primitive type"; 56 | } 57 | String lowercase = name().toLowerCase(java.util.Locale.US); 58 | return lowercase; 59 | } 60 | }; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/TypeScriptPartitionScanner.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.parser; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.eclipse.jface.text.rules.EndOfLineRule; 7 | import org.eclipse.jface.text.rules.IPredicateRule; 8 | import org.eclipse.jface.text.rules.IToken; 9 | import org.eclipse.jface.text.rules.MultiLineRule; 10 | import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; 11 | import org.eclipse.jface.text.rules.SingleLineRule; 12 | import org.eclipse.jface.text.rules.Token; 13 | 14 | /** 15 | * @author Konstantin Zaitcev 16 | */ 17 | public class TypeScriptPartitionScanner extends RuleBasedPartitionScanner { 18 | /** Doc id */ 19 | public static final String TS_JAVA_DOC = "__ts_java_doc"; 20 | 21 | /** Comment id */ 22 | public static final String TS_COMMENT = "__ts_comment"; 23 | 24 | /** Reference id */ 25 | public static final String TS_REFERENCE = "__ts_reference"; 26 | 27 | /** 28 | * TypeScript partition types 29 | */ 30 | public static final String[] TS_PARTITION_TYPES = new String[] { 31 | TS_JAVA_DOC, 32 | TS_COMMENT, 33 | TS_REFERENCE 34 | }; 35 | 36 | /** 37 | * A constructor 38 | */ 39 | public TypeScriptPartitionScanner() { 40 | IToken javaDoc = new Token(TS_JAVA_DOC); 41 | IToken comment = new Token(TS_COMMENT); 42 | 43 | List rules = new ArrayList<>(); 44 | 45 | // rule for reference 46 | rules.add(new EndOfLineRule("///", new Token(TS_REFERENCE))); 47 | 48 | // Add rule for single line comments. 49 | rules.add(new EndOfLineRule("//", comment)); 50 | 51 | // Add rule for strings and character constants. 52 | rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\')); 53 | rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\')); 54 | rules.add(new SingleLineRule("`", "`", Token.UNDEFINED, '\\')); 55 | 56 | // Add rules for multi-line comments and javadoc. 57 | rules.add(new MultiLineRule("/**", "*/", javaDoc, (char) 0, true)); 58 | rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true)); 59 | 60 | IPredicateRule[] result = new IPredicateRule[rules.size()]; 61 | rules.toArray(result); 62 | setPredicateRules(result); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/TypeScriptTokenConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.parser; 9 | 10 | /** 11 | * @author Konstantin Zaitcev 12 | */ 13 | public final class TypeScriptTokenConstants { 14 | /** Token constant. */ 15 | public static final String TS_DEFAULT = "ts_default"; 16 | /** Token constant. */ 17 | public static final String TS_REFERENCE = "ts_reference"; 18 | /** Token constant. */ 19 | public static final String TS_KEYWORD = "ts_keyword"; 20 | /** Token constant. */ 21 | public static final String TS_STRING = "ts_string"; 22 | /** Token constant. */ 23 | public static final String TS_COMMENT = "ts_comment"; 24 | /** Token constant. */ 25 | public static final String TS_NUMBER = "ts_number"; 26 | /** Token constant. */ 27 | public static final String TS_JAVA_DOC = "ts_java_doc"; 28 | /** Token constant. */ 29 | public static final String TS_BRACKETS = "ts_brackets"; 30 | /** Token constant. */ 31 | public static final String TS_BOLD_SUFFIX = "_bold"; 32 | /** Token constant. */ 33 | public static final String TS_ITALIC_SUFFIX = "_italic"; 34 | 35 | /** 36 | * Protect from initialization. 37 | */ 38 | private TypeScriptTokenConstants() { 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/parser/TypeScriptWhitespaceDetector.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.parser; 2 | 3 | import org.eclipse.jface.text.rules.IWhitespaceDetector; 4 | 5 | /** 6 | * Class that helps to detect whitespaces 7 | * 8 | * @author Konstantin Zaitcev 9 | */ 10 | public class TypeScriptWhitespaceDetector implements IWhitespaceDetector { 11 | @Override 12 | public boolean isWhitespace(char c) { 13 | return (c == ' ' || c == '\t' || c == '\n' || c == '\r'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/preferences/SyntaxPreviewCode.txt: -------------------------------------------------------------------------------- 1 | /// 2 | module module1 { 3 | /** 4 | * This is about Greeter. 5 | */ 6 | class Greeter implements IGreeter { 7 | /* This comment may span multiple lines. */ 8 | constructor(public greeting: string) { } 9 | // This comment may span only this line 10 | greet() { 11 | return "

" + this.greeting + "

"; 12 | } 13 | }; 14 | interface IGreeter { 15 | greet(): string; 16 | } 17 | var greeter: IGreeter = new Greeter("Hello, world!"); 18 | var str = greeter.greet(); 19 | var num1: number = 123; 20 | document.body.innerHTML = str; 21 | } -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/preferences/TypescriptPreviewerUpdater.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.preferences; 2 | 3 | import org.eclipse.jface.preference.IPreferenceStore; 4 | import org.eclipse.jface.text.source.SourceViewer; 5 | import org.eclipse.jface.util.IPropertyChangeListener; 6 | import org.eclipse.jface.util.PropertyChangeEvent; 7 | import org.eclipse.swt.events.DisposeEvent; 8 | import org.eclipse.swt.events.DisposeListener; 9 | 10 | import com.axmor.eclipse.typescript.editor.TypeScriptEditorConfiguration; 11 | 12 | public class TypescriptPreviewerUpdater { 13 | 14 | public TypescriptPreviewerUpdater(final SourceViewer viewer, final TypeScriptEditorConfiguration configuration, final IPreferenceStore preferenceStore) { 15 | final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() { 16 | /* 17 | * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) 18 | */ 19 | public void propertyChange(PropertyChangeEvent event) { 20 | if (configuration.affectsTextPresentation(event)) { 21 | configuration.adaptToPreferenceChange(event); 22 | viewer.invalidateTextPresentation(); 23 | } 24 | } 25 | }; 26 | viewer.getTextWidget().addDisposeListener(new DisposeListener() { 27 | /* 28 | * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) 29 | */ 30 | public void widgetDisposed(DisposeEvent e) { 31 | preferenceStore.removePropertyChangeListener(propertyChangeListener); 32 | } 33 | }); 34 | preferenceStore.addPropertyChangeListener(propertyChangeListener); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/preferences/TypescriptTemplateContextType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.preferences; 9 | 10 | import org.eclipse.jface.text.templates.GlobalTemplateVariables; 11 | import org.eclipse.jface.text.templates.TemplateContextType; 12 | 13 | /** 14 | * @author kudrin 15 | * 16 | */ 17 | public class TypescriptTemplateContextType extends TemplateContextType { 18 | 19 | /** This context's id */ 20 | public static final String TYPESCRIPT_CONTEXT_TYPE = "typeScript"; //$NON-NLS-1$ 21 | 22 | /** 23 | * Creates a new XML context type. 24 | */ 25 | public TypescriptTemplateContextType() { 26 | addGlobalResolvers(); 27 | } 28 | 29 | private void addGlobalResolvers() { 30 | addResolver(new GlobalTemplateVariables.Cursor()); 31 | addResolver(new GlobalTemplateVariables.WordSelection()); 32 | addResolver(new GlobalTemplateVariables.LineSelection()); 33 | addResolver(new GlobalTemplateVariables.Dollar()); 34 | addResolver(new GlobalTemplateVariables.Date()); 35 | addResolver(new GlobalTemplateVariables.Year()); 36 | addResolver(new GlobalTemplateVariables.Time()); 37 | addResolver(new GlobalTemplateVariables.User()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/rename/RenameInfo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.rename; 9 | 10 | /** 11 | * Rename refactor information Java bean. 12 | * 13 | * @author Konstantin Zaitcev 14 | */ 15 | public class RenameInfo { 16 | 17 | /** An old name. */ 18 | private String oldName; 19 | /** A new name. */ 20 | private String newName; 21 | /** File path. */ 22 | private String path; 23 | /** Position of old name. */ 24 | private int position; 25 | 26 | /** 27 | * @return the oldName 28 | */ 29 | public String getOldName() { 30 | return oldName; 31 | } 32 | 33 | /** 34 | * @param oldName 35 | * the oldName to set 36 | */ 37 | public void setOldName(String oldName) { 38 | this.oldName = oldName; 39 | } 40 | 41 | /** 42 | * @return the newName 43 | */ 44 | public String getNewName() { 45 | return newName; 46 | } 47 | 48 | /** 49 | * @param newName 50 | * the newName to set 51 | */ 52 | public void setNewName(String newName) { 53 | this.newName = newName; 54 | } 55 | 56 | /** 57 | * @return the path 58 | */ 59 | public String getPath() { 60 | return path; 61 | } 62 | 63 | /** 64 | * @param path 65 | * the path to set 66 | */ 67 | public void setPath(String path) { 68 | this.path = path; 69 | } 70 | 71 | /** 72 | * @return the position 73 | */ 74 | public int getPosition() { 75 | return position; 76 | } 77 | 78 | /** 79 | * @param position 80 | * the position to set 81 | */ 82 | public void setPosition(int position) { 83 | this.position = position; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/rename/RenameWizard.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.editor.rename; 9 | 10 | import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring; 11 | import org.eclipse.ltk.ui.refactoring.RefactoringWizard; 12 | 13 | /** 14 | * @author Konstantin Zaitcev 15 | */ 16 | public class RenameWizard extends RefactoringWizard { 17 | 18 | /** Rename info bean. */ 19 | private final RenameInfo info; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param processor 25 | * refactoring processor 26 | * @param info 27 | * rename info bean 28 | */ 29 | public RenameWizard(final RenameProcessor processor, final RenameInfo info) { 30 | super(new ProcessorBasedRefactoring(processor), RefactoringWizard.WIZARD_BASED_USER_INTERFACE); 31 | this.info = info; 32 | setDefaultPageTitle("Rename Element"); 33 | } 34 | 35 | @Override 36 | protected void addUserInputPages() { 37 | addPage(new RenameInputPage(info)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/semantichighlight/TypeScriptPresentationReconciler.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.semantichighlight; 2 | 3 | import org.eclipse.jface.text.IDocument; 4 | import org.eclipse.jface.text.IRegion; 5 | import org.eclipse.jface.text.TextPresentation; 6 | import org.eclipse.jface.text.presentation.PresentationReconciler; 7 | 8 | public class TypeScriptPresentationReconciler extends PresentationReconciler { 9 | 10 | /** Last used document */ 11 | private IDocument fLastDocument; 12 | 13 | /** 14 | * Constructs a "repair description" for the given damage and returns this description as a text 15 | * presentation. 16 | *

17 | * NOTE: Should not be used if this reconciler is installed on a viewer. 18 | *

19 | */ 20 | public TextPresentation createRepairDescription(IRegion damage, IDocument document) { 21 | if (document != fLastDocument) { 22 | setDocumentToDamagers(document); 23 | setDocumentToRepairers(document); 24 | fLastDocument = document; 25 | } 26 | return createPresentation(damage, document); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/semantichighlight/TypeScriptSemanticHighlighting.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.editor.semantichighlight; 2 | 3 | import org.eclipse.swt.graphics.RGB; 4 | 5 | import us.monoid.json.JSONObject; 6 | 7 | public abstract class TypeScriptSemanticHighlighting { 8 | 9 | /** 10 | * @return the preference key, will be augmented by a prefix and a suffix for each preference 11 | */ 12 | public abstract String getPreferenceKey(); 13 | 14 | /** 15 | * @return the default default text color 16 | */ 17 | public abstract RGB getDefaultTextColor(); 18 | 19 | /** 20 | * @return true if the text attribute bold is set by default 21 | */ 22 | public abstract boolean isBoldByDefault(); 23 | 24 | /** 25 | * @return true if the text attribute italic is set by default 26 | */ 27 | public abstract boolean isItalicByDefault(); 28 | 29 | /** 30 | * @return true if the text attribute italic is enabled by default 31 | */ 32 | public abstract boolean isEnabledByDefault(); 33 | 34 | /** 35 | * @return the display name 36 | */ 37 | public abstract String getDisplayName(); 38 | 39 | public abstract boolean consumes(JSONObject obj); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/src/com/axmor/eclipse/typescript/editor/wizards/NewClassCode.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * New typescript file 3 | */ -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.editor/templates/typescript-default.properties: -------------------------------------------------------------------------------- 1 | Templates.for_array=iterate over array 2 | Templates.for_temp=iterate over array with temporary variable 3 | Templates.for_iterable=iterate using for .. in 4 | Templates.do=do while statement 5 | Templates.switch=switch case statement 6 | Templates.if=if statement 7 | Templates.ifelse=if else statement 8 | Templates.elseif=else if block 9 | Templates.else=else block 10 | Templates.try=try catch block 11 | Templates.catch=catch block 12 | Templates.public_method=function 13 | Templates.anonymous_public_method=anonymous function 14 | Templates.new=create new object -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.feature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.FeatureNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.feature/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | epl-v10.html,\ 3 | feature.properties 4 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.feature/feature.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.feature/feature.properties -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | %description 11 | 12 | 13 | 14 | %copyright 15 | 16 | 17 | 18 | %license 19 | 20 | 21 | 24 | 25 | 28 | 29 | 32 | 33 | 38 | 39 | 44 | 45 | 51 | 52 | 58 | 59 | 65 | 66 | 72 | 73 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.feature/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.feature 13 | eclipse-feature 14 | 15 | TypEcs Feature 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.repository/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.repository 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.repository/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.repository/category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.repository/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.repository 13 | eclipse-repository 14 | 15 | TypEcs Update Site Repository 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | net.sf.eclipsecs.core.CheckstyleBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | net.sf.eclipsecs.core.CheckstyleNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.7 8 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: TypEcs UI Plugin 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript.ui; singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Activator: com.axmor.eclipse.typescript.ui.Activator 7 | Bundle-Vendor: Axmor Software Inc. 8 | Require-Bundle: org.eclipse.ui, 9 | org.eclipse.ui.views, 10 | com.axmor.eclipse.typescript.core, 11 | org.eclipse.core.runtime, 12 | org.eclipse.ui.console 13 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 14 | Bundle-ActivationPolicy: lazy 15 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | icons/ 7 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/icons/typecs16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript.ui/icons/typecs16.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript.ui 13 | eclipse-plugin 14 | 15 | TypEcs UI Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/src/com/axmor/eclipse/typescript/PerspectiveFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript; 9 | 10 | import org.eclipse.ui.IFolderLayout; 11 | import org.eclipse.ui.IPageLayout; 12 | import org.eclipse.ui.IPerspectiveFactory; 13 | import org.eclipse.ui.console.IConsoleConstants; 14 | 15 | /** 16 | * @author Konstantin Zaitcev 17 | */ 18 | public class PerspectiveFactory implements IPerspectiveFactory { 19 | 20 | @Override 21 | public void createInitialLayout(IPageLayout layout) { 22 | String editorArea = layout.getEditorArea(); 23 | layout.setEditorAreaVisible(true); 24 | 25 | IFolderLayout leftFolder = layout.createFolder("left", IPageLayout.LEFT, 0.22f, editorArea); 26 | IFolderLayout bottomFolder = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.65f, editorArea); 27 | IFolderLayout rightFolder = layout.createFolder("right", IPageLayout.RIGHT, 0.80f, editorArea); 28 | 29 | leftFolder.addView("org.eclipse.ui.navigator.ProjectExplorer"); 30 | leftFolder.addView("org.eclipse.jdt.ui.PackageExplorer"); 31 | 32 | 33 | bottomFolder.addView("org.eclipse.ui.views.ProblemView"); 34 | bottomFolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); 35 | 36 | rightFolder.addView("org.eclipse.ui.views.ContentOutline"); 37 | 38 | layout.addActionSet("org.eclipse.debug.ui.launchActionSet"); 39 | 40 | layout.addNewWizardShortcut("com.axmor.eclipse.typescript.editor.wizards.NewClassWizard"); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/src/com/axmor/eclipse/typescript/ui/Activator.java: -------------------------------------------------------------------------------- 1 | package com.axmor.eclipse.typescript.ui; 2 | 3 | import org.eclipse.core.runtime.Status; 4 | import org.eclipse.jface.resource.ImageDescriptor; 5 | import org.eclipse.ui.plugin.AbstractUIPlugin; 6 | import org.osgi.framework.BundleContext; 7 | 8 | /** 9 | * The activator class controls the plug-in life cycle 10 | */ 11 | public class Activator extends AbstractUIPlugin { 12 | 13 | /** 14 | * The plug-in ID 15 | */ 16 | public static final String PLUGIN_ID = "com.axmor.eclipse.typescript.ui"; //$NON-NLS-1$ 17 | 18 | /** 19 | * The shared instance 20 | */ 21 | private static Activator plugin; 22 | 23 | /** 24 | * The constructor 25 | */ 26 | public Activator() { 27 | } 28 | 29 | @Override 30 | public void start(BundleContext context) throws Exception { 31 | super.start(context); 32 | plugin = this; 33 | } 34 | 35 | @Override 36 | public void stop(BundleContext context) throws Exception { 37 | try { 38 | plugin = null; 39 | } finally { 40 | super.stop(context); 41 | } 42 | } 43 | 44 | /** 45 | * Returns the shared instance 46 | * 47 | * @return the shared instance 48 | */ 49 | public static Activator getDefault() { 50 | return plugin; 51 | } 52 | 53 | /** 54 | * Returns an image descriptor for the image file at the given plug-in relative path 55 | * 56 | * @param path 57 | * the path 58 | * @return the image descriptor 59 | */ 60 | public static ImageDescriptor getImageDescriptor(String path) { 61 | return imageDescriptorFromPlugin(PLUGIN_ID, path); 62 | } 63 | 64 | /** 65 | * Print error message to Error log. 66 | * 67 | * @param e 68 | * exception 69 | */ 70 | public static void error(final Exception e) { 71 | plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, e.getMessage(), e)); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript.ui/src/com/axmor/eclipse/typescript/ui/Startup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 Axmor Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | *******************************************************************************/ 8 | package com.axmor.eclipse.typescript.ui; 9 | 10 | import org.eclipse.core.runtime.preferences.ConfigurationScope; 11 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; 12 | import org.eclipse.ui.IPerspectiveDescriptor; 13 | import org.eclipse.ui.IStartup; 14 | import org.eclipse.ui.IWorkbench; 15 | import org.eclipse.ui.IWorkbenchWindow; 16 | import org.eclipse.ui.PlatformUI; 17 | import org.osgi.service.prefs.BackingStoreException; 18 | 19 | /** 20 | * @author Konstantin Zaitcev 21 | */ 22 | public class Startup implements IStartup { 23 | 24 | /** First start indicator to show TypeScript perspective. */ 25 | private static final String CFG_SHOW_PERSPECTIVE_KEY = "show_perspective"; 26 | 27 | /** TypeScript perspective identifier. */ 28 | private static final String TYPESCRIPT_PERSPECTIVE_ID = "com.axmor.eclipse.typescript.perspective"; 29 | 30 | @Override 31 | public void earlyStartup() { 32 | IEclipsePreferences pref = ConfigurationScope.INSTANCE.getNode(this.getClass().getName()); 33 | if (pref.getBoolean(CFG_SHOW_PERSPECTIVE_KEY, true)) { 34 | pref.putBoolean(CFG_SHOW_PERSPECTIVE_KEY, false); 35 | try { 36 | pref.flush(); 37 | } catch (BackingStoreException e) { 38 | Activator.error(e); 39 | } 40 | final IWorkbench workbench = PlatformUI.getWorkbench(); 41 | workbench.getDisplay().asyncExec(new Runnable() { 42 | public void run() { 43 | IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); 44 | if (window != null && window.getActivePage() != null) { 45 | IPerspectiveDescriptor desc = PlatformUI.getWorkbench().getPerspectiveRegistry() 46 | .findPerspectiveWithId(TYPESCRIPT_PERSPECTIVE_ID); 47 | window.getActivePage().setPerspective(desc); 48 | } 49 | } 50 | }); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.axmor.eclipse.typescript 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | net.sf.eclipsecs.core.CheckstyleBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | net.sf.eclipsecs.core.CheckstyleNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.7 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.7 12 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: TypEcs - TypeScript IDE for Eclipse 4 | Bundle-SymbolicName: com.axmor.eclipse.typescript;singleton:=true 5 | Bundle-Version: 4.0.0.qualifier 6 | Bundle-Vendor: Axmor Software Inc. 7 | Bundle-ActivationPolicy: lazy 8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 9 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/about.ini: -------------------------------------------------------------------------------- 1 | # about.ini 2 | 3 | # Property "aboutText" contains blurb for "About" dialog (translated) 4 | aboutText=TypEcs - TypeScript IDE for Eclipse.\n\ 5 | \n\Copyright (c) 2014 Axmor Software Inc. All rights reserved.\n\ 6 | Visit https://bitbucket.org/axmor/eclipse-typescript 7 | 8 | # Property "windowImage" contains path to window icon (16x16) 9 | # needed for primary features only 10 | windowImage=typecs16.png 11 | 12 | # Property "featureImage" contains path to feature image (32x32) 13 | featureImage=typecs.png 14 | 15 | # Property "aboutImage" contains path to product image (500x330 or 115x164) 16 | # needed for primary features only 17 | 18 | # Property "appName" contains name of the application (not translated) 19 | # needed for primary features only 20 | 21 | # Property "welcomePerspective" contains the id of the perspective in which the 22 | # welcome page is to be opened. 23 | # optional 24 | 25 | # Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page 26 | # optional 27 | # tipsAndTricksHref=/org.eclipse.jdt.doc.user/tips/jdt_tips.html 28 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = target/classes 3 | bin.includes = typecs16.png,\ 4 | typecs.png,\ 5 | about.ini,\ 6 | META-INF/ -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | 6 | com.axmor.eclipse.typescript 7 | product 8 | 4.0.0-SNAPSHOT 9 | 10 | 11 | com.axmor.eclipse.typescript 12 | com.axmor.eclipse.typescript 13 | eclipse-plugin 14 | 15 | TypEcs Plugin 16 | -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/typecs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript/typecs.png -------------------------------------------------------------------------------- /src/com.axmor.eclipse.typescript/typecs16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axmor/typecs/f89f0f7b6cb5ed0c445e45052b9274820bf61ac1/src/com.axmor.eclipse.typescript/typecs16.png --------------------------------------------------------------------------------