REditorSupport / REditorSupport/vscode-R

syntax: leading and trailing periods / dots not tokenized as part of identifier

Open
#1,183 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Given an R document with the code:

.hello.world.

The leading + trailing .s are tokenized as separate entities.

Screen Shot 2022-08-25 at 4 37 25 PM

I believe the use of \b here forces VSCode to consider . as a word boundary, and so it fails to tokenize the whole identifier as a single token:

https://github.com/REditorSupport/vscode-R/blob/da579cc17a9485f7a11bf5e75bf6b9c347eca116/syntax/r.json#L165-L168

If so, I think those \bs can be safely removed?

Contributor guide

Open the contributing guide

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

Open syntax/r.json around lines 165-168 and inspect the identifier pattern's word-boundary handling. Confirm the change against the example .hello.world.; done means the leading and trailing periods are tokenized as part of one identifier rather than as separate entities.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.