-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Context menu enhancements Enhances the memory webview to properly support context menu actions contributed via `webview/context` contribution point. This includes - Augmenting the webview components with `data-vscode-context` custom data properties. These properties are used to provide additional context info (as JSON string). The composed context is then available in `when` conditions from `webview/context` contributions and as command argument when executing the associated command. Provides the following context menu enhancements outlined in #51 - Quick access to window configuration by - providing show/hide entries for variable & ascii column - show/hide for radix prefix - `Show advanced Options` command to show the advanced settings overlay - Allow contributions from other extensions
- Loading branch information
Showing
11 changed files
with
342 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2024 EclipseSource and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
import { WebviewIdMessageParticipant } from 'vscode-messenger-common'; | ||
import { VariableMetadata } from './memory-range'; | ||
|
||
export interface WebviewContext { | ||
messageParticipant: WebviewIdMessageParticipant, | ||
webviewSection: string, | ||
showAsciiColumn: boolean | ||
showVariablesColumn: boolean, | ||
showRadixPrefix: boolean, | ||
} | ||
|
||
export interface WebviewCellContext extends WebviewContext { | ||
column: string; | ||
value: string; | ||
} | ||
|
||
export interface WebviewVariableContext extends WebviewCellContext { | ||
variable?: VariableMetadata | ||
} | ||
|
||
/** | ||
* Retrieves the currently visible (configurable) columns from the given {@link WebviewContext}. | ||
* @returns A string array containing the visible columns ids. | ||
*/ | ||
export function getVisibleColumns(context: WebviewContext): string[] { | ||
const columns = []; | ||
if (context.showAsciiColumn) { | ||
columns.push('ascii'); | ||
} | ||
if (context.showVariablesColumn) { | ||
columns.push('variables'); | ||
} | ||
return columns; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.