VS Code: How to make all text bold, except the comments? [closed] - comments

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Can we make all text except for comments appear bold in VS Code?
I've tried using "editor.fontWeight": "bold" but this makes everything, including comments, bold.
Example: in the screenshot below, all text except for the comments (grey) would be bold.

Setting different fonts or font size for comments is currently not a standard feature in VS Code.
You can however make everything except comments bold:
Open settings.json Ctrl+Shift+P → type 'Open Settings (JSON)' → Enter)
Paste in the entry below and save to make all text bold, except comments:
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": [
"constant",
"constant.character",
"constant.character.escape",
"constant.numeric",
"constant.numeric.integer",
"constant.numeric.float",
"constant.numeric.hex",
"constant.numeric.octal",
"constant.other",
"constant.regexp",
"constant.rgb-value",
"emphasis",
"entity",
"entity.name",
"entity.name.class",
"entity.name.function",
"entity.name.method",
"entity.name.section",
"entity.name.selector",
"entity.name.tag",
"entity.name.type",
"entity.other",
"entity.other.attribute-name",
"entity.other.inherited-class",
"invalid",
"invalid.deprecated",
"invalid.illegal",
"keyword",
"keyword.control",
"keyword.operator",
"keyword.operator.new",
"keyword.operator.assignment",
"keyword.operator.arithmetic",
"keyword.operator.logical",
"keyword.other",
"markup",
"markup.bold",
"markup.changed",
"markup.deleted",
"markup.heading",
"markup.inline.raw",
"markup.inserted",
"markup.italic",
"markup.list",
"markup.list.numbered",
"markup.list.unnumbered",
"markup.other",
"markup.quote",
"markup.raw",
"markup.underline",
"markup.underline.link",
"meta",
"meta.block",
"meta.cast",
"meta.class",
"meta.function",
"meta.function-call",
"meta.preprocessor",
"meta.return-type",
"meta.selector",
"meta.tag",
"meta.type.annotation",
"meta.type",
"punctuation.definition.string.begin",
"punctuation.definition.string.end",
"punctuation.separator",
"punctuation.separator.continuation",
"punctuation.terminator",
"storage",
"storage.modifier",
"storage.type",
"string",
"string.interpolated",
"string.other",
"string.quoted",
"string.quoted.double",
"string.quoted.other",
"string.quoted.single",
"string.quoted.triple",
"string.regexp",
"string.unquoted",
"strong",
"support",
"support.class",
"support.constant",
"support.function",
"support.other",
"support.type",
"support.type.property-name",
"support.variable",
"variable",
"variable.language",
"variable.name",
"variable.other",
"variable.other.readwrite",
"variable.parameter"
],
"settings": {
"fontStyle": "bold"
}
},{
"scope": [
"comment",
"punctuation.definition.comment"
],
"settings": {
"fontStyle": ""
}
}]
}
If your settings.json doesn't contain any other entries just wrap the above in { }.
You can read more about customizing the editor text in VS Code here.

Related

Is there any SDK for golang to gererate branch link dyncmically? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I need to dynamically generate deep links with few embedded parameters using branch.io in a golang project. That link will be sent to android phones as a SMS. So that invite referral link redirects to the play store app. Is there any go lang SDK or any way another way to generate referral link dynamically?
Currently, there is no library/wrapper support for GoLang specifically. However, you can make use of the Deep Linking API to achieve your use case.
Sample cURL -
curl -XPOST https://api2.branch.io/v1/url -H "Content-Type: application/json" \
-d '{
"branch_key": "key_live_xxxxxxxxx",
"channel": "facebook",
"feature": "onboarding",
"campaign": "new product",
"stage": "new user",
"tags": ["one", "two", "three"],
"data": {
"$canonical_identifier": "content/123",
"$og_title": "Title from Deep Link",
"$og_description": "Description from Deep Link",
"$og_image_url": "http://www.lorempixel.com/400/400/",
"$desktop_url": "http://www.example.com",
"custom_boolean": true,
"custom_integer": 1243,
"custom_string": "everything",
"custom_array": [1,2,3,4,5,6],
"custom_object": { "random": "dictionary" }
}
}'

Is there a way to customize the color of the import in JS in VS Code?

I'm trying to change the color of the word after import in JS, in VS Code. I attached a screenshot of what I mean.
Screenshot:
What I'm referring to is underlined in red
I didn't find a valid entry in the textMateRules for this.
I'd appreciate some help. Thanks :)
I don't know which flavor of javascript you are using but you can use the following in your settings.json:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.other.readwrite.alias.js",
"settings": {
"foreground": "#FF0000"
}
}
]
}
How to know which scopes a given token has
In your command palette type:
> Developer: Inspect Editor Tokens and Scopes
This will show a popup of information related to the token at cursor:
You will see applicable scope entries at the bottom for textmate scopes, you can use any of the options listed, but the topmost option is the most specfic option
If you use the Inspect Editor Tokens and Scopes command (from the Command Palette) you will see this scope:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.other.readwrite.alias.js.jsx",
"settings": {
"foreground": "#ff0000",
"fontStyle": "bold underline"
}
},
]
},
You cannot add a colored underline without also changing the font color also.
If you really want to color the line differently than the text (and many other formatting options, see https://code.visualstudio.com/api/references/vscode-api#DecorationRenderOptions
use the Highlight extension:
"highlight.regexes": {
"(import\\s+)(.*?)(\\s+from .*)": {
"filterLanguageRegex": "javascriptreact",
"decorations": [
{},
{
"borderWidth": "0 0 2px 0",
"borderColor": "red",
"borderStyle": "solid"
}
{}
]
}
},
LOL: you probably just wanted to change the word color, not the underlining. Nevertheless, the Highlight extension gives you many more options, like outlines, borders, backgroundColor, letterSpacing, even before and after css properties - so you can easily make the text you want to stand out.

parsing output and passing in specific line into following command [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am trying to parse an output from aws cli and pass it into another argument. I am trying to accomplish this with sed and am stuck on how to approach it, I have read other posts but can't seem to figure it out.
output:
{
"LoadBalancers": [
{
"Type": "network",
"Scheme": "internet-facing",
"IpAddressType": "ipv4",
"VpcId": "vpc-3ac0fb5f",
"AvailabilityZones": [
{
"LoadBalancerAddresses": [
{
"IpAddress": "35.161.207.171",
"AllocationId": "eipalloc-64d5890a"
}
],
"ZoneName": "us-west-2b",
"SubnetId": "subnet-5264e837"
}
],
"CreatedTime": "2017-10-15T22:41:25.657Z",
"CanonicalHostedZoneId": "Z2P70J7EXAMPLE",
"DNSName": "my-network-load-balancer-5d1b75f4f1cee11e.elb.us-west-2.amazonaws.com",
"LoadBalancerName": "my-network-load-balancer",
"State": {
"Code": "provisioning"
},
"LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/net/my-network-load-balancer/5d1b75f4f1cee11e"
}
]
}
The string i am trying to capture is
arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/net/my-network-load-balancer/5d1b75f4f1cee11e
and pass it into the following command:
aws elbv2 delete-load-balancer --load-balancer-arn <the arn extracted from the previous output>
If you provide a solution a small explanation would be helpful as well. Thanks in advance for your help!
If the output is json format, sed is not recommended to parse the json/xml...input.
You can use jq in shell, for your example, you can do:
..cmd to get yourOutput..|jq '.LoadBalancers[0].LoadBalancerArn'

TextMate scope for triple quoted Python docstrings

I'm currently setting up VS Code for Python development. I'd like to have triple-quoted docstrings highlighted as comments, not as strings, i.e. grey instead of light green in this picture:
I know that I can adjust this in the TextMate rules for this theme, but I can't figure out the right scope for Python docstrings. I thought I would be something like this:
"editor.tokenColorCustomizations": {
"[Predawn]": {
"comments": "#777777",
"textMateRules": [
{
"scope": "string.quoted.triple",
"settings": {
"foreground": "#777777"
}
}
]
},
}
but that does not have the desired effect, even after restarting the editor. Does anyone know what the right scope is?
Just to expand on the comments above, the scopes are:
For docstrings: string.quoted.docstring.multi.python for """ ''' (or .single for ' ")
For triple quote strings that are not docstrings: string.quoted.multi.python
The scope string.quoted.triple is not used, even though it appears in settings.json autocomplete.
Try using this one
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"string.quoted.multi.python",
"string.quoted.double.block.python",
"string.quoted.triple",
"string.quoted.docstring.multi.python",
"string.quoted.docstring.multi.python punctuation.definition.string.begin.python",
"string.quoted.docstring.multi.python punctuation.definition.string.end.python",
"string.quoted.docstring.multi.python constant.character.escape.python"
],
"settings": {
"foreground": "#777777" //change to your preference
}
}
]

CouchBase Lite Mobile Schema Design [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am unsure if I am creating a proper schema for a CouchBase mobile database. Here is an example of a schema for 1 user's mobile app:
{
"users": [
{
"firstname": "Jim",
"lastname": "terry",
"addresses": [
{
"address": "123 Way",
"zipcode": "65432"
},
...
],
"activities": [
{
"steps": 500
},
{
"sleep_hours": 2
},
...
],
"posts": [
{
"subject": "Hello",
"body": "World"
},
...
]
},
...
]
}
A mobile app could have 1 to many users on a device. The server database could hold many users that the app would only have access to. What I am having a hard time wrapping my head around is whether this is a good data model for a couchbase app. I have denormalized all of the data associated to a user under a user schema. My questions are as follows:
What happens if activity gets really large for a user and posts gets really large? When you make an update to activity does it have to save the whole document which could create a performance option when only one piece of data on the user gets updated? Does the database break up these arrays as separate documents from the user?
Is it best practice to store the data in activities in this fashion? In the example, both objects are an activity but they contain completely separate data.
Is this the most efficient model? One example of a change might be instead of having a generic "activities":[] creating "step_activities" and "sleep_activities"?

Resources