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

Inconsistent syntax highlighting for GitHub and VSCode #52

Closed
joeykilpatrick opened this issue Nov 3, 2023 · 3 comments
Closed

Inconsistent syntax highlighting for GitHub and VSCode #52

joeykilpatrick opened this issue Nov 3, 2023 · 3 comments

Comments

@joeykilpatrick
Copy link

My understanding is that this repo also powers the syntax highlighting for GitHub since github-linguist/linguist points here.

Lots of files in gleam-lang/stdlib do not highlight properly on GitHub (example, example, example). Here's a small demo:

import gleam/result
import gleam/int
import gleam/list
import gleam/map.{type Map}
import gleam/option.{type Option, None, Some}
import gleam/order

// Internal private representation of an Iterator
type Action(element) {
  // Dedicated to Electric Six
  // https://youtu.be/_30t2dzEgiw?t=162
  Stop
  Continue(element, fn() -> Action(element))
}

/// Traverse an iterator, calling a function on each element.
///
/// ```gleam
/// > from_list(["Tom", "Malory", "Louis"]) |> each(io.println)
/// // -> Tom
/// // -> Malory
/// // -> Louis
/// Nil
/// ```
///

pub fn yield(element: a, next: fn() -> Iterator(a)) -> Iterator(a) {
  Iterator(fn() { Continue(element, next().continuation) })
}

In every example, the issue seems to be related to the import a/b.{type c} syntax.

A similar (though less severe) issue for the Dart language seems related. It's unclear if this is a bug in this repo, in GitHub's highlighting, or in VSCode's highlighting.

@lpil
Copy link
Member

lpil commented Nov 4, 2023

Hello! This repo is not used by GitHub for their syntax highlighting, instead they use the Gleam tree sitter grammar. You will need to ask GitHub support to upgrade to the latest version of the tree sitter grammar as this part of the GitHub config is not open source.

@lpil lpil closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2023
@joeykilpatrick
Copy link
Author

joeykilpatrick commented Nov 5, 2023

Thanks, I'll make an issue on that repo instead. I see now that the tree-sitter grammar is listed in the linguist repo.

Out of curiosity, why is this repo listed as a submodule of that repo if it's not used?

@joeykilpatrick
Copy link
Author

Nevermind, answered my own question here.

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

2 participants