Xellos's blog

By Xellos, history, 6 years ago, In English

A long time ago, I started writing syntax definitions for Q# in Sublime Text. Motivated again by the recent contest, I significantly improved them, so they're actually usable in a competition. You can check the current version at https://gitgud.io/Xellos/qsharp-sublime-syntax.

  • Vote: I like it
  • +43
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Xellos (previous revision, new revision, compare).

»
6 years ago, # |
  Vote: I like it +1 Vote: I do not like it

why not to use language server protocol instead of editor-specific definitions

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    Hmm, first, I had no idea what that is. Second, after checking out the docs, I'm not in the mood to learn how it works. Seems too long.

    If you want something else done, why not do it yourself?

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Xellos (previous revision, new revision, compare).

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you, it is a good idea!

Though, it seems there are some weird broken things (due to Q# syntax evolving?) (commit 6f99c0b56dbe241f86792745b1f4f5a8d65a2c2e):

namespace Solution {
function f(a: Int): Int {    
    for(i in a) {
    }
}
operation g(q: Qubit): Unit {
    
}
}
  1. For me operation g and below is not highlighted. If I remove the for loop or change function to operation, then operation g becomes highlighted.

  2. There is a within { ... } apply {... }; construction.

  3. Functors e.g. is Ctl+Adj seem to cause en error in parsing.

  4. is it possible to make commenting code with Ctrl+/ work?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, I haven't updated it — I would if I had time. The usual thing with open-source applies, you can implement a feature, make a pull request and I'll add it there if it works.