digitalmars.D - Request d.vim testing
- Jesse Phillips (14/14) May 18 2013 Hello Vim users,
- Anon (3/3) May 18 2013 Works for me.
- 1100110 (3/6) May 18 2013 +1
- Jonathan M Davis (15/33) May 19 2013 Using this new d.vim file, I get whole piles of errors just opening an e...
- Idan Arye (4/45) May 20 2013 Are you sure you downloaded it correctly? From the error message
- Jonathan M Davis (6/9) May 20 2013 LOL. Yeah, that looks like it's what I did. I think that I got it correc...
- Vladimir Panteleev (4/8) May 20 2013 Here's the test file for D highlighting for the colorer library:
- Iain Buclaw (5/15) May 20 2013 Thanks Vladimir, I'll test this against cgdb as well. =)
- Iain Buclaw (7/25) May 20 2013 First question that I have:
- Jesse Phillips (3/9) May 20 2013 No, but nor does size_t... Object is always made available, so
- Iain Buclaw (10/24) May 20 2013 Thanks.
- Jesse Phillips (11/16) May 20 2013 In case you don't know (guessing you might not based on the
- Brian Schott (3/7) May 20 2013 The standard says "In between must be valid D tokens", so I'm not
- Jesse Phillips (7/15) May 20 2013 That just means it can be tokenized; pretty much anything can be
- Adam D. Ruppe (9/11) May 20 2013 A string in single quotes doesn't pass. I use it for inline
- Iain Buclaw (11/27) May 20 2013 The second is a normal string.
- Idan Arye (7/11) May 20 2013 I used it for GLSL and it turned out nicely:
- Idan Arye (13/26) May 20 2013 Here are the results on my Vim 7.3 on Linux:
- Jesse Phillips (5/7) May 20 2013 Are you sure you didn't have merge errors, The only indicator
- Idan Arye (9/16) May 20 2013 Oopsie... my fault...
- Jesse Phillips (3/5) May 20 2013 Nope, most recent information I know is found here:
- Jonathan M Davis (6/8) May 20 2013 What do you mean by proper indentantion? I just set tabstop and shiftwid...
- Jesse Phillips (6/17) May 20 2013 Not sure exactly what he has in mind.
- Idan Arye (39/58) May 20 2013 Some examples:
- Jesse Phillips (5/9) May 20 2013 Ah yes, formatter. This is handled by their internal c-indenting
- Jonathan M Davis (7/10) May 20 2013 I gave up on ctags ages ago with just C++. I wouldn't even attempt to us...
- Idan Arye (3/17) May 20 2013 Take a look at DScanner - https://github.com/Hackerpilot/Dscanner
- Brian Schott (6/9) May 20 2013 It also attempts to provide some level of autocomplete for Vim
Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4 I'm requesting that you check that the new file has not butchered highlighting for you. https://github.com/JesseKPhillips/d.vim * ASM blocks highlight comments * in/out contracts no longer highlighted as storage class * If a module name is the same as a keyword it will not be highlighted on module declaration or import. * scope highlights as a statement, as a storage class in parameter list * pragma will highlight known commands (lib,msg)
May 18 2013
Works for me. I'm glad to see you are still maintaining this - appreciate your work.
May 18 2013
On 05/18/2013 02:09 PM, Anon wrote:Works for me. =20 I'm glad to see you are still maintaining this - appreciate your work.+1 I'll take a look over the next day or two.
May 18 2013
On Saturday, May 18, 2013 20:12:16 Jesse Phillips wrote:Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4 I'm requesting that you check that the new file has not butchered highlighting for you. https://github.com/JesseKPhillips/d.vim * ASM blocks highlight comments * in/out contracts no longer highlighted as storage class * If a module name is the same as a keyword it will not be highlighted on module declaration or import. * scope highlights as a statement, as a storage class in parameter list * pragma will highlight known commands (lib,msg)Using this new d.vim file, I get whole piles of errors just opening an empty .di file - starting off with Error detected while processing /home/jmdavis/.vim/syntax/d.vim line 4: E477: No ! allowed: <!DOCTYPE html> line 5: E488: Trailing characters: <html> and so on and so forth. I'm using vim 7.3 on Arch Linux. Maybe I need 7.4 for it to work? Or maybe something else in my setup is messed up. I only grabbed the syntax/d.vim file from your repo, since I don't know what the others are and don't currently have anything like them, so that may or may not be a factor. But based on the errors, it looks like my local version of vim just plain can't handle the new d.vim syntax file. - Jonathan M Davis
May 19 2013
On Monday, 20 May 2013 at 02:24:44 UTC, Jonathan M Davis wrote:On Saturday, May 18, 2013 20:12:16 Jesse Phillips wrote:Are you sure you downloaded it correctly? From the error message you got, it seems like you have downloaded the source of the GitHub page that displays the `syntax/d.vim` file.Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4 I'm requesting that you check that the new file has not butchered highlighting for you. https://github.com/JesseKPhillips/d.vim * ASM blocks highlight comments * in/out contracts no longer highlighted as storage class * If a module name is the same as a keyword it will not be highlighted on module declaration or import. * scope highlights as a statement, as a storage class in parameter list * pragma will highlight known commands (lib,msg)Using this new d.vim file, I get whole piles of errors just opening an empty .di file - starting off with Error detected while processing /home/jmdavis/.vim/syntax/d.vim line 4: E477: No ! allowed: <!DOCTYPE html> line 5: E488: Trailing characters: <html> and so on and so forth. I'm using vim 7.3 on Arch Linux. Maybe I need 7.4 for it to work? Or maybe something else in my setup is messed up. I only grabbed the syntax/d.vim file from your repo, since I don't know what the others are and don't currently have anything like them, so that may or may not be a factor. But based on the errors, it looks like my local version of vim just plain can't handle the new d.vim syntax file. - Jonathan M Davis
May 20 2013
On Monday, May 20, 2013 10:04:22 Idan Arye wrote:Are you sure you downloaded it correctly? From the error message you got, it seems like you have downloaded the source of the GitHub page that displays the `syntax/d.vim` file.LOL. Yeah, that looks like it's what I did. I think that I got it correctly now though, and it seems to work (or at least, it works well enough that I can open .d files using it now without any errors - I haven't messed around with it enough yet to determine if it's having any further issues). - Jonathan M Davis
May 20 2013
On Saturday, 18 May 2013 at 18:12:17 UTC, Jesse Phillips wrote:Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4Here's the test file for D highlighting for the colorer library: https://svn.code.sf.net/p/colorer/svn/trunk/schemes/hrc/test/other/d-sample.d Hope this helps.
May 20 2013
On 20 May 2013 10:08, Vladimir Panteleev <vladimir thecybershadow.net>wrote:On Saturday, 18 May 2013 at 18:12:17 UTC, Jesse Phillips wrote:Thanks Vladimir, I'll test this against cgdb as well. =) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4Here's the test file for D highlighting for the colorer library: https://svn.code.sf.net/p/**colorer/svn/trunk/schemes/hrc/** test/other/d-sample.d<https://svn.code.sf.net/p/colorer/svn/trunk/schemes/hrc/test/other/d-sample.d> Hope this helps.
May 20 2013
On 20 May 2013 10:51, Iain Buclaw <ibuclaw ubuntu.com> wrote:On 20 May 2013 10:08, Vladimir Panteleev <vladimir thecybershadow.net> wrote:First question that I have: Does 'Object' *need* to be syntax highlighted? Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';On Saturday, 18 May 2013 at 18:12:17 UTC, Jesse Phillips wrote:Thanks Vladimir, I'll test this against cgdb as well. =)Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4Here's the test file for D highlighting for the colorer library: https://svn.code.sf.net/p/colorer/svn/trunk/schemes/hrc/test/other/d-sample.d Hope this helps.
May 20 2013
On Monday, 20 May 2013 at 16:36:59 UTC, Iain Buclaw wrote:First question that I have: Does 'Object' *need* to be syntax highlighted? Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';No, but nor does size_t... Object is always made available, so basically a keyword.
May 20 2013
Thanks. I've fixed cgdb syntax highlighting for various literals here. https://github.com/cgdb/cgdb/pull/22 Wonder if anyone has any ideas for q"( strings )" Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; On May 20, 2013 11:40 PM, "Jesse Phillips" <Jessekphillips+D gmail.com> wrote:On Monday, 20 May 2013 at 16:36:59 UTC, Iain Buclaw wrote:First question that I have: Does 'Object' *need* to be syntax highlighted? Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';No, but nor does size_t... Object is always made available, so basically a keyword.
May 20 2013
On Monday, 20 May 2013 at 23:08:26 UTC, Iain Buclaw wrote:Thanks. I've fixed cgdb syntax highlighting for various literals here. https://github.com/cgdb/cgdb/pull/22 Wonder if anyone has any ideas for q"( strings )" RegardsIn case you don't know (guessing you might not based on the comment): q{ Token string here } q"( custom wysiwyg string delimiter )" The first should probably highlight as normal code (Vim is doing that). The second is a normal string. The token string is interesting since it can be used to house non-D language making D not necessarily the proper highlighting scheme.... hmm I wonder if I could make vim.d identify the language (probably needs specific indicator though).
May 20 2013
On Monday, 20 May 2013 at 23:20:08 UTC, Jesse Phillips wrote:The token string is interesting since it can be used to house non-D language making D not necessarily the proper highlighting scheme.... hmm I wonder if I could make vim.d identify the language (probably needs specific indicator though).The standard says "In between must be valid D tokens", so I'm not sure that's actually the case.
May 20 2013
On Monday, 20 May 2013 at 23:30:48 UTC, Brian Schott wrote:On Monday, 20 May 2013 at 23:20:08 UTC, Jesse Phillips wrote:That just means it can be tokenized; pretty much anything can be tokenized. I was going to give an example of something that would fail... but I can't think of anything that should fail. My first thought was '45oau' since identifiers can't start with a number... but my testing shows this is accepted.The token string is interesting since it can be used to house non-D language making D not necessarily the proper highlighting scheme.... hmm I wonder if I could make vim.d identify the language (probably needs specific indicator though).The standard says "In between must be valid D tokens", so I'm not sure that's actually the case.
May 20 2013
On Monday, 20 May 2013 at 23:57:21 UTC, Jesse Phillips wrote:I was going to give an example of something that would fail... but I can't think of anything that should fail.A string in single quotes doesn't pass. I use it for inline javascript sometimes and hits this: a.onclick = q{ var a = 'something'; // this won't compile in D - it will have to use double quotes return false; }; test.d(5): Error: unterminated character constant
May 20 2013
On May 21, 2013 12:25 AM, "Jesse Phillips" <Jessekphillips+D gmail.com> wrote:On Monday, 20 May 2013 at 23:08:26 UTC, Iain Buclaw wrote:The second is a normal string.Thanks. I've fixed cgdb syntax highlighting for various literals here. https://github.com/cgdb/cgdb/pull/22 Wonder if anyone has any ideas for q"( strings )" RegardsIn case you don't know (guessing you might not based on the comment): q{ Token string here } q"( custom wysiwyg string delimiter )" The first should probably highlight as normal code (Vim is doing that).The token string is interesting since it can be used to house non-Dlanguage making D not necessarily the proper highlighting scheme.... hmm I wonder if I could make vim.d identify the language (probably needs specific indicator though). The bit causing trouble is knowing the token that shall end the string. Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
May 20 2013
On Monday, 20 May 2013 at 23:20:08 UTC, Jesse Phillips wrote:The token string is interesting since it can be used to house non-D language making D not necessarily the proper highlighting scheme.... hmm I wonder if I could make vim.d identify the language (probably needs specific indicator though).I used it for GLSL and it turned out nicely: https://github.com/someboddy/Dandy/blob/initial-development/dandy/common/shaders.d#L8L31 Many acceptable languages for token strings are c-like anyways, so they look good with the D syntax highlighting - even if it doesn't highlight all the keywords, or highlight stuff that are not keywords, or highlight in wrong color.
May 20 2013
On Saturday, 18 May 2013 at 18:12:17 UTC, Jesse Phillips wrote:Hello Vim users, Sadly I don't have a good set of unittests for highlighting. I've made some changes and think that it will be good to have them part of vim 7.4 I'm requesting that you check that the new file has not butchered highlighting for you.Here are the results on my Vim 7.3 on Linux: http://postimg.org/image/cgtkbhr0t/ hybrid.vim was OK so I didn't put it in the screenshot(also I couldn't fit them all to screen height...)* ASM blocks highlight comments/* */ comments are good, but /+ +/ comments are not ended. This is also true outside ASM blocks.* in/out contracts no longer highlighted as storage classWorks* If a module name is the same as a keyword it will not be highlighted on module declaration or import.Made worse - in the original syntax `assert` was not highlighted when used as module name. `string` and `void` are still highlighted as module names.* scope highlights as a statement, as a storage class in parameter listWorks* pragma will highlight known commands (lib,msg)Doesn't work
May 20 2013
On Monday, 20 May 2013 at 16:20:34 UTC, Idan Arye wrote:Here are the results on my Vim 7.3 on Linux: http://postimg.org/image/cgtkbhr0t/Are you sure you didn't have merge errors, The only indicator that you have the latest file is the asm.d highlighting, and I can't reproduce this. Anyone else seeing these?
May 20 2013
On Monday, 20 May 2013 at 22:34:05 UTC, Jesse Phillips wrote:On Monday, 20 May 2013 at 16:20:34 UTC, Idan Arye wrote:Oopsie... my fault... I haven't really merged it or replaced the old file - I just `unlet`ted `b:current_syntax` and `source`d your syntax file, so I guess the two syntax files got mixed. I removed the suffix from the example files and loaded just your syntax, and everything turned out OK! Anyways, do you happen to know where we can get a proper indentation for D under Vim?Here are the results on my Vim 7.3 on Linux: http://postimg.org/image/cgtkbhr0t/Are you sure you didn't have merge errors, The only indicator that you have the latest file is the asm.d highlighting, and I can't reproduce this. Anyone else seeing these?
May 20 2013
On Monday, 20 May 2013 at 22:51:52 UTC, Idan Arye wrote:Anyways, do you happen to know where we can get a proper indentation for D under Vim?Nope, most recent information I know is found here: http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport/VimEditor
May 20 2013
On Tuesday, May 21, 2013 00:51:51 Idan Arye wrote:Anyways, do you happen to know where we can get a proper indentation for D under Vim?What do you mean by proper indentantion? I just set tabstop and shiftwidth to 4 and then turn on cindent. Is there something that that doesn't cover? I'm probably just so used to how that works that I have no clue what you're missing. - Jonathan M Davis
May 20 2013
On Tuesday, 21 May 2013 at 00:17:56 UTC, Jonathan M Davis wrote:On Tuesday, May 21, 2013 00:51:51 Idan Arye wrote:Not sure exactly what he has in mind. I know 'gd' and 'gD' fail most often (goto definition) Ctags probably could get a patch pushed upstream, but since I'm not using it I don't know if there is still something wrong. Other than that, I don't know what would be missing.Anyways, do you happen to know where we can get a proper indentation for D under Vim?What do you mean by proper indentantion? I just set tabstop and shiftwidth to 4 and then turn on cindent. Is there something that that doesn't cover? I'm probably just so used to how that works that I have no clue what you're missing. - Jonathan M Davis
May 20 2013
On Tuesday, 21 May 2013 at 00:39:48 UTC, Jesse Phillips wrote:On Tuesday, 21 May 2013 at 00:17:56 UTC, Jonathan M Davis wrote:Some examples: void main(){ /+ Comment +/ } When applying indentation, turns to void main(){ /+ Comment +/ } Also: void main(){ foo([ 1, 2, 3, ], [ 4, 5, 6, ]); } turns to: void main(){ foo([ 1, 2, 3, ], [ 4, 5, 6, ]); }On Tuesday, May 21, 2013 00:51:51 Idan Arye wrote:Not sure exactly what he has in mind. I know 'gd' and 'gD' fail most often (goto definition) Ctags probably could get a patch pushed upstream, but since I'm not using it I don't know if there is still something wrong. Other than that, I don't know what would be missing.Anyways, do you happen to know where we can get a proper indentation for D under Vim?What do you mean by proper indentantion? I just set tabstop and shiftwidth to 4 and then turn on cindent. Is there something that that doesn't cover? I'm probably just so used to how that works that I have no clue what you're missing. - Jonathan M Davis
May 20 2013
On Tuesday, 21 May 2013 at 00:54:58 UTC, Idan Arye wrote:Ah yes, formatter. This is handled by their internal c-indenting function. These may be acceptable corrections to include there, but nothing D specific is likely to make it in. (:help =) You can set 'equalprg' to any external program you wish...Some examples:On Tuesday, May 21, 2013 00:51:51 Idan Arye wrote:Anyways, do you happen to know where we can get a proper indentation for D under Vim?
May 20 2013
On Tuesday, May 21, 2013 02:39:48 Jesse Phillips wrote:I know 'gd' and 'gD' fail most often (goto definition) Ctags probably could get a patch pushed upstream, but since I'm not using it I don't know if there is still something wrong.I gave up on ctags ages ago with just C++. I wouldn't even attempt to use it with D. It's way too primitive to be worth anything IMHO. Among othe things, it would have to actual understand namespaces (or modules or whatever) and overloads, and it doesn't. You need something that actually understands the language. - Jonathan M Davis
May 20 2013
On Tuesday, 21 May 2013 at 01:08:08 UTC, Jonathan M Davis wrote:On Tuesday, May 21, 2013 02:39:48 Jesse Phillips wrote:Take a look at DScanner - https://github.com/Hackerpilot/Dscanner It can produce ctags files.I know 'gd' and 'gD' fail most often (goto definition) Ctags probably could get a patch pushed upstream, but since I'm not using it I don't know if there is still something wrong.I gave up on ctags ages ago with just C++. I wouldn't even attempt to use it with D. It's way too primitive to be worth anything IMHO. Among othe things, it would have to actual understand namespaces (or modules or whatever) and overloads, and it doesn't. You need something that actually understands the language. - Jonathan M Davis
May 20 2013
On Tuesday, 21 May 2013 at 01:13:13 UTC, Idan Arye wrote:Take a look at DScanner - https://github.com/Hackerpilot/Dscanner It can produce ctags files.It also attempts to provide some level of autocomplete for Vim and Textadept. It doesn't work very reliably, so consider it a prototype. I have plans for a replacement soon(tm). On the topic of ctags, I think that what he's referring to is that the ctags format, not the tool, is not sufficient for D.
May 20 2013