-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Go to Definition #45
Comments
It's because it's a template function and it can't know which function it should show you without you providing the arguments. If you click on it anyway without any arguments it should just open the file without knowing the exact function definition. When the file is open you can just press Ctrl-Shift-O (outline) and it will show you all functions in the file. You can then enter the function name you want to show the definition of in there. If you want more features for go to definition, auto completion, documentation or similar things consider creating an issue on Hackerpilot/DCD first and I will make it work with code-d as quickly as possible once it's implemented |
filename is not a function, it's a variable, screenshot doesn't show it, here is readConfig definition: |
Hm, does it work if its in the first line? If yes then its probably an issue with the line endings. Does it work if you change them to LF instead of CRLF in the bottom right? DCD isn't always working perfectly either. There is often a problem with auto variables and UFCS but it should work with the normal way of calling. Try making a small source file where you can easily reproduce the issue |
Does it still work with that variable if you copy that same code to the bottom of the file? |
Changing line ending doesn't make difference |
Nope |
Is there a delegate somewhere in the middle? DCD gets very unusable for code after delegates |
Nope |
Does it work in the console if you pass it to dcd-client? |
Tested in console, works only if file has \r\n line ending |
Did some research on this bug and found the problem. document.offsetAt returns wrong offset if file contains non-ASCII symbols |
Hm now the question: is this DCD's fault for not handling unicode characters as one letter or is it because vscode handles them as multiple letters? |
DCD requires byte offset, but vscode works with text, not with it's byte representation, for vscode every symbol length = 1, but non-ASCII symbols consists of 2 bytes, which creates incosistence between dcd and vscode |
oh nice I will implement it then when they add it to the API and maybe add a workaround using the nodejs buffer api while they are doing this. Thanks for your research |
In italian unicode symbols are pretty common, so now I understand why this function never worked for me... (Please notice: i'm using linux, this bug is tagged as "windows") |
Go to Definition sometimes does not work or move cursor to line or even file, that does not contains this variable.

OS: Windows 10 x64
Code-D: 0.10.10
Workspace-D: 2.7.1+commit.11.gc27329c
The text was updated successfully, but these errors were encountered: