You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- todo: run & show localhost in addr bar instead of github.io -->
36
-
37
-
To view source files while using a tool than the **Sources** tool in the **Activity Bar**, use the **Quick source** tool, as follows:
38
-
39
-
1. Open a webpage; for example, open [Demo To Do](https://microsoftedge.github.io/Demos/demo-to-do/) in a new window or page.<!-- todo: localhost -->
40
-
41
-
1. Right-click the webpage and then select **Inspect**.
42
-
43
-
DevTools opens.
44
-
45
-
1. In the **Activity Bar** at the top of DevTools, select the **Sources** () tool.
46
-
47
-
1. In the **Sources** () tool, in the **Page** tab, select one or more files, such as `to-do.js`.
48
-
49
-
The tabs for the selected files are opened in the **Sources** tool:
50
-
51
-

52
-
53
-
1. In the **Activity Bar** at the top of DevTools, select a tool other than **Sources**, such as **Elements** ().
54
-
55
-
1. If the **Quick View** toolbar isn't shown at the bottom of DevTools, press **Esc**.
56
-
57
-
1. In the **Quick View** toolbar at the bottom of DevTools, click the **More tools** button, and then select **Quick source**.
58
-
59
-
The **Quick source** tool expands in **Quick View** at the bottom of DevTools, and displays the same files that are open in the **Sources** tool:
60
-
61
-
<!-- todo: simpler display -->
62
-
63
-
You can now view or edit the file in the **Quick source** tool, at the same time as displaying a different tool in the main part of DevTools.
33
+
## Edit local source files in DevTools by selecting a Workspace folder
64
34
65
-
See also:
66
-
*[Using the Page tab to explore resources that construct the current webpage](../sources/index.md#using-the-page-tab-to-explore-resources-that-construct-the-current-webpage) in _Sources tool overview_.
35
+
This is an end-to-end tutorial of all steps to demonstrate the **Quick source** tool, by using the ToDo web app in the **MicrosoftEdge / Demos** repo.
67
36
37
+
By selecting a local folder as a **Workspace** in the **Sources** tool, you can then edit files from within the **Quick source** tool at the same time as displaying a different tool, and have those edits be saved to your local drive. This way, you can edit files in the **Quick source** tool while using another tool, such as **Elements** or **Network**, and have your edits be saved to the corresponding source file on your local drive.
## Edit local source files in DevTools by selecting a Workspace folder
39
+
To edit source files in the **Quick source** tool, you'll do the following:
71
40
72
-
By selecting a local folder as a **Workspace** in the **Sources** tool, you can then edit files from within the **Quick source** tool at the same time as displaying a different tool, and have those edits be saved to your local drive. This way, you can edit files in the **Quick source** tool while using another tool, such as **Elements** or **Network**, and have your edits be saved to the corresponding source file on your local drive.
41
+
1. Have access to the webpage sourcefiles locally, such as a cloned repo.
73
42
74
-
To edit source files in the **Quick source** tool:
43
+
1. In the **Workspace** tab in the **Sources**() tool, add a local folder of source files.
75
44
76
-
1.Have access to your source files locally, such as a cloned repo. See [Have local source files, such as a cloned repo](#have-local-source-files-such-as-a-cloned-repo), below.
45
+
1.In the **Workspace** tab, open a file, such as a `.js` file.
77
46
78
-
1. In the **Workspace** tab in the **Sources**() tool, add a local folder of source files. See [Select a local folder of source files as the Workspace](#select-a-local-folder-of-source-files-as-the-workspace), below.
47
+
1. In the **Activity Bar**, select a tool other than the **Sources** tool, such as the **Elements** tool.
79
48
80
-
1. In the **Activity Bar**, select a tool other than the **Sources** tool, such as the **Elements** tool. Then in the **Quick View** panel at the bottom of DevTools, open the **Quick source** tool. See [Open the Quick source tool](#open-the-quick-source-tool), below.
49
+
1. In the **Quick View** panel at the bottom of DevTools, open the **Quick source** tool. The opened `.js` file is shown in a streamlined editor, and the **Elements** tool is still displayed.
@@ -136,6 +105,19 @@ Continue with the next section.
136
105
137
106
If you use the git bash shell, it's a UNIX shell, so even on Windows, you need to wrap a directory path that has backslashes in quotes, or else use forward slashes rather than backslashes.
138
107
108
+
1. Create a working branch named "test" and switch to it (to avoid altering the demo's files in the "main" branch):
109
+
110
+
```Shell
111
+
git checkout -b test
112
+
```
113
+
114
+
That's equivalent to:
115
+
116
+
```Shell
117
+
git branch test
118
+
git switch test
119
+
```
120
+
139
121
1. Run one of the following commands, to start the web server:
140
122
141
123
```bash
@@ -199,16 +181,6 @@ Continue with the next section.
199
181
200
182

201
183
202
-
1. In the **Activity Bar** at the top of DevTools, select a tool other than the **Sources** () tool, such as the **Elements** () tool.
203
-
204
-
The **Quick source** tool expands in **Quick View** at the bottom of DevTools, and has a tab for each open file:
205
-
206
-
<!-- todo: localhost in addr bar -->
207
-
208
-
1. If there's no longer a green "mapped" dot on the HTML, JS, or CSS file, long-click or right-click the **Refresh** button in Microsoft Edge, and then select **Hard refresh** (**Ctrl+Shift+R**).
@@ -223,7 +195,7 @@ Suppose you want to continue viewing the **Elements** tool, but you want to simu
223
195
224
196
The **Quick source** tool opens in **Quick View** at the bottom of DevTools:
225
197
226
-
<!--todo:localhost-->
198
+

227
199
228
200
`todo.js` is displayed, because that file is open in the **Sources** tool.
229
201
@@ -253,10 +225,12 @@ Suppose you want to continue viewing the **Elements** tool, but you want to simu
253
225
254
226
Now, when you edit the folder's files in DevTools, the edits are not only made to the transient file that's returned by the server, but are also saved to the source files on your local drive. You can edit the file from within the **Quick source** tool at the same time as displaying another tool (or from within the **Sources** tool).
255
227
228
+
This is the end of the tutorial steps.
229
+
256
230
See also:
257
231
*[Add a local folder to the workspace, to use DevTools to edit files and save changes to disk](../sources/index.md#add-a-local-folder-to-the-workspace-to-use-devtools-to-edit-files-and-save-changes-to-disk) in _Sources tool overview_.
258
232
*[Edit and save files in a workspace (Sources tool Workspace tab)](../workspaces/index.md)
259
-
*[Step 4: Save a JavaScript change to disk](../workspaces/index.md#step-4-save-a-javascript-change-to-disk) in _Edit and save files in a workspace (Sources tool Workspace tab)_
233
+
*[Step 6: Save a JavaScript change to disk](../workspaces/workspace-tutorial.md#step-6-save-a-javascript-change-to-disk) in _Workspace tutorial (Sources tool Workspace tab)_
Copy file name to clipboardExpand all lines: microsoft-edge/devtools-guide-chromium/sources/index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,13 +48,13 @@ Use the **Sources** tool to view, modify, and debug front-end JavaScript code, a
48
48
*[Transformations from source code to compiled front-end code](#transformations-from-source-code-to-compiled-front-end-code)
49
49
*[Editing CSS](#editing-css)
50
50
* [Editing CSS by using the Styles tab in the Elements tool, when using the Workspace tab of the Sources tool](#editing-css-by-using-the-styles-tab-in-the-elements-tool-when-using-the-workspace-tab-of-the-sources-tool)
51
-
* [The Page tab or Workspace tab in the Sources tool](#the-page-tab-or-workspace-tab-in-the-sources-tool)
51
+
* [Editing CSS in the Page tab or Workspace tab in the Sources tool](#editing-css-in-the-page-tab-or-workspace-tab-in-the-sources-tool)
52
52
*[Editing an HTML file](#editing-an-html-file)
53
53
*[Going to a line number or function](#going-to-a-line-number-or-function)
54
54
*[Quick source tool, to display source files when using a different tool](#quick-source-tool-to-display-source-files-when-using-a-different-tool)
55
55
*[Using the Debugger pane to debug JavaScript code](#using-the-debugger-pane-to-debug-javascript-code)
56
56
*[The basic approach to using a debugger](#the-basic-approach-to-using-a-debugger)
57
-
*[Advantages of the debugger's Watch and Scope over console.log](#advantages-of-the-debuggers-watch-and-scope-over-console.log)
57
+
*[Advantages of the debugger's Watch and Scope over console.log](#advantages-of-the-debuggers-watch-and-scope-over-consolelog)
58
58
*[Debug from Visual Studio Code directly](#debug-from-visual-studio-code-directly)
59
59
*[Articles about debugging](#articles-about-debugging)
60
60
*[See also](#see-also)
@@ -325,7 +325,7 @@ The following subsections cover the Editor pane:
325
325
*[Reformatting a minified JavaScript file with pretty-print](#reformatting-a-minified-javascript-file-with-pretty-print)
326
326
*[Mapping minified code to your source code to show readable code](#mapping-minified-code-to-your-source-code-to-show-readable-code)
327
327
*[Transformations from source code to compiled front-end code](#transformations-from-source-code-to-compiled-front-end-code)
328
-
*[Editing a CSS file](#editing-a-css-file)
328
+
*[Editing CSS in the Page tab or Workspace tab in the Sources tool](#editing-css-in-the-page-tab-or-workspace-tab-in-the-sources-tool)
329
329
*[Editing an HTML file](#editing-an-html-file)
330
330
*[Going to a line number or function](#going-to-a-line-number-or-function)
331
331
*[Quick source tool, to display source files when using a different tool](#quick-source-tool-to-display-source-files-when-using-a-different-tool)
@@ -449,7 +449,7 @@ See also:
449
449
450
450
451
451
<!-- ---------- -->
452
-
###### The Page tab or Workspace tab in the Sources tool
452
+
###### Editing CSS in the Page tab or Workspace tab in the Sources tool
453
453
454
454
The **Page** or **Workspace** tab in the **Sources** tool supports directly editing a CSS file. For example, if you edit the CSS file from the tutorial [Edit and save files in a workspace (Sources tool Workspace tab)](../workspaces/index.md) to match the style rule below, the `H1` element in the upper left of the rendered webpage changes to green:
Copy file name to clipboardExpand all lines: microsoft-edge/devtools-guide-chromium/workspaces/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Use the **Workspace** tab in the **Sources** tool to display and edit the conten
33
33
The typical way to set up a workspace is to set it up to display the source files of your website's frontend code. This way, you use DevTools both to inspect your website, and to make changes to its source files. This way, the changes that you make are saved on your computer, rather than lost when you refresh the page.
*[Open a demo folder from the Workspace tab in the Sources tool](../../devtools-guide-chromium/sample-code/sample-code.md#open-a-demo-folder-from-the-workspace-tab-in-the-sources-tool) in _Sample code for DevTools_.
216
216
*[Track changes to files using the Changes tool](../changes/changes-tool.md)
217
217
*[Display or edit source files using the Quick source tool](../quick-source/quick-source-tool.md)
0 commit comments