Skip to content
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

github syntax highlight for Nim extensions (nims, nim.cfg, nimble) #125

Closed
timotheecour opened this issue Nov 7, 2018 · 3 comments · Fixed by #127
Closed

github syntax highlight for Nim extensions (nims, nim.cfg, nimble) #125

timotheecour opened this issue Nov 7, 2018 · 3 comments · Fixed by #127

Comments

@timotheecour
Copy link
Member

timotheecour commented Nov 7, 2018

@Varriount I'm trying to figure out how to syntax highlight nim code (inlcuding nimble and nim.cfg) files on github, see github-linguist/linguist#4295 which just got merged and changes Nim section to:

https://github.com/github/linguist/blob/ee29c920f6ecb56750ccb4607b8852dab19082b4/lib/linguist/languages.yml#L3099-L3112

the docs in https://github.com/github/linguist says:

Linguist detects the language of a file but the actual syntax-highlighting is powered by a set of language grammars which are included in this project as a set of submodules as listed https://github.com/github/linguist/blob/master/vendor/README.md

this points to:
Nim: https://github.com/Varriount/NimLime

hence this is why I'm asking you here.

https://github.com/Varriount/NimLime/tree/master/Syntaxes shows
Nim.tmLanguage
Nim_Cfg.tmLanguage
etc

is my PR github-linguist/linguist#4295 wrong (for eg, classify nim.cfg as Nim instead of Nim_Cfg) ?
for eg, for D, there's a single D.tmLanguage in https://github.com/textmate/d.tmbundle/blob/master/Syntaxes/
even though 2 extensions are shown here:

D:
  type: programming
  color: "#ba595e"
  extensions:
  - ".d"
  - ".di"
  ace_mode: d
  codemirror_mode: d
  codemirror_mime_type: text/x-d
  language_id: 80

https://github.com/github/linguist/blob/ee29c920f6ecb56750ccb4607b8852dab19082b4/lib/linguist/languages.yml#L967-L976

but I don't think it would make sense to have nims, nimble, nim.cfg files reported as Nim_Cfg, Nims, Nimble in github language stats, they should just be Nim (as I was trying to do in this PR)

/cc @pchaigno if you have any tips, thanks!

@pchaigno
Copy link
Contributor

pchaigno commented Nov 7, 2018

If your issue is that Nim syntax highlighting doesn't work, it's normal. Your changes will take effect with the next Linguist release. There's usually one every month.

@timotheecour
Copy link
Member Author

@pchaigno

Your changes will take effect with the next Linguist release. There's usually one every month.

even if it's just a vague indication it's better than nothing

timotheecour added a commit to timotheecour/NimLime that referenced this issue Nov 7, 2018
* should fix nim-lang#125 (hopefully)
let me know if I'm mistaken
This was referenced Nov 7, 2018
Varriount pushed a commit that referenced this issue Nov 7, 2018
* should fix #125 (hopefully)
let me know if I'm mistaken
@pchaigno
Copy link
Contributor

pchaigno commented Nov 8, 2018

thanks for replying; could that be documented in https://github.com/github/linguist/blob/master/README.md ?

It will be documented in the new FAQ (cf. github-linguist/linguist#4271).

timotheecour added a commit to timotheecour/NimLime that referenced this issue Dec 16, 2018
* should fix nim-lang#125 (hopefully)
let me know if I'm mistaken
Varriount pushed a commit that referenced this issue Dec 29, 2018
* Move core files to 'core' directory.
Remove Nimsuggest and Nimble support.

* Refactor settings, hotkeys, and nimcheck code.

* Fix #110

* Fix file permissions.

* fix #118 (#120)

* fix #118

* Update core/commands/nimcheck.py

Co-Authored-By: timotheecour <[email protected]>

* Make command import more correct.

* fix #112 (#123)

* Split comment grammer into separate file, to support nested multiline comments.
Fixes #94

* Update keymaps for new comment definitions.
Fixes #94, #97, and #128

* Straighten out TODO matching.

* Simplify package settings menu by using native edit_settings command.

* Fix comment continuation.

* Remove ST2/ST3 distinction.

* comment and doc comment completion work (#133)

* fix #134 (#135)

* fix #125 (#127)

* should fix #125 (hopefully)
let me know if I'm mistaken

* Update Nim.YAML-tmLanguage (#126)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants