nickspoons / vim-cs

Official Vim Runtime Files for C#
9 stars 3 forks source link

Add script and project files to browsefilter #38

Closed dkearns closed 2 years ago

dkearns commented 2 years ago

It didn't seem useful to add a separate filter for "C# Script Files (*.csx)".

nickspoons commented 2 years ago

I have no idea if this is correct, I don't use the GUI menus so I don't have experience with how this is usually done. We don't provide any support for .csproj or .csproj.user files, so is it correct to be able to browse for them specifically from a .cs file? What about .sln files?

.csproj.user files in particular are for Visual Studio settings, aren't they? I wouldn't expect that to be something people would want to edit from vim often enough that they needed to have them in the list when looking for .csproj files.

Just some thoughts, I don't feel strongly about it.

dkearns commented 2 years ago

I don't use this feature either but volunteered myself sometime ago to try and normalise its use across the runtime. The line is not very clear as to what should be included but it's not uncommon to include associated filetypes.

Vim has filetype detection for .csproj* files. We should probably add detection for SLN files as well. I'll send Bram a patch for those next time I'm updating filetype.vim as he's happy to have detection even if there's no other runtime support.

I was umming and ahhing about .csproj.user files. I figured it didn't really hurt but maybe you're right and it's more annoying to have to filter them out otherwise. I suppose we could also add .sln files too but I'd probably vote for just .csproj now you've raised it.

I'm not sure how common it is to work with Vim and VS side by side in alternating fashion these days. I don't use VS but I believe that there's a decent Vim plugin so perhaps it's less common than it used to be given OmniSharp.

I noticed you joined the pattern into a single line in an earlier commit. I was assume there's a line length where continuations become acceptable but I'll install vint and see what it says. Are you just using the defaults?

nickspoons commented 2 years ago

I'm not sure how common it is to work with Vim and VS side by side in alternating fashion these days. I don't use VS but I believe that there's a decent Vim plugin so perhaps it's less common than it used to be given OmniSharp.

I use VS occasionally for certain things, and I do edit .csproj and .sln files in Vim. My point about .csproj.user files though is that AIUI these are actually config files for VS, meaning that I wouldn't bother editing these in vim (certainly not often enough to need help finding them), because if I have them in the first place I presumably am generating/modifying them from VS.

I noticed you joined the pattern into a single line in an earlier commit. I was assume there's a line length where continuations become acceptable but I'll install vint and see what it says. Are you just using the defaults?

Right, sorry about that. AFAIR I was firstly striving for consistency within the files in this repo, and I like the vint recommendations of using ' rather than ", and full option names (except in b:undo_plugin).

I was also unfamiliar with b:browsefilter and so I was looking at other examples, and I think I joined it thinking it didn't seem to need two lines and most of the examples I saw only used 1.

However I also was not aware that you had volunteered to take that mantle up (although I think I remember reading it now :thinking:). As I say, I value consistency very highly, so I'm more than happy to let you format that as you like, as part of your larger updates.

dkearns commented 2 years ago

I'm with you. However, I was just reading an advisory from MS suggesting you're a very bad person for editing solution files by hand.

I've added .sln and removed .csproj.user from the filters. I've also updated Bram with some filetype detection and a ftplugin for solution files. I made a start on a syntax file.

nickspoons commented 2 years ago

Well if vim gets proper .sln support that's just going to make me an even worse person 😃

That sounds great, thanks a lot.