jaredly / jaredly/reason-language-server

adding [@@bs.val] to an external breaks the ocaml syntax highlighting

Open
#189 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
649
Forks
85
PR merge metrics
No merged PRs in 30d

Description

I just copied this code, but moved the lines around from the Bucklescript docs: https://bucklescript.github.io/docs/en/function (Object method)

type document (* abstract type for a document object *)
external doc: document = "document" [@@bs.val]
external getElementById: document -> string -> Dom.element = "getElementById" [@@bs.send]
The lines after [@@bs.val] (2nd line) aren't being highlighted correctly.

![47742766-c0369900-dc53-11e8-9c66-eebb3595b403](https://user-images.githubusercontent.com/1102159/48375332-98a0f100-e695-11e8-90f5-ba49cf01fb07.png)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example from the BuckleScript function documentation and compare highlighting before and after [@@bs.val]. Trace the syntax-highlighting entry point for OCaml attributes, then verify that the following external declaration and its types are highlighted correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.