-
Notifications
You must be signed in to change notification settings - Fork 234
We need a way to customize output color for error/warning, etc #651
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
Comments
Thanks Joel! I reasonable request indeed. |
If anyone is interested in picking this up the general idea is to
|
I would like to work on it ! Can I be assign ? |
@KeroroLulu you can work on any issue at any time you'd like :) We don't usually 'assign' work. You can freely start and submit a Pull Request when you're ready to get feedback! Once the PR looks good, we will merge it in! |
@tylerl0706 Thank you :) I'm not used to stuff like that, so if I have any questions I'll ask you ! |
You can always ask questions too! Let me know if you have any 👍 |
@tylerl0706 In the instructions
The link for EditorServicesPSHost.PrivateData redirect here, I should create this file and copy/past ConsoleColorProxy class and PrivateData member in it, or this file already exist ? Edit Nevermind I just found PrivateData. Sorry but my english comprehension is not perfect but what do you mean by "Port ConsoleColorProxy ..." ? I guess that it's not just a copy/past, right ? |
No problem :) Port usually means "take that and add it to this" sometimes it does mean actually copy/paste. However I think it's a little bit more work than copy/paste. First copy paste those classes over into Then, follow @SeeminglyScience's next step and Change the Write* methods in EditorServicesPSHostUserInterface to use the new colors. |
@tylerl0706 Ok ! But I have to copy ConsoleColorProxy class into the override or above like in ConsoleHost ? Edit I can't use ConsoleHostUserInterface due to his level of restriction I tried using Microsoft.PowerShell.EditorServices.Console; but it doesn't work. Which import should I use to prevent this error ? |
What was the error that you got? |
@tylerl0706 My powershell is in french but by translating we got :
I think that's because ConsoleHostUserInterface is in Powershell and not in Powershell Editor Service |
Ah yeah you should replace that with Line 27 in a0761cf
Here are all of the |
@tylerl0706 The problem is that
Should I use For example
something like that ? |
You should be able to add these that I see in ConsoleHostUserInterface: to |
And then don't forget to edit these to use those values instead of the hardcoded ones 🙂 Line 526 in a0761cf
Ask all the questions you need. You've got this 💪 you're going to fix this issue 😃 |
@tylerl0706 Console.BackgroundColor doesn't exist in Microsoft.PowerShell.EditorServices.Console. Where is BackgroundColor exactly ? I will add it to Console. Edit I found it I think it's
Tell me if I'm wrong. I added it to Edit 2 I changed all the
tell me if I did nothing wrong with the Invoke-Build there's no error. I would like to test it but I don't really know how. And finally WriteProgress I don't know if I have to change something for the color or if it's ok. |
That's great @KeroroLulu! Here's what you can do to test: Follow these instructions to test your code out: |
@tylerl0706 Should I add Unit Test to my code ? Edit I'm on mac and I'm trying to launch the extension with F5, it propose me several process to attach my extension (zsh, adobe, cloud, etc...) which one should I use ? Edit 2 I did it somehow by using |
@KeroroLulu does |
It gives me :
I just tested it by deleting the message but it's just my way to test it that doesn't work. How can I print warning or error by using PWSH Editor Services ? |
If you change
does it still print in red or dark cyan? Note this will only work if you made the correct changes to the Line 565 in a0761cf
to use the You're getting there! 😄 |
@tylerl0706 Well I changed it in
But it doesn't change in my pwsh Here's my
I did my Edit It's really strange, I change my
But my error foreground color is still red ! Edit 2 Nevermind !! It works that was just a little problem from my installation :) I will do the Pull Request ! |
Supress Warnings in travis Supress Warning in Travis PowerShell#2 Test for travis Add Comment XML for travis Add Comment for Testing
That's great @KeroroLulu!! 🎉 🎉 |
* Add customize output color enhancement (#651) Supress Warnings in travis Supress Warning in Travis #2 Test for travis Add Comment XML for travis Add Comment for Testing * Adding internal class I added all internal class and suppress all the SuppressMessage. But I can't remove the empty documentation, the analysis of PowerShell Editor Services doesn't let it pass. I tried to add the suppress warning in it but it doesn't work as well. So I had to add all documentation. * Suppress Documentation for internal members Sorry I didn't notice that was only for public members until I read the error again. * Add text for color sumary
Specifically, in PowerShell.exe we have the ability to change the color used for errors, warnings, etc.:
In VSCode I can change the colors of the 16 ANSI colors, but I can't find a way to change which of them you are using to write errors out.
The text was updated successfully, but these errors were encountered: