REditorSupport / REditorSupport/languageserver

Static type checking

Open
#384 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
675
Forks
118
Avg merge
1d 37m
Merged PRs (30d)
11

Description

@kcf-jackson has created the {typeChecker} package, an experimental static type checker for R. I had a try at integrating it into {languageserver}, in the types branch of my fork. It calls {typeChecker} alongside {lintr}, and returns the results of both as diagnostics.

Here it is in action with VS Code. The type checking problems are underlined, and the problem details are shown in the terminal.

vscode_demo

Installation:

# install.packages("remotes")
remotes::install_github("kcf-jackson/typeChecker")
remotes::install_github("andycraig/languageserver@types")

It currently works on single files only, so it won't type check functions declared in one file but used in another.

Since type annotations are experimental for R I'm not sure we'd want to merge my types branch into master at this stage. But it's there for anyone who wants to try it out. My plan is to periodically rebase it onto the master branch to keep it up to date.

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

Start with the integration described in the issue and compare the types branch of the fork with master. Review how {typeChecker} is called alongside {lintr} and returns diagnostics, then determine whether single-file checking and experimental R type annotations are sufficiently stable for an integration; done means an agreed direction for bringing this work into the project.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.