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

Problems with formatting #33

Closed
ghost opened this issue Jun 22, 2019 · 11 comments
Closed

Problems with formatting #33

ghost opened this issue Jun 22, 2019 · 11 comments

Comments

@ghost
Copy link

ghost commented Jun 22, 2019

While using your extension I run into some problem. First and foremost: The print menu won't show up anymore, even after deleting and reinstalling. But the most annyoing part is shown in the pictures below: For some reason parts of the formatting were/are 'destroyed', while exporting the code. I tried printing those parts via a new file, formatting them anew but nothing worked so far. I hope you're able to help me.

Bildschirmfoto 2019-06-22 um 18 01 42

Bildschirmfoto 2019-06-22 um 18 02 04

@PeterWone
Copy link
Collaborator

Thank you for reporting this problem.

Can I have a sample file for which the problem occurs please? To reproduce the problem in my debugger is the first big step.

@PeterWone
Copy link
Collaborator

PeterWone commented Jun 23, 2019

The formatting inconsistency you are observing is a consequence of mixed spaces and tabs. The renderer should set the CSS tab-size to match your VS Code settings, but just tested this and the value is undefined because it is incorrectly retrieved from settings.

Well done, you have found a bug.

There is a workaround — convert all your tabs to spaces. Just set VS Code to use spaces instead of tabs, and then format the document.

I will put out a fix shortly, but I do still need a sample file to help me work out your other issue. If you have been using my extension for some time and the problem is recent then it may be related to localisation. What language is your development code using? Given your username I suspect it may be German, which is not yet a supported language.

@ghost
Copy link
Author

ghost commented Jun 23, 2019

Thanks for the fast response. I attached a file with two codes, where the bugs occurred.
Sample_File.zip

@PeterWone
Copy link
Collaborator

It appears you are using OS/X. I'll have to borrow a Mac to debug this so it may be a few days before you hear anything.

@PeterWone
Copy link
Collaborator

PeterWone commented Jun 23, 2019

It took me a while to recognise that language, it's VHDL if I'm not mistaken. None of the VHDL extensions appears to include a formatter so that workaround isn't very practical. And you are right the menu is not appearing for VHDL files. I have managed to reproduce the fault on Windows.

@PeterWone
Copy link
Collaborator

Here's a snip of your sample file with mixed spaces and tabs from 76 to 79. The indent looks wrong because my system is configured for a two-space tab indent, but most of this sample uses four spaces per indent.

image

@PeterWone
Copy link
Collaborator

With my current codebase I can't reproduce the problem with the print menu not showing up. I suspect this is the same issue reported by issues #31 and #32 which was fixed by 0.7.6, so I'm going to fix the other bug I noticed while chasing yours, and then release 0.7.7

@PeterWone
Copy link
Collaborator

PeterWone commented Jun 24, 2019

Set your tab size to 4 and update your copy of vscode-print.

Please let me know that you are satisfied with this fix by closing the issue.

I am looking for a volunteer to handle localisation to German.

If you have any other problems just raise an issue.

@ghost
Copy link
Author

ghost commented Jun 24, 2019

Thank you, for your fast response and fix. I apologize for replying so late. Formatting works like a charm now. One last problem I run into (don't know whether its MAC exclusive or not or a 'feature'): if I try selecting a theme via the the option F1 -> Printing: Browse for stylesheets I get the following error (the paths seem to be wrong?). Selecting the file manually (writing the name of the theme into the setting 'Print: Colour Scheme')
error.pdf
works.

@PeterWone
Copy link
Collaborator

PeterWone commented Jun 24, 2019 via email

@PeterWone
Copy link
Collaborator

I'm closing this issue and opening a new one with the path problem.

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

1 participant