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

Highlight should not rely on normalized identifiers #24

Closed
cjxgm opened this issue Jul 10, 2016 · 2 comments
Closed

Highlight should not rely on normalized identifiers #24

cjxgm opened this issue Jul 10, 2016 · 2 comments

Comments

@cjxgm
Copy link

cjxgm commented Jul 10, 2016

With the following source code

import strutils
echo "".t_o_l_o_w_e_r

nimsuggest gives the following highlight for the t_o_l_o_w_e_r:

highlight       skProc  2       8       7

which should really be

highlight       skProc  2       8       13

I suppose that's because in the library it's written as toLower, or the highlight is based on normalized identifier tolower, thus the wrong length of 7.

@Araq
Copy link
Member

Araq commented Jul 10, 2016

I suppose that's because in the library it's written as toLower, or the highlight is based on normalized identifier tolower, thus the wrong length of 7.

Indeed and it's much work to fix. We need to look at the original text file to fix it much like an editor could. Maybe we shouldn't output the token length at all? ;-)

@cjxgm
Copy link
Author

cjxgm commented Jul 11, 2016

I don't know about the internals of nim compiler/nimsuggest, but how about storing the original identifier along side the nomalized one in the symbol table?

We need to look at the original text file to fix it much like an editor could. Maybe we shouldn't output the token length at all? ;-)

Well that's what I did in my highlighter: ignore the length and search the original text file. But that feels awkward. I prefer a fix in nim compiler/nimsuggest.

alaviss added a commit to alaviss/Nim that referenced this issue Jan 29, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
alaviss added a commit to alaviss/Nim that referenced this issue Jan 30, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
alaviss added a commit to alaviss/Nim that referenced this issue Feb 7, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
alaviss added a commit to alaviss/Nim that referenced this issue Feb 7, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
alaviss added a commit to alaviss/Nim that referenced this issue Feb 7, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
alaviss added a commit to alaviss/Nim that referenced this issue Feb 7, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
narimiran pushed a commit to nim-lang/Nim that referenced this issue Feb 7, 2019
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants