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

UTF-16 LE search results issues #18680

Closed
Rhywun opened this issue Jan 17, 2017 · 10 comments
Closed

UTF-16 LE search results issues #18680

Rhywun opened this issue Jan 17, 2017 · 10 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

@Rhywun
Copy link

Rhywun commented Jan 17, 2017

  • VSCode Version: Code 1.8.1 (ee428b0, 2016-12-19T14:49:23.350Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:
Extension Author Version
unique-lines bibhasdn 1.0.0
xml DotJoshJohnson 1.7.0
text-transform florianloch 0.1.0
vscode-insertdatestring jsynowiec 1.1.2
VBScript luggage66 0.0.1
mssql ms-mssql 0.2.0
csharp ms-vscode 1.6.2
PowerShell ms-vscode 0.8.0
vscode-sql-beautify sensourceinc 0.0.4

Steps to Reproduce:

  1. Select menu item File, Open Folder... and choose a folder (note: no files appear under "Open Editors")
  2. Select menu item Edit, Find in Files
  3. Enter a search word under "Search" that you know exists in one or more files in the open folder
  4. Leave "Replace", "files to include", and "files to exclude" blank
  5. Hit Enter -> no results found
  6. Expected result -> matching files are listed
    The docs state that "VS Code allows you to quickly search over all files in the currently-opened folder" but in fact only files that are open (i.e. appear under Open Editors) will be searched.
@mjbvz mjbvz added the search Search widget and operation issues label Jan 17, 2017
@roblourens
Copy link
Member

Is the progress bar still visible? Could be that the search is stuck or still ongoing.

Is the open workspace a very large one?

@Rhywun
Copy link
Author

Rhywun commented Jan 17, 2017

Maybe 30 files. I did move them from a network share to local because the network was very slow but the issue persisted.

I noticed later there might be some encoding issue. Some of the files were showing gibberish characters in the search results after I opened them and did a search as described above. I think the encoding was showing UTF-16. (Another application I opened them in was showing UTF-16LE - not sure if that is meaningful). The files were generated by MS SQL Server Management Studio with *.sql extension, if that helps.

@roblourens
Copy link
Member

roblourens commented Jan 17, 2017

Yes, thanks for mentioning that - we fixed search for UTF-16 files recently, and you should see it work now in the Insider's build, or 1.9 in two weeks.

#17408

@Rhywun
Copy link
Author

Rhywun commented Jan 17, 2017

Thanks, I'll take a look when I get it!

@Rhywun Rhywun closed this as completed Jan 17, 2017
@Rhywun
Copy link
Author

Rhywun commented Jan 18, 2017

Confirmed that search is working on UTF-16 LE files but with a problem:
Clicking on a search result is not consistently scrolling the editor to show the matching text. Sometimes it scrolls to the end of the file. And sometimes the wrong text is highlighted. Clicking a second or third time seems to give the correct behavior.

@Rhywun Rhywun reopened this Jan 18, 2017
@roblourens
Copy link
Member

Interesting, will take a look

@roblourens roblourens changed the title Find in Files only works on open files UTF-16 LE search results issues Jan 19, 2017
@roblourens roblourens added this to the January 2017 milestone Jan 19, 2017
@roblourens
Copy link
Member

FYI @bpasero

@bpasero
Copy link
Member

bpasero commented Jan 20, 2017

@roblourens I am not able to reproduce any issue without your fix. what are the steps?

@roblourens
Copy link
Member

  • Have a file with CRLF line endings and UTF16le encoding (CRLF is necessary)
  • Ensure the file is not open - open files are searched on the front end, and it won't repro
  • Search for something in that file
  • When you click the search results, the wrong text is highlighted

And,

  • Have a relatively long file with UTF16be encoding and CRLF line endings
  • Same steps as above
  • Some of the search results towards the end of the file may highlight the wrong text when clicked, because when the CR/LF is split in two reads, we don't count the number of lines correctly.

@bpasero
Copy link
Member

bpasero commented Jan 20, 2017

@roblourens wow I see it, good catch.

@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Jan 20, 2017
@bpasero bpasero added the verified Verification succeeded label Jan 26, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 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

4 participants