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

Tweaks: normalize TextAttribute method names (adjective form) #6951

Conversation

jazzdelightsme
Copy link
Member

Summary of the Pull Request

Text can have various attributes, such as "bold", "italic", "underlined", etc. The TextAttribute class embodies this. It has methods to set/query these attributes.

This change tweaks a few of the method names to make them match. I.e. for an imaginary text property "Foo", we should have methods along the lines of:

IsFoo
SetFoo(bool isFoo)

And variations should match: we should have "Foo" and "OverFoo", not "Fooey" and "OverFoo".

I chose to standardize on the adjective form, since that's what we are closest to already. The attributes I attacked here are:

SetItalics --> SetItalic
SetUnderline --> SetUnderlined
SetOverline --> SetOverlined

("italic" is an adjective; "italics" is a plural noun, representing letters or words in an italic typeface)

And I also added methods for "DoublyUnderlined" for good measure.

I stopped short of renaming the GraphicsOptions enum values to match, too; but I'd be willing to do that in a follow-up change if people wanted it.

Validation Steps Performed

It builds, and tests still pass.

jazzdelightsme and others added 2 commits July 16, 2020 12:39
Text can have various attributes, such as "bold", "italic",
"underlined", etc.  The TextAttribute class embodies this. It has
methods to set/query these attributes.

This change tweaks a few of the method names to make them match. I.e.
for an imaginary text property "Foo", we should have methods along the
lines of:

```
IsFoo
SetFoo(bool isFoo)
```

And variations should match: we should have "Foo" and "OverFoo", not
"Fooey" and "OverFoo".

I chose to standardize on the adjective form, since that's what we are
closest to already. The attributes I attacked here are:

SetItalic**s** --> SetItalic
SetUnderline --> SetUnderline**d**
SetOverline --> SetOverline**d**

("italic" is an adjective; "italics" is a plural noun, representing
letters or words in an italic typeface)

And I also added methods for "DoublyUnderlined" for good measure.

I stopped short of renaming the GraphicsOptions enum values to match,
too; but I'd be willing to do that in a follow-up change if people
wanted it.
@DHowett
Copy link
Member

DHowett commented Jul 16, 2020

/cc @j4james as he's been in this area for a while

@DHowett
Copy link
Member

DHowett commented Jul 16, 2020

I'd rather not introduce the handling for DoublyUnderlined without tests added to the existing SGR tests; it also changes this from a purely mechanical change to one that impacts our VT support (though not in a meaningful way) (it touches on #2916 and we need to make sure the cases outlined in James' comments on that thread are covered)

@j4james
Copy link
Collaborator

j4james commented Jul 16, 2020

This looks good to me. 👍

@miniksa miniksa added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 17, 2020
@ghost
Copy link

ghost commented Jul 17, 2020

Hello @miniksa!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 1f8264d into microsoft:master Jul 17, 2020
@jazzdelightsme jazzdelightsme deleted the user/danthom/makeTextAttributeGrammarParallel branch July 17, 2020 16:46
DHowett added a commit that referenced this pull request Aug 5, 2020
Carlos Zamora (1)
* UIA: use full buffer comparison in rects and endpoint setter (GH-6447)

Dan Thompson (2)
* Tweaks: normalize TextAttribute method names (adjective form) (GH-6951)
* Fix 'bcz exclusive' typo (GH-6938)

Dustin L. Howett (4)
* Fix VT mouse capture issues in Terminal and conhost (GH-7166)
* version: bump to 1.3 on master
* Update Cascadia Code to 2007.15 (GH-6958)
* Move to the TerminalDependencies NuGet feed (GH-6954)

James Holderness (3)
* Render the SGR "underlined" attribute in the style of the font (CC-7148)
* Add support for the "crossed-out" graphic rendition attribute (CC-7143)
* Refactor grid line renderers with support for more line types (CC-7107)

Leonard Hecker (1)
* Added til::spsc, a lock-free, single-producer/-consumer FIFO queue (CC-6751)

Michael Niksa (6)
* Update TAEF to 10.57.200731005-develop (GH-7164)
* Skip DX invalidation if we've already scrolled an entire screen worth of height (GH-6922)
* Commit attr runs less frequently by accumulating length of color run (GH-6919)
* Set memory order on slow atomics (GH-6920)
* Cache the viewport to make invalidation faster (GH-6918)
* Correct comment in this SPSC test as a quick follow up to merge.

Related work items: MSFT-28208358
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants