-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major revision (complete overhaul of nearly everything) #93
Major revision (complete overhaul of nearly everything) #93
Conversation
Great work. |
7104dc8
to
f40e317
Compare
Is this ready to go? |
No. There's still some things on my personal TODO that I want to fix. After that, I'd like to use it for a few days to try to spot regressions before pushing it to master. Help with testing what's here so far would be helpful. |
Is it possible to fontify parens-const-qualified function parameters and return types such as const(Type) foo(const(Type) param); ? Currently first occurrence of |
Anything is possible, file some issues and we can see if it's feasible. |
bd96d26
to
9b88f6a
Compare
That's everything from my list. |
Summary of changes:
Pertinent project-wide changes:
@atilaneves @MartinNowak @andralex @dmakarov If you or anyone would like to test this early, or have any feedback about the implementation or other suggestions, now would be a good time. My plan is to merge this into master one week-ish from now or the last fix for any regressions found if any. After that and a while more, we can tag a stable release. One possible future direction would be to work with cc-mode developers to implement some hooks in cc-mode to allow supporting d-mode in a way that relies less on cc-mode implementation details (or copying code), though I don't know how enthusiastic they'd be about the idea. |
Wow, awesome work! I'd love to take a look but can't provide much travel -
I'll be on the road next week and am preparing now.
…On Thu, Sep 12, 2019 at 10:18 AM Vladimir Panteleev < ***@***.***> wrote:
Summary of changes:
- Fixes all remaining open issues
<https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode/issues>,
except DDoc support
<#80>.
- Further extends cc-mode's understanding of D syntax, fixing many
fontification and indentation issues.
- A new imenu implementation (for Emacs 26+) which uses cc-mode's
parsing instead of regular expressions. It also arranges entries in a
tree shows the "fully-qualified" name for declarations according to
their context in the D source code (like an outliner).
@russel <https://github.com/russel>
Pertinent project-wide changes:
- Dropped support for Emacs 24. Emacs 26 is now officially supported.
- The code now includes some bits of (modified) cc-mode code (as I
couldn't find a way to implement some D constructs through only
configuration and advice micro-patching).
- The license is now GPLv3 or newer, same as Emacs and cc-mode.
- Probably this should be tagged as v2.1 once this is merged and
stabilized.
@atilaneves <https://github.com/atilaneves> @MartinNowak
<https://github.com/MartinNowak> @andralex <https://github.com/andralex>
@dmakarov <https://github.com/dmakarov>
If you or anyone would like to test this early, or have any feedback about
the implementation or other suggestions, now would be a good time.
My plan is to merge this into master one week-ish from now or the last fix
for any regressions found if any. After that and a while more, we can tag a
stable release.
One possible future direction would be to work with cc-mode developers to
implement some hooks in cc-mode to allow supporting d-mode in a way that
relies less on cc-mode implementation details (or copying code), though I
don't know how enthusiastic they'd be about the idea.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#93?email_source=notifications&email_token=AAEKLFY3HXWB4OOAAMT34SDQJJFTVA5CNFSM4ISJ7432YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6SBOJQ#issuecomment-530847526>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEKLFZEPTDOC4QBHT32VFDQJJFTVANCNFSM4ISJ743Q>
.
|
I'm just going to trust you on this one. Good work! |
Found the cornercase struct S
{
@safe:
T x;
} in which |
I actually found a lot of bugs / regressions. I'll add this to the pile :) I hope I can get back to this as soon as I finish my current project, which is taking a bit longer than expected. |
Found one more cornercase: Parameters qualified with void f(T)(scope return T x)
{
} when void f(T)(scope T x)
{
} works. This is easily fixed by adding (c-lang-defconst c-modifier-kwds
d '("abstract" "deprecated" "extern"
"final" "out" "lazy" "mixin" "override" "private"
"protected" "public" "ref" "return" "scope" "static" "synchronized"
"volatile" "__vector")) |
Thanks for the fixes. This case remains to correctly fontify @safe:
class C { } . |
Until patches are upstreamed: https://github.com/sviridov/undercover.el/pulls?q=author%3ACyberShadow
Qualifier package class A {}
package abstract class B {} |
Sorry, I can't reproduce the problem: Works fine for me. |
Strange. What Emacs version are you using? I'm currently sitting on Emacs master. |
26.3. |
I added the test case to this branch for CI, and it passed for all supported Emacs versions: https://travis-ci.org/Emacs-D-Mode-Maintainers/Emacs-D-Mode/builds/637279679 |
I put any more time into this for a while. Thanks. |
Does this fontify correctly for you? alias Expr = string[];
void toString(scope void delegate(scope const(char)[]) @safe sink,
scope const Expr expr); I get
during fontification. The |
Same here (because of |
Ok, thanks. I'll see if I can figure out the source of the error. |
Correction, I do see the error if I look in *Messages*. |
Thanks. |
Alan Mackenzie, the maintainer of CC Mode, contacted Russell and me today regarding one use of Emacs Lisp advice in the current (master) version of d-mode: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18158#26 As the changes in this PR introduce additional advice patches such as the one fixed by Alan's patch, I replied inquiring about the possible future for d-mode going forward. My reply is below Alan's message at the link above. |
Doesn't seem to be necessary any more.
Revert an earlier fontification fix ("Fix fontification of lone protection labels") to fix indentation regression.
I think at this point it would have to be a fork or some kind of branch, because 1) it's much more difficult to maintain, and 2) it introduces its own regressions (which are perhaps less severe than the ones in master). Unfortunately we didn't get anywhere in the discussion with the cc-mode maintainer either. |
I've been using it daily for a month now, and bar for the little bug when writing function prototypes, it really works well. |
I agree. |
Should we just merge this? Or maybe publish it as a separate package? The biggest concern is that this version depends a lot of cc-mode internals, and if a future Emacs version breaks it, it might not be easy to fix again. |
I think a separate package would be confusing and divert effort. I'd be in favor of just merging it, as mentioned earlier. And perhaps now is the time to ping the maintainer again ? |
OK.
It's possible that we might get to a better place through collaboration, but that requires some expended time and effort from both sides. It does seem to me that time would be instead better spent on solutions based on language servers, so that all editors benefit from them, and we don't have to implement the same functionality once per editor. Edit: Just noticed this pull request was exactly one year old today :) |
Fixes a lot of bugs and I'm sure introduces many others. WIP.
Uploading this now as I'm taking a break from this project to work on https://github.com/CyberShadow/TrenD.