facebook

Typescript 2 Support planned?

  1. CodeMix & Angular IDE
  2.  > 
  3. Webclipse 1.x Help
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #497552 Reply

    baca
    Participant

    Hi,

    Are you guys planning to support Typescript 2 anytime soon?

    Thanks,

    Greg

    #497553 Reply

    Brian Fernandes
    Moderator

    Greg,

    Absolutely – our next release, 2016 CI 8, due in about a month, will include TypeScript 2 support.

    Have you already tried the TypeScript support in CI 7? Are there any features you would like to see in our TS tooling – any suggestions or feedback would be appreciated.

    Thank you for asking.

    #497554 Reply

    baca
    Participant

    Hi Brian,

    I’m just trying it out now. I’ve just started work with a new project that contains a lot of TypeScript code, React components, all wrapped up with Webpack, and I’m trying to find some useful tool support.

    Am I right in understanding that I can’t add breakpoints in the typescript code, only in the transpiled JS?

    It would be great to be able to debug directly in the TS file, and somehow sourcemap from the JS.

    Greg

    #497627 Reply

    Brian Fernandes
    Moderator

    Greg,

    Am I right in understanding that I canโ€™t add breakpoints in the typescript code, only in the transpiled JS?

    Yes and no. Our JS debugger has sourcemap support, with which you can add breakpoints in the original TypeScript script file, you don’t need to do this in the transpiled JS (though you certainly can there too, of course). However, due to an unfortunate oversight, we forgot to add breakpoint support to the TS editor ๐Ÿ™

    As a workaround, you can open the TS file in the JS editor, and add the breakpoints there, while you continue editing in the TS editor. We’ll have this fixed in the next release, of course.

    For details on TypeScript debugging, see this doc: https://www.genuitec.com/tech/javascript-debugging-with-source-maps/

    Apologies for the inconvenience caused and thank you for asking!

    #497898 Reply

    hd42
    Participant

    When this happen, I would love to see the option to configure Webclipse to use my globally installed typescript on my system.

    #497900 Reply

    hd42
    Participant

    Some feedback on TS tooling:

    1) when ctrl-space inside an import statement I would have expected the system to show the publically available elements from the give reference file. Instead I believe it is showing all of them from all imports.

    2) Smarter editors for tsconfig.json (like you have for package.json) would be nice

    3) Ctrl-space within @ directive is great, but
    a) hovering over existing element doesn’t show its documentation
    b) mutually exclusive entries like styles/styleURL are not obvious or documented

    4) Outline view is always collapsed by default, it should be fully expanded by default, no? Or retain that last state? Java does this.

    5) Ability to export & import formatting/style settings

    Overall, its a good tool…I think you guys are close to making us Eclipse users not have to use Webstorm.

    #498313 Reply

    Brian Fernandes
    Moderator

    Some of these issues have already been fixed for the upcoming CI 8 release, and we’ve targeted most of your suggestions to CI 8 as well.

    We appreciate the kind words and the detailed feedback, do keep it coming!

    #500088 Reply

    baca
    Participant

    Hi,

    Just checking out the CI7a build now – TS/webpack breakpoints look good so far, great work guys!

    But I have another question: It seems that if you open the dev console in Chrome it detaches from eclipse and breakpoints stop working. This is understandable as I imagine Chrome grabs back control on the JS debugging, but I often also need to use the other parts of the dev console, especially the Network panel.

    I think IDEA addresses this by having their own Network debugging in the IDE.

    Just to be clear, I really want to be able to see what network requests are being made by the browser, and what response it’s getting, ideally while debugging in Eclipse – so stepping over GETs or POSTs and seeing what’s going over the wire.

    Is there currently or any plans to either build in something that lets me do this? Or is there a work around, i.e., somehow disable/stop Chrome grabbing back debugging for JS while having it still showing network requests?

    Thanks

    #501361 Reply

    baca
    Participant

    Hi,

    Got a bit of odd functionality here:

    Debugging was working mostly okay in my webpack/TS project – I could set breakpoints and launch a debug session, and execution would break and eclipse would open a file with the pointer at the right place. Strangely, the file that opened wouldn’t be ‘myfile.ts’ but ‘myfile.ts.js’. But at least I could step over and evaluate etc.

    But now I’m getting an error. Eclipse opens an editor with ‘source not found’. If I click ‘Edit source lookup path’ I can see that my sources path should be there.

    I also see an eclipse error log:

    The following will be send to: Eclipse

    REPORT

    anonymousId 3210bfa1-3fe7-4b8b-b818-40c364478ff5
    name
    email
    comment
    eclipseBuildId 4.6.1.M20160907-1200
    eclipseProduct org.eclipse.epp.package.jee.product
    javaRuntimeVersion 1.8.0_102-b14
    osgiWs cocoa
    osgiOs MacOSX
    osgiOsVersion 10.11.6
    osgiArch x86_64
    severity UNKNOWN

    STATUS

    pluginId org.eclipse.debug.core
    pluginVersion 3.10.100.v20160419-1720
    code 125
    severity 4
    message Error logged from Debug Core:
    fingerprint a8ec40562b636dbec1bcd5df9e16ca35

    Exception:org.eclipse.core.internal.resources.ResourceException: The project description file (.project) for ‘JavaScript Debug Target Source’ is missing. This file contains important information about the project. The project will not function properly until this file is restored.
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
    at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:904)
    at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:774)
    at org.eclipse.core.internal.resources.Project.open(Project.java:1041)
    at org.eclipse.core.internal.resources.Project.open(Project.java:1087)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:142)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doSourceLookup(AbstractSourceLookupDirector.java:505)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.getSourceElement(AbstractSourceLookupDirector.java:785)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at HIDDEN.HIDDEN(HIDDEN:-1)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    STATUS

    pluginId org.eclipse.core.resources
    pluginVersion 3.11.0.v20160503-1608
    code 567
    severity 4
    message The project description file (.project) for ‘JavaScript Debug Target Source’ is missing. This file contains important information about the project. The project will not function properly until this file is restored. [detached from CoreException of Status ‘Error logged from Debug Core: ‘ by Error Reporting]
    fingerprint 8aae7670c44189d614d7f7a579549a1f

    BUNDLES

    name com.genuitec.eclipse.javascript.debug.core
    version 13.0.0.201610070900

    name org.eclipse.core.jobs
    version 3.8.0.v20160509-0411

    name org.eclipse.core.resources
    version 3.11.0.v20160503-1608

    name org.eclipse.core.runtime
    version 3.12.0.v20160606-1342

    name org.eclipse.debug.core
    version 3.10.100.v20160419-1720

    #501364 Reply

    baca
    Participant

    Un ‘Hidden’ stack trace:

    org.eclipse.core.internal.resources.ResourceException: The project description file (.project) for ‘JavaScript Debug Target Source’ is missing. This file contains important information about the project. The project will not function properly until this file is restored.
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
    at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:904)
    at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:774)
    at org.eclipse.core.internal.resources.Project.open(Project.java:1041)
    at org.eclipse.core.internal.resources.Project.open(Project.java:1087)
    at com.genuitec.eclipse.javascript.debug.core.sourcelookup.DebugTargetSourceManager.ensureProjectLoaded(DebugTargetSourceManager.java:81)
    at com.genuitec.eclipse.javascript.debug.core.sourcelookup.DebugTargetSourceManager.loadDebugTargetScriptSource(DebugTargetSourceManager.java:91)
    at com.genuitec.eclipse.javascript.debug.core.sourcelookup.internal.JSSourceLookupParticipant.findSourceElements(JSSourceLookupParticipant.java:25)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:142)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.findSourceElements_aroundBody0(AbstractSourceLookupDirector.java:768)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$AjcClosure1.run(AbstractSourceLookupDirector.java:1)
    at scala.tools.eclipse.contribution.weaving.jdt.core.SourceLookupAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_SourceLookupAspect$1$1d3458edproceed(SourceLookupAspect.aj:21)
    at scala.tools.eclipse.contribution.weaving.jdt.core.SourceLookupAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_core_SourceLookupAspect$1$1d3458ed(SourceLookupAspect.aj:35)
    at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.findSourceElements(AbstractSourceLookupDirector.java:767)
    at com.genuitec.eclipse.javascript.debug.core.sourcelookup.JSScriptResolver.getWorkspaceFiles(JSScriptResolver.java:61)
    at com.genuitec.eclipse.javascript.debug.core.sourcelookup.JSScriptResolver.matches(JSScriptResolver.java:32)
    at org.eclipse.wst.jsdt.debug.internal.core.model.ScriptResolverExtension.matches(ScriptResolverExtension.java:57)
    at org.eclipse.wst.jsdt.debug.internal.core.model.ScriptResolutionManager.matches(ScriptResolutionManager.java:70)
    at org.eclipse.wst.jsdt.debug.internal.core.breakpoints.JavaScriptBreakpoint.handleEvent(JavaScriptBreakpoint.java:456)
    at org.eclipse.wst.jsdt.debug.internal.core.model.EventDispatcher.dispatch(EventDispatcher.java:125)
    at org.eclipse.wst.jsdt.debug.internal.core.model.EventDispatcher.run(EventDispatcher.java:95)
    at java.lang.Thread.run(Thread.java:745)

    #501367 Reply

    Brian Fernandes
    Moderator

    Greg,

    Is there currently or any plans to either build in something that lets me do this? Or is there a work around, i.e., somehow disable/stop Chrome grabbing back debugging for JS while having it still showing network requests?

    I’m not sure it will be possible to prevent Chrome from grabbing control, but we will look at what we can do here to improve this experience, given the features you actually need – really appreciate you bringing us this request.

    As far as debugging is concerned, it’s odd that the JS file was opened in the first place – would indicate that there is something awry with the source maps – they’re able to place a breakpoint in the right JS file but not translate that back into TS source when the debugging happens. You should never have had to see the .js file at all (support for Webpack was added in CI 7a), for some reason it doesn’t appear to be working for you. Just to clarify, are you saying that the .js file would open initially, but now, not even that is happening?

    1) Can you reference this doc: https://www.genuitec.com/tech/javascript-debugging-with-source-maps/
    and see if there is anything you may have missed – specifically, if the “Loaded JavaScript” view is showing the source maps as described?
    2) Have you enabled the source map related options on the TypeScript > Compiler property page? Have you enabled the “Automatically compile TypeScript files” on the Build Path page?
    3) Can you share your tsconfig.json and any other configuration files related to building that might help, specifically how the .map files are being generated? If you could share one of the .map files themselves, that would help a great deal.
    4) Can you share a screenshot of the launch settings you are using to initiate debugging?

    To reiterate, this should work just fine, but there seems to be a bug / misconfiguration due to which you’re experiencing these problems – with your info, we should be able to figure it out.

    #501373 Reply

    baca
    Participant

    Hi Brian,

    To clarify, yes, initially the .js file would open, but now that isn’t happening. Now, an editor window opens with the correct ‘title’ i.e, in this case the title of the editor is “workflow-widget.ts WorkflowCanTransitionWidget.render() line:59”, but with content “Source not found.”

    So I’m guessing that source maps should be working okay, as it looks like it knows which file to open.

    Also, in chrome, I can see that it looks like it can find the sourcemap no problem.

    See the attached screenshots.

    As to your points:

    1) I don’t see sourcemaps here, just the webpack filename-bundle.js files
    2) I am not using eclipse to generate JS or sourcemaps, I am using the webpack-dev-server

    3 & 4) I can’t really provide this just now (I have to get one with some work! ๐Ÿ™ maybe later…), but this was previously working…

    I have just done an experiment: I switched to a new, fresh workspace, imported the same project (from the same file system path, so it’s the same files not a clone), and it has reverted to previous behaviour: it pops up a workflow-widget.ts.js editor. I include a screen shot.

    I’m happy to provide more info when I get time…

    Greg

    Attachments:
    You must be logged in to view attached files.
    #501376 Reply

    baca
    Participant

    Extra screenshot (the last one was too big)

    Attachments:
    You must be logged in to view attached files.
    #501382 Reply

    baca
    Participant

    Hi,

    I was using webpacks eval-source-map which creates inline sourcemaps. I switched to devtool = ‘source-map’ to create separate source maps.

    I still get the problem with it opening workflow-widget.ts.js, but now I get a an explorable hierarchy in the Loaded JavaScript view.

    I also now get a lot of these errors:

    !ENTRY com.genuitec.eclipse.javascript.tern 4 0 2016-10-27 15:58:00.710
    !MESSAGE Error while loading outline for file workflow-widget.ts.js
    !STACK 0
    tern.TernException: 127.0.0.1:53769 failed to respond
    at tern.server.DefaultResponseHandler.getData(DefaultResponseHandler.java:54)
    at tern.server.protocol.TernResultsProcessorsFactory.makeRequestAndProcess(TernResultsProcessorsFactory.java:46)
    at tern.eclipse.ide.internal.core.resources.IDETernServerAsyncReqProcessor.processRequest(IDETernServerAsyncReqProcessor.java:50)
    at tern.server.AbstractTernServer.request(AbstractTernServer.java:218)
    at tern.resources.TernProject.request(TernProject.java:644)
    at tern.resources.TernProject.request(TernProject.java:632)
    at com.genuitec.eclipse.javascript.tern.outline.RefreshOutlineJob.run(RefreshOutlineJob.java:65)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    Caused by: org.apache.http.NoHttpResponseException: 127.0.0.1:53769 failed to respond
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260)
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283)
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:251)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:197)
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:685)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
    at tern.server.nodejs.NodejsTernHelper.makeRequest(NodejsTernHelper.java:82)
    at tern.server.nodejs.NodejsTernServer.makeRequest(NodejsTernServer.java:297)
    at tern.server.nodejs.NodejsTernServer.request(NodejsTernServer.java:255)
    at tern.server.protocol.TernResultsProcessorsFactory.makeRequestAndProcess(TernResultsProcessorsFactory.java:45)
    … 6 more

    #501384 Reply

    baca
    Participant

    Just to reiterate again: sourcemaps consistently work correctly in chrome

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: Typescript 2 Support planned?

You must be logged in to post in the forum log in