-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Remaining code cleanups for language APIs #2968
Comments
Oh, one more:
|
One more...
|
It looks like @TomMalbran has the "haxe" issue addressed in #2971, but I noticed one other seeming issue with Sprint 20 parity. We used to distinguish C and C++ modes but in the new languages.json they're all lumped together. |
@peterflynn I just pushed a commit on my pull request to address the C and C++ modes. |
Jason fixed the exports issue in 81aa896 |
Sorry for messing up language support (Haxe, C/C++), those were very easy to miss since rebasing doesn't work very well when files get changed in master that are long gone in a new branch. |
This is my final comment about being strict about language IDs. I suppose I'm just traumatized by PHP:
With a-z, we have:
With a-z, separated by _ we have:
With a-z, A-Z and _ we have:
I'm sure I forgot some. What's the benefit of allowing that? I am not sure. I'd like to see a use case. I remember Peter talking about package style names. For languages, though? Will we really have cpp, dk_cpp, pf_cpp, jsj_cpp? All with the same file extensions, thus conflicting anyway? I think it's perfectly fine to have a choice for what extension to install in order to support C++, but if I depend on that language in my extension, I don't want want to have to do something like that: But I suppose this is not what we're worried about. We're worried about two different languages ending up using the same ID, right? But that would mean that if I were to introduce SASS support, I would define it with the ID "denniskehrig_sass" to make sure it's unique. And then Joe Developer wants to provide SASS support, doesn't know about my extension, and defines it as "joedeveloper_sass". Awesome, now if Jane Foo wants to write an extension that requires SASS support she has to be able to specify that she either needs the language denniskehrig_sass OR joedeveloper_sass. Or it'll just work with denniskehrig_sass and someone who has joedeveloper_sass installed just can't use her extension. Or the extension will install fine because both SASS extensions are installed, but her extension won't do anything because joedeveloper_sass snatches all SASS files, so that denniskehrig_sass is never reported. I think we want our extension repository to list which names currently exist under which ID so people who write a language extension can stick to an existing ID or come up with a new one if there's a conflict with a different language. And then the need for package style IDs is pretty much gone anyway. Command IDs are different in nature, they are usually NOT intended to be used by somebody else. Language IDs however ARE. Still, had we been more strict about command IDs, writing that extension that lists what keyboard shortcuts are defined by which extensions might have been easier, too. I'll leave it at that. It's a democracy after all. |
@DennisKehrig thanks for the detailed explanation. I missed your reply in 2844, so glad I caught this one. These seem like reasonable concerns, so I'm ok with leaving the restrictions as they stand (now that they match the docs). |
Ok, I'll change the validation to be lowercase a-z only. |
reviewed - medium priority |
@jasonsanjose Hah, ok... so we're going back to lowercase-only now? Can we at least change the documentation & validation error string to say so this time? :-P Also, if we're going to touch this code again can we add numbers to the list of allowed values? Otherwise you can't have languages like "css3" or "c_99" which seem like both reasonable and useful language ids. |
I agree with adding numbers, you mention reasonable examples and numbers are unproblematic, I think. |
Closing since I think everything here has been addressed now that #2980 is in. |
This is a continuation of the code review in #2844. The branch was landed before some smaller issues were addressed to give it additional bake time.
Remaining issues:
id
to contain "." but not "_", the opposite of the docs. Though I actually like "." better since it's more consistent with our other id naming conventions, and I don't really see the need for explicit restrictions anyway... (See this comment).defineMIME("text/x-brackets-html"...
call could use clarification (see this comment)* Should blockComment, lineComment be private though? They have a setter you're supposed to use...
The text was updated successfully, but these errors were encountered: