Copy computed css value in chrome devtools - google-chrome-devtools

In the example below I would like to copy the value of 'box-shadow'.
But in Chrome Devtools I can't select the value and there is no copy option.
Is there a better way to do this?
I can copy the value in the 'styles' tab, but that contains a bunch of css variables.
Update: a extra nice option would be 'Copy computed styles' here:

Related

Is there any way in vscode to know where the current the file has been imported?

Are there any extensions/features in vs-code which could let me know where the current file is imported? I usually do a global search of the filename but it is time consuming when the file name is similar to any variable or there are similar named files.
You can do a right-click on every function / variable or class. Then you choose "Find all references" to show where each function / variable or class is called.
For this you do not need an extension, because it is a standard feature of vscode
- find unused exports in project:
you can use this extension in vscode to find all unused exports
+ find name references (e.g. used exports) in project:
click on name then press shift+alt+F12
NO EXTENSION REQUIRED
Yes, We can find the references of a file in VSCODE like this:
Right-click on the file and then select Find References.
VSCODE will show all the references/imports of the file.
image reference
Right-click > Go to References (Shift + F12)
There is also an extension to change the appearance of how references show https://marketplace.visualstudio.com/items?itemName=jrieken.references-plusplus
If you are limiting your search to the current open workspace / folder, you can
do a search for 'import' using the magnifying glass or pressing ctrl+shift+s
open the results in editor by either clicking the link that says 'Open in editor' or by pressing alt+enter
In the document that opens, search for the name of your module.
In this way you will discover all of the imports that involve your module, regardless of whether you have used 'import mymodule' or 'from mymodule import myfunction' or anything else. I'm specifically thinking of how I'd structure a python project, but if you are using another language, you can alter the search in a way that works for the way your language does imports.

How to set default file type to be All Files(*.*) in VS Code?

Now my default file type of Visual Studio Code is Plain Text.
If I save a new file with name like a.in, it will save as a.in.txt. I have to change the dropdown to All Files.
I find the same problems in github: 1, 2. However, they seem not solve my problem.
This is not possible in the general case in VSCode.
The issue is that you cannot assign "no extension" to a language, and as per the links you mentioned, the All Files (*.*) option is disabled by upstream (electron).
Therefore, you will either have to remove the extension manually, OR you can create the file first (using the terminal, Explorer, an extension, etc.) and then open that existing file.
There is a way to change the default extension (but not to All Files)
Add the following line to your settings.json
"files.defaultLanguage": "<language>",
Replace <language> with the language of your choice.
Now, whenever you make a new a file, the default file language will be <language>.
A special value for <language> is ${activeEditorLanguage} which is the language of the file last opened (useful if, say, you copy a piece of code from one file to save as another).
Unfortunately, this does not fully answer the question, but provides a partial solution.

Change title of untitled tab in Visual Studio Code

I'm building a VS Code extension which includes changing the name/title of untitled-1 tab (unsaved file).
I tried running the below code in debugger console of extension but it didn't reflect in the editor:
vscode.workspace.textDocuments[0].fileName="myFile"
Is it not possible or am I missing something?
It is still (Q1 2020) not possible, but the next VSCode 1.42 will name its Untitled editors differently.
Untitled editors in VS Code are text buffers that have not yet been saved to disk.
You can leave them open for as long as you like and all text content is stored and restored between restarts.
Untitled editors were given generic names such as Untitled-1 and counting upwards.
In this release, untitled editors will use the content of the first line of the document for the editor title, and include the generic name as part of the description:
Note: If the first line is empty or does not contain any words, the title will fall back to Untitled_* as before.
So while you cannot set the title yourself (still readonly fileName), technically... changing the first line of that file would be enough to change the title of said "Untitled" editor.
With VSCode 1.43 (Q1 2020), a new setting workbench.editor.untitled.labelFormat allows to control whether untitled editors should use the contents as title or not.
Possible values are content or name.
Configure 'workbench.editor.untitled.labelFormat': 'name' to get the previous behavior back where untitled editors would have a short title, such as Untitled-1.
It's not possible - if you check out the source code for the API definition in vscode.d.ts, you'll see that fileName is declared as readonly:
export interface TextDocument {
// ...
readonly fileName: string;
// ...
}
Unfortunately, it seems that the readonly attribute isn't reflected in the API docs on the website.
This mainly happens if we create a new file in the OPEN EDITORS section, thus they appear as unsaved. To prevent this, create a folder for storing your files, and then in that folder, create your new file then it will show options to name it, also you can add a file type extension like .cpp.
TIP: vsc-rename-files extension to rename your files.

How do I modify the EL opening template in Eclipse?

Whenever I am working in a JSP file and I type ${ to start an el (Expression Language) tag, Eclipse will automatically add } (with a space before the closing brace) after the cursor so that I get ${ } instead of ${}.
Is there a code template in Preferences that I can modify to change this behavior, or is it beyond user preference control?
I have checked in Preferences: Web: JSP Files: Editor: Templates, but none of those templates match. I've also looked in several other sections in Preferences but haven't found anything promising.
What #Mero provided (see comments on answer above) might not be an exact answer, but creating a JSP Template probably the closest thing that I've found.
A few notes for anyone that wants to go that route:
Create a new template through menu Window->Preferences, then in the drill down menu navigate to Web->JSP Files->Editor->Templates. Click New.
Name is a shortcut you can type (the same way typing sysout ctrl+space in Java is a shortcut for System.out.println()). I suggest something simple like el. This allows you to type e l ctrl-space instead of $ { ctrl-space to pull it up.
Context tells it when it should appear in intellisense. I suggest creating two of this template where one has a context of JSP Attribute value and the other has a context of All JSP.
Description is just informative. Put whatever you want. I put 'EL Script' myself.
Pattern is where you put what will be inserted. Put $${${cursor}} or $${${script}}, depending on preference. See below for explanation on the differences.
In Eclipse Templates ${} is how you put variables in the template, so to make it actually print ${} you have to escape the $ with a $$ leading to $${}.
The predefined variable ${cursor} defines where the cursor is after intellisense replaces the el, so to have the cursor appear in between the curly braces you want to do this: $${${cursor}}.
Using any variable that is not predefined (in this case, ${script}) will simply put in that variable with a box around it and allow you to type over it and press enter when you're done, allowing you to move to the end of the closing curly brace.
Note: I understand that this is not an actual answer, but rather is a workaround. I'm putting it here simply so that those who are fine with a workaround can know how to go about doing it.
Edit
For those that don't like having to type ctrl-space, a workaround could be to have the template name start with< since on JSP pages, the < opens the intellisense, so for instance, you could have the name be <el or <$.
A workaround but not an answer:
Disable auto-close of EL tags. You type ${expression} and get ${expression}|, rather than typing ${expression and getting ${expression| }. (| denotes the cursor location)
See this answer, from when this same question was asked of Eclipse Kepler: https://stackoverflow.com/a/20258401/1021426

See raw code/text from copy paste

I doing some formatting from copy/paste. When I copy a table from Word, and I want to insert it in my program, I need to edit the table formatting to show the info like I want.
When I copy from word I can view whats copy in clipboard magic:
Is there a way to get the formatting, or do I need to create a new table for scratch with the data listed in clipboard magic?
I Clipdiary the "copy" is read as HTML
This makes me wounder, is it possible to get the html code?
Yes, the HTML is present as CF_HTML. See reference on MSDN: http://msdn.microsoft.com/en-us/library/aa767917(v=vs.85).aspx
If you just want to SEE it, ClipMate has a Binary display that will show you a binary dump of the data. It's available in the trial version. If you don't see the Binary tab in the display window, turn it on in the Tools | Options | Editor dialog.