Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Lessons learned #71

Closed
scott-fleischman opened this issue Jun 5, 2017 · 3 comments
Closed

Lessons learned #71

scott-fleischman opened this issue Jun 5, 2017 · 3 comments

Comments

@scott-fleischman
Copy link

This is sort of an open-ended question, but I am curious if you might summarize (if you haven't already somewhere) some of the key points to keep in mind for creating a VS Code extension like this.

If I were to create an extension like this for another language, what would be a good starting point? What would be some best practices to follow, or pitfalls to avoid?

Thanks for any direction you might suggest and for your work on this extension!

@ghost
Copy link

ghost commented Jun 5, 2017

I haven't written anything like that but maybe I should.

Off the top of my head I don't recall many situations where I felt that I needed to go back and redesign something but here are some general observations:

  • prefer es6 features, enable strict null checking, etc.
  • use promises/async everywhere right from the start
  • avoid libraries that require deep integration throughout the entire extension
  • make each feature as self-contained as possible; keep the overall design modular
  • avoid premature optimization; decent algorithms are enough; latency is rarely a big problem here
  • given a choice between jumps in complexity versus simplicity with some duplication, choose the latter

As for where to start, if you want to have a language server I think either the OCaml one or the Agda could serve as an example if you just stripped out the features you didn't need. If you take a look at the server capabilities it shouldn't be too hard to trace down to the individual features in the code base.

That's assuming you want to have it implemented in typescript though. If you already have a tool like merlin available, I would just implement the server in typescript because it will be much easier to get to something usable quickly. If you don't have that, there's less reason to use typescript, but then the whole package (client/server) becomes a lot more work.

@scott-fleischman
Copy link
Author

Thanks for the feedback. That's probably good enough for me for now. If you ever felt the motivation, I would certainly enjoy reading a write up on some more details of the work you've done on this extension and others. Thanks!

@ghost
Copy link

ghost commented Jun 11, 2017

No problem. By the way, if you decide to start working on your own extension or language server I would be happy to give some tips if you run into any difficulties.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant