Style link text + tidy up functions

This commit is contained in:
shati-patel
2021-12-14 08:12:33 +00:00
committed by Shati Patel
parent b7f86ae7a9
commit 72ff828b57
3 changed files with 22 additions and 17 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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 {