Style link text + tidy up functions
This commit is contained in:
@@ -776,7 +776,7 @@ async function activateWithInstalledDistribution(
|
||||
void logger.log('Initializing remote queries interface.');
|
||||
const rqm = new RemoteQueriesManager(ctx, logger, cliServer);
|
||||
|
||||
registerTextProvider();
|
||||
registerRemoteQueryTextProvider();
|
||||
|
||||
// The "runRemoteQuery" command is internal-only.
|
||||
ctx.subscriptions.push(
|
||||
@@ -991,7 +991,7 @@ const checkForUpdatesCommand = 'codeQL.checkForUpdatesToCLI';
|
||||
*
|
||||
* TODO: Consolidate this with the 'codeql' text provider in query-history.ts.
|
||||
*/
|
||||
function registerTextProvider() {
|
||||
function registerRemoteQueryTextProvider() {
|
||||
workspace.registerTextDocumentContentProvider('remote-query', {
|
||||
provideTextDocumentContent(
|
||||
uri: Uri
|
||||
|
||||
@@ -65,21 +65,21 @@ export function RemoteQueries(): JSX.Element {
|
||||
const [repoListExpanded, setRepoListExpanded] = useState(false);
|
||||
const numOfReposToShow = repoListExpanded ? queryResult.results.length : numOfReposInContractedMode;
|
||||
|
||||
const openQueryFile = () => {
|
||||
vscode.postMessage({
|
||||
t: 'openFile',
|
||||
filePath: queryResult.queryFilePath
|
||||
});
|
||||
};
|
||||
|
||||
const openQueryTextVirtualFile = () => {
|
||||
vscode.postMessage({
|
||||
t: 'openVirtualFile',
|
||||
queryText: queryResult.queryText
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
const openQueryFile = () => {
|
||||
vscode.postMessage({
|
||||
t: 'openFile',
|
||||
filePath: queryResult.queryFilePath
|
||||
});
|
||||
};
|
||||
|
||||
const openQueryTextTmpFile = () => {
|
||||
vscode.postMessage({
|
||||
t: 'openVirtualFile',
|
||||
queryText: queryResult.queryText
|
||||
});
|
||||
};
|
||||
|
||||
return <div className="vscode-codeql__remote-queries-view">
|
||||
<h1 className="vscode-codeql__query-title">{queryResult.queryTitle}</h1>
|
||||
|
||||
@@ -94,7 +94,7 @@ export function RemoteQueries(): JSX.Element {
|
||||
</a>
|
||||
</span>
|
||||
<span>{octicons.codeSquare}
|
||||
<a className="vscode-codeql__query-file-link" href="#" onClick={openQueryTextTmpFile}>
|
||||
<a className="vscode-codeql__query-file-link" href="#" onClick={openQueryTextVirtualFile}>
|
||||
query
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
.vscode-codeql__query-file-link {
|
||||
text-decoration: none;
|
||||
padding-left: 0.3em;
|
||||
color: var(--vscode-editor-foreground);
|
||||
}
|
||||
|
||||
.vscode-codeql__query-file-link:hover {
|
||||
color: var(--vscode-editor-foreground);
|
||||
}
|
||||
|
||||
.vscode-codeql__query-summary-container {
|
||||
|
||||
Reference in New Issue
Block a user