{"action":"opened","issue":{"url":"https://api.github.com/repos/OmniSharp/omnisharp-vim/issues/429","repository_url":"https://api.github.com/repos/OmniSharp/omnisharp-vim","labels_url":"https://api.github.com/repos/OmniSharp/omnisharp-vim/issues/429/labels{/name}","comments_url":"https://api.github.com/repos/OmniSharp/omnisharp-vim/issues/429/comments","events_url":"https://api.github.com/repos/OmniSharp/omnisharp-vim/issues/429/events","html_url":"https://github.com/OmniSharp/omnisharp-vim/issues/429","id":384500429,"node_id":"MDU6SXNzdWUzODQ1MDA0Mjk=","number":429,"title":"Feedback wanted: Extended highlighting","user":{"login":"nickspoons","id":5274565,"node_id":"MDQ6VXNlcjUyNzQ1NjU=","avatar_url":"https://avatars1.githubusercontent.com/u/5274565?v=4","gravatar_id":"","url":"https://api.github.com/users/nickspoons","html_url":"https://github.com/nickspoons","followers_url":"https://api.github.com/users/nickspoons/followers","following_url":"https://api.github.com/users/nickspoons/following{/other_user}","gists_url":"https://api.github.com/users/nickspoons/gists{/gist_id}","starred_url":"https://api.github.com/users/nickspoons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickspoons/subscriptions","organizations_url":"https://api.github.com/users/nickspoons/orgs","repos_url":"https://api.github.com/users/nickspoons/repos","events_url":"https://api.github.com/users/nickspoons/events{/privacy}","received_events_url":"https://api.github.com/users/nickspoons/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-26T20:37:30Z","updated_at":"2018-11-26T20:37:30Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"From commit 8f6ba69:\r\n\r\n> The previous highlighting functionality was very limited - all classes\r\n> and interfaces declared in the solution were added as solution-wide\r\n> keywords.\r\n> \r\n> Instead, use the roslyn-provided syntax highlighting. This entails\r\n> parsing the highlighting information provided by OmniSharp-roslyn (a\r\n> json file containing line/column groupings describing syntax fragments),\r\n> extracting the interesting parts (class and interfaces), then reading\r\n> the relevant spans from the buffer into an array of type name strings.\r\n> \r\n> The result is much more comprehensive highlighting coverage, but at an\r\n> efficiency cost.\r\n\r\nThis commit has been added to new branch [type_highlighting](https://github.com/OmniSharp/omnisharp-vim/tree/type_highlighting), as an experiment based on the issue #428 and the discussion there. I am hoping for some feedback before merging it into master. The new highlighting _replaces_ the previous type highlighting. It _could_ be added as a 2nd highlighting option but I'd prefer to avoid that, I think it would be too confusing.\r\n\r\nTo test, pull down this the type_highlighting branch. To do this directly from i.e. vim-plug, update the entry in your .vimrc like this:\r\n\r\n```vim\r\nPlug 'OmniSharp/omnisharp-vim', { 'branch': 'type_highlighting' }\r\n```\r\n\r\nTo get basic highlighting, just start OmniSharp as usual, and run `:OmniSharpHighlightTypes`. This will highlight the current buffer, and begin highlighting new buffers when they are opened.\r\n\r\nFor better results which are refreshed regularly (at the cost of more server interactions), add this to a `~/.vim/after/ftplugin/cs.vim` file:\r\n\r\n```vim\r\naugroup MyOmniSharpHighlighting\r\n  autocmd!\r\n  \" Note the argument 1 indicating that highlighting should be refreshed even\r\n  \" for buffers which have already been highlighted.\r\n  \" Other/additional possible autocmds are BufWritePost, CursorHold etc.\r\n  autocmd BufEnter *.cs call OmniSharp#EnableTypeHighlightingForBuffer(1)\r\naugroup END\r\n\r\n\" Optional mapping to manually refresh the buffer:\r\nnnoremap <buffer> <F9> :call OmniSharp#EnableTypeHighlightingForBuffer(1)<CR>\r\n```\r\n\r\nThe highlight groups used are `csUserType` and `csUserInterface`, and they are linked to `Type` and `Include` respectively. To try different colours, you can do things like this, in your `~/.vim/after/ftplugin/cs.vim` file:\r\n\r\n```vim\r\nhighlight link csUserType Identifier\r\nhighlight csUserInterface ctermfg=12 guifg=Blue\r\n```\r\n\r\nCurrently this branch only highlights classes and interfaces. It doesn't highlight methods/properties/variables, although some of these may be added. At this stage it's pretty rough."}}
{"actor":{"display_login":"nickspoons"}}