Linguist: Kotlin syntax highlighting stopped working in 7.12.0

Created on 7 Nov 2020  路  14Comments  路  Source: github/linguist

Preliminary Steps

Please confirm you have...

Problem Description

Kotlin highlighting seems to be broken in the latest linguist deployment, we're tracking the issue in the kotlin repo here https://github.com/nishtahir/language-kotlin/issues/33. Testing with lightshow, the latest version of the grammar seems to be working when I link to the grammar directly. However selecting the scope from the drop-down doesn't work.

URL of the affected repository:

https://github.com/nishtahir/language-kotlin/

Last modified on:

2020-10-18

Expected language:

Kotlin

Detected language:

Kotlin

Most helpful comment

Syntax highlighting is now working again. Sorry for the inconvenience peeps. Closing.

All 14 comments

cc @lildude

Ooof. 馃う I completely missed this. Sorry.

Looks like the structure of the Kotlin grammar has changed and resulted in our grammar compiler picking the individual files in src and not the complete grammar in dist and is thus creating an incomplete grammar file:

- [ ] repository `vendor/grammars/language-kotlin` (from https://github.com/nishtahir/language-kotlin) (11 errors)
    - [ ] Grammar conversion failed. File `src/ident.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/ident.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/keywords.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/keywords.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/literals.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/literals.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/objects.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/objects.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/annotations.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/annotations.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/functions.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/functions.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/package.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/package.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/types.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/types.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/classes.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/classes.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/comments.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/comments.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/imports.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/imports.YAML-tmLanguage` has no scope name

I think this is easy enough to change in the compiler. I'll take a look at this on Monday.

Confirmed on both mobile website, mobile app and desktop website

Ooof. 馃う I completely missed this. Sorry.

Looks like the structure of the Kotlin grammar has changed and resulted in our grammar compiler picking the individual files in src and not the complete grammar in dist and is thus creating an incomplete grammar file:

- [ ] repository `vendor/grammars/language-kotlin` (from https://github.com/nishtahir/language-kotlin) (11 errors)
    - [ ] Grammar conversion failed. File `src/ident.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/ident.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/keywords.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/keywords.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/literals.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/literals.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/objects.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/objects.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/annotations.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/annotations.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/functions.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/functions.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/package.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/package.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/types.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/types.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/classes.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/classes.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/comments.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/comments.YAML-tmLanguage` has no scope name
    - [ ] Grammar conversion failed. File `src/imports.YAML-tmLanguage` failed to parse: Undeclared scope in grammar: `src/imports.YAML-tmLanguage` has no scope name

I think this is easy enough to change in the compiler. I'll take a look at this on Monday.

My repo has a JSON grammar distribution. Would it be possible to point to that temporarily before the compiler fix?
It would be unfortunate to not have any syntax highlighting before a change to the compiler can be made/tested/deployed.

Would it be possible to point to that temporarily before the compiler fix?

Unfortunately not as I couldn't deploy the grammar update to GitHub.com until Monday as the PR would need approval before it can be deployed. I'm based on the UK so will have everything in place for when my US colleges come online.

BTW, can you please avoid deploying on Fridays going forward? 馃檪
That can help getting hotfixes before everyone notice the issue 馃槈

BTW, can you please avoid deploying on Fridays going forward? 馃檪
That can help getting hotfixes before everyone notice the issue 馃槈

I normally do, but I'm pushed for time to include this in the latest GitHub Enterprise Server (GHES) release so pushing Friday allowed the issue to be detected and fixed before it gets included in GHES which is much slower to update.

I'm in the process of releasing v7.12.1 which fixes this so should be fixed 馃敎 .

Re-opening as this won't be fixed until the grammars have been deployed.

Syntax highlighting is now working again. Sorry for the inconvenience peeps. Closing.

Thanks :)

@lildude Thanks for fixing! Much appreciated. One question though- is the expectation that annotations get a special highlighting? Looks like they're still not highlighted differently, but I'm not sure what the behavior was prior to this fix, so this may not be an issue.

@Test
fun thisIsATest() {
}

Yes. Before it would have shown all in the same font color, meaning highlighting wasn't working.

Annotations would be a different issue

One question though- is the expectation that annotations get a special highlighting?

I have no idea 馃榿 You'd need to ask the grammar maintainer over in https://github.com/nishtahir/language-kotlin/

@ggoudeau-chwy That is the expected behavior. There is a scope being applied to annotations however that scope isn't given special treatment in the github theme.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GabLeRoux picture GabLeRoux  路  6Comments

TimothyGu picture TimothyGu  路  5Comments

pfitzseb picture pfitzseb  路  5Comments

philiparvidsson picture philiparvidsson  路  4Comments

d4nyll picture d4nyll  路  3Comments