sdras / night-owl-vscode-theme

🌌 NIGHT OWL: A VS Code dark theme for contrast for nighttime coding, 🦉 LIGHT OWL: a daytime light theme
https://aka.ms/nightowl
MIT License
2.82k stars 243 forks source link

Directives to improve language-specific coloring #285

Open thiagomajesk opened 3 years ago

thiagomajesk commented 3 years ago

Hi! I'd like to know what would be the contribution process to improve the highlight of some specific language. I see that there's a Ruby demo here and it seems that it's a little more flavorful than what I get with Elixir.

For example:

This is an example comparing both:

image

And here's a code snippet (don't try to compile that), that tries to demonstrate some of the language aspects:

defmodule ExampleModule do
  @moduledoc """
  Module documentation
  """

  require Another.Module

  import Another.Module

  alias Another.Module

  @type type() :: __MODULE__

  @module_attribute 1

  defstruct [:field1, :field2, field3: "Optional", field4: 42, field5: []] 

  def function_examples do
    function_with_args(:arg)
    function_no_args
  end

  def list_access do
    list = [1, 2] ++ [3]

    list
    |> Enum.uniq()
    |> Enum.at(1)      
  end

  @deprecated "This function is deprecated"
  @spec deprecated_function(term()) :: term()
  def deprecated_function_with_spec(param), do: nil

  def map_access do
    atom_map = %{
      key1: "info",
      key2: "info"
    }

    string_map = %{
      "key1" => "info",
      "key2" => "info"
    }

    atom_map.key1
    atom_map[:key1]
    string_map["key2"]    
  end

  @doc """
  This function is very well documented
  """
  def output do
    IO.puts "Output here"
    IO.inspect(nil, label: "Output here")
  end

  def pattern_matching_function(%__MODULE__{field1: field1}) when not is_nil(field1) do
    "I am function with pattern matching and guards!"
  end

  def pattern_matching_function(%__MODULE__{field1: field1}) do
      "I am function with pattern matching!"
  end  

  defmacro metaprogramming_macro(param) do 
    quote do
      IO.inspect("Hello from #{__MODULE__}, #{unquote(param)})"
    end
  end

  defp other_function(opts \\ []) do
    IO.puts "doing other stuff #{0..42}"
  end

  defp another_private_function() do
    [1, 2, 3] |> Enum.each(fn item -> IO.puts(item) end)
  end

  defp calling_erlang_modules(), do: :millisecond |> :os.system_time() |> to_string()

end

BTW: Would it be possible to publish the current color palette somewhere? This way I could test locally and suggest changes based that on what it's working for me. Also, I can't find any information about the current guideline the theme uses to color language constructs - if there's one, this would be really helpful.