Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search result for "UTF-8 with BOM" files shifted on first line by a character #35633

Closed
Ranger1230 opened this issue Oct 5, 2017 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Milestone

Comments

@Ranger1230
Copy link

  • VSCode Version: Code 1.16.1 (27492b6, 2017-09-14T16:38:23.027Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions:
Extension Author (truncated) Version
path-intellisense chr 1.4.2
coldfusion ili 0.0.11
Angular2 joh 2.7.0
csharp ms- 1.12.1
sort-imports pet 2.4.0
autoimport ste 1.2.2
vsc-angular-cli web 1.0.0

Steps to Reproduce:

  1. Open a folder with a ASP.NET project in it
  2. Perform a find and replace entering "Block.FeatureCard" to the find and "Block.Cards" for the replace
  3. Click the replace all button
  4. Look in the cs files and see it worked fine, but look in the cshtml files and notice that a line like "@using NewProj.Blocks.FeatureCard.Simple" is replaced with "@using NewProj.BBlocks.CardsSimple". Notice the B is duplicated and the '.' before "Simple" is missing.

Note: This does not seem to happen if you manually replace them one by one in the find pane. Only seems to happen when clicking replace all.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added editor editor-find Editor find operations labels Oct 5, 2017
@chrmarti chrmarti assigned roblourens and unassigned rebornix Oct 5, 2017
@chrmarti chrmarti added search Search widget and operation issues and removed editor editor-find Editor find operations labels Oct 5, 2017
@thomazmoura
Copy link

thomazmoura commented Oct 7, 2017

VSCode Version: Code 1.17 (be377c0, 2017-10-04T23:44:50.318Z)
OS Version: Windows 10 Home x64 10.0.15063

I've seen that same behaviour before on .cs files and managed to get a print of it this time:
image
As you can see from the print the first line will get changed to "using InsertSolutionNamespaceHere.Domain.Repositorios;" to "using ISolutionNamespaceDomain.Repositorios;" instead of "using SolutionNamespace.Domain.Repositorios;" as expected. The line 6 will be changed properly though.

If it helps the code of the print is from the following commit: (thomazmoura/Generator.DotNetSolution@4bf3605) and the replace all parameters was from "InsertSolutionNamespaceHere" to "SolutionNamespace". It happens even if I open code with --disable-extensions.

@roblourens
Copy link
Member

roblourens commented Oct 9, 2017

Thanks for the example, I can repro! This is because the file has a BOM, and our search tool counts that as a character in the first line. Any search result on the first line of a file with a BOM will be shifted by a character.

@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Oct 9, 2017
@roblourens roblourens added this to the October 2017 milestone Oct 9, 2017
@roblourens roblourens changed the title Find and Replace for cshtml pages seems to be shifted Find and Replace for "UTF-8 with BOM" files shifted on first line by a character Oct 9, 2017
@roblourens roblourens changed the title Find and Replace for "UTF-8 with BOM" files shifted on first line by a character Search result for "UTF-8 with BOM" files shifted on first line by a character Oct 9, 2017
@aeschli aeschli added the verified Verification succeeded label Nov 3, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants