StarlaneStudios / vscode-comment-anchors

⚓A Visual Studio Code extension that adds support for comment anchors 🔭
https://marketplace.visualstudio.com/items?itemName=ExodiusStudios.comment-anchors
MIT License
212 stars 33 forks source link

Problem with LINK and ANCHOR #130

Open NoralK opened 3 years ago

NoralK commented 3 years ago

DESCRIPTION If a single LINK cannot be resolved it breaks all LINKS in the page. It seems that if there are any special character like space ( ) . $ or the like it breaks the LINK, I am not sure if it is an ANCHOR or LINK issue ... maybe both. NOTE: The underscore is not an issue.

EXAMPLES DO NOTE: Spaces in Folders and Files are not an issue.

FILE 1 - source links
This works
// LINK .\src code\Some File.php#12some_great_function

This is broken
// LINK .\src code\Some File.php#1.2 some_great_function

This is broken - this is the format I would like to see since this provides the correct 
                 documentation when I am looking at the source File Anchors
// LINK .\src\Some File.php#1.2 some_great_function( $someVariable, 'some text' )

FILE 2 - destination anchors
This works
// ANCHOR[id=12some_great_function]

This is broken
// ANCHOR[id=1.2 some_great_function]

This is broken
// ANCHOR[id=1.2 some_great_function( $someVariable, 'some text' )]

It would be nice feature/enhancement if the SECTION were to be an automatic ANCHOR.

// SECTION 1.2 some_great_function( $someVariable, 'some text' )
// ANCHOR[id=1.2 some_great_function( $someVariable, 'some text' )]

to be equivalent to
// SECTION 1.2 some_great_function( $someVariable, 'some text' )

Cheers

JordanDi123 commented 3 years ago

Hi there,

I was able to fix the problem with a single broken link breaking all other links. As for your other requests regarding the allowing of some symbols, I played around with it for a while but I was unable to get anything solid as of yet. When I get a chance, I'll give it another go and hopefully have something working for you.

Regardless, thanks so much for your ticket and the actual release should come shortly. For now though, you can access the fixed version here: comment-anchors-1.9.6.zip

Have a wonderful day!

BlackDex commented 3 years ago

I am just testing this, but it doesn't seem to work for me. It does open the file it links to, but it does not go to the correct anchor. Also, if i try to use a line number, that also doesn't work.

I'm using v1.9.6 together with vscode v1.60.1 on a remote ssh connection.

JordanDi123 commented 3 years ago

I am just testing this, but it doesn't seem to work for me. It does open the file it links to, but it does not go to the correct anchor. Also, if i try to use a line number, that also doesn't work.

I'm using v1.9.6 together with vscode v1.60.1 on a remote ssh connection.

Hi BlackDex,

I know that in the past there were some reports of issues when using a remote session and so I'm unsure as to if it is broken all around or just when using a remote session. Can you confirm whether you are using the version attached in the zip or the currently released version you get from the extensions marketplace? (both versions state v1.9.6) That might help in diagnosing the problem.

Thanks and have a wonderful day!

BlackDex commented 3 years ago

@JordanDi123 i tried both actually. Both work fine locally, but not on a remote session. If there is anything i can help with let me know.

JordanDi123 commented 3 years ago

@JordanDi123 i tried both actually. Both work fine locally, but not on a remote session. If there is anything i can help with let me know.

Ah that’s great to hear! Yes, if you figure out a solution to the issues with remote and make a pull request that would be much appreciated. None of us use or know anything about remote so that would be very helpful.

Thanks!

BlackDex commented 3 years ago

@JordanDi123 i tried both actually. Both work fine locally, but not on a remote session. If there is anything i can help with let me know.

Ah that’s great to hear! Yes, if you figure out a solution to the issues with remote and make a pull request that would be much appreciated. None of us use or know anything about remote so that would be very helpful.

Thanks!

Well, i would need some pointers, as i never ever have worked on a vscode extension before. The most easy thing for me would be enabling some kind of debugging or verbose logging i can enable somehow.

Or, if that is possible just add some console.log() lines somewhere within the vsix file, but for that i would love to have some pointers on which part of the code does the link creation, and the actual opening of the link.

That would save me a ton of time.