Skip to content

"Change All Occurrences (CTRL+F2)" matches too much #1574

@brikken

Description

@brikken

When using "Change All Occurrences (CTRL+F2)" it appears to match too much. It looks like it's doing a basic "search/replace" rather than matching on the selected symbol.

Code to reproduce

module Main where

import qualified Data.Time as Time ( Day, fromGregorian )

data Day = Day Int Int Int

myDay :: Day
myDay = Day 2021 3 14

myRealDay :: Time.Day 
myRealDay = Time.fromGregorian 2021 3 14

main :: IO ()
main = putStrLn "Hello, Haskell!"

Place the caret on the data definition of Day. Notice that only the relevant symbols are now highlighted by the editor (ie. the data definition and the type declaration of myDay).

image

Now hit CTRL+F2. Notice that now all simple text matches of Day are selected and updated when changing the text.

image

Version: 1.54.2 (user setup)
Commit: fd6f3bce6709b121a895d042d343d71f317d74e7
Date: 2021-03-11T00:56:19.848Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19041

Extension v1.2.0

output.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions