microsoft / microsoft/monaco-editor

Javascript/Typescript does not replace word (with fix)

Open
#1,979 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted typescript
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

monaco-editor version: 0.20.0

ISSUE: If completing cons|ole.log() with caret at pilene the completion becomes consoleole.log() (should just be console.log())

FIX: In https://github.com/microsoft/monaco-typescript/blob/master/src/languageFeatures.ts#L276 the completion goes getWordUntilPosition - it should be getWordAtPosition

Thanks!

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

Start in src/languageFeatures.ts around line 276 and reproduce the completion behavior described for cons|ole.log(). Check the completion word-position lookup there and verify that completing the word does not duplicate the existing suffix, resulting in console.log().

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.