Debug Protocol: Coming soon to an IDE near you

Our absolute favourite type of talk to do is one where we’ve been working on something so cutting-edge that we don’t have all the answers yet. This was the case with our work on the debug protocol and our talk at EclipseCon Europe. We got to take where we’d gotten to and present it to a room full of smart people who were generous enough to show up, ask questions and give us their insightful feedback.

The talk gives an overview of the debug protocol then demonstrates it working in:

  • VS Code
  • Eclipse IDE
  • Eclipse Che

We demo 7 different types of debug functionality as supported by the protocol: Continue reading “Debug Protocol: Coming soon to an IDE near you”

Debug Protocol vs Language Server Protocol

It is safe to say that the language server protocol (LSP) is the future of developer tools.  When it comes to the equivalent for debug, the debug protocol is ‘LSP for debuggers’. It is a useful tagline but here are three key differences to be aware of:

  1. State – the big mindshift with LSP is that servers are stateless. The clients store all the state e.g. the files themselves and settings (what language, classpath, etc). Any state kept on the serverside (e.g. the index) is usually purely for performance reasons. What this means is that, for instance, servers can be restarted and carry on seamlessly without having to know anything of what happened in the system beforehand. On the other hand, the debug protocol is not stateless, servers need to know all sorts of state and sequences of what has happened, so the design space is different for this protocol.
  2. JSON RPC 2.0 Spec (and cancellable requests) – The LSP defines JSON-RPC messages for requests, responses and notifications. The debug protocol was created before JSON RPC 2.0 spec was finalized, debug protocol uses a similar structure, but it is not cross compatible. For example, the JSON field name for the method to call is command in debug protocol and method in JSON RPC 2.0. The type of message (event, request, or response) is explicit in DSP in the type field, but is implicit in JSON RPC 2.0 (based on presence of the combination of method, id, result and error fields). However using a library like org.eclipse.lsp4j.jsonrpc can hide such differences and provide equivalent higher level abstractions (like Java interfaces) and leave the library to handle the differences. The LSP has a nice feature, cancellable requests, that is an extension to JSON RPC2.0 that is also not available in the debug protocol: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#-cancellation-support
  3. Ubiquity – although the LSP was defined originally for use in VS Code do you know that the 2 flagship languages for VS Code are not based on LSP? Typescript and javascript language tooling is not done using LSP. On the other hand the debug protocol does underpin all the debugger implementations in VS Code, including the flagship node debuggers for V8 and Chrome.

All that being said, it’s worth repeating the common benefits of both protocols which are:

  • good separation of client/server
  • building the tooling once and reusing it across IDEs and editors i.e. vs code, eclipse, atom, etc
  • better unit/isolated testing
  • write in language most suited to the job
  • more effective way for tool developers to keep pace with underlying tools

The language server protocol will revolutionize how you code

lsps

The next generation Spring Boot tooling has been completely refactored to be based on the language server protocol (LSP). The tooling covers things like code assist for the Spring Boot property file, support for Cloud Foundry manifest files as well as Spring Boot support for Java files with typical features such as validation, content-assist and quick-fixes.

Beyond IDEs

Continue reading “The language server protocol will revolutionize how you code”

The Future of Developer Tools for IoT, ThingMonk 2017

ThingMonk is an annual London conference that brings together the people building and shaping the Internet of Things. This year I spoke at the conference on ‘The Future of Developer Tools for IoT’. This talk looks at emerging and future trends in the developer tools space. Check out the slides and feedback from the audience, as well as reference links at the end. Plus thanks to Marcel Bruch & Codetrails for input on AI tools. Be sure to share your thoughts on how you see developer tools shaping up to scale for building the Internet of Things.

Continue reading “The Future of Developer Tools for IoT, ThingMonk 2017”

Be a 10X Developer! Write Parameterized Tests

Following on from Yannick’s previous post about the necessity of thorough testing we wanted to look at the subject from an alternative angle. Within the confines of Junit’s Parameterized Test it is possible to test multiple classes simultaneously – thus saving  time and effort – but as with every labour-saving device, the devil is in the detail at the front end of the task – how to create a test we can rely on that will also reduce our ongoing test maintenance burden? Kichwa Coders’ intern Pierre Sachot grapples with this problem in his latest blog detailing how he set about creating a Parameterized Test within the Eclipse January Project. Find out how he got on and let us know what you think in the comments below.

Context:

I was back on the January Eclipse project, more specifically on JUnit Tests. We needed to test two functions of the Maths.java: arctan2() function and abs() in order to calculate the absolute value of a Dataset. I worked more on the second function, and as those two functions were really similar we decided to create a Parameterized Test class to include the first function too. This is a test that could be applied to both series of code, with only variable changing. It can therefore be used to test a function with a lot of values to find the one which is failing, or in our case, on several class types.

Tests before using Parameterized Tests:

Continue reading “Be a 10X Developer! Write Parameterized Tests”