Pure-D / atom-ide-d

Adds D language support for Atom

Home Page:https://atom.io/packages/ide-d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong syntax highlight

trikko opened this issue · comments

image

void test()
{
      auto payload = MY_MAGIC_FUNCTION
      (
         "first", value,
         "another", DateTime(nextMonday, TimeOfDay(12,00)).toRailsString,
         "grayed_out", test_coupon_code,
         "this_too", "3"
      );

      int a = 10;
   }
}

Rewriting code in this way:

immutable blah = DateTime(nextMonday, TimeOfDay(12,00)).toRailsString; 
auto payload = MY_MAGIC_FUNCTION
(
   ...
   "another", blah,
   ...
)

restore highlight :)

I need to update the language syntax file with the updates from the language-d plugin.

I've seen other related bugs for example:

struct Hello
{
   void test() { }
}

The last bracket is not highlighted. Removing test() (and other inner code-blocks) it works fine.

Why don't you depend on a different package for syntax highlighting? This package seems more like a "make atom an IDE" style thing, rather than a "make atom a feasible editor for D" thing.That way users get both better workspace-d support (because you guys aren't spending time on syntax highlighting at all, period), and they get a choice of what scheme to use (I personally prefer d-struct's scheme over language-d's).

@ysgard (creator of d-struct) and I are maybe interested in providing syntax highlighting for this package.

if you could make a generic textmate style grammar (cson, json, xml doesn't matter, preferably json) that would be great. It would also be usable in other editors like visual studio code.

You might wanna look at https://rawgit.com/Hackerpilot/DGrammar/master/grammar.html for it too. Maybe make a separate project for it so all extensions can use it, just make sure it's a grammar that represents all features then. I can probably help a bit on it too once you have started it

Actually, we already have a grammar (cson) at ysgard/d-struct.
I was thinking that you'd either:

  • Remove all of your grammar/syntax highlight material and depend on d-struct
  • or use a git submodule with the d-struct repo to include it in your project.
    I'f you're not interested, that's fine, but I thought I'd offer.

Hm well I would like to support it in other editors like vscode too, which AFAIK needs json or xml. As the project is MIT licensed I suppose the grammar can be used in other projects if the license is included, and of course (but not required) a link to the original repository

I couldn't add it as submodule because atom requires the files to be in grammars/ and a dependency would require a package from npm so instead I just copied the file + license @MggMuggins

@ysgard should be made aware of this as well.

@MggMuggins @WebFreak001 I'm cool with it. Given the disparity of D integrations for Atom, I think now that d-struct's grammar (really its best point) is in atomize-d the best thing would be to deprecate and unpublish d-struct in favour of this package.

Well... maybe I'll wait until atomize-d is actually published, which I would urge you to do.

Break things, release fast, release often... it's a good methodology that drives results.

well but having multiple plugins and users saying that they would rather use one plugin than the other plugin also drives results :p

Even if you don't update over here very often, ysgard and I would contribute occasionally to fix things. There's no harm in releasing what's here either.