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

"Rewrap text" is useless #14

Open
rossburton opened this issue Oct 6, 2023 · 5 comments
Open

"Rewrap text" is useless #14

rossburton opened this issue Oct 6, 2023 · 5 comments
Labels
question Further information is requested

Comments

@rossburton
Copy link

The "rewrap text" command is basically pointless in bitbake mode.

Paste the following into a recipe or other file in BitBake mode:

FOO = "foo"
# The following list provides some explanation for the statements found in the example reference machine configuration file for the BeagleBone development boards.
BAR = "bar"

Move the cursor to the comment line and press 'Rewrap Comment/Text", you'll get this:

FOO = "foo" # The following list provides some explanation for the statements
found in the example reference machine configuration file for the BeagleBone
development boards. BAR = "bar"

That is not useful. Repeating the same test in 'Shell Script' mode produces the expected output:

FOO = "foo"
# The following list provides some explanation for the statements found in the
# example reference machine configuration file for the BeagleBone development
# boards.
BAR = "bar"
@deribaucourt deribaucourt added the question Further information is requested label Oct 11, 2023
@deribaucourt
Copy link
Member

deribaucourt commented Oct 11, 2023

Hello, thanks for reporting this issue. I could indeed reproduce it with the current marketplace version but this seems to have been fixed if you use the staging branch.

Could you please try this again with the staging version and confirm if this fixes your problem?

@rossburton
Copy link
Author

Sorry, still broken with the vsix I just grabbed from github.

@deribaucourt
Copy link
Member

Rewrapping is handled by an external extension. On my setup I'm using stkb.rewrap version 1.16.3.

Could you please share with us the logs from this command, which prints out the list of extensions you have installed:
code --show-versions --list-extensions

With my rewrap extension, The option "Rewrap Comment/Text" is part of the command prompt (ctrl+shift+p). I do not have it in the contextual menu. Maybe you have a different extension than me?

Additionally, please send us your Rewrap extension's settings. From the extension panel, right click the extension, then "Extension Settings". A screenshot of the User and Workspace settings would do. I'm using the default settings.

image

@rossburton
Copy link
Author

rossburton commented Nov 2, 2023

Confirmed that I have [email protected] installed, the rewrap settings are the same, and I'm running Rewrap Comment/Text from the command prompt.

I'd actually forgotten that was a separate plugin, not integrated into vscode. I've uninstalled the old bitbake plugin and am using a vsix from github as of last week.

From my very bad knowledge of VS Code and every less F#, it looks like client/language-configuration.json should have block and/or line attributes, telling the reformat plugin that # is the comment character.

Sources: https://github.com/stkb/Rewrap/blob/6a27098e20baf95759c621a5cc1cd9b3fedbd9ed/vscode/src/CustomLanguage.ts#L70 for the plugin reading other plugin's configuration files, and https://github.com/stkb/Rewrap/blob/6a27098e20baf95759c621a5cc1cd9b3fedbd9ed/core/Parsing.Documents.fs#L45 showing that if line is set to # then that might just work.

@deribaucourt
Copy link
Member

An idea came to me. When you installed the .vsix from github, did you first uninstall the market place one? Because they have different identities for now, they will conflict if both are installed at the same time. So maybe you keep observing the behavior of the previous version.

@WilsonZiweiWang WilsonZiweiWang removed their assignment Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants