Skip to content

Japanese in the type constructor name, it becomes a parsing error #105

@ncaq

Description

@ncaq

The Elm compiler accepts the source code, but the elm-language-server recognizes it as a parsing error.

The problem is that if you put Japanese in the type constructor name, it becomes a parsing error.

The source code.

module Main exposing (..)


type Color
    = Color| Color| Color

Expected Behavior

The parsing completes normally.

Current Behavior

 Main.elm     4   1 error                           Parsing error. (lsp)

Possible Solution

The Unicode character range accepted by Elm is accepted.

Steps to Reproduce (for bugs)

  1. git init, elm init…
  2. Write a type constructor that contains Japanese.

Context

Mainly English-speaking people may think that a type constructor containing Japanese is ridiculous and that only ASCII range should be used for the constructor.

However, we are Japanese who write programs to process Japanese in Haskell.

In our team, there are almost only native Japanese speakers.
It would be unclear and inefficient for our team to go to the trouble of finding literature that explains Japanese concepts in English and use terminology expressed in inexact English to program Japanese-specific concepts.

Therefore, we used a type constructor called PredicateInflection未然 in Haskell, and converted it to Elm.
Both Haskell and Elm accepted the Japanese type constructor.

However, if LSP rejects it, the Elm source code of the corresponding part is troublesome to handle from others, though it is generated automatically.

Your Environment

  • Version used: 2.2.1
  • Editor used: Emacs
  • Environment name and version (e.g. node.js 5.4): node.js v16.10.0
  • Operating System and version: Linux 5.10.61-gentoo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions