quan-xie / goclipse

Automatically exported from code.google.com/p/goclipse
0 stars 0 forks source link

file offset for gocode is calculated incorrectly after some non-ascii characters #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a source file with this content:

package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello, 世界")
    fmt.
}

2. Place cursor after second occurence of "fmt."
3. Press ctrl + space.

What is the expected output?

Listing of methods of the format package

 What do you see instead?

main ( )
fmt :

If you enter 4 more characters after the second "fmt." and then press ctrl + 
space there, the autocompletion works "as expected". So it must be a problem 
with the offset calculation.

What version of the product are you using?

Eclipse 3.7
GoClipse 0.7.5.v432
go 1.0.2
latest version of gocode installed with 'go get -u github.com/nsf/gocode'

On what operating system?

Ubuntu 12.10

Original issue reported on code.google.com by Kim.Stebel@gmail.com on 12 Dec 2012 at 2:00

GoogleCodeExporter commented 9 years ago
Yes, by default gocode takes a byte offset, if you provide a character offset 
as an argument, prefix it with 'c' or 'C' character. That's a hint to goclipse 
devs.

Original comment by no.smile...@gmail.com on 13 Dec 2012 at 11:09

GoogleCodeExporter commented 9 years ago
Hint taken ;)

Original comment by devonca...@gmail.com on 13 Dec 2012 at 7:47

GoogleCodeExporter commented 9 years ago

Original comment by devonca...@gmail.com on 19 Dec 2012 at 12:09