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

Lexers should have human readable names #206

Closed
edwardloveall opened this issue Dec 21, 2014 · 13 comments
Closed

Lexers should have human readable names #206

edwardloveall opened this issue Dec 21, 2014 · 13 comments

Comments

@edwardloveall
Copy link
Contributor

I think it would be a good idea to have human readable names attached to each lexer. Some languages are easy to make by capitalizing the first letter (Ruby, Go, Swift, C) but it gets a little more complex with mid-word capitalization (JavaScript, XML, TeX) and even more difficult when symbols get involved (C++, Objective-C, C#).

My reasoning for this would be when a list of supported languages is available to the user, or when the detected language is displayed. These could likely be put in the lexers themselves along with the tag and file extensions.

@jneen
Copy link
Member

jneen commented Dec 21, 2014

Hm. Okay, that sounds reasonable. They already have the desc field, but yeah something printable would be great.

@edwardloveall
Copy link
Contributor Author

I can go in and try to add human readable names for all of them at some point if that works for you

@jneen
Copy link
Member

jneen commented Dec 21, 2014

Sure, thanks!

@edwardloveall
Copy link
Contributor Author

Looking at some of these lexers, it seems like tag is sort of for this purpose already:

Used to specify or get the canonical name of this lexer class.

But it seems in practice it's more used as a finder string, i.e. Lexer.find('foo') as opposed to a display string. Is that the intended purpose?

@jneen
Copy link
Member

jneen commented Dec 24, 2014

It's used for both. In particular, the tag and the aliases are what are used in markdown to specify filetype.

@jneen
Copy link
Member

jneen commented Dec 24, 2014

you could have a human_name thing that defaults to the tag

@edwardloveall
Copy link
Contributor Author

I could, but they seem like different concepts. What do you think about changing the docs for tag so they say something like

Used to retrieve the lexer class

and name could be

Used as a human readable string for the lexer's language.

@jneen
Copy link
Member

jneen commented Dec 24, 2014

Sounds OK to me - I'd use a method other than name though, since that's already a thing on Class.

@edwardloveall
Copy link
Contributor Author

Ah ok. Maybe title then. This language's title is "C++"

@jneen
Copy link
Member

jneen commented Dec 24, 2014

Sounds good.

@mpeteuil
Copy link
Contributor

mpeteuil commented Feb 6, 2016

Looks like this is closable as a result of the work that was merged in with d627db7

@edwardloveall
Copy link
Contributor Author

Thanks for lookin out!

@mpeteuil
Copy link
Contributor

mpeteuil commented Feb 8, 2016

Sure thing, thanks for creating the title 😄

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

No branches or pull requests

3 participants