-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Command rename #87853
Comments
It shouldn't and it doesn't in my testing. So, I need reproducible steps that allow me to see what you see |
video |
Please paste the code here |
package cpd
//unit for windows1251
var consonans1251 = [256]byte{
/* 0 1 2 3 4 5 6 7 8 9 A
B C D E F*/
/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 2 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 3 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 4 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 5 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 6 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 8 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 9 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* A */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* B */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* C */ 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01
, 0x01, 0x01, 0x01, 0x00, 0x01,
/* D */ 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
, 0x00, 0x01, 0x00, 0x00, 0x00,
/* E */ 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01
, 0x01, 0x01, 0x01, 0x00, 0x01,
/* F */ 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
, 0x00, 0x01, 0x00, 0x00, 0x00,
}
var vowels1251 = [256]byte{
/* 0 1 2 3 4 5 6 7 8 9 A
B C D E F*/
/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 2 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 3 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 4 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 5 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 6 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 8 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 9 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* A */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* B */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00,
/* C */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x01, 0x00,
/* D */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x01, 0x00, 0x01, 0x01, 0x01,
/* E */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x01, 0x00,
/* F */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
, 0x01, 0x00, 0x01, 0x01, 0x01,
}
// cvPairs1251 - counts the number of pairs consonans+vowels
func cvPairs1251(d []byte) (cvPairsCount int) {
for i := 0; i < len(d)-1; i++ {
if consonans1251[d[i]] > 0 {
i++
if vowels1251[d[i]] > 0 {
cvPairsCount++
}
}
}
return cvPairsCount
}
// matchRunes1251 - counts the number of characters that are the most
popular letters of the Russian alphabet
func matchRune1251(d []byte, tbl *codePageTable) int {
for i := 0; i < len(d); i++ {
if is1251(d[i]) {
upper := lu1251(d[i])
j := tbl.index(rune(d[i]))
(*tbl)[j].count++
for i++; (i < len(d)) && is1251(d[i]); i++ {
if upper >= lu1251(d[i]) {
j = tbl.index(rune(d[i]))
(*tbl)[j].count++
}
}
}
}
return tbl.founded()
}
func match1251(d []byte, tbl *codePageTable) MatchRes {
return MatchRes{matchRune1251(d, tbl), cvPairs1251(d)}
}
func runesMatch1251_1(d []byte, tbl *codePageTable) (counts int) {
for i := range d {
if i < 1 {
continue
}
//case "ab" - counts only if symbols are arranged in pairs
if is1251(d[i-1]) {
j := tbl.index(rune(d[i]))
if j > 0 {
(*tbl)[j].count++
counts++
}
continue
}
if i < 2 {
continue
}
//case " Us" separator_UPPER_lower
if IsSeparator(rune(d[i-2])) && isUpper1251(d[i-1]) {
j := tbl.index(rune(d[i]))
if (j > 0) && (isLower1251(d[i])) {
(*tbl)[j].count++
counts++
continue
}
}
}
return
}
const (
cp1251BeginUpperChar = 0xC0
cp1251StopUpperChar = 0xDF
cp1251BeginLowerChar = 0xE0
cp1251StopLowerChar = 0xFF
)
func isUpper1251(r byte) bool {
return (r >= cp1251BeginUpperChar) && (r <= cp1251StopUpperChar)
}
// lu1251 - return 1 if r is upper, return 0 if r is lower
func lu1251(r byte) (res int) {
if isUpper1251(r) {
res = 1
}
return
}
func isLower1251(r byte) bool {
return (r >= cp1251BeginLowerChar) && (r <= cp1251StopLowerChar)
}
func is1251(r byte) bool {
return isUpper1251(r) || isLower1251(r)
}
чт, 2 янв. 2020 г. в 22:57, Johannes Rieken <[email protected]>:
… Please paste the code here
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#87853?email_source=notifications&email_token=AIDJHCCSCZ5NHTY3HQIKEGTQ3Y2KNA5CNFSM4KBC3E2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH7C4WA#issuecomment-570306136>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDJHCFMULDJ6FIS4Q2M4PDQ3Y2KNANCNFSM4KBC3E2A>
.
|
You can download full package from https://github.com/softlandia/cpd
file win1251.go
cursor do not keep position at F2 command on all files
чт, 2 янв. 2020 г. в 22:57, Johannes Rieken <[email protected]>:
… Please paste the code here
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#87853?email_source=notifications&email_token=AIDJHCCSCZ5NHTY3HQIKEGTQ3Y2KNA5CNFSM4KBC3E2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH7C4WA#issuecomment-570306136>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDJHCFMULDJ6FIS4Q2M4PDQ3Y2KNANCNFSM4KBC3E2A>
.
|
Hm, I get these messages.. Is there any special setup that's not part of the go-dev-container?
|
Yes, I receive such messages very often... I tried to understand in what cases this message occurs, and in which not. I do not understand yet. Extentions installed in VSC : |
I understand. |
Issue Type: Feature Request
After renaming (command F2), the cursor changes position.
When you rename several constants, you have to return the cursor to the block of renamed constants
VS Code version: Code 1.41.1 (26076a4, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 10.0.17763
The text was updated successfully, but these errors were encountered: