google / google/starlark-go

improve spelling heuristic

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.8k
Forks
251
Avg merge
21h 8m
Merged PRs (30d)
4

Description

```
% starlark
Welcome to Starlark (go.starlark.net)
>>>
>>>
>>> def f(js_library, AsLibrary):
... _ = as_library
...
:2:7: undefined: as_library (did you mean AsLibrary?)
```

The spell checker ignores case and underscores, but perhaps it shouldn't, or perhaps it should ignore them only if it go no matches when considering them. (Perhaps that can be implemented cleanly by treating the distance from 'a' to 'A' as less then 1.0.)

Contributor guide

Open the contributing guide

Research direction

Reproduce the Starlark REPL example and inspect the spell-checker implementation, which is the only component identified by the issue. Compare suggestions when case and underscores are preserved versus ignored, then verify that the undefined as_library example no longer prefers AsLibrary while existing spelling suggestions still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.