Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-291502: Inconsistent behaviour : RS does not save it's generated files in a way as the vanilla VS does

$
0
0
Reporter bkmz (bkmz123) bkmz (bkmz123)
Created Mar 24, 2012 3:35:49 PM
Updated Mar 24, 2012 3:41:57 PM
Priority Normal
Type Task
Fix versions No Fix versions
State Submitted
Assignee Sergey Shkredov (serjic.shkredov)
Subsystem Refactoring
Affected versions 6.1.1
Fixed in build No Fixed in build

Problem


  • Using VS, developers could be expected to write non-english text (comments, literals, etc)
  • Given such text is russian, one could save file in cp1251 or in unicode encodings
  • Nowadays it's a standard for everyone to keep it's files as unicode saved
  • Using ReSharpers commands that generate new files ('Move to another file to math type name', for examaple) one get's new files saved ALWAYS in cp1251, that leads to:
    • unread characters on popular resources such as github
    • resaving files by frustrated developers

Steps to reproduce


  1. Open blank VS and do whatever to make VS to work with Unicode files by default:
    1. Set Tools->Environment->Documents : Save documents as Unicode when data cannot be saved in codepage.
    2. Set Tools->Text Editor->General->Auto-detect UTF-8 encoding without signature

  2. Create plain Console application.
    1. Given Program.cs as default application entry file, ensure it's saved in Unicode: File->Save Program.cs as->Save with encoding->*see encoding* (Alternatively, one could quickly check encoding via loading file in browser).
    2. Create new class via VS generation methods: type ClassFromWs classFromWs = new ClassFromWS(); and use Visual studio quick fix to create new file 'Generate class for ClassFromWs'. Ensure it is saved in Unicode.
    3. Create new file for new class via RS methods: Type ClassFromRS classFromRs = new ClassFromRs(); and use ReSharper commands - 'Create class ClassFromRs'. Generated class appears in Program.cs. Use 'Move to another...' on ClassFromRs to move it to new file. See it's saved in cp1251.
    4. Alternatively, create a new class but use SolutionExplorer->Refactor->Move types into matching files on Program.cs. New class appears in solution explorer, but is saved in cp1251.

Expected behaviour


I'd expect Unicode to be default encoding on every new RS-generated file, but I presume more correct expected behaviour will be:
"Both ways 2.C and 2.D should generate files with encodings that are equal to one in which VS saves it's new files."

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>