{"action":"created","issue":{"url":"https://api.github.com/repos/onivim/oni/issues/2038","repository_url":"https://api.github.com/repos/onivim/oni","labels_url":"https://api.github.com/repos/onivim/oni/issues/2038/labels{/name}","comments_url":"https://api.github.com/repos/onivim/oni/issues/2038/comments","events_url":"https://api.github.com/repos/onivim/oni/issues/2038/events","html_url":"https://github.com/onivim/oni/issues/2038","id":311560283,"number":2038,"title":"Help wanted trying to get ColdFusion Textmate Grammar to work","user":{"login":"am2605","id":119977,"avatar_url":"https://avatars2.githubusercontent.com/u/119977?v=4","gravatar_id":"","url":"https://api.github.com/users/am2605","html_url":"https://github.com/am2605","followers_url":"https://api.github.com/users/am2605/followers","following_url":"https://api.github.com/users/am2605/following{/other_user}","gists_url":"https://api.github.com/users/am2605/gists{/gist_id}","starred_url":"https://api.github.com/users/am2605/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/am2605/subscriptions","organizations_url":"https://api.github.com/users/am2605/orgs","repos_url":"https://api.github.com/users/am2605/repos","events_url":"https://api.github.com/users/am2605/events{/privacy}","received_events_url":"https://api.github.com/users/am2605/received_events","type":"User","site_admin":false},"labels":[{"id":482847095,"url":"https://api.github.com/repos/onivim/oni/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-05T10:44:00Z","updated_at":"2018-04-07T16:02:49Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm playing around trying to get the ColdFusion textmate bundle to work (NB: I'm aware this isn't the latest and greatest CF textmate grammar, there's a better one for VSCode but I couldn't get it working either so fell back to this one):  https://github.com/textmate/coldfusion.tmbundle\r\n\r\nHere's my oni config:\r\n\r\n```\r\nconst activate = (oni) => {\r\n};\r\n\r\nmodule.exports = {\r\n    \"editor.fontSize\": \"14px\",\r\n    \"editor.fontFamily\": \"Consolas\",\r\n    \"oni.useDefaultConfig\": true,\r\n    \"editor.textMateHighlighting.enabled\": true,\r\n    \"language.cf.textMateGrammar\": \"D:/AMyers/dev/coldfusion.tmbundle/Syntaxes/ColdFusion.tmLanguage\",\r\n    \"editor.textMateHighlighting.debugScopes\": true,\r\n    \"editor.completions.enabled\": true\r\n}\r\n\r\n```\r\n\r\nUnfortunately when I load a cfm file it seems to not use the textmate grammar and loads the built in cf.vim syntax.\r\n\r\nIf I open a file with the .cfml extension, the debug message is:\r\n\r\n`` [LanguageManager::_onBufferEnter] Setting language for file C:\\Users\\AMyers\\Desktop\\test.cfml to image\r\n\r\ntest.cfml file content is:\r\n\r\n```\r\n<cfoutput>\r\n    #now()#\r\n</cfoutput>\r\n```\r\n\r\nI'm not sure if this might be a windows path specific issue or not - I've tried backslashes, escaped backslashes all to no avail.  Any other suggestions please?"},"comment":{"url":"https://api.github.com/repos/onivim/oni/issues/comments/379479980","html_url":"https://github.com/onivim/oni/issues/2038#issuecomment-379479980","issue_url":"https://api.github.com/repos/onivim/oni/issues/2038","id":379479980,"user":{"login":"bryphe","id":13532591,"avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T16:02:49Z","updated_at":"2018-04-07T16:02:49Z","author_association":"COLLABORATOR","body":"> @am2605 @CrossR I think the required file type for textmate grammars is JSON - @bryphe I believe left a comment in the textmate json files in oni which say\r\n\r\nActually, we use the parser from VSCode - https://github.com/Microsoft/vscode-textmate - so we should support any format they support, too 👍 \r\n\r\n@CrossR  - thanks for trying it out! The screenshot / investigation you shared helps a lot - it looks like there is a bug where if the `filetype` is not set, we fall back to `image`. In this case, we're not recognizing the `cfml` file as a `cf` filetype.\r\n\r\nIMO, the _ideal_ flow for this is you could just install the `vscode-coldfusion` plugin in Oni, and  we'd pick up the stuff we can handle today - like the syntax files and everything! Unfortunately there are some quirks in that right now that block that from working (but it would be super cool if we could at least leverage parts of VSCode plugins). I hope we can get there and make that painless! 👍 We could even communicate via the plugin sidebar which capabilities were able to load, and which we were not....\r\n\r\nAnyway, I was able to get this working with a few steps:\r\n![image](https://user-images.githubusercontent.com/13532591/38457174-ce877aa6-3a41-11e8-9f74-bddcef62243b.png)\r\n\r\n(Note the `cf` filetype at the bottom)\r\n\r\n1) Modify your __`init.vim`__ and add the following line:\r\n```\r\nau BufNewFile,BufRead *.cfml set filetype=cf\r\n```\r\n\r\nThis fixes the issue we had where the filetype was being set to `image` by explicitly setting it as soon as Vim loads the file. Ideally, if we could understand the vscode plugin, you wouldn't need to do this (it has the same info in its manifest) - but for the time being, this will get things set. I prefer if users don't __need__ to go to their `init.vim` to customize 😄 \r\n\r\n2) Point to the CF grammar in your Oni config:\r\n    \"language.cf.textMateGrammar\": \"E:/cfml.tmLanguage\",\r\n\r\n(I used the VSCode grammar - but I think you already have this part set, @am2605 )\r\n\r\n3) Restart Oni\r\n\r\n4) Open the coldfusion file\r\n\r\nIf it worked, you should see `cf` as the file type and get the syntax highlighting. I also enabled the `editor.textMateHighlighting.debugScopes` flag to true to make sure I was getting the highlighting from textmate.\r\n\r\nHope that helps, and hope we can streamline this soon 👍 Let me know if you have questions with any of the steps, @am2605 "}}
{"actor":{"display_login":"bryphe"}}