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

Debug Console: Hyperlink to error line #12

Closed
SAbboushi opened this issue Jun 12, 2020 · 14 comments
Closed

Debug Console: Hyperlink to error line #12

SAbboushi opened this issue Jun 12, 2020 · 14 comments

Comments

@SAbboushi
Copy link
Sponsor

SAbboushi commented Jun 12, 2020

Parentheses and spaces in path (folder name or file name) breaks Hyperlink to error line.
I did not test other non-alpha characters that are valid for folder/file names.

Examples:
"D:\Documents\GAR\New folder (2)
"D:\Documents\GAR\Newfolder2\Untitled 2.ahk"

For future issues, do you have preference:

I am missing this feature very much as I am fixing scripts to be compatible with new AHK version which has broken (almost all of) my scripts!!

@zero-plusplus
Copy link
Owner

zero-plusplus commented Jun 13, 2020

It is a bug that should be fixed that the output is a little strange when using parenthesized paths.

For paths with spaces, I've checked with the Node Debugger, but those paths have broken links.
This was also true for paths that contained symbols (except for some underscores and hyphens).
This is probably by design and cannot be fixed.
The only way to avoid this issue is to use paths that do not contain spaces and their symbols.

I also checked the file of multi-byte character strings. In that case, the file name is displayed as ?, but this is probably the specification because it is the same for SciTE4AutoHotkey.

@zero-plusplus
Copy link
Owner

zero-plusplus commented Jun 13, 2020

For future issues, do you have preference

There is no problem in creating a new one.

@zero-plusplus
Copy link
Owner

This issue has been fixed in 1.3.6. Please close this issue if you can confirm.

If you still have problems, please see my previous comments and comment again.

@SAbboushi
Copy link
Sponsor Author

Still problems.
1)
Path: "D:\Documents\GAR\New folder (2)\Untitled - 1.ahk"
Folder has spaces and parentheses
File name has spaces
Error hyperlink is to AutoHotkeyU64.exe
Line number of error (11) is not mentioned on error line in DEBUG CONSOLE

image

Path: "D:\Documents\GAR\Newfolder2\Untitled1.ahk"
Folder has no spaces or parentheses
File name has no spaces
Error line has two hyperlinks: First Error hyperlink is to AutoHotkeyU64.exe
Second Error hyperlink is to "Untitled1.ahk" but without Line number of error (11)

image

@zero-plusplus
Copy link
Owner

zero-plusplus commented Jun 16, 2020

This is not a problem. It is a specification.
In case of an error that occurs during execution, for some reason AutoHotkey does not output the file path information.

The line shown in yellow only shows the command when executing AutoHotkey, not the error output.

By the way, another problem, try throw Excepton(""). Only the message box appears, and the contents are not output. This is probably also a specification. It may be a bug.

Well, actually you can fix this problem.
Try the code below. You were using v2, right? If you are using v1 or older v2, convert hasOwnProp to haskey

OnError("errorHandler")
TraySetIcon("AHK_Gold_16x16.ico")
return

errorHandler(exception, reason)
{
    message := Format("{}:{} ==> {}", exception.file, exception.line, exception.message)
    if (exception.hasOwnProp("extra")) {
        message .= "`n     Specifically: " . exception.extra
    }
    message .= "`n"
    OutputDebug(message)

    ExitApp
}

@SAbboushi
Copy link
Sponsor Author

This is not a problem. It is a specification.
Oops! Ottotto!

Thanks for your explanations and the education. It seems I can send output to DEBUG CONSOLE that becomes a hyperlink to a file or line within file. I wonder what the requirement is?

  • I tested and it works with full path to a valid file with any extension
  • If I also want hyperlink to line number, format required seems to be: ":" without any spaces

Is this correct? Is this a feature of your extension and your specification? Or part of DBGp protocol?

For paths with spaces, I've checked with the Node Debugger, but those paths have broken links.
This was also true for paths that contained symbols (except for some underscores and hyphens).
This is probably by design and cannot be fixed.

  1. Do you know if this is bug with AHK, DBGp or something to do with vscode?

For paths with spaces, I've checked with the Node Debugger, but those paths have broken links.

  1. I am ignorant in this area... does this mean your extension is written in node.js?

  2. I am curious if you are a registered user of AutoHotkey forums? If yes, will you share your user name with me: I am interested to see your posts.

  3. I wonder if you post on AHK forum to report bugs or to get answers; also, to announce your very very good extension?

@zero-plusplus
Copy link
Owner

  • I tested and it works with full path to a valid file with any extension
  • If I also want hyperlink to line number, format required seems to be: ":" without any spaces

I think it's correct.

I write each answer.

  1. The link feature of Debug Console is a standard feature of vscode.

  2. The answer is yes, but a little different.
    The reason I refer to the node debugger is because it's a standard extension.

  3. I have created the account itself. The name is the same zero-plusplus. However, I still can't post because my account is still locked because I didn't receive the activation email.

  4. I can't read the intention a little because the translation doesn't work. Are you asking me if I plan to post bug reports etc on the Forum?
    I may post if my account is verified.

@SAbboushi
Copy link
Sponsor Author

For paths with spaces, I've checked with the Node Debugger, but those paths have broken links.
This was also true for paths that contained symbols (except for some underscores and hyphens).
This is probably by design and cannot be fixed.

  1. Do you know if this is bug with AHK, DBGp or something to do with vscode?

Also, I have requested Autohotkey admin to try and enable your user account.

@zero-plusplus
Copy link
Owner

This is a vscode spec, not a bug
Look here

It seems difficult to fix this problem, but it seems that there is intention to consider it, so if you request symbols other than brackets, you may be able to fix it.

Also, I have requested Autohotkey admin to try and enable your user account.

sorry. I confirmed that my account was already activated.

@SAbboushi
Copy link
Sponsor Author

This is a vscode spec, not a bug
Look here

Thanks - what about the spaces?

@zero-plusplus
Copy link
Owner

look here

This is also added to the fix plan.

@SAbboushi
Copy link
Sponsor Author

I have made enhancement request in AHK Forum

@zero-plusplus
Copy link
Owner

Thanks for the report.

@SAbboushi
Copy link
Sponsor Author

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