|
2 | 2 | // Licensed under the MIT license. |
3 | 3 |
|
4 | 4 | import { GenerateHeaderOptions } from "@microsoft/fast-foundation"; |
5 | | -import { provideReactWrapper } from '@microsoft/fast-react-wrapper'; |
6 | | -import * as webviewUI from "@vscode/webview-ui-toolkit"; |
| 5 | +import { VSCodeDataGrid, VSCodeDataGridRow, VSCodeDataGridCell } from "@vscode/webview-ui-toolkit/react"; |
7 | 6 | import React from 'react'; |
8 | 7 | const isMac: boolean = navigator.platform.toLowerCase().indexOf("darwin") === 0; |
9 | | -const { wrap } = provideReactWrapper(React); |
10 | | -const DataGrid = wrap(webviewUI.VSCodeDataGrid); |
11 | | -const DataRow = wrap(webviewUI.VSCodeDataGridRow); |
12 | | -const DataCell = wrap(webviewUI.VSCodeDataGridCell); |
13 | 8 |
|
14 | 9 | export default function CodeEditingPanel() { |
15 | 10 | const controlKey = !isMac ? <kbd data-os="win">Ctrl</kbd> : <kbd data-os="mac">⌘</kbd>; |
@@ -38,48 +33,48 @@ export default function CodeEditingPanel() { |
38 | 33 | <p> |
39 | 34 | Code Navigation makes it easy to understand existing codebase. Here to mention a few features that can help you navigate your code repositories. |
40 | 35 | </p> |
41 | | - <DataGrid generateHeader={GenerateHeaderOptions.none} gridTemplateColumns="1fr 3fr"> |
42 | | - <DataRow key={1}> |
43 | | - <DataCell className="font-weight-bold" gridColumn="1">Go to Definition</DataCell> |
44 | | - <DataCell gridColumn="2"><kbd>F12</kbd><br />You can also hover on the symbol to preview its declaration and javadoc. To jump to the definition, hold the {controlKey} key, and click on the symbol.</DataCell> |
45 | | - </DataRow> |
46 | | - <DataRow key={2}> |
47 | | - <DataCell className="font-weight-bold" gridColumn="1">Go to Implementation</DataCell> |
48 | | - <DataCell gridColumn="2">{f12Key}<br />For an interface, this shows all the implementors of that interface and for abstract methods, this shows all concrete implementations of that method.</DataCell> |
49 | | - </DataRow> |
50 | | - <DataRow key={3}> |
51 | | - <DataCell className="font-weight-bold" gridColumn="1">Go to Type Definition</DataCell> |
52 | | - <DataCell gridColumn="2">This one allows you to go to the definition of the type of the symbol. For example, you have a class member <code>someString</code>, "Go to Definition" will take you to the definition of <code>someString</code> while "Go to <strong>Type</strong> Definition" will take you to the definition of <code>String</code>.</DataCell> |
53 | | - </DataRow> |
54 | | - <DataRow key={4}> |
55 | | - <DataCell className="font-weight-bold" gridColumn="1">Find All References</DataCell> |
56 | | - <DataCell gridColumn="2">{shiftAltF12}<br />This allows you to quickly analyze the impact of your edit or the popularity of your specific method or property throughout your repository.</DataCell> |
57 | | - </DataRow> |
58 | | - </DataGrid> |
| 36 | + <VSCodeDataGrid generateHeader={GenerateHeaderOptions.none} gridTemplateColumns="1fr 3fr"> |
| 37 | + <VSCodeDataGridRow key={1}> |
| 38 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Go to Definition</VSCodeDataGridCell> |
| 39 | + <VSCodeDataGridCell gridColumn="2"><kbd>F12</kbd><br />You can also hover on the symbol to preview its declaration and javadoc. To jump to the definition, hold the {controlKey} key, and click on the symbol.</VSCodeDataGridCell> |
| 40 | + </VSCodeDataGridRow> |
| 41 | + <VSCodeDataGridRow key={2}> |
| 42 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Go to Implementation</VSCodeDataGridCell> |
| 43 | + <VSCodeDataGridCell gridColumn="2">{f12Key}<br />For an interface, this shows all the implementors of that interface and for abstract methods, this shows all concrete implementations of that method.</VSCodeDataGridCell> |
| 44 | + </VSCodeDataGridRow> |
| 45 | + <VSCodeDataGridRow key={3}> |
| 46 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Go to Type Definition</VSCodeDataGridCell> |
| 47 | + <VSCodeDataGridCell gridColumn="2">This one allows you to go to the definition of the type of the symbol. For example, you have a class member <code>someString</code>, "Go to Definition" will take you to the definition of <code>someString</code> while "Go to <strong>Type</strong> Definition" will take you to the definition of <code>String</code>.</VSCodeDataGridCell> |
| 48 | + </VSCodeDataGridRow> |
| 49 | + <VSCodeDataGridRow key={4}> |
| 50 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Find All References</VSCodeDataGridCell> |
| 51 | + <VSCodeDataGridCell gridColumn="2">{shiftAltF12}<br />This allows you to quickly analyze the impact of your edit or the popularity of your specific method or property throughout your repository.</VSCodeDataGridCell> |
| 52 | + </VSCodeDataGridRow> |
| 53 | + </VSCodeDataGrid> |
59 | 54 | </div> |
60 | 55 | <div> |
61 | 56 | <p> |
62 | 57 | The commands above will possibly take you to another file. But you can choose to stay using the peeking features below: |
63 | 58 | </p> |
64 | | - <DataGrid generateHeader={GenerateHeaderOptions.none} gridTemplateColumns="1fr 3fr"> |
65 | | - <DataRow key={1}> |
66 | | - <DataCell className="font-weight-bold" gridColumn="1">Peek Definition</DataCell> |
67 | | - <DataCell gridColumn="2">{altF12Key}</DataCell> |
68 | | - </DataRow> |
69 | | - <DataRow key={2}> |
70 | | - <DataCell className="font-weight-bold" gridColumn="1">Peek References</DataCell> |
71 | | - <DataCell gridColumn="2">{shiftF12}</DataCell> |
72 | | - </DataRow> |
73 | | - </DataGrid> |
| 59 | + <VSCodeDataGrid generateHeader={GenerateHeaderOptions.none} gridTemplateColumns="1fr 3fr"> |
| 60 | + <VSCodeDataGridRow key={1}> |
| 61 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Peek Definition</VSCodeDataGridCell> |
| 62 | + <VSCodeDataGridCell gridColumn="2">{altF12Key}</VSCodeDataGridCell> |
| 63 | + </VSCodeDataGridRow> |
| 64 | + <VSCodeDataGridRow key={2}> |
| 65 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Peek References</VSCodeDataGridCell> |
| 66 | + <VSCodeDataGridCell gridColumn="2">{shiftF12}</VSCodeDataGridCell> |
| 67 | + </VSCodeDataGridRow> |
| 68 | + </VSCodeDataGrid> |
74 | 69 | </div> |
75 | 70 | <div> |
76 | 71 | <p> Last but not least, you can jump between the matching brackets back and forth: </p> |
77 | | - <DataGrid generateHeader={GenerateHeaderOptions.none} gridTemplateColumns="1fr 3fr"> |
78 | | - <DataRow key={1}> |
79 | | - <DataCell className="font-weight-bold" gridColumn="1">Go to Bracket</DataCell> |
80 | | - <DataCell gridColumn="2">{ctrlShiftSlash}</DataCell> |
81 | | - </DataRow> |
82 | | - </DataGrid> |
| 72 | + <VSCodeDataGrid generateHeader={GenerateHeaderOptions.none} gridTemplateColumns="1fr 3fr"> |
| 73 | + <VSCodeDataGridRow key={1}> |
| 74 | + <VSCodeDataGridCell className="font-weight-bold" gridColumn="1">Go to Bracket</VSCodeDataGridCell> |
| 75 | + <VSCodeDataGridCell gridColumn="2">{ctrlShiftSlash}</VSCodeDataGridCell> |
| 76 | + </VSCodeDataGridRow> |
| 77 | + </VSCodeDataGrid> |
83 | 78 | </div> |
84 | 79 | <h2 className="font-weight-light">IntelliSense</h2> |
85 | 80 | <p> |
|
0 commit comments